Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - TheOracle

Pages: [1]
1
Chit Chat / Re: Birthday Mod v1.0
« on: February 18, 2006, 08:05:50 PM »
Quote

$birthday = explode("-",$user_row[$user_table_fields['birthday']]);


@V@no:

Didn't you said the $user_table_fields only applys for core fields and not over additional user fields ?

2
I remember posting this on the old forum in the past.

I just wanted to advise that, when users are switching languages (by using the dropdown form from the Language Select MOD for example - "and" others) + refresh the page (no matter where), a refresh question from your browser will appear. To fix that, a clickstream string needs to be added in your index.php file (in order to avoid using 'refresh'). By simply clicking on the home link will resolve the issue. ;)

In index.php file,

find :

Quote

}
else {
  $template = "";
}


add below :

Code: [Select]

$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>";


;)

3
// Introduction

This feature was already published by V@no in the past but seems to have been lost on the old forum. However, since the code was never found again, I have decided to re-code it myself. ;)

// Affected files



- includes/page_header.php
- templates/<your_template>/user_logininfo.html



// Backup your files

Always backup your files before proceeding to these steps below.

// Step 1

In your includes/page_header.php file,

find :

Quote

// Replace Globals in $lang
$lang = $site_template->parse_array($lang);


add below :

Code: [Select]

if (!empty($user_info['lightbox_image_ids']))  {
  $lightbox_image_ids = explode(" ",$user_info['lightbox_image_ids']);
  $lightbox_total_count = count ($lightbox_image_ids);
}


Then, find :

Quote

"lang_lightbox" => $lang['lightbox'],


add right below :

Code: [Select]

"lightbox_total_count" => intval($lightbox_total_count),


// Step 1.1

Then, find : (updated - automatic refresh when ether removing and adding an image to lightbox).

Quote

$msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];


add below :

Code: [Select]

$site_template->register_vars("msg", $msg);


Then, find :

Quote

$msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];


add below :

Code: [Select]

$site_template->register_vars("msg", $msg);


This will redirect automatically to your current page and refresh the lightbox count. ;)

// Step 2

In your templates/<your_template>/user_logininfo.html file,

find :

Quote

&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />


replace with :

Code: [Select]

&raquo; <a href="{url_lightbox}">{lang_lightbox} ({lightbox_total_count})</a><br />


// Installation complete

That's it. You're done !

To test this out, simply go to your home page gallery as you should be to see the number aside of the lightbox. Add an image to the lightbox and click on the lightbox link (for the first time). Then, you should see the value changing. ;)

For instance : lightbox (1). ;)

(Note: '1' is just an example).

Good luck !

4
// New images total count v1.0 (Please proceed to v1.1 below)

// Introduction

This MOD allows you to see directly how many new images you have from your site header like this :

Quote

new images (x)


rather than clicking on it all the time to see how many new images has been in your database lately. ;)

// Affected files



- index.php
- templates/<your_template>/home.html



// Backup your files

Always backup your files before proceeding to these steps below.

// Step 1

In your index.php file,

find :

Quote

if (!$num_rows)  {


add above :

Code: [Select]

$new_images_count = str_replace("{new_images_count}", "", $num_rows);


Then, find :

Quote

$site_template->register_vars("new_images", $new_images);


add above :

Code: [Select]

$site_template->register_vars("new_images_count", $new_images_count);


// Step 2

In your templates/<your_template>/home.html file,

find :

Quote

<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;


replace with :

Code: [Select]

<a href="{url_new_images}"><b>{lang_new_images} ({new_images_count})</b></a>&nbsp;


========================================================================================

// New images total count v1.1

// Step 1

Uninstall v1.0 before proceeding to this steps below (of course, if you already installed it in the first place).

// Step 2

In your includes/page_header.php file,

find :

Quote

// Replace Globals in $lang
$lang = $site_template->parse_array($lang);


add below :

Code: [Select]

// Verification of new images in your gallery.
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;


Then, find :

Quote

"lang_new_images" => $lang['new_images'],


add below :

Code: [Select]

"image_is_new" => ($is_new) ? $is_new : "",


Then, on all your HTML templates that you can find the following :

Quote

<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;


Change them all to :

Code: [Select]

<a href="{url_new_images}"><b>{lang_new_images}</a>{if image_is_new} ({image_is_new}){endif image_is_new}</b>&nbsp;


// Installation complete

That's it. You're done !

Go to your home gallery page and check out your 'new images' link. You should see the total number right aside of it. ;)

Additional note: This should work on all your pages from the clickstream bar.

5
Since the topic is locked, I decided to create a new topic on this subject (even though it has ben obsolete).

I remember, in the past, reading some requests regarding the total number of each boxes within the PMS MOD from the clickstream bar.

Well, the day has come (if it has not been published already ... if so, then point it to me.  :mrgreen:).

// Compatibility

These modifications also works for PM v2. Simply follow trez's instructions below on this topic.

// Step 1

In your includes/page_header.php file,

find :

Quote

$pms_new = "<a href=\"".$site_sess->url(ROOT_PATH."pms.php")."\">".(($result['new']) ? "<blink>".$result['new']."</blink>" : 0)."</a>";


add above :

Code: [Select]

$pms_inbox_count = str_replace("{inbox_count}", "", $pms_inbox);
$pms_outbox_count = str_replace("{outbox_count}", "", $pms_outbox);
$pms_sentbox_count = str_replace("{sentbox_count}", "", $pms_sentbox);


Then, find:

Quote

"pms_popup_header" => $pms_popup_header,


add right below :

Code: [Select]

"inbox_count" => $pms_inbox_count,
"outbox_count" => $pms_outbox_count,
"sentbox_count" => $pms_sentbox_count,


// Step 2

