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 - Chris

Pages: 1 2 [3] 4 5
31
The picture and some other info can be found in the FAQ forum here:
http://www.4homepages.de/forum/index.php?topic=5702.0

32
FAQ, Tips / How is the default "style.css" stylesheet used?
« on: May 16, 2003, 09:49:07 PM »
(The picture is large. Internet Explorer & Mozilla 1.3 users can press F11 to toggle between normal and full screen)

A stylesheet is used to control the appearance of the default template pack that ships with 4images. 
It governs things such as table background colors, etc. 

If you are unfamiliar with stylesheets, here is an excellent reference:
http://webdesign.about.com/cs/css/

This is a picture of how templates/default/style.css is used



There are more classes and selectors used than are pictured above. 
If you open style.css in a text editor, you will find comment lines such as:
Code: [Select]
/*--Categories------------------------------------------------*/
/*--Images----------------------------------------------------*/
/*--Comments--------------------------------------------------*/
These identify the blocks of css code that work with Categories, Images and Comments.


33
FAQ, Tips / How to add a new, custom template page
« on: April 06, 2003, 02:31:41 AM »
By using a built in feature found within index.php, it is possible to add your own custom template pages that are processed by 4images. This lets you create a new html template that supports many 4images features. In fact, your new template can use whatever you find inside the home.html template.

For example, if you want to create a Frequently Asked Questions page for your visitors:

  • Copy one of the existing templates like "error.html" to "FAQ.html"
  • Remove the {lang_error} {error_msg} from "FAQ.html"
  • Add your FAQ information to "FAQ.html"
  • Upload "FAQ.html" to the your template directory where you keep "error.html"

You can link to the new FAQ page by using a URL like the following example:
http://www.example.com/4images/index.php?template=FAQ

Please note that URLs are CaSe seNSitIve!

34
Updated 03-15-2006 for 4images v1.7.2

Keep Track Of What Each User Has Downloaded
For each registered user, this mod maintains a list of the images they download and the date/time of the their last download.

Summary Description NOTE: This is NOT a download stats or counter mod

It has been said that necessity is the mother of invention. On my web site, I only allow downloads for registered users and I wanted to keep track of who was downloading what.

This mod lets you track what images have been downloaded by each registered user. It also enhances the "Edit Users" function in the admin control panel to let you query all users who downloaded anything before, after, or within a date range you enter by entering dates in both the before and after fields. You can also sort the returned list of users by the last download date in either ascending or descending order.

Once that query list is generated, clicking the "Edit" link next to a specific user will display the following in the "Edit User" HTML form:

1. A text area that holds the id numbers of the images they downloaded.
2. A search link to display those images in a new window.
3. The date and time of the user's last download.

The search link is also displayed in the member_profile.html template if you are logged in as a 4images administrator.

The database table 4images_users is modified to store the image id numbers for all downloads made by each user. It is also modified to store the date and time of the last download.  This code was heavily copied from the lightbox logic so it only took me 4 or 5 hours to research, code, test, document the installation procedure and write an installer to modify the database.  Your time to install this mod is approximately 15 minutes, you lucky bastard!  :wink:

Summary of files affected
[change] admin/users.php

[change] includes/functions.php
[change] includes/sessions.php
[change] includes/db_field_definitions.php

[change] lang/english/main.php
[change] lang/english/admin.php

[change] download.php
[change] member.php
[change] search.php

[change] templates/default/member_profile.html

[new]    4i_install_tud.php


admin/users.php:
Locate:
4images v1.7 - 1.7.1
Code: [Select]
  show_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction", $user_row['user_lastaction'], $textinput_size);4images v1.7.2
Code: [Select]
  show_date_input_row($lang['field_lastaction'].$lang['date_desc'], "user_lastaction", $user_row['user_lastaction'], $textinput_size);
Insert after:
Code: [Select]
  $user_row['download_lastaction'] = date("Y-m-d H:i", $user_row['download_lastaction']); // Mod: Track User Downloads
   $additional_user_fields['downloaded_image_ids'] = array("<a href=\"".ROOT_PATH."search.php?user_downloads=".$user_row['user_id']."\" target=\"_blank\">".$lang['downloaded_image_ids']."</a>", "textarea", 0); // Mod: Track User Downloads
Locate:
4images v1.7 - 1.7.1
Code: [Select]
  show_input_row($lang['field_lastaction_before'].$lang['date_format'], "lastactionbefore", "", $textinput_size);4images v1.7.2
Code: [Select]
  show_date_input_row($lang['field_lastaction_before'].$lang['date_format'], "lastactionbefore", "", $textinput_size);
Insert after:
Code: [Select]
  $user_row['download_lastaction'] = date("Y-m-d H:i", $user_row['download_lastaction']); // Mod: Track User Downloads
  show_input_row($lang['field_download_lastaction_after'].$lang['date_format'], "download_lastaction_after", "", $textinput_size); // Mod: Track User Downloads
  show_input_row($lang['field_download_lastaction_before'].$lang['date_format'], "download_lastaction_before", "", $textinput_size); // Mod: Track User Downloads
Locate:
Code: [Select]
  <option value="<?php echo get_user_table_field("""user_lastaction"); ?>"><?php echo $lang['field_lastaction']; ?></option>Insert after:
Code: [Select]
  <option value="<?php echo get_user_table_field("""download_lastaction"); ?>"><?php echo $lang['field_download_lastaction']; ?></option>Locate:
Code: [Select]
  $lastactionbefore = trim($HTTP_POST_VARS['lastactionbefore']);
  if ($lastactionbefore != "") {
    $condition .= " AND ".get_user_table_field("", "user_lastaction")." < UNIX_TIMESTAMP('$lastactionbefore')";
  }
Insert after:
Code: [Select]
  $download_lastaction_after = trim($HTTP_POST_VARS['download_lastaction_after']); // Mod: Track User Downloads
  if ($download_lastaction_after != "") { // Mod: Track User Downloads
    $condition .= " AND ".get_user_table_field("", "download_lastaction")." > UNIX_TIMESTAMP('$download_lastaction_after')"; // Mod: Track User Downloads
  } // Mod: Track User Downloads
  $download_lastaction_before = trim($HTTP_POST_VARS['download_lastaction_before']); // Mod: Track User Downloads
  if ($download_lastaction_before != "") { // Mod: Track User Downloads
    $condition .= " AND ".get_user_table_field("", "download_lastaction")." < UNIX_TIMESTAMP('$download_lastaction_before')"; // Mod: Track User Downloads
    $condition .= " AND ".get_user_table_field("", "download_lastaction")." > 0"; // Mod: Track User Downloads
  } // Mod: Track User Downloads
Locate:
Code: [Select]
    show_hidden_input("lastactionafter", $lastactionafter);
    show_hidden_input("lastactionbefore", $lastactionbefore);
Insert after:
Code: [Select]
    show_hidden_input("download_lastaction_after", $download_lastaction_after); // Mod: Track User Downloads
    show_hidden_input("download_lastaction_before", $download_lastaction_before); // Mod: Track User Downloads


Open includes/functions.php, at the very bottom and just before the closing:
Code: [Select]
?>Insert before:
Code: [Select]
// Mod: Track User Downloads BLOCK INSERT BEGIN
function add_to_downloaded_image_ids($id) {
  global $user_info, $site_db;
  $id = intval($id);
  if (!$id) {
    return false;
  }
  $downloaded_ids = $user_info['downloaded_image_ids'];
  $downloaded_array = explode(" ", $downloaded_ids);
  if (!in_array($id, $downloaded_array)) {
    $downloaded_ids .= " ".$id;
  }
  $user_info['downloaded_image_ids'] = trim($downloaded_ids);
  $user_info['download_lastaction'] = time();
  $sql = "UPDATE ".USERS_TABLE."
          SET download_lastaction = ".$user_info['download_lastaction'].", downloaded_image_ids = '".$user_info['downloaded_image_ids']."'
          WHERE user_id = ".$user_info['user_id'];
  return ($site_db->query($sql)) ? 1 : 0;
}
// Mod: Track User Downloads BLOCK INSERT END


Open includes/sessions.php, locate at the top:
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq"
);
Add a comma at the end of the user_icq line and add a new line after:
Code: [Select]
$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
  "user_icq" => "user_icq", // Mod: Track User Downloads (comma was added at end of line!)
  "download_lastaction" => "download_lastaction" // Mod: Track User Downloads
);