In your templates/<your_template>/pms.html file,

find :

Quote

{lang_inbox}&nbsp;&nbsp;|&nbsp;&nbsp;

{lang_sentbox}&nbsp;&nbsp;|&nbsp;&nbsp;

{lang_outbox}&nbsp;&nbsp;|&nbsp;&nbsp;


replace with :

Code: [Select]

{lang_inbox} ({inbox_count})&nbsp;&nbsp;|&nbsp;&nbsp;

{lang_sentbox} ({sentbox_count})&nbsp;&nbsp;|&nbsp;&nbsp;

{lang_outbox} ({outbox_count})&nbsp;&nbsp;|&nbsp;&nbsp;


Then, visit your PMS's root page and see if you do have 0 or higher. ;)

6
Chit Chat / [Forum-Error] I saw these errors.
« on: February 07, 2006, 03:48:41 AM »
Sounds like someone is trying to modify the forum :

Quote
removed

 :lol:

7
// Report a picture - v1.0 (Final release & patched version)

// Introduction

Responding for this topic: http://www.4homepages.de/forum/index.php?topic=9389.0

This MOD has been expected for quite some time now. However, as promised - fortunitely, I have successfully coded & completed this feature over a testing e-mail server and reported total success.

Update: Please take note that (as part of 4images's core), it is hardly you can use this MOD if you intend to send / receive reports by using Hotmail, Yahoo, Gmail ect . . .

// Change log

[Fix-Update] - 02-15-2006

- There was some unusual errors with the header command. It has now been modified to read as Meta Redirection instead.
- Some actions were conditionned with header redirection over the same file (which was totally unnecesarry after all). The actions are now being forwarded without the need to redirect from now on.

For users who already installed this MOD, you will need to redo step 11 only.

// Beta tester - Thanks note

My thanks goes to trez for accepting my evaluations as his patience was (and still is) a huge appreciation for the task and the time it required in order to achieve this goalm.

// Features

As you may already know, this MOD lets your users / admins to send a report, from the details page, to the webmaster / owner of the gallery for 'x' reasons towards a specific image.

// Restrictions

For security saighs, this page is / will & shall be loaded only from the details page and nowhere else (and I made sure of that). In the mean time, only registered users may see this page.

// Restrictions - Why such implementations ?

The reason why these security inputs has been added into the report image's core file is to avoid spamming from GUESTs users and bots.

Secondly, in order to avoid flooded e-mails from your mailbox (and also to avoid your e-mail to be added into your web hosting service's SPAM filter), all link infos must be tracked before entering the report page "as well" as the comment box must be filled.

That said, since om5acw posted a MOD about avoiding SPAMs within 4images lately, my personal thanks on this one as you can see his publishing from here :

http://www.4homepages.de/forum/index.php?action=profile;u=11153

Meaning, I strongly recommend you install this MOD within your 4images copy after installing mine.

// Secure code - compatible with other MODs ?

Absolutely. As we can see here :

http://www.4homepages.de/forum/index.php?topic=8987.msg59688#msg59688

it has been done within the contact form MOD (which apparently was a complete success as well).

// Affected files


- admin/settings.php
- includes/functions.php
- includes/page_header.php (02-16-2006)
- lang/english/admin.php
- lang/english/main.php
- templates/<your_template>/details.html
- SETTINGS_TABLE


// New files


- report_pic.php
- lang/english/email/image_report_message.html
- templates/<your_template>/report_pic_form.html
- templates/<your_template>/report_pic_failed.html
- templates/<your_template>/report_pic_success.html


// Step 1

In your admin/settings.php file,

find :

Code: [Select]
function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
  $config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
  $setting[$setting_name] = replace_url($setting[$setting_name]);
  if ($value_option == "") {
    show_input_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  elseif ($value_option == "textarea") {
    show_textarea_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value, "", 6);
  }
  elseif ($value_option == "radio") {
    show_radio_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  else {
    echo "<tr class=\"".get_row_bg()."\">\n<td valign=\"top\"><p class=\"rowtitle\">".$setting[$setting_name]."</p></td>\n";
    echo "<td><p>";
    $value_option($setting_name, $config_value);
    echo "</p></td>\n</tr>\n";
  }
}

add below :

Code: [Select]

function show_report_image_select($setting_name, $setting_value) {
  global $report_image_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($report_image_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}


Then, find :

Quote

show_table_separator($setting_group[7], 2, "#setting_group_7");
show_setting_row("user_edit_image", "radio");
show_setting_row("user_delete_image", "radio");
show_setting_row("user_edit_comments", "radio");
show_setting_row("user_delete_comments", "radio");
show_setting_row("account_activation", "show_account_activation_options");
show_setting_row("activation_time");
show_setting_row("session_timeout");
show_setting_row("display_whosonline", "radio");
show_setting_row("highlight_admin", "radio");


add below :

Code: [Select]

show_table_separator($setting_group[X], 2, "#setting_group_X");
show_setting_row("report_image_status", "show_report_image_select");


Note: Replace the 'Xs' with your latest value number on the list.

// Step 2 (Updated: 02-07-2006)

In your includes/functions.php file,

find :

Quote

$lightbox_url = $self_url;
$lightbox_url .= (!empty($mode)) ? ((strpos($lightbox_url, '?') !== false) ? "&amp;" : "?")."mode=".$mode : "";
$lightbox_url .= strpos($lightbox_url, '?') !== false ? "&amp;" : "?";


add above :

Code: [Select]

$report_url = ($config['report_image_status'] == 0 && $user_info['user_level'] >= USER) ? $site_sess->url(ROOT_PATH."report_pic.php?".URL_CAT_ID."=".$image_row['cat_id']."&cat_name=".$image_row['cat_name']."&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&image_name=".$image_row['image_name']) : "";


Then, find (updated - thanks to Mawenzi):

Quote

"image_file_name" => $image_row['image_media_file'],


add below :

Code: [Select]

"report_image_url" => $report_url,
"lang_report_pic" => $lang['report_pic_title'],


// Step 3

In your lang/english/admin.php file,

add above the '?>' tag (Updated - Thanks to Mawenzi):

Code: [Select]

/*-- Setting-Group X --*/
$setting_group[X] = "Report Image";
$setting['report_image_status'] = "Would you like to activate the report image feature within your details page ?";
$report_image_optionlist = array(
  "0" => "Yes",
  "1" => "No"
);


Note: Remember the 'Xs' rule. ;)

// Step 4

In your lang/english/main.php file,

add above the '?>' tag :

Code: [Select]

//-----------------------------------------
// Report a picture -----------------------
//-----------------------------------------
$lang['report_image_name'] = "Image name:";
$lang['report_user_name'] = "User name:";
$lang['report_success'] = "<span class=\"smalltext\">Email sent successfully. Please wait, redirecting to the categories page . . .</span>";
$lang['report_failed_comments'] = "<span class=\"smalltext\">Either you did not filled up the comments table 'or' you're trying to access this page without viewing the details page. On either case, please login and click on the ' Report a picture ' link from the details page.<br /><br />&nbsp;&nbsp;Please wait, redirecting . . .</span>";
$lang['report_pic_title'] = "<span class=\"smalltext\">Report a Picture</span>";
$lang['image_url'] = "Image URL:";
$lang['reporting_comments'] = "<span class=\"smalltext\">Please state the reason for reporting this image:</span>";
$lang['report_email_subject'] = "Report a picture";
$lang['send_report_image'] = "Send my report";


// Step 5

In your templates/<your_template>/details.html file,

add the following link where you wish to see it appear from your details page :

Code: [Select]

{if report_image_url}<a href="{report_image_url}" class="smalltext">{lang_report_pic}</a><br /><br />{endif report_image_url}


// Step 6

Update : [ 02-04-2006 - Login as ADMIN before executing the file ].

Create a new file called : install_report_image.php. This will add a new field within your SETTINGS_TABLE.

Code: [Select]

<?php

define 
('ROOT_PATH''./');
include (
ROOT_PATH."global.php");
require (
ROOT_PATH."includes/sessions.php");
$user_access get_permission();

if (
$user_info['user_level'] == ADMIN) {

$sql "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('report_image_status', '0')

"
;

$result $site_db->query($sql);

if (
$result) {

echo 
"Installation successful.";

} else {

echo 
"Installation failed.";

####### End of if statement.

} else {

show_error_page($lang['no_permission']);

####### End of if statement.
?>



Once created, and saved, upload it to your root path of the gallery and execute it. Once executed, and successfully added into your SETTINGS_TABLE, you may delete this file.

// Step 7

In your lang/english/email folder, create a new file called : image_report_message.html.

Code: [Select]

Greetings webmaster,

User profile: {user_name_link}

Image URL: {destination_url}

The user name: "{user_name}" has just reported a comment over one of your images named: "{image_name}"

for the following reason below:

=============================================

{report_comments}

=============================================

If you wish to reply to this user, here's his e-mail address: {user_email}

(Note: The specified e-mail address above may not / may no longer be a true e-mail. You have been warned !)

Regards.

{site_name}.


Note: If you don't like the way it's been coded from this template, you may personalize it the way you feel is right. ;)

// Step 8

In your templates/<your_template> folder, create a new file called : report_pic_form.html.

Now, the following codings may, of course, be customized but - for now - I have decided to design it on my own and show the  results to you. Again, if you don't like the way the form is currently presented below, you may personalize it the way you feel is right for your gallery.

Code: [Select]

{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{lang_report_pic}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="navbar"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1">&nbsp;</td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_report_user_name}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{user_name}</td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /></td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_report_image_name}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{image_name}</td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /></td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_image_url}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /><a href="{image_url}" target="_blank">{image_name}</a></td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1">&nbsp;</td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right" valign="top">{lang_reporting_comments}</td>
<td class="row1" width="50%" align="left">
<form method="post" action="{url_report_image}"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />
<input type="hidden" name="image_id" value="{image_id}">
<input type="hidden" name="image_name" value="{image_name}">
<input type="hidden" name="user_name" value="{user_name}">
<textarea name="report_comments" cols="40" rows="12" wrap="VIRTUAL" class="textarea"></textarea>
<br /><br />
<img src="{template_url}/images/spacer.gif" width="8" height="4" alt="" />
<input type="submit" name="send_image_report" value="{lang_send_report_image}">
<img src="{template_url}/images/spacer.gif" width="8" height="4" alt="" />
<input type="reset" value="{lang_reset}">
</form></td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


2nd note: This is the place where the Secure Code MOD should be considered. ;)

// Step 9 (Updated: 02-07-2006)

In your templates/<your_template> folder, create a new file called : report_pic_failed.html (please read the condition from the template file above - it also applys through here).

Code: [Select]

{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left">&nbsp;&nbsp;{lang_report_title}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;&nbsp;{msg}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


// Step 10 (Updated: 02-07-2006)

In your templates/<your_template> folder, create a new file called : report_pic_success.html (please read the condition from the two template above as it also applys through this one).

Code: [Select]

{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left">&nbsp;&nbsp;{lang_report_title}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;&nbsp;{msg}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


// Step 11 (Updated: 02-15-2006)

And, finally, the routines that has been mostly expected for this MOD, create a new file called : report_pic.php on your root path.

Code: [Select]

<?php

$main_template 
"report_pic_form";

define ('GET_CACHES'1);
define ('ROOT_PATH''./');
include (
ROOT_PATH.'global.php');
require (
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include (
ROOT_PATH.'includes/page_header.php');

if (
$config['report_image_status'] == 1) {
$redirect "<meta http-equiv=\"refresh\" content=\"0; url=".$site_sess->url(ROOT_PATH."index.php""&")."\">";
echo 
$redirect;
unset (
$redirect);
###### End of if statement.

if ($user_info['user_level'] == GUEST && !ereg("details.php"$url)) {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."index.php""&")."\">";
echo 
$redirect;
unset (
$redirect);
exit;
###### End of if statement.

if ($action == "") {
$action "view_report";
###### End of if statement.

if ($action == "view_report") {

$cat_id = (isset($HTTP_GET_VARS['cat_id']) && $HTTP_GET_VARS['cat_id'] != 0) ? intval($HTTP_GET_VARS['cat_id']) : 0;
$cat_name = (isset($HTTP_GET_VARS['cat_name']) && $HTTP_GET_VARS['cat_name'] != "") ? (stripslashes(trim($HTTP_GET_VARS['cat_name']))) : $lang['no_categories'];
$image_id = (isset($HTTP_GET_VARS['image_id']) && $HTTP_GET_VARS['image_id'] != 0) ? intval($HTTP_GET_VARS['image_id']) : 0;
$image_name = (isset($HTTP_GET_VARS['image_name']) && $HTTP_GET_VARS['image_name'] != "") ? (stripslashes(trim($HTTP_GET_VARS['image_name']))) : $lang['no_images'];
$image_url $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id);

if (!
$cat_id || !$cat_name || !$image_id || !$image_name || !$image_url) {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."index.php""&")."\">";
echo 
$redirect;
unset (
$redirect);
exit;
###### End of if statement.

$sql "

SELECT "
.get_user_table_field("""user_id"). get_user_table_field(",""user_name"). get_user_table_field(",""user_level")."
FROM "
.USERS_TABLE."
WHERE "
.get_user_table_field("""user_id")." = ".$user_info['user_id']." AND ".get_user_table_field("""user_level")." >= '".USER."'

"
;

$result $site_db->query($sql);

while (
$user_row $site_db->fetch_array($result)) {
$user_name $user_row['user_name'];
###### End of while statement.

$site_template->register_vars(array(
"image_id" => intval($image_id),
"lang_report_image_name" => $lang['report_image_name'],
"image_name" => stripslashes($image_name),
"lang_image_url" => $lang['image_url'],
"image_url" => stripslashes($image_url),
"lang_report_pic" => $lang['report_pic_title'],
"lang_reporting_comments" => $lang['reporting_comments'],
"lang_report_user_name" => $lang['report_user_name'],
"user_name" => stripslashes($user_name),
"lang_submit" => $lang['submit'],
"lang_reset" => $lang['reset'],
"lang_send_report_image" => $lang['send_report_image']
));

$clickstream "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".($cat_id))."\">".($cat_name)."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\">".$image_name."</a>".$config['category_separator']. str_replace("_"" "ucfirst($main_template));
$site_template->register_vars("clickstream"$clickstream);
$site_template->print_template($site_template->parse_template($main_template));
###### End of if statement.

if ($action == "send_image_report") {

$image_id = (isset($HTTP_POST_VARS['image_id']) && $HTTP_POST_VARS['image_id'] != 0) ? intval($HTTP_POST_VARS['image_id']) : 0;
$image_name = (isset($HTTP_POST_VARS['image_name']) && $HTTP_POST_VARS['image_name'] != "") ? (stripslashes(trim($HTTP_POST_VARS['image_name']))) : $lang['no_images'];
$report_comments = (isset($HTTP_POST_VARS['report_comments'])) ? (un_htmlspecialchars(trim($HTTP_POST_VARS['report_comments']))) : "";
$user_name $user_info['user_name'];
$user_name_link $script_url."/member.php?action=showprofile&".URL_USER_ID."=".$user_info['user_id'];
$user_email $user_info['user_email'];
$destination_url $script_url."/details.php?".URL_IMAGE_ID."=".$image_id;

if (!isset(
$HTTP_POST_VARS['image_id']) || $image_id == "") {
$msg = ($lang['report_failed_image_id']) ? $lang['report_failed_image_id'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo 
$redirect;
unset (
$redirect);
exit;

} elseif (!isset(
$HTTP_POST_VARS['image_name']) || $image_name == "") {
$msg = ($lang['report_failed_image_name']) ? $lang['report_failed_image_name'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo 
$redirect;
unset (
$redirect);
exit;

} elseif (!isset(
$HTTP_POST_VARS['report_comments']) || $report_comments == "") {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo 
$redirect;
unset (
$redirect);
exit;
###### End of if statement.

if (!empty($site_email) || $site_email != "") {
unset (
$site_email);
###### End of if statement.

@include_once(ROOT_PATH.'includes/email.php');

$site_email = new Email();

if (!
$site_email->reset()) {
$site_email->reset();
###### End of if statement.

$site_email->set_to(stripslashes($config['site_email']));
$site_email->set_from(stripslashes($config['site_email']), stripslashes($user_name));
$site_email->set_subject($lang['report_email_subject']);

$site_email->register_vars(array(
"image_id" => intval($image_id),
"image_name" => stripslashes($image_name),
"report_comments" => stripslashes($report_comments),
"destination_url" => stripslashes($destination_url),
"user_name" => stripslashes($user_name),
"user_email" => stripslashes($user_email),
"user_name_link" => stripslashes($user_name_link),
"site_name" => trim($config['site_name'])
));

$site_email->set_body("image_report_message"$config['language_dir']);
$site_email->send_email();

$action "report_success";
###### End of if statement.

if ($action == "report_success") {

$msg = ($lang['report_success']) ? $lang['report_success'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_success"));

$redirect "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".(isset($cat_id)), "&")."\">";
echo 
$redirect;
unset (
$redirect);
###### End of if statement.

unset ($cat_id);
unset (
$cat_name);
unset (
$image_id);
unset (
$image_name);
unset (
$image_url);
unset (
$report_comments);
unset (
$user_name);
unset (
$user_email);
unset (
$user_name_link);
unset (
$destination_url);
unset (
$msg);

include (
ROOT_PATH.'includes/page_footer.php');
?>



// Step 11.1 (Created: 02-07-2006)

In your lang/english/main.php file,

add the following statement in the same paragraph as your previous pasting of the report image :

Code: [Select]

$lang['report_failed_image_id'] = "<span class=\"smalltext\">Your image ID could not be sent to the webmaster (probably due to email restriction levels from the site's web hosting service). Please wait. Redirecting . . .</span>";
$lang['report_failed_image_name'] = "<span class=\"smalltext\">Your image name could not be sent to the webmaster (probably due to email restriction levels from the site's web hosting service). Please wait. Redirecting . . .</span>";


// Step 11.2 (Created on: 02-16-2006)

In your includes/page_header.php file,

find :

Quote

"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),


add below (this is it):

Code: [Select]

"url_report_image" => $site_sess->url(ROOT_PATH."report_pic.php?action=send_image_report"),


// Installation completed

This completes the installation of this MOD. From now on, you should be able to configure from your ACP's configuration page (down below). You can, either, select ' yes ' or ' no ' to activate / deactivate this feature from your details page - as simple as that. ;)

// Questions & support

If you have any questions or request additional support for this MOD, please state them here. Do NOT start a new topic.

// Screenshots

I almost forgot, here's a screenshot for this amazing MOD :



;)

Update: [ 02-05-2006 ] - Successful screenshot page from report a picture (e-mail does send from my end + received) :



And this is the part when the e-mail has been received :

Quote

Greetings webmaster,

User profile:
http://www.mysite.com/mygallery/member.php?action=showprofile&user_id=myuserid

http://www.mysite.com/mygallery/details.php?image_id=myimageid

The user name: "oracle" has just reported a comment over one of your images
named: "Test picture"

for the following reason below:

=============================================

This is a test for the forum to see if it works.

TheOracle.

=============================================

If you wish to reply to this user, here's his e-mail address:
myemail@myserver.com

(Note: The specified e-mail address above may not / may no longer be a true
e-mail. You have been warned !)

Regards.

oracles test gallery.



;)

Note: URLs and e-mail address has, of course, been modified for users privacy. ;)

// Personal inputs

Finally, I can code up with the $site_email class name !!! ;)

Good luck and PLEASE GIVE ME YOUR INPUTS !!! 8)

8
Greetings.

I have just thought about creating this simple topic, since I noticed that numerous users are beginning to wonder if someone could develop new templates (generally speaking - nothing specific). It would give, for each of us, a better idea for HTML developers to see how interested users would really be since 4images can handle unlimited HTML template solutions (or almost).

Since this is a more personalized subject, I don't really see how this could evolve the forum itself "but" would still be greatly appreciated to know how much you like 4images and what great development you did on your templates already. This would, even, give new ideas for newbies who just started to use their websites with 4images. ;)

9
//  Banners Ads - Fully configurable from ACP - v1.0 - First release

Responding for this topic :

http://www.4homepages.de/forum/index.php?topic=11035.0

Since most of E-Commerce scripts uses this type of functionnality, I never realized the importance of this feature before today.

// Affected files

- admin/settings.php.
- lang/<your_lang>/admin.php (assuming english).
- includes/page_header.php
- SETTINGS_TABLE.

// Purpose

As we all know already, this feature allows you to show your ads banner from, either, the top header and / or your footer below your site (depending of the configuration you chosed from your ACP's settings).

// Step 1

In your admin/settings.php file,

find :

Quote

function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
  $config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
  $setting[$setting_name] = replace_url($setting[$setting_name]);
  if ($value_option == "") {
    show_input_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  elseif ($value_option == "textarea") {
    show_textarea_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value, "", 6);
  }
  elseif ($value_option == "radio") {
    show_radio_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  else {
    echo "<tr class=\"".get_row_bg()."\">\n<td valign=\"top\"><p class=\"rowtitle\">".$setting[$setting_name]."</p></td>\n";
    echo "<td><p>";
    $value_option($setting_name, $config_value);
    echo "</p></td>\n</tr>\n";
  }
}


add below :

Code: [Select]

function show_ads_banner_header_options($setting_name, $setting_value) {
  global $set_ads_banner_header_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($set_ads_banner_header_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}

function show_ads_banner_footer_options($setting_name, $setting_value) {
  global $set_ads_banner_footer_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($set_ads_banner_footer_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}


Then, find :

Quote

show_table_separator($setting_group[3], 2, "#setting_group_3");
show_setting_row("image_order", "show_image_order_select");
show_setting_row("image_sort", "show_image_sort_select");
show_setting_row("new_cutoff");
show_setting_row("image_border");
show_setting_row("image_cells");
show_setting_row("default_image_rows");
show_setting_row("custom_row_steps");
show_setting_row("image_table_width");
show_setting_row("image_table_cellspacing");
show_setting_row("image_table_cellpadding");


add below :

Code: [Select]

show_table_separator($setting_group[X], 2, "#setting_group_X");
show_setting_row("ads_banner_header", "show_ads_banner_header_options");
show_setting_row("ads_banner_footer", "show_ads_banner_footer_options");
show_setting_row("ads_banner_url");


Note : You must change the "X" letter to your next new number.

Example : Assuming you have the first 10 values already, simply add 11 on this one. ;)

// Step 2

In your lang/english/admin.php file, above the "?>" tag,

add this :

Code: [Select]

/*-- Setting-Group X --*/
$setting_group[X] = "Banner Ads Activation Options";
$set_ads_banner_header_optionlist = array(
  "1" => "yes",
  "2" => "no",
);
$setting['ads_banner_header'] = "<span class=\"smalltext\">Would you like to activate your Banners Ads on your album's site header page (top) ?</span>";
$set_ads_banner_footer_optionlist = array(
  "1" => "yes",
  "2" => "no",
);
$setting['ads_banner_footer'] = "<span class=\"smalltext\">Would you like to activate your Banners Ads on your album's site footer page (below) ?</span>";
$setting['ads_banner_url'] = "<span class=\"smalltext\">If you chosed to activate (at least) one of these two above, please specify the URL where the clicker should be redirected.";


(Remember the 'X' rules above).

// Step 3

In your includes/page_header.php file,

find :

Quote

// Cache Templates
$template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset($templates_used) && $templates_used != "") {
  $template_list = $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);


add below :

Code: [Select]

//-----------------------------------------------------
//--- Ads Banner --------------------------------------
//-----------------------------------------------------

if ($config['ads_banner_header'] != 2) {

$site_template->register_vars(array(
"banner_header_url" => ($config['ads_banner_url'] != "") ? "<br />".$config['ads_banner_url']."<br /><br />" : ""
));

} ###### End of if statement.

if ($config['ads_banner_footer'] != 2) {

$site_template->register_vars(array(
"banner_footer_url" => ($config['ads_banner_url'] != "") ? "<br /><br />".$config['ads_banner_url']."<br /><br />" : ""
));

} ###### End of if statement.


// Step 4

Then, add the following SQL fields in your SETTINGS_TABLE :

Quote

- Setting_name: ads_banner_header
- Setting_value: 1
- Setting_name: ads_banner_footer
- Setting_value: 1
- Setting_name: ads_banner_url
- Setting_value: your_url


// Step 5

In your templates/<your_template>/header.html file, you can fully customize the way you'd like to show it.

However, just use these tags to show your header banner ads correctly :

Code: [Select]

{if banner_header_url}
{banner_header_url}
{endif banner_header_url}


// Step 6

In your templates/<your_template>/footer.html file, you can also customize your presentation in the way you'd like.

However, use these codes to show your footer banner correctly :

Code: [Select]

{if banner_footer_url}
{banner_footer_url}
{endif banner_footer_url}


// Installation Complete

This completes the installation of this MOD.

// Try-out

To test it out, go to your ACP's configuration page and activate, either (or both) banners in order to show it from your header / footer - depending on your personal preference. Then, right below these two choices, simply add the given URL from your affiliate and the banner show be able to appear genericly from your album once you'll save your settings. ;)

Enjoy and, hopefully, someone will send HIS INPUTS THIS TIME !!! 8)

//  Banners Ads - Fully configurable from ACP - v2.0 - Full installation

// Changelog

This topic was updated on : [ 01/26/2006 ].

---

This topic was updated on : [ 01/27/2006 ].

A new folder called : banner is now involved in the new version.
A single general function is being used rather than two seperated functions from the settings page (since it is useless) and uses less SQL ressources.

// Affected files

Same as v1.0 above (except includes/functions.php file in addition).

// Purpose

Same purpose as above - except this time - images for your header and footer are fully configurable from your ACP's configuration page and, both, are seperated options according to your decision - if you wish to activate them or not. ;)

Note: For users who has never installed this MOD before, there's no need to install v1.0 before the v2.0. You can install this version right away. For users who did installed the v1.0 before, it would be HIGHLY recommended you uninstall this MOD and install the new version instead. Much more and better functionnality has been established now.

// Step 1

In your admin/settings.php file,

find :

Quote

function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
  $config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
  $setting[$setting_name] = replace_url($setting[$setting_name]);
  if ($value_option == "") {
    show_input_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  elseif ($value_option == "textarea") {
    show_textarea_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value, "", 6);
  }
  elseif ($value_option == "radio") {
    show_radio_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  else {
    echo "<tr class=\"".get_row_bg()."\">\n<td valign=\"top\"><p class=\"rowtitle\">".$setting[$setting_name]."</p></td>\n";
    echo "<td><p>";
    $value_option($setting_name, $config_value);
    echo "</p></td>\n</tr>\n";
  }
}


add below :

Code: [Select]

function show_ads_banner_header_footer_options($setting_name, $setting_value) {
  global $set_ads_banner_header_footer_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($set_ads_banner_header_footer_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}

function show_banner_dir_select($setting_name, $setting_value) {
  echo "<select name=\"setting_item[".$setting_name."]\">";
  $handle = @opendir(TEMPLATE_PATH."/images/banner");
  $folderlist[] = "---\n";
  while (false !== ($file = @readdir($handle))) {
    if (@is_dir(TEMPLATE_PATH."/images/banner") && $file != "." && $file != "..") {
      $folderlist[] .= $file;
    }
  }
  @sort($folderlist);
  for($i = 0; $i < sizeof($folderlist); $i++) {
    echo "<option value=\"".$folderlist[$i]."\"";
    if ($setting_value == $folderlist[$i]) {
      echo " selected=\"selected\"";
    }
    echo ">".$folderlist[$i]."</option>\n";
  }
  @closedir($handle);
  echo "</select>\n";
}


Then, find :

Quote

show_table_separator($setting_group[3], 2, "#setting_group_3");
show_setting_row("image_order", "show_image_order_select");
show_setting_row("image_sort", "show_image_sort_select");
show_setting_row("new_cutoff");
show_setting_row("image_border");
show_setting_row("image_cells");
show_setting_row("default_image_rows");
show_setting_row("custom_row_steps");
show_setting_row("image_table_width");
show_setting_row("image_table_cellspacing");
show_setting_row("image_table_cellpadding");


add below :

Code: [Select]

show_table_separator($setting_group[X], 2, "#setting_group_X");
show_setting_row("ads_banner_header", "show_ads_banner_header_footer_options");
show_setting_row("ads_banner_footer", "show_ads_banner_header_footer_options");
show_setting_row("ads_banner_header_image_url", "show_banner_dir_select");
show_setting_row("ads_banner_footer_image_url", "show_banner_dir_select");
show_setting_row("ads_banner_header_url");
show_setting_row("ads_banner_footer_url");


Note: Replace the 'X" with the latest value of the setting group.

// Step 2

In your lang/english/admin.php file,

add before your '?>' tag (code updated below - thanks to JensF for pointing the array error.):

Code: [Select]

/*-- Setting-Group xx --*/
$setting_group[xx] = "Banner Ads Activation Options";
$set_ads_banner_header_header_optionlist = array(
  "1" => "yes",
  "2" => "no",
);
$setting['ads_banner_header'] = "<span class=\"smalltext\">Would you like to activate your Banners Ads on your album's site header page (top) ?</span>";
$set_ads_banner_header_footer_optionlist = array(
  "1" => "yes",
  "2" => "no",
);
$setting['ads_banner_footer'] = "<span class=\"smalltext\">Would you like to activate your Banners Ads on your album's site footer page (below) ?</span>";
$setting['ads_banner_header_image_url'] = "<span class=\"smalltext\">Please select your banner ads image you would like to show from your site header.";
$setting['ads_banner_header_url'] = "<span class=\"smalltext\">If you chosed to activate the banner from the site header, please specify the URL (which will go with your selected image).";
$setting['ads_banner_footer_image_url'] = "<span class=\"smalltext\">Please select your banner ads image you would like to show from your site footer.";
$setting['ads_banner_footer_url'] = "<span class=\"smalltext\">If you chosed to activate the banner from the site footer, please specify the URL (which will go with your selected image).";


Remember the 'X' rule. ;)

// Step 3

In your includes/page_header.php file,

find :

Quote

// Cache Templates
$template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset($templates_used) && $templates_used != "") {
  $template_list = $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);


add below :

Code: [Select]

//-----------------------------------------------------
//--- Ads Banner --------------------------------------
//-----------------------------------------------------

if ($config['ads_banner_header'] == 1) {

$site_template->register_vars(array(
"banner_header_url" => (@file_exists(TEMPLATE_PATH."/images/banner/".$config['ads_banner_header_image_url']) && $config['ads_banner_header_url'] != "") ? "<br /><center><a href=\"".$config['ads_banner_header_url']."\"><img src=\"".get_banner_image($config["ads_banner_header_image_url"])."\" border=\"0\" target=\"_blank\"></a></center><br /><br />" : ""
));

} ###### End of if statement.

if ($config['ads_banner_footer'] == 1) {

$site_template->register_vars(array(
"banner_footer_url" => (@file_exists(TEMPLATE_PATH."/images/banner/".$config['ads_banner_footer_image_url']) && $config['ads_banner_footer_url'] != "") ? "<br /><br /><center><a href=\"".$config["ads_banner_footer_url"]."\"><img src=\"".get_banner_image($config["ads_banner_footer_image_url"])."\" border=\"0\" target=\"_blank\"></a></center><br /><br />" : ""
));

} ###### End of if statement.


// Step 4

In your includes/functions.php file,

find :

Quote

function get_gallery_image($image_name) {
  global $config;
  if (file_exists(TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name)) {
    return TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name;
  }
  else {
    return TEMPLATE_PATH."/images/".$image_name;
  }
}


add below :

Code: [Select]

function get_banner_image($banner_name) {
 if (@file_exists(TEMPLATE_PATH."/images/banner/".$banner_name)) {
   return TEMPLATE_PATH."/images/banner/".$banner_name;
   }
  }


// Step 5 (Updated on: 02/12/2006)

Create a file called : install_ads.php on your ROOT_PATH folder (remember, this is a FRESH install !) and

add the following setting name in your SETTINGS_TABLE :

Quote

<?php

define ('ROOT_PATH', './');
include (ROOT_PATH."global.php");
require (ROOT_PATH."includes/sessions.php");
$user_access = get_permission();

if ($user_info['user_level'] == ADMIN) {

$sql = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_header', '2')

";

$result = $site_db->query($sql);

$sql1 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_footer', '2')

";

$result1 = $site_db->query($sql1);

$sql2 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_header', '2')

";

$result2 = $site_db->query($sql2);

$sql3 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_header_image_url', '')

";

$result3 = $site_db->query($sql3);

$sql4 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_footer_image_url', '')

";

$result4 = $site_db->query($sql4);

$sql5 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_header_url', '')

";

$result5 = $site_db->query($sql5);

$sql6 = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('ads_banner_footer_url', '')

";

$result6 = $site_db->query($sql6);

if ($result && $result1 && $result2 && $result3 && $result4 && $result5 && $result6) {

echo "Installation successful.";

} else {

echo "Installation failed.";

} ####### End of if statement.
} ####### End of if statement.
?>


// Step 6

In your templates/<your_template>/header.html file,

add the following below your <BODY> tag :

Quote

{if banner_header_url}{banner_header_url}{endif banner_header_url}


// Step 7

In your templates/<your_template>/footer.html file,

find :

Quote

{cp_link}


add below :

Code: [Select]

{if banner_footer_url}{banner_footer_url}{endif banner_footer_url}


// Step 8

[Updated since 01-27-2006]

In your templates/<your_template>/images folder, create a new folder called : banner.

// Installation complete

This completes the installation of this MOD.

// Try-out

To test it out, go to your ACP's configuration page and activate, either (or both) banners in order to show it from your header / footer - depending on your personal preference. Then, right below these two choices, simply choose your images for your header + footer and add the given URL (for each - if required) from your affiliate and the banner show be able to appear genericly from your album once you'll save your settings. ;)

// Where are the upgrade instructions ?

If there's enough place on this topic to type it all, I'll post these instructions. ;)

Good luck !

10
Greetings,

This tutorial is about using the arrays in the right way (basically speaking - for 4images coders).

For instance :

Quote

$site_template->register_vars(array(
"test" => $lang['test'],
"test1" => $lang['test1'],
));


This will allow you to register each new tags and use them like these :

Quote

{test}
{test1}


in your appropriate HTML template file.

Another way to do it would be like this :

Code: [Select]

$site_template->register_vars("test", $lang['test']);
$site_template->register_vars("test1", $lang['test1']);


(depending on the circomstances).

[Update - 10-01-2006]

Then, from your related HTML template files, you can use :

Code: [Select]

{if test}{test}{endif test}
{if test1}{test1}{endif test1}


11
Lately, I did some research on the forum regarding site postings which, unfortunitely, includes the "SESSIONID" query.

Meaning, this is a security risk for posters. Why ? Your session is being encrypted "but" - by posting your random generated numbers, a hacker could easily decode the number you're posting.

// How to be protected your session activities by posting the links ?

It is very easy actually. In order to protect your sessions, simply post your URLs

like this :

http://www.yoursite.com/4images/file.php?your_page_query=id_number

and NOT like this :

http://www.yoursite.com/4images/file.php?your_page_query=id_number&SESSIONID=yourrandomnumber

This way, a new SESSIONID number will be generated from each new visitors that clicks on your pointed site from the forum (or even from anywhere else on the net - regarding the places you posted your link). ;)

Regards.

TheOracle.

12
Ok. I have decided to create a new topic. This way, users will find this more easier rather than using the search for ' all ' topics I have corrected earlier today.

Update: This is NOT a security fix but a Session Tutorial.
Update: [29-12-2005] - Redirection from HTML template files.

This topic was much longer than right now but it turns out it will be much shorter than expected. ;)

It is my understanding that good number of coders uses really great codings but aren't quite familiar with 4images classes.

To all coders, when you create a MOD (which involves the $user_profile_link string), make sure, when you point out your <a href= tag, to "always call the $site_sess->url class.

For instance,

you have this code :

(Yes V@no - with quotes now) :

Quote

$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";


and not like this :

Quote

$user_profile_link = !empty($url_show_profile) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$user_profile_link."\">".$user_name."</a>";


Otherwise, the user's session will expire as he will need to login again. As for the preg_replace, according to V@no, it is useless in this case. As for the (), simply a safer equality. ;)

Another example. Assuming you do not want to add the $user_name_link as an individual string but you'd like to use it as part of a registering array, do it like this :

Quote

$site_template->register_vars(array(
"user_name_link" => "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>",
"link_name" => $lang['your_link_name']
));


and NOT like this :

Quote

$site_template->register_vars(array(
"user_name_link" => "<a href=\"".$user_profile_link."\">".$user_name."</a>"
));


[Update - 29-12-2005]

When you're using a redirect link from your HTML templates, make sure you use the array name you used above. For instance, in this case, the name is : user_name_link. In your HTML template files, it would become : {user_name_link}.

So ;

Code: [Select]

<a href="{user_name_link}">{link_name}</a>


Meaning, do NOT use is like this :

Quote

<a href="yourfile.php?yourquery">link name</a>


Then, add it into your lang/<your_lang>/main.php file

like this :

Code: [Select]

$lang['your_link_name'] = "Your link name";


from your HTML template files.

Otherwise, it will result a session time out and the user will, also, have to login again (indefinitely - for both cases - if not corrected). ;)

Merry Christmas to you all.

Regards.

TheOracle.

13
Chit Chat / [Greetings-again] - TheOracle is back.
« on: December 25, 2005, 02:56:06 PM »
Greetings to all moderators and 4images users.

Today, as a Christmas gift, I have decided to post again. Most of you guys must be celebrating with your family right now. If so, the best times to you.

To those who are still working on their site during Christmas day, think of your family first. ;)
To those who didn't had a place to sleep along with their entire family (like my case), you may proceed. :P :mrgreen:

Let's drop the jokes.

I'm glad to be back but I'd like to set one record straight. What happened on this forum, in the past, is done and will remained done. I will be glad to answer most of your questions as I will try to reply as soon as possible.

In the mean time, during the past few weeks, I have visited some topics and I have discovered some very basic result issues which is like the following :

... but it doesn't work.

WHAT DOESN'T WORK ??? WHAT DOES IT SAY OR WHAT'S SIMPLY THE RESULTS ??? !!!

Update: 01/13/2006

http://www.4homepages.de/forum/index.php?topic=11117.msg56882#msg56882

End of Update

Users who will PM me with this simple text will NOT be replied. Why ? There are several thousands of different issues in PHP (and those already discovered - imagine those who has NOT been discovered yet). A doesn't work matter means that it could result these mounts of possibilities in order to resolve the issues you're currently facing with 4images.

When you're about to create a new topic (or posting to an additional existing one), make sure you leave all technical error in details before submitting your thread (or when PMing me). This way, it will bring everyone into their attention, as myself, in order to see if anyone else can reproduce this error.

I guess this argument will help you to understand why you're not always getting a response from moderators or any other related author.

Thanks for your understanding as I'm wishing you a Merry Christmas, again, to you all. ;)

Best regards.

TheOracle.

Pages: [1]