Open includes/db_field_definitions.php, locate:
Code: [Select]
// Example for additional user fields
//$additional_user_fields['user_adress'] = array($lang['user_adress'], "text", 1);
Insert after:
Code: [Select]
$additional_user_fields['downloaded_image_ids'] = array($lang['downloaded_image_ids'], "textarea", 0); // Mod: Track User Downloads
$additional_user_fields['download_lastaction'] = array($lang['download_lastaction'], "text", 0); // Mod: Track User Downloads


Open lang/english/main.php, at the very bottom and just before the closing:
Code: [Select]
?>Insert before:
Code: [Select]
$lang['downloaded_image_ids'] = "Downloaded Image IDs"; // Mod: Track User Downloads
$lang['download_lastaction'] = "Date Of Last Download"; // Mod: Track User Downloads
$lang['downloaded_images'] = "Downloaded Images"; // Mod: Track User Downloads


Open lang/english/admin.php
Locate:
Code: [Select]
$lang['field_lastaction'] = "Last activity";Insert after:
Code: [Select]
$lang['field_download_lastaction'] = "Last Download"; // Mod: Track User DownloadsLocate:
Code: [Select]
$lang['field_lastaction_before'] = "Last activity before";
$lang['field_lastaction_after'] = "Last activity after";
Insert after:
Code: [Select]
$lang['field_download_lastaction_before'] = "Last download before"; // Mod: Track User Downloads
$lang['field_download_lastaction_after'] = "Last download after"; // Mod: Track User Downloads


Open download.php, locate:
Code: [Select]
  if ($user_info['user_level'] != ADMIN) {
    $sql = "UPDATE ".IMAGES_TABLE."
            SET image_downloads = image_downloads + 1
            WHERE image_id = $image_id";
    $site_db->query($sql);
  }
Insert after:
Code: [Select]
  if ($user_info['user_level'] == USER) // Mod: Track User Downloads
    add_to_downloaded_image_ids($image_id); // Mod: Track User Downloads
OPTIONAL: If you want to track downloads from users AND administrators, change
Code: [Select]
  if ($user_info['user_level'] == USER) // Mod: Track User DownloadsTo
Code: [Select]
  if ($user_info['user_level'] >= USER) // Mod: Track User (and administrator) Downloads

Open member.php:
Locate:
Code: [Select]
      "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq']
    ));
REPLACE with:
Code: [Select]
      "lang_email" => $lang['email'],
      "lang_homepage" => $lang['homepage'],
      "lang_icq" => $lang['icq'],
      "lang_download_lastaction" => $lang['download_lastaction'], // Mod: Track User Downloads
      "lang_user_downloads" => $lang['downloaded_images'], // Mod: Track User Downloads
      "url_user_downloads" => ($user_info['user_level'] == ADMIN) ? $site_sess->url(ROOT_PATH."search.php?user_downloads=".$user_row['user_id']) : "" // Mod: Track User Downloads
    ));


Open search.php:
Locate:
Code: [Select]
$search_id = array();Insert after:
Code: [Select]
// Mod: Track User Downloads BLOCK INSERT BEGIN
if (isset($HTTP_POST_VARS['user_downloads']) || isset($HTTP_GET_VARS['user_downloads'])) {
   $user_downloads = (isset($HTTP_POST_VARS['user_downloads'])) ? intval($HTTP_POST_VARS['user_downloads']) : intval($HTTP_GET_VARS['user_downloads']);
   if ($user_downloads != "" && $user_info['user_level'] == ADMIN) {
     $show_result = 1;
      $sql = "SELECT downloaded_image_ids
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_id")." = $user_downloads";
     $user_downloads_info = $site_db->query_firstrow($sql);
     $user_downloads_ids = str_replace(" ", ",", trim($user_downloads_info['downloaded_image_ids']));
     $search_id['image_ids'] = $user_downloads_ids;
   }
}
// Mod: Track User Downloads BLOCK INSERT END


Open templates/default/member_profile.html:
Locate:
Code: [Select]
        <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>
Insert after:
Code: [Select]
              {if url_user_downloads}
        <tr>
          <td class="row1"><b>{lang_user_downloads}</b></td>
          <td class="row1"><a href="{url_user_downloads}">{lang_user_downloads}</a></td>
        </tr>
              {endif url_user_downloads}


4i_install_tud.php
Because the database must be modified, and it can be difficult to do correctly, I have written and tested an installer. Download the 4i_install_tud.zip file attached to this post. Extract the 4i_install_tud.php file and upload it to your web site. In a web browser, go to http://www.example.com/4images/4i_install_tud.php and follow the on-screen instructions.  Once your database is successfully updated, you should delete 4i_install_tud.php


Revisions:
*  Enhanced with V@no's add-on that provides a search link in both the admin Control Panel "Edit Users" and the member_profile.html template. Separately we both thought of adding the same feature but V@no beat me to it. Thank you. :)
*  Added "Last Download" to the "Order By" options list for admin CP "Edit Users".
* Attached the installer file to this post, just download it !

35
I've finished a mod that lets me track the image ids each user has downloaded.   It's works like the lightbox feature in that it stores a list of image ids in the 4images_users table.  The mod also stores the date of the most recent download and lets you query users from the admin CP using a date range.

If anyone is interested, I'll post the mod in the next few days in the published mods forum.

If anyone has more questions about this mod, post them here.

36
FAQ, Tips / How can I include another PHP file in the templates?
« on: February 23, 2003, 10:02:35 PM »
Open the 4images html template where you would like to include your PHP file and include it like this:
Code: [Select]
<?php 
include($_SERVER['DOCUMENT_ROOT']."/relative/path/to/my/include.php"); 
?>
Next, open includes/constants.php and change
Code: [Select]
// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 0);
to this
Code: [Select]
// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);

PLEASE be sure to read this FAQ forum topic: http://www.4homepages.de/forum/index.php?topic=3378
for information regarding some limitations and possible solutions for working with certain types of PHP scripts.

[UPDATE]
If you are using relative path ./ inbetween the templates, then be advised, that php will look for files in includes/ directory and not 4images root!
i.e. if used
Code: [Select]
<?php
include("./somephpfile.php");
?>
the somephpfile.php must be placed in includes/ folder.

37
FAQ, Tips / What is the {iptc_info} tag in details.html?
« on: February 21, 2003, 12:09:22 AM »
4images can read IPTC info from the images. This is a method to store information directly in the image file.

Visit http://www.iptc.org for more information.

The {if iptc_info} and {endif iptc_info} tags are used to output the enclosed HTML only if IPTC info exists for the image.

38
Feedback & Suggestions / Problem with opendetailwindow() and a solution
« on: February 04, 2003, 02:33:50 AM »
From thumbnail_bit.html:
Code: [Select]
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
The current implementation of this has a small problem.  If the user SHIFT-Clicks on the thumbnail in IE, they get an empty 'detailwindow' browser popup and a 2nd, fully chromed browser window with the actual details.html.  By that I mean they get a 2nd browser window with all the toolbars, address bar, etc.

To prevent this from happening and make it so either clicking or SHIFT-Clicking on the thumbnail both produce a single popup as intended a change must be made to both php and javascript code.  Fortunately it's not that much.

You must edit 4images/top.php and 4images/includes/functions.php.  Locate all places where you find this code fragment:
Code: [Select]
onclick=\"opendetailwindow()\" target=\"detailwindow\">
And replace it with this:
Code: [Select]
onclick=\"opendetailwindow(this.href);return false;\">

Now edit the header.html template.  Change this block of code:
Code: [Select]
 function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }

To this:
Code: [Select]
function opendetailwindow(url) {
detailwindow=window.open(url,'detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
detailwindow.focus();
}


*** NOTE ***
This doesn't stop the user who uses CTRL-Click in Netscape Navigator or Mozilla from opening details.html in a new tab inside the current, chromed browser.  Therefore, if you want to discourage this you can edit header.html and locate:
Code: [Select]
<script language="javascript" type="text/javascript">
<!--
  function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }


And insert the 2 lines as shown:
Code: [Select]
<script language="javascript" type="text/javascript">
<!--

if( location.href.indexOf("details.php") != -1 && window.name != "detailwindow" )
  location.href = "http://www.YourDomain.com";

  function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }

where you replace http://www.YourDomain.com with the URL of your web site.  This will momentarily reveal the URL of the details page but the browser will be redirected before any content is rendered.

39
Adds a list of all available image keywords to the search_form.html template where the user can select 1 or more and include those words in their search criteria.
See the screen shot at the bottom.

NOTE: There is some confusion circulating around what keywords really are in 4images. Let's see if I can help clear it up.

The default template search_form.html, with the english language pack, uses search_keywords and lang_search_keywords in the form field that actually accepts "words to search for". Search words can be anything from the image description, name, and even keywords. Keywords are words you explicitly assign to an image.

From a dictionary:
Quote
key·word also key word -
A word used as a reference point for finding other information.

It's very common for digital asset management software to not only let you categorize files, but to also let you assign keywords. Keywords are descriptive words, not phrases, that you can assign to your cataloged files in order to categorize and classify them. If you had an image of a tropical beach at sunset, you might assign it keywords such as Sand, Beach, Ocean, Sunset, Tropical, Vacation, Recreation, Outdoor, and so on. You might have chosen to place this image in a "Beaches" category. Suppose you also had an image of a city building taken at sunset when the color had changed and you placed it in a "Buildings" category. The keyword "sunset" could be used to group these images as having something in common. ("Tropical Sunset" is actually two keywords.)

Summary Description
The database table 4images_images is read and a sorted, unique list of keywords is generated. This array is then used to add list of all image keywords found to the search_form.html template. This is a standard HTML <select> form control that allows multiple items to be selected. Example is shown below:


Summary of files affected
[change] search.php
[change] includes/functions.php
[change] lang/english/main.php
[change] templates/default/search_form.html


Open search.php, locate this code near the top:
Code: [Select]
$org_search_keywords = $search_keywords;

if (isset($HTTP_POST_VARS['search_user']) || isset($HTTP_GET_VARS['search_user'])) {

Change it to the new lines as shown:
Code: [Select]
$org_search_keywords = $search_keywords;

// [Mod] Add a list of image keywords to the search form BEGIN
if (isset($HTTP_POST_VARS['search_keyword_list'])) {
  $search_keyword_list = implode(" ", $HTTP_POST_VARS['search_keyword_list']);
  $show_result = 1;
}
else {
  $search_keyword_list = "";
}

$org_search_keywords .= trim(" ".$search_keyword_list);
$search_keywords = $org_search_keywords;
// [Mod] Add a list of image keywords to the search form END

if (isset($HTTP_POST_VARS['search_user']) || isset($HTTP_GET_VARS['search_user'])) {


Locate this code near the bottom:
Code: [Select]
    "category_dropdown" => get_category_dropdown($cat_id)
  ));

Change it to the new lines as shown:
Code: [Select]
    "category_dropdown" => get_category_dropdown($cat_id),
    "lang_image_keyword_list" => $lang['image_keyword_list'], // [Mod] Add a list of image keywords to the search form
    "image_keyword_list" => get_keyword_list() // [Mod] Add a list of image keywords to the search form
  ));



Open includes/functions.php, locate this code at the very bottom:
Code: [Select]
?>
Change it to the following:
Code: [Select]

// [Mod] Add a list of image keywords to the search form BEGIN
function get_keyword_list()
{
  global $lang, $site_sess, $site_db;
  $keyword_dropdown = "";
  $keyword_dropdown .= "<select name=\"search_keyword_list[]\" multiple=\"multiple\" size=\"10\" class=\"setperpageselect\">\n";
  $sql = "SELECT `image_keywords` FROM ".IMAGES_TABLE." WHERE 1 order by `image_keywords` DESC";
  $result = $site_db->query($sql);
  $array = array();
  while(list($Name) = mysql_fetch_row($result)) {
// Commented out until enforcement of user/category/image permissions is developed
//    if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
    if(!empty($Name)) {
      $explode_array = explode(" ",$Name);
      for($ctr=0; $ctr < count($explode_array); $ctr++){
        $temp = $explode_array[$ctr];
        $array[] = $temp;
      }
    }
  }
  $site_db->free_result();
  $array1 = array_unique($array); // Remove duplicate values from the array
  if (!empty($array1)) {
    sort($array1,SORT_REGULAR); // Sort the array
    foreach($array1 as $val) {
       $keyword_dropdown .= "<option value=\"".$val."\">".$val."</option>\n";
    }
  }
  $keyword_dropdown .= "</select>\n";
  return $keyword_dropdown;
}
// [Mod] Add a list of image keywords to the search form END

?>



Now let's correct some misleading text in the english language pack and add our new language phrases for this mod.

Open lang/english/main.php and locate:
Code: [Select]
$lang['search_by_keyword'] = "Search by Keyword:<br /><span class=\"smalltext\">Use terms such as AND, OR and NOT to control your search in more detail. Use asterisks (*) as a wildcard for partial matches.</span>";
$lang['search_terms'] = "Search term:";

Change those lines to:
Code: [Select]
$lang['search_by_keyword'] = "Search Words:<br /><span class=\"smalltext\">Use terms such as AND, OR and NOT to control your search in more detail.<br />Use asterisks (*) as a wildcard for partial matches.</span>";
$lang['search_terms'] = "Any or All search words?";


After this line
Code: [Select]
$lang['or'] = "OR";
Add this new line
Code: [Select]
$lang['image_keyword_list'] = "Select Image Keywords:<br /><span class=\"smalltext\">Use CTRL-click or SHIFT-click to select multiple keywords.<br><br>You can use the '".$lang['keywords_only']."' field above to limit your search.</span>"; // [Mod] Add a list of image keywords to the search form


Open templates/default/search_form.html and locate:
Code: [Select]
          <tr>
            <td class="row1">&nbsp;</td>
            <td class="row1"><input type="submit" value="{lang_search}" class="button" /></td>
          </tr>

Replace with this:
Code: [Select]
          <tr class="row2">
            <td valign="top"><b>{lang_image_keyword_list}</b></td>
            <td>{image_keyword_list}</td>
          </tr>
          <tr>
            <td class="row2">&nbsp;</td>
            <td class="row2"><input type="submit" value="{lang_search}" class="button" /></td>
          </tr>


Revisions:
  • Jan 28, 2005 - Version 2.0 - Major rewrite
          Eliminated the need for a new template
          Eliminated the single keyword jump menu and keyword links
          Introduced a multi-item selectable list of image keywords providing more functionality than version 1.0
          Consolidated and reduced code
          TODO:  Find a way to return only keywords for images the user has permission to view. Currently this mod returns ALL image keywords.
  • Removed extraneous show_error_page() from new code block for functions.php - Thanks to v@no for spotting it
  • Fixed location of {keyword_dropdown_form} in search_form.html
       Previous location had it embedded in the search form and caused a javascript error.
  • Added an example of {keyword_links} in search_form.html to the picture.

40
This modifies the HTML form that allows the user to set the number of images to display per page.  It makes it behave the same way as the category dropdown list.

When the user selects a category from the category_dropdown_form.html, the choice is made without having to click a "Go" button.  This mod makes the setperpage_dropdown_form.html behave the same way.  The user will not have to click a "Go" button.

Open includes/page_header.php.
Code: [Select]

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
// Original 4images code
// $setperpage_dropdown = "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";

// Make this a jumpbox
$setperpage_dropdown = "\n<select name=\"setperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['imagesperpage'].submit() }\" class=\"setperpageselect\">\n";

41
There are three common reasons you might get an error that looks like the following:
Quote
Warning: Cannot add header information - headers already sent by
(output started at /home/sites/site57/web/membership/gallery/config.php:36)
in /home/sites/site57/web/membership/gallery/admin/admin_functions.php on line 169

1. If you have edited ANY of the 4images php files, including <language>/main.php, open all files you have edited and delete any and all characters before:
<?php
and after:
?>
the very last at the end of the file. This includes trailing spaces, tabs, carriage returns, etc.

2. If you start to get this error after including a non-4images php file in the templates, the most likely cause is that the included file is trying to output a complete page to the browser which naturally includes HTTP headers.  Typical php files that do this are poll and news scripts.

One solution for this senario is to place an inline frame somewhere in your template where you want the output of the included script to appear.  The HTML code for this would look something like:
Code: [Select]
<iframe src="/polls/latest.php" width="150" height="450" scrolling="no" frameborder="0"></iframe>
3.  If you are trying to include php files in the 4images templates, sometimes it helps to break up the include into three lines like the following example:<?php
include($_SERVER['DOCUMENT_ROOT']."/relative/path/to/my/include.php");
?>

These three lines should begin at the very left-hand side of your file with no leading spaces or tabs.

42
FAQ, Tips / sending emails to my members - admin address in to field
« on: December 18, 2002, 05:15:09 AM »
"When I send email to my members, they receive it but the email is addressed FROM admin@mysite.com and sent TO admin@mysite.com. - Why does the TO field show the administrator's email address and not the email addresses of my members?  What's wrong?"

This is not actually a problem.  Emails are sent like this by design.  Recipient addresses are placed in the BCC (Blind Carbon Copy) field of emails sent by 4images.  When an email address is put in the BCC field, the email is delivered to that address but is not displayed anywhere in the message or email headers.  In this way, 4images protects the identities of recipients by not revealing their email addresses to the other recipients.

43
Common error messages include:

Quote
Warning: fgets(): supplied argument is not a valid File-Handle resource in /pub/www/user41/htdocs/4images/includes/email.php on line 185
Quote
Email Error: Invalid mail server response (service not ready?):
SMTP (Simple Mail Transfer Protocol) is the most widely used method of sending email from email accounts.  But when it comes to using it from php on a web site, the vast majority of web hosts do not have it enabled. 

Right out of the box, PHP has an email function built into it.  Under UNIX it almost always uses a program called sendmail to do the actual sending.  Only under MS Windows is it possible, perhaps even likely, that php might be configured to use SMTP.  (More info at php.net) Therefore the general recommendation is to turn off SMTP for sending emails unless you know for sure your web site is running on MS Windows and/or you've already tried the method below.

To use php to send email from 4images:
    1.  Login to the admin control panel
    2.  Under "General" click "Settings"
    3.  Fill in "Admin Email" with a working email address.
    4.  Click the "NO" radio button for "Use SMTP server".
    5.  Leave the SMTP server host, username and password fields blank.
    6.  Click "Save Changes" at the bottom of the page.[/list:u]

44
FAQ, Tips / Can I use FTP to batch upload images?
« on: December 12, 2002, 01:14:25 AM »
You must be an administrator to do this.

1.  Use "Add Categories" in the admin control panel to create your categories. DO NOT USE FTP to create new directories.  This is very important since the directories where images and thumbnails are to be stored is automatically created by 4images when the category is created.

2.  Once created, go to "Edit Categories" and move your mouse over a specific category in the list into which you want to upload new images.  Your browser status bar will display a URL for the category.  At the end of this url will be "?cat_id=" and a number.  Make a note of this number as it corresponds to the directory names used by that category for storing images and thumbnails.

3.  Use FTP to upload your images to 4images/data/media/<number> and your thumbnails to 4images/data/thumbnails/<number> where <number> is the number for your category.  In order to get 4images to pick up your thumbnails, they must have the exact same file names as your images.

4.  Go back to the admin control panel and click "Check New Images".  Select the category into which you just uploaded your files.  4images scans the corresponding directory for new files, adds them to the database and automatically assigns the category.

5. (optional) You can also use the auto-thumbnailer to create the thumbnails for you instead of uploading your own.  Follow all the steps described above and just skip the uploading of thumbnails.

6. (optional) You can easily edit multiple images at once or at one page with (images that already added) [MOD] Batch Copy/Move/Edit Images


---------------------------------------------------------------------------------

If you are uploading files to several categories and find step 4 to be time consuming, you might consider installing the mod
"Check new images in ALL categories"

You can also install these "Multi Upload" Modifications so that your users are able to multiupload images:

45
I was installing 4images for someone and after submitting the form for install.php, I got the message stating 4images was unable to create the config.php file.  That's because I was installing 4images in the web site's root directory and the script didn't have permission.  So I clicked the "Download" button to get config.php so I could upload it to the server.

Unfortunately, here are the entire contents of what was downloaded to me:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; config.php                                           *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/

$db_servertype =

I've already worked past this issue so this is just an informational posting.  I don't need help.

Pages: 1 2 [3] 4 5