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 - V@no

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 14
106
This is an improved version of admin/thumbnailer.php file with new features:
- Check thumbnails for remote images (in default version its ignored remote images)
- Create thumbnails from remote images
- Check if thumbnails already existed, but not updated in database (same as "check new images" but for thumbnails)

----------- [ Installation ] ------------

Installation:

- backup admin/thumbnailer.php file
- download attached file (at the bottom of this post)
- unzip it
- upload it into admin/ folder, if asked, replace the old file.



--------- [ Version history ] ---------

v2.3.1 (12-10-08)
- Fixed: v2.3 was broken

v2.3 (12-10-08)
- Fixed: warning messages displayed when used remote images
- Fixed: support for remote images that don't have filename at the end. (i.e. http://example.com/images.php?id=10 )
- Added: links on categories name
- Added: links to the images on results page
- Added: error handling
- Changed: all text moved to $lang


v2.2.1 (08-29-04)
- Fixed a few bugs that applyed to combination of filenames such as 01.jpg and 1.jpg
and for unix system for filenames such as 1.jpg and 1.JPG

v2.2
- Fixed problem with thumbnails for non-images files (video, audio, etc.)
- Now it "really" works as it planned, it does search for already uploaded thumbnails for "inserted" into database media.

107
This mod will create thumbnails from remote images uploaded through members upload page (not ACP)


Step 1.
Open /member.php
Find:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none" && !$uploaderror) {
      if ($direct_upload) {
        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else {
        $src = MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".$new_name;
      }
Replace with:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && (!empty($HTTP_POST_FILES['media_file']['tmp_name']) || $new_name) && ($HTTP_POST_FILES['media_file']['tmp_name'] != "none" || $new_name) && !$uploaderror) {
      if (is_remote($new_name)){
        $name = MEDIA_TEMP_PATH."/".md5(time()).".".get_file_extension($new_name);
        if ($infile = fopen ($new_name, "rb")) {
          $outfile = fopen ($name, "wb");
          while (!feof ($infile)) {
            fwrite($outfile, fread ($infile, 4096));
          }
          fclose($infile);
          fclose($outfile);
        }
      }
      if ($direct_upload) {
        $src = (is_remote($new_name)) ? $name : MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }
      else {
        $src = (is_remote($new_name)) ? $name : MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }


Step 1.2.
Find:
Code: [Select]
            $new_thumb_name = $new_name;Replace with:
Code: [Select]
            $new_thumb_name = (is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name;

Step 1.3.
Find
Code: [Select]
     }

    if (!$uploaderror) {
Insert above:
Code: [Select]
      if (is_remote($new_name)){
        unlink($name);
      }
MAKE SURE U INSERTED IT ABOVE CLOSING BRACKET! ( } )


108
Chit Chat / Missing MODs/FIXes/FAQs (Updated 19-07-2005 21:10 EST)
« on: March 15, 2005, 08:32:17 AM »
This is list of MODs/FIXes/FAQs that we have saved from Google, Yahoo and MSN search cached pages.
If u know any other MODs/FIXes/FAQs that were posted before the hack and not included in this list and havent been published yet, please let us know
Also, if a topic already published and in the list it listed as not published, please let us know too, so we wont waste our time recreating already published topics.
NOTE:
please do not post cached pages of a mod already included in this list and listed as "mod/fix is saved but not published yet". We already have those.



Thank you.


Legend:
  • mod/fix is saved but not published yet
  • mod/fix is published
  • mod/fix is missing need help to restore it!
The topics:


109
Plugins / [Plugin] Check Files on server v1.2 (2009-03-29)
« on: March 15, 2005, 08:00:45 AM »
Ones I was browsing my site and all of the sudden I discovered that some images and thumbnails were missing (it showed 404.gif and red cross where thumbnails where missing). To check if image file missing is easy - just go to "Edit images" and it shows " ! " if it missing, but with thumbnail files u have to edit the image to find it out - that would take forever editing 3000+ images.
I desided just write something that will find the broken images automaticaly 

------[ Overview ]------------------

This plugin could save lots of time if u need check/find missing/broken files/thumbnails


------[ How does it work ]---------

It scans files from all/selected categories and check if they are actual exist on the server


------[ Installation ]----------------

1. Create admin/plugins/ folder
2. Download files_check_XX.zip from the attachment at the bottom of this post
3. Extract it and upload in admin/plugins/


------ [ How to use ] ----------------

Login to your 4images Admin Control Panel
On left side u should see new link Files Check

Scanning:


Error Report:


------ [ Version history ] -----------

v1.2 (2009-03-29)
- Fixed: possible problem on some servers related to incorrect ROOT_PATH
- Added: "include sub-categories" option
- Added: "check thumbnails" option

v1.1
- Added batch delete option

v1
- First release

110
This is a modified admin/images.php file, that now can copy/move files to the selected category.
new feature added in v2.3: copied/moved files date handling, either keep its original, or use current date.

------- [ Features ] ----------

  • thumbnails in image list
  • batch copy images to specified category
  • batch move images to specified category
  • batch edit images description, keywords, date, active and allow comments settings
  • quick edit images name, description, keywords, date and other image fields
  • displays category ID of the images
  • fixed few bugs from original 4images v1.7
  • support for [Mod] Show original image in new window by clicking on image
  • configurable open in a new window individual image edit/delete links
  • adjustable thumbnails size in image list
  • adjustable image preview size in edit image page
  • support for [MOD] Category Image
  • quick change owner of the selected images
  • support for backup images
  • search not activated images
  • search in additional image fields
  • show/hide each additional image field in search form
  • more precise search by means of selectable search methods for each field
  • EXIF support (very limited as of v4.11)
  • customizable search form presets

Legend:
  • feature configurable/available through web interface
  • feature configurable/available through manual editing admin/images_config.php

Normal view:
 


With "Quick edit":
 


Since v4.8:

Image search form:


Search results without "quick edit":


Multi-image edit:


------- [ Installation ] ----------

1. Backup admin/images.php file
2. Download attached package(s) (note, attached image_config.php file is optional and can be used to store settings. It might not be the same version as images.php, it only getting updated if some settings are changed or added/removed)
3. Unpack them and upload into admin/ dir (replace the old one).


------- [ Configuration ] --------

The following settings are located at admin/image_config.php file:
//--- Settings --------

/*set BIGDIR variable with the name of your "big" folder for "big" images (no trailing slashes!)*/
//define("BIGDIR", "");
define('BIGDIR'"big"); // http://www.4homepages.de/forum/index.php?topic=3236.0

/*set BACKUPDIR variable with the full path to your backup dir (no trailing slashes!)*/
if (!defined('BACKUPDIR'))
{
  
define('BACKUPDIR'"");
//  define('BACKUPDIR', "/home/4images/backup"); //example full path on unix systems
//  define('BACKUPDIR', "C:/4images/backup"); //example full path on windows systems
}

$thumbsize 48//thumbnail size showed at find image page (will be resized by browser)
$imagesize 600//image size showed at edit image page (will be resized by browser)

//quick edit description and keywords field size
$cols 30//textarea width
$rows 4//textarea height
$target false//Open links to edit/delete a single image in a new window? (true or false)

$limitnumber 25//number of images per page by default

//Quick Edit options:
$quickedit_checkboxes 0//1 = show checkboxes; 0 = show multiline dropdown
$quickedit_checkboxes_height 200//when show checkboxes limit height of the column in pixels (0 = disable)
$quickedit_default = array(); //list of image fields that will be selected by default and after search form reset.

//example select image name, description and date by default or when reset search form
/*
$quickedit_default = array(
  "image_name",
  "image_description",
  "image_date",
);
*/
$nextpage_default 1//select "Continue next page after save" by default? (1 = yes, 0 = no)

$savedate 1//select "save date" on copy/move by default? (1 = yes, 0 = no)

$use_media_template 1//use media template at edit image page (useful for non-image files)

$num_newimages_max 10//max number of "add new images"

$exif_enable 1//use exif? if PHP doesn't support read_exif_data() function, this setting will be ignored and exif support will be disabled.

$image_resize_default 1//resize image by default for add new images page (1 = yes, 0 = no)
$thumb_tools_default 2//thumbnail tools by default for add new images page (0 = skip, 1 = resize, 2 = create)

$image_resize_type = -1//image resize type (-1 = use settings, 1 = proportionally, 2 = fixed width, 3 = fixed height)
$image_resize_quality = -1//image quality (-1 = use settings, 0-100 = quality)
$image_resize_width = -1//image resize width (-1 = use settings)
$image_resize_height = -1//image resize height (-1 = use settings)

$thumb_resize_type = -1//thumbnail resize type (-1 = use settings, 1 = proportionally, 2 = fixed width, 3 = fixed height)
$thumb_resize_quality = -1//thumbnail quality (-1 = use settings, 0-100 = quality)
$thumb_resize_dimension = -1//thumbnail resize dimention (-1 = use settings)

$presets_session 0//use sessions to store presets? (1 = yes, 0 = no) If no, use $presets_file
$presets_file ROOT_PATH."data/images_presets.txt"//file where presets will be stored. Must be writable!

//--- End Settings -------------------



------- [ Addons ] ---------

Select images from lightbox (by e-trader_2002)



-------- [ How to use ] ---------

1. Login into ACP (Admin Control Panel).
2. Click on "Edit Images" link on left.
3. Find needed images.
4. Select a category to witch u want the images be copied/moved to
5. Click on "Copy" or "Move" button


-------- [ Version history ] --------
v4.15.7 (2011-01-09)
 - FIXED: search keywords not being saved at quick edit unless image keywords edited
 - FIXED: yet another issue with keywords when adding images

v4.15.6 (2011-01-07)
 - FIXED: another keywords issue from quick edit page...

v4.15.5 (2011-01-06)
 - FIXED: compatibility issue with config file from previous versions.

v4.15.4 (2010-12-18)
 - FIXED: not all template tags generated when use of templates activated

v4.15.3 (2010-12-17)
 - FIXED: keywords not saved properly (hopefully) on multi image edit

v4.15.2 (2010-12-12)
 - FIXED: keywords not saved properly

v4.15.1 (2010-08-14)
 - FIXED: keywords handling for 4images >= v1.7.8

v4.15 (2010-07-17)
 - FIXED: presets filtering
 - FIXED: unable remove autoload from a preset, if no other presets exist
 - ADDED: search in subcategories

v4.14.1 (2008-12-30)
 - Fixed: incorrect loaded preset name displayed when clicked "back" button
 - Fixed: would not let save new preset if "Default" selected in the dropdown
 - Fixed: quick edit category id would not move images
 - Changed: save at quick edit will only update images that had changes
 - Changed: "Media file" and "Thumb file" removed from quick edit options. This is due to possible conflicts with existing filenames

v4.14 (28-12-2008)
 - Added: search form presets

v4.13 (27-12-2008)
 - Added: image resize, thumbnail resize/create at add/edit image pages
 - Added: edit image link after new image added
 - Added: delete image link at image edit page (next to image name header)
 - Changed: image name field at add images page is no longer required, if left empty filename will be used
 - Changed: return to "add images" page after image(s) successfully added
 - Changed: improved message display after new image(s) added

v4.12 (26-12-2008)
 - Fixed: if error occur while saving an image, it didn't mark the form field where the error was.
 - Added: direct links to media/thumb files at edit image page. (links are at filename)
 - Added: new setting $exif_enable to enable/disable EXIF support. This setting will only work if PHP itself supports EXIF, otherwise it will be ignored and EXIF support will be disabled.

v4.11 (22-11-2008)
- Fixed: Multi image upload adds user_id from last image to all images.
- Fixed: Wrong message showed when error occur while deleting image comments.
- Added: EXIF support, for now only DateTimeOriginal, DateTimeDigitized and DateTime EXIF values used in edit image page and in quick edit.
- Added: When selected "User ID" in quick edit it allowes you enter username instead of user id. To activate this feature you must install this: http://www.4homepages.de/forum/index.php?topic=23387.0

v4.10 (06-11-2008)
- Fixed: incompability with 4images v1.7 - 1.7.1
- Added: max number of new images is configurable via $num_newimages_max variable and can be set manually on the page.

v4.9.2 (13-10-2008)
- Fixed: keywords not being properly saved when used quick edit

v4.9.1 (05-10-2008)
- Fixed: image name and date wasn't updated after save at quick edit page

v4.9 (05-10-2008)
- Added: javascript select all/none in quick edit dropdown box
- Fixed: javascript calendar doesn't work on quick edit page
- Fixed: when used none-english language pressing some buttons would show a blank page
- Fixed: none-english usernames and categories showed incorrectly

v4.8 (04-10-2008)
- Added: color in dropdown menu if it will affect search results
- Added: at "batch image edit" page keywords field will show unique keywords from all selected images
- Added: quick calendar for date inputs at quick edit and multi edit pages.
- Changed: "quick edit" is rewriten, now any image fields can be edited
- Changed: after save "batch image edit" shows result above search form (used to be results with a link to search form)
- Changed: layout at search form.
- Fixed: at batch image edit page fields showed the searched data
- Removed: $editname, $editdescription, $editkeywords, $editdate variables no longer used, $quickedit_default array used instead.

v4.7 (22-09-2008)
- Added dropdown options for more precise searches
- Checkboxes for additional fiels replaced by dropdown menus
- Added highlited entire row for images with missing files (additional to a red "!")
- $big and $backup variables no longer used, instead BIGDIR and BACKUPDIR constant used.
- Added new feature: use media template at edit image page (useful for non-images media files). Controlled by $use_media_template variable
- Fixed php warning message showed when replaced remote image with an uploaded one
- Fixed "reset" button didn't work when $savesearchform = 0 and pressed "back" button after search.
- Fixed old keywords references not being removed from database when saved via quick edit

v4.6 (16-09-2008)
- Internal configuration now moved into separate file admin/images_config.php
- Added support for easier show/hide additional image fields via admin/images_config.php
- Fixed all additional image fields checkboxes get selected after pressing "next page" button

v4.5 (16-09-2008)
- Added experemental support for additional image fields on search form

v4.4 (16-09-2008)
- Added thumbnails to multi-image edit page
- Now if only one image selected and pressed edit button, a normal image edit page opens
- Fixed displaying missing thumbnails
- Fixed progress window popup wouldn't close after save at multi-image edit.

v4.3 (16-09-2008)
- Added link to image details in edit image page and after new image added
- Added error message if trying edit non-existent image
- Image preview size is now can be changed via $imagesize variable
- Date column at search images page now shows image date and time
- Fixed uploaded image file not being deleted if something went wrong and image was not updated/saved in the database
- Fixed cat image being overwritten by moved in image

v4.2 (14-09-2008)
- "Reset" button will now reset form to default
- Added "internal" setting to enable/disable save search form in session

v4.1 (14-09-2008)
- "Results per page" number and selection of dropdown menus and radio buttons are now restored from last search.
- Fixed moving a category image to a new category not being removed from old category
- Fixed language misspellings

v4.0.3 (13-09-2008)
- Minor layout tweaks
- Fixed some deutsch translation incompatibilities.

v4.0.2 (13-09-2008)
- Fixed image doesn't get deleted from old category when category changed at "normal" edit page
- Fixed "big" and "backup" image not being deleted from old category when category changed at "normal" edit image page
- Fixed white page with non-english language and pressed "change owner" button
- Fixed "0" showed in some search fields when pressed back button

v4.0.1 (13-09-2008)
- Fixed "big" image not being moved if changed category at "normal" edit image page.
- Fully multilingual support. Included english and deutsch translation
- More settings on top of the file (see "configuration" above)
- Some minor visual changes on page after image search

v4.0 (22-02-2008) by ivan

v3.7.3 (10-08-2006)
- Fixed a minor bug on line 214

v3.7.2 (16-05-2005)
- Fixed thumbnails with the same name being overwritten on copy/move (more info here)

v3.7.1 (01-04-2005)
- Fixed little bug that would not let remove "Category image"

v3.7 (31-03-2005) (more info here)
- Added button to change owner of the selected images
- Added support for images in backup directory
- fixed few minor bugs
- moved most of the messages into appropriate $lang array, so now its easier translate to other languages

v3.6 (11-02-2005)
- Added option to open links to edit/delete a single image in a new window (edit setting inside the file to disable it)

v3.5.1 (06-12-2004)
-Fixed a minor bug, that could delete images in "big" folder when images deleted, even though the "big" folder wasnt set.

v3.5
-Added support for Category Image mod

v3.4.1
-Fixed quick edit date problem

v3.4
-Fixed minor bug that produced error messages when on quick edit save

v3.3
-Added search active/inactive images

v3.2
-Added new option "Continue on next page" after quick edit save

v3.1
-Added new option in "Quick edit": edit date

v3
-Added new option: "Quick edit"
It let u edit image's name, description and keywords in the search results.

v2.5
-Fixed overwriting files with same name

v2.4
-Fixed error with a missing function
-Added new feature: batch images edit. It let edit description and keywords for selected images.

111
Mods & Plugins (Releases & Support) / Signature image v2.3
« on: March 15, 2005, 02:54:39 AM »
This code will alow u show your gallery statistics anywhere on the web as a dynamicaly generated image

Before you start, please note, that this script is required GD v2.x and it doesnt support any other graphic modules such as ImageMagic or NetPBM!



Step 1
Create signature.php with this code inside:
Code: [Select]
<?php
##################################
#   signature.php version 2.3    #
# - - - - - - - - - - - - - - - -#
# Copyright © V@no 2004-ETERNiTY #
##################################
#                                #
#         TERMS OF USE           #
#                                #
#    NO PORNOGRAPHY OR ANY       #
#    OTHER PICTURES THAT COULD   #
#    BE TREATED AS OFFENSIVE     #
#    MAY BE SHOWED ON 4IMAGES    #
#    FORUM OR ANYWHERE ELSE      #
#    WHERE ITS NOT ACCEPTIBLE.   #
#                                #
#     PLEASE RESPECT OTHERS!     #
#                                #
##################################

// ------- Config -----------
$random_image 1//show random image
$random_fast 1//if your mysql account doesn't have permission to create/delete temporary tables, set this to 0
$debug 0//turning this on, will ignore expiration time, meaning every request will create a new image. change this to 0 before u publish your signature!
$expire 20//seconds before image will be expired and recompilled with new random image and information (lower this will encrease server load!)
$type "png"//image type: png or jpeg
$quality "50"//image quality when used jpeg
define('ROOT_PATH''./'); //path to your 4images root dir with trailing slash! must be ralative ( ./ or ../ or combination of these) and NOT full internet or local (http://example/4images/ or /www/blah/4images/)
$signature_template_dir "./signatures/"//directory with signature template images WITH TRAILING SLASH!!!
$signature_template "signature.png"//default signature template image filename
$signature_template_random 1//use random template image? (0 = no | 1 = yes)
$path "/tmp/"// WRITEBLE dir (chmod 777), where compilled image will be stored (does not requere access from web)
$tmpfname $path."signature.tmp"// filename for the compilled image (extension does not metter)
$tmptname $path."signature.id"// filename for the file where some extra info will be stored in (image id)
$template "default"//name of the template which icons will be used, if thumbnail not found
$sitename "Statistics for my site"//signature header
$fonts_dir ""//directory with custom fonts WITH TRAILING SLASH! (leave blank if no fonts)
$fonts = array(); // an array with font names the first number is the number that u can use in $fsize variable, it must be sequenced! and first item must have number 6 or larger!
/*
//an example array:
$fonts = array(
               6  => "micross8px.gdf",
               7  => "micross9px.gdf",
               8  => "micross10px.gdf",
               9  => "micross12px.gdf"
);
*/
$fsize 2//font type (1 to 5 for build-in fonts and 6 to XX for your custom fonts (see $font array above)
$offset 7//offset from the left, right and bottom, uses for random image and the text (not used if random image disabled)
$offset2 99//extra offset from the left (place where random image will be embeded if its enabled. Not used if random image disabled)
$spacing 11//height of each line of text
$start 21//offset from top (space where header shows)
$tiny 9//an extra space at the begining of each line (needed for offset from the random image space)
$not_in_cat "0"//list of categories which should not be included for random image, separated by coma (i.e. "1,2,3,7") "0" - means disabled
$auth 0//permission level for auth_viewimage (0 = All, 2 = Members, 3 = Private or 9 = Admin) Refer in /includes/constants.php
$peruser 1//alow per user random image (images uploaded by XX user. Usage: signature.php?user=XX)
$noimage "jpeg.gif"//icon name if no random image was found
$new_cutoff 7//Days when images treated as new
$lang_images "Images: ";
$lang_users "Members: ";
$lang_cat "Categories: ";
$lang_new_user "Newest member: ";
$lang_online "Online: ";
$lang_comments "Comments: ";
// --------- End Config ----------

$peruser = ($peruser && isset($_GET['user']) && intval($_GET['user'])) ? intval($_GET['user']) : "";
$tmpfname .= $peruser;
$tmptname .= $peruser;
if (isset(
$_GET['go']) && $_GET['go'])
{
  if (
$handle = @fopen($tmptname"rb"))
  {
    while (!
feof($handle))
    {
      
$buffer fgets($handle4096);
      
$imgid intval($buffer);
    }
    
fclose($handle);
  }
  
$nozip 1;
  
define('GET_CACHES'1);
  include(
ROOT_PATH.'global.php');
  require(
ROOT_PATH.'includes/sessions.php');
  
$user_access get_permission();
  
$url $site_sess->url(ROOT_PATH."index.php""&");
  if (
$imgid && $random_image)
  {
    
$sql "SELECT cat_id
            FROM "
.IMAGES_TABLE."
            WHERE image_id = 
$imgid";
    if (
$row $site_db->query_firstrow($sql))
    {
      if (
check_permission("auth_viewcat"$row['cat_id']) || check_permission("auth_viewimage"$row['cat_id']))
      {
        
$url = (check_permission("auth_viewimage"$row['cat_id']) && check_permission("auth_viewcat"$row['cat_id'])) ? $site_sess->url(ROOT_PATH."details.php?image_id=".$imgid) : ((check_permission("auth_viewcat"$row['cat_id'])) ? $site_sess->url(ROOT_PATH."categories.php?cat_id=".$row['cat_id']) : $url);
      }
    }
  }
  if (!
function_exists("redirect"))
  {
    function 
redirect($url) {
      global 
$script_url$site_sess;
      if (
strpos($url'://') === false) {
        
$url $script_url.'/'.$url;
      }
      
$location = @preg_match('/Microsoft|WebSTAR|Xitami/'getenv('SERVER_SOFTWARE')) ? 'Refresh: 0; URL=' 'Location: ';
      if (
is_object($site_sess)) {
        
$url $site_sess->url($url"&");
      }
      
header($location.$url);
      exit;
    }
  }
  
redirect($url);
}
$imageid 0;
$time = @filemtime($tmpfname);
if (
$handle = @fopen($tmptname"r"))
{
  if (!
feof($handle))
  {
    
$buffer fgets($handle4096);
    
$imageid intval($buffer);
  }
  
fclose($handle);
}
$current_time time();
if (!
$time || (($current_time $time) > $expire || ($current_time $time) < 0) || $debug)
{
  
$show = array();
  include(
ROOT_PATH.'config.php');
  include(
ROOT_PATH.'includes/constants.php');
  include(
ROOT_PATH.'includes/db_mysql.php');
  
define('MEDIA_PATH'ROOT_PATH.MEDIA_DIR);
  
define('THUMB_PATH'ROOT_PATH.THUMB_DIR);
  
define('MEDIA_TEMP_PATH'ROOT_PATH.MEDIA_TEMP_DIR);
  
define('THUMB_TEMP_PATH'ROOT_PATH.THUMB_TEMP_DIR);
  
define('TEMPLATE_PATH'ROOT_PATH.TEMPLATE_DIR."/".$template);
  
define('ICON_PATH'ROOT_PATH.TEMPLATE_DIR."/".$template."/icons");
  include(
ROOT_PATH.'includes/functions.php');
  
$site_db = new Db($db_host$db_user$db_password$db_name);

// --- Random image -----
  
if ($random_image)
  {
    if (
$random_fast)
    {
      
mt_srand((double)microtime() * intval(session_id()));
      
$temptab "tab_".mt_rand(0,1000000);
      
$sql "CREATE TEMPORARY TABLE ".$temptab." TYPE  =  HEAP
              SELECT i.image_id, i.cat_id
              FROM "
.IMAGES_TABLE." i
              LEFT JOIN "
.CATEGORIES_TABLE." c ON c.cat_id = i.cat_id
              WHERE i.image_active = 1 AND c.auth_viewcat = 
$auth AND i.cat_id NOT IN ($not_in_cat)".(($peruser) ? " AND i.user_id = ".$peruser "").(($imageid) ? " AND i.image_id <> ".$imageid "")."
              ORDER  BY RAND()
              LIMIT 1"
;
      
$result $site_db->query($sql);
      
$sql "SELECT t.image_id, t.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file
              FROM "
.$temptab." AS t
              LEFT JOIN "
.IMAGES_TABLE." AS i ON i.image_id=t.image_id";
      
$imagedata $site_db->query_firstrow($sql);
      
$sql "DROP TABLE ".$temptab;
      
$result $site_db->query($sql);
    }
    else
    {
      
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file
              FROM "
.IMAGES_TABLE." i
              LEFT JOIN "
.CATEGORIES_TABLE." c ON c.cat_id = i.cat_id
              WHERE i.image_active = 1 AND c.auth_viewcat = 
$auth AND i.cat_id NOT IN ($not_in_cat)".(($peruser) ? " AND i.user_id = ".$peruser "").(($imageid) ? " AND i.image_id <> ".$imageid "")."
              ORDER  BY RAND()
              LIMIT 1"
;
      
$imagedata $site_db->query_firstrow($sql);
    }
    if (empty(
$imagedata))
    {
      
$thumb ICON_PATH."/".$noimage;
    }
    elseif (!
get_file_path($imagedata['image_thumb_file'], "thumb"$imagedata['cat_id'], 00))
    {
      
$thumb ICON_PATH."/".get_file_extension($imagedata['image_media_file']).".gif";
    }
    else
    {
      
$thumb get_file_path($imagedata['image_thumb_file'], "thumb"$imagedata['cat_id'], 01);
    }
  }
  else
  {
    
$offset $offset2 0//no need any offset if random image disabled
  
}
// --- Total users -----
  
$sql "SELECT COUNT(*) AS total_users
          FROM "
.USERS_TABLE."
          WHERE user_level > "
.USER_AWAITING;
  
$row $site_db->query_firstrow($sql);
  
$show['total_users'] = $row['total_users'];

// --- Total not activated users -----
  
$sql "SELECT COUNT(*) AS total_users
          FROM "
.USERS_TABLE."
          WHERE user_level = "
.USER_AWAITING;
  
$row $site_db->query_firstrow($sql);
  
$show['total_users_awaiting'] = $row['total_users'];

// --- Lattest username -----
  
$sql "SELECT user_name
          FROM "
.USERS_TABLE."
          WHERE user_level > "
.USER_AWAITING."
          ORDER BY user_id DESC"
;
  
$row $site_db->query_firstrow($sql);
  
$show['new_user'] = stripslashes($row['user_name']);

// --- Total images -----
  
$sql "SELECT COUNT(*) AS total_images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1"
;
  
$row $site_db->query_firstrow($sql);
  
$show['total_images'] = $row['total_images'];

// --- Total new images -----
  
$new_cutoff time() - 60 60 24 $new_cutoff;
  
$sql "SELECT COUNT(*) AS total_new_images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_date > "
.$new_cutoff;
  
$row $site_db->query_firstrow($sql);
  
$show['total_new_images'] = $row['total_new_images'];

// --- Total categories -----
  
$sql "SELECT COUNT(*) AS total_categories
          FROM "
.CATEGORIES_TABLE;
  
$row $site_db->query_firstrow($sql);
  
$show['total_categories'] = $row['total_categories'];

// --- Total comments -----
  
$sql "SELECT SUM(image_comments) AS sum
          FROM "
.IMAGES_TABLE;
  
$row $site_db->query_firstrow($sql);
  
$show['comments'] = $row['sum'];

// --- Online users -----
  
$time_out time() - 300;
  
$sql "SELECT session_user_id, session_ip
          FROM "
.SESSIONS_TABLE."
          WHERE session_lastaction >= 
$time_out";
  
$result $site_db->query($sql);
  
$show['guests_online'] = $show['reg_online'] = 0;
  while (
$row $site_db->fetch_array($result))
  {
    if (
$row['session_user_id'] != GUEST)
    {
      if (!isset(
$prev_user_ids[$row['session_user_id']]))
      {
        
$show['reg_online']++;
      }
      
$prev_user_ids[$row['session_user_id']] = 1;
    }
    else
    {
      if (!isset(
$prev_session_ips[$row['session_ip']]))
      {
        
$show['guests_online']++;
      }
    }
    
$prev_session_ips[$row['session_ip']] = 1;
  }
//-----------------------

  
if (!empty($fonts_dir) && count($fonts))
  {
    foreach (
$fonts as $key => $val)
    {
      
imageloadfont($fonts_dir.$val);
    }
  }
  
$total_online $show['reg_online'] + $show['guests_online'];
  
$online " (".$show['reg_online']." member".(($show['reg_online'] > || !$show['reg_online'])? "s" "")." and ".$show['guests_online']." guest".(($show['guests_online'] > || !$show['guests_online'])? "s" "").")";
  
$far $offset2+$tiny+(strlen($lang_new_user))*($fsize+4);
  
//array with data:
  //[0] - font type
  //[1] - offset
  //[2] - text
  //[3] - color (i.e. "text_color" will use $text_color variable)
  
$stats = array(
                  array(array(
$fsize$offset2+$tiny$lang_images"text_color"), array($fsize$far$show['total_images']." (".$show['total_new_images']." new)""text_color")),
                  array(array(
$fsize$offset2+$tiny$lang_cat"text_color"), array($fsize$far$show['total_categories'], "text_color")),
                  array(array(
$fsize$offset2+$tiny$lang_comments"text_color"), array($fsize$far$show['comments'], "text_color")),
                  array(array(
$fsize$offset2+$tiny$lang_users"text_color"), array($fsize$far$show['total_users'], "text_color"), array($fsize$far+strlen($show['total_users'])*($fsize+4), " and ".$show['total_users_awaiting']." not activated""text_color")),
                  array(array(
$fsize$offset2+$tiny$lang_online"text_color"), array($fsize$far$total_online"red"), array($fsize$far+strlen($total_online)*($fsize+4), $online"text_color")),
                  array(array(
$fsize$offset2+$tiny$lang_new_user"text_color"), array($fsize$far$show['new_user'], "text_color"))
  );
  if (
$signature_template_random)
  {
    if (
$dir = @opendir($signature_template_dir))
    {
      
$list = array();
      while (
$file = @readdir($dir))
      {
        if (!
is_dir($signature_template_dir.$file) && is_file($signature_template_dir.$file) && strtolower(substr(strrchr($file,"."), 1)) == "png")
        {
          
$list[] = $file;
        }
      }
      @
closedir($dir);
      
$signature_template $list[array_rand($list)];
    }
  }
  
$im ImageCreateFromPNG($signature_template_dir.$signature_template);
  
$width imagesx($im);
  
$height imagesy($im);
  
$text_color ImageColorAllocate ($im000);
  
$red ImageColorAllocate ($im25500);
//  ImageString($im, 3, $offset2+(($width-$offset2)/2)-(strlen($sitename)*7/2), 4, $sitename, $text_color);
  
ImageString($im3$offset2+$tiny4$sitename$text_color);
  
$i $start;
  foreach (
$stats as $key)
  {
    if (
$key[0][2] == $lang_online && !$total_online)
    {
      continue;
    }
    foreach (
$key as $val)
    {
      
ImageString($im$val[0], $val[1], $i$val[2], $$val[3]);
    }
    
$i $i $spacing;
  }
  if (
$random_image)
  {
    
$image_info getimagesize($thumb);
    
$types = array(=> "gif"=> "jpeg"=> "png");
    
$th "imagecreatefrom".$types[$image_info[2]];
    
$width_start $image_info[0];
    
$height_start $image_info[1];
    
$dimension $offset2-$offset*2;
    if (
$height $image_info[1] < $offset && $height $offset2 $offset)
    {
      
$dimension $height $offset*2;
    }
    
$width_end $dimension;
    
$height_end $dimension;
    if ((
$width_start $width_end || $height_start $height_end) && $width_start && $height_start && $width_end && $height_end)
    {
       
$ratio $width_start $height_start;
      if (
$ratio 1)
      {
        
$width_end $dimension;
        
$height_end round(($dimension/$width_start) * $height_start);
      }
      else
      {
        
$width_end round(($dimension/$height_start) * $width_start);
        
$height_end $dimension;
       }
    }
    elseif (
$width_start || $height_start)
    {
       
$width_end $width_start;
       
$height_end $height_start;
    }
    
$temp imagecreateTrueColor($width_end$height_end);
    if (
$image $th($thumb))
    {
      
imagecopyresampled($temp$image0000$width_end$height_endImageSX($image), ImageSY($image));
    }
    
$posx round(($offset2-$width_end)/2);
    
$posy round(($height-$height_end)/2);
    
imagecopymerge($im,$temp$posx$posy00$width_end$height_end100);
    
ImageRectangle($im$posx-1$posy-1$posx+$width_end-1$posy+$height_end-1$text_color);
  }
  
$function "Image".$type;
  
$function($im,$tmpfname,(($type == "png") ? $quality)); 
  
ImageDestroy($im);
  
$handle = @fopen($tmptname"wb");
  
$contents = @fwrite($handle, (($random_image) ? $imagedata['image_id'] : 0));
  @
fclose($handle);
//end compilling new image
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header("Content-disposition: filename=signature".MD5(time()).".".$type);
header("Content-Type: image/".$type);
header("Content-Length: ".filesize($tmpfname));
readfile($tmpfname);
?>

Place it into your 4images root directory (actualy u can place it somewhere else, on the same sever with your 4images, but then u'll need change ROOT_PATH inside the script.)



Step 2
Create signature.png image which will be used as default template (background) for your signature image. Make sure the color depth is 24bit, otherwise your thumbnail might get distorted.  Place it in signatures/ folder
You can create as many template images as u wish, just place them into signatures/ directory and make sure in the settings u have $signature_template_random = 1;
I've attached 3 sample templates (please dont be too harsh about their design, I know I suck with graphics :oops:)
[EDIT]
more image templates: http://www.4homepages.de/forum/index.php?topic=6755.msg142768#msg142768
[/EDIT]



Step 3
Place jpeg.gif image in the same directory as your signature.php (u can copy it from templates/<yourtemplate>/icons/ folder) This image will be used if a random image does not have a thumbnail.



Step 4
Look in the configuration of the script, change it to your own needs, every setting is explained inside the code.



If everything is done correctly, by executing the script (type in your browser: http://yoursiteurl/path_to_the_script/signature.php) u should see something like this:




In case a forum where u are trying show your signature image does not support images with .php extension or u simply would like have signature.png instead of signature.php then chose one of the following methods:

1) this method require Apache webserver with mod_rewrite enabled
create .htaccess file with this code:
Code: [Select]
RewriteEngine On
#RewriteBase /
RewriteRule ^signature\.png$ signature.php?%{QUERY_STRING}
RewriteRule ^go$ signature.php?go=1&%{QUERY_STRING}
upload it to the same directory where your signature.php file is.

to test it type in your browser: http://<youraddress>/signature.png
it should show u your signature. Then type: http://<youraddress>/go
it should redirect u to the image/category of the last random image showed in the signature (asuming its enabled)

2) this method require Apache webserver

create .htaccess file with this code:
Code: [Select]
<Files signature.png>
AddType application/x-httpd-php .png
</Files>
upload it to the same directory where your signature.php file is.
Rename your signature.php to signature.png
to test it type in your browser: http://<youraddress>/signature.png
To redirect to the last random image showed in the signature use: http://<youraddress>/signature.png?go=1

3) I'm not quet sure what kind of server/confguration this method required, so try it and see if it works for u

user url like this: http://<youraddress>/signature.php/sig.png

sig.png could be any name u want.

To redirect to the last random image showed in the signature use: http://<youraddress>/signature.png?go=1



If you get a "red x" (broken image), the first thing u should do is comment out (remove) every line that has header():
Code: [Select]
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header("Content-disposition: filename=signature".MD5(time()).".".$type);
header("Content-Type: image/".$type);
and check again for any error messages.
Without error messages u should see a bunch of "random" characters (bunch of crap if u wish)



Since v2.21 you can load your own fonts.
As of now, no TTF (TrueTypeFont) can be used, but special "GD Font" fonts.
On this site you can create your own fonts
or download this program to convert windows fonts into "GD" format
or you can download already converted fonts from this site.

112
Finaly u can add multilanguage support not only for the interface ( http://www.4homepages.de/forum/index.php?topic=4743.0 ) but also for any text, such as image names, description, anything. Since this is not "real" MOD, I will only show an example how to add this support to image names and description. (basicaly this is more for developers and who know little bit PHP and 4images code structure)

Q: How it works?
A: In the text u'll need add [language] (i.e. [english] or [deutsch]).
Yes, that's it, no [/language] tag requered.
- Everything that is followed after [language] will be used when this language was selected.
- If a text starts with something other then [language] tag and no [language] tag was matched with current language, then the text that can be found before FIRST [language] tag will be showed.
- If a text starts with a [language] tag, and none of the [language] tags are matching with current language, the script will try find [language] tag with 4images default language, if none was found, it will show text as is, with all [] tags.
- If u add [/language] (closing tag) and then add some text after it, that text will be ignored.

Try and see diffirent situations that could be and how this script handle them: http://gallery.vano.org/multilang.php

Here is a little example.

Updated on 08-07-03 2:50PM (EST)

-------- [ Installation ] ----------
Step 1
Open global.php
Find:
Code: [Select]
$config['language_dir_default'] = $config['language_dir'];

Insert below:
Code: [Select]
$handle = opendir(ROOT_PATH."lang");
$config['language_list_array'] = array();
while ($folder = @readdir($handle)) {
  if (@is_dir(ROOT_PATH."lang/$folder") && $folder != "." && $folder != "..") {
    $config['language_list_array'][] = $folder;
  }
}
closedir($handle);
$config['language_list'] = "(".implode("|", $config['language_list_array']).")";



Step 2
Open includes/functions.php
Insert at the end, above closing ?>
Code: [Select]
function multilang($text, $show_first = 0, $remove = 0){
  global $config;
  preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  if ($show_first) {
    preg_match("#\[".$config['language_list']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
    if (!empty($match[2])) {
      return $match[2];
    }
  }
  if ($remove) {
    return preg_replace("#\[".$config['language_list']."\](.*)#iDs", "", $text);
  }
  return $text;
}

function multilang_tag_remove($text){
  global $config;
  return preg_replace("#\[\/?".$config['language_list']."\]#iDUs", " ", $text);
}


Added 05-11-2005
Step 3 (optional)
With this step you'll be able add multilanguage support in date format.
Open global.php
Find:
Code: [Select]
include(ROOT_PATH.'includes/functions.php');Insert below:
Code: [Select]
$config['date_format'] = multilang($config['date_format']);
$config['time_format'] = multilang($config['time_format']);

Step 3.1
Open includes/functions.php
Find:
Code: [Select]
  return date($format, $timestamp + (3600 * $timezone_offset));Insert above:
Code: [Select]
  global $lang;
  if (isset($lang['date_translate']) && !empty($lang['date_translate']))
    return strtr(date($format, $timestamp + (3600 * $timezone_offset)), $lang['date_translate']);

Step 3.1 (optional, needed only if you want use names of month/weekday)
Open lang/<your language>/main.php
At the end, above closing ?> insert:
Code: [Select]
$lang['date_translate'] = array(
  "Monday" => "Понедельник",
  "Tuesday" => "Вторник",
  "Wednesday" => "Среда",
  "Thursday" => "Четверг",
  "Friday" => "Пятница",
  "Saturday" => "Суббота",
  "Sunday" => "Воскресенье",
  "Mon" => "Пон",
  "Tue" => "Втр",
  "Wed" => "Срд",
  "Thr" => "Чтв",
  "Fri" => "Птн",
  "Sat" => "Суб",
  "Sun" => "Вос",
  "January" => "Января",
  "February" => "Февраля",
  "March" => "Марта",
  "April" => "Апреля",
  "May" => "Мая",
  "June" => "Июня",
  "July" => "Июля",
  "August" => "Августа",
  "September" => "Сентября",
  "October" => "Октября",
  "November" => "Ноября",
  "December" => "Декабря",
  "Jan" => "Янв",
  "Feb" => "Фев",
  "Mar" => "Мар",
  "Apr" => "Апр",
  "May" => "Май",
  "Jun" => "Июн",
  "Jul" => "Июл",
  "Aug" => "Авг",
  "Sep" => "Сен",
  "Oct" => "Окт",
  "Nov" => "Ноя",
  "Dec" => "Дек",
  "AM" => "AM",
  "PM" => "PM",
  "am" => "am",
  "pm" => "pm",
);
Translate right side of the array (after =>) to your langauge. DO NOT TOUCH LEFT PART, WHICH MUST STAY IN ENGLISH

Step 3.3
Go to you ACP (Admin Control Panel) -> Settings and add [<your langauge>] tags to "Date" and "Time" format field.
For example in USA the date format is: month, day, year, (10.25.2005) in Europe is day, month, year (25.10.2005) so, the string in "Date" field should be:
Quote
[english]m.d.Y[russian]d.m.Y
For more info about the language tags, read below. And for more info about date format you can find here

This is it.
Now, let me show u how to use it:

You'll need send your text through multilang() function (i.e. echo multilang($text); this will print result after processing text from $text variable)
Added two keys: multilang($text, $show_first, $remove)
$show_first = 1 would use first matching [language] as default, instead of showing entire text (case 4 and 5 in the example)
$remove = 1 would remove everything, instead of showing entire text (case 4 and 5 in the example)

Practical example:
-------- Image name and description ------------
Open includes/functions.php
Find:
Code: [Select]
    "image_name" => $image_row['image_name'],
    "image_description" => $description,


Replace with:
Code: [Select]
    "image_name" => multilang($image_row['image_name']),
    "image_description" => multilang($description),



Important! this is MUST do, otherwise your keywords will be messed up!

Open admin/images.php
Find:
Code: [Select]
          $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);

Replace with:
Code: [Select]
          $search_words[$image_column] = multilang_tag_remove(stripslashes($HTTP_POST_VARS[$image_column]));


Find:
Code: [Select]
              $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column.'_'.$i]);

Replace with:
Code: [Select]
              $search_words[$image_column] = multilang_tag_remove(stripslashes($HTTP_POST_VARS[$image_column.'_'.$i]));



Open member.php
Find TWO (2) times:
Code: [Select]
          $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);

Replace BOTH with:
Code: [Select]
          $search_words[$image_column] = multilang_tag_remove(stripslashes($HTTP_POST_VARS[$image_column]));



P.S. I will updating this post if I think of something else ;)

P.P.S. in the attached file is provided saved google cached page of the original post with a few replys and some extra code.

113
Because of this bug people are able see images through postcard creation page, which they dont have permissions to view.

Open postcards.php
Find:
Code: [Select]
  if (!check_permission("auth_sendpostcard", $cat_id)) {
Replace with:
Code: [Select]
/*
  FIX ACCESS RESTRICTED IMAGES
  ORIGINAL BLOCK:
  if (!check_permission("auth_sendpostcard", $cat_id)) {
*/ 
/*
  FIX ACCESS RESTRICTED IMAGES
  START REPLACE
*/
  if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !check_permission("auth_sendpostcard", $cat_id)) {
/*
  FIX ACCESS RESTRICTED IMAGES
  END REPLACE
*/

114
When media directory size is over 2 gigabytes it shows as negative ( -2.0 GB )
This is not a bug in 4images itself, but its limitation of intval() function which can only handle numbers between -2147483648 and 2147483647

As of now, the only sollution I know is dont use that function on numbers larger then 2147483647

Open includes/functions.php
Find:
Code: [Select]
  $file_size = intval($file_size);
Replace with:
Code: [Select]
/*
  FIX NEGATIVE NUMBERS
  ORIGINAL BLOCK:
  $file_size = intval($file_size);
*/
/*
  FIX NEGATIVE NUMBERS
  START REPLACE
*/
  if ($file_size < 2147483648)
  {
    $file_size = intval($file_size);
  }
/*
  FIX NEGATIVE NUMBERS
  END REPLACE
*/

115
This mod will show country flags of your visitors in "Who's online?" in ACP (Admin Control Panel)




--------- [ Installation ] ------------

Step 1
Visit the home page of the tools will be used in this mod:
http://www.maxmind.com/app/geoip_country
Read the licence and make sure its NOT conflicts with your usage.

Download the following files:
1) http://www.maxmind.com/download/geoip/api/php/geoip.inc
Save it in includes/ directory of your 4images installation

2) http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
Extract the content of this archive (u can use WinZIP, WinRAR, 7-Zip or any other archivers)
Save the extracted file (GeoIP.dat) into includes/ directory (make sure u keep the case: its GeoIP.dat not geoip.dat)

3) Download and extract flags.zip file from the attachment below.
Save the files into flags/ folder in your 4images root directory.

The attached GeoIP.20100809.zip file should only be used as a backup, only if provided download links no longer working, because it might be out of date.

Step 2
Open admin/home.php
Find:
Code: [Select]
   $prev_ip = "";
Insert below:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
    if (!class_exists("GeoIP"))
    {
      include(ROOT_PATH."includes/geoip.inc");
    }
    
    $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
    $countries = array();
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/


Step 2.1
Find:
Code: [Select]
       echo "<td>".$username.$invisibleuser."</td>\n";
Insert above:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/


Step 2.2
Find:
Code: [Select]
       echo "<td>".$lang['userlevel_guest']."</td>\n";
Replace with:
Code: [Select]
/*
  MOD VISITORS COUNTRY FLAGS
  ORIGINAL BLOCK:
        echo "<td>".$lang['userlevel_guest']."</td>\n";
*/
/*
  MOD VISITORS COUNTRY FLAGS
  START REPLACE
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";
/*
  MOD VISITORS COUNTRY FLAGS
  END REPLACE
*/

116
If your subcategories shown something like this:


Then remove from includes/functions.php this block of code:

Code: [Select]
     if ($total <= $table_columns && $table_columns > 1) {
       $table_rows = 1;
     }
     else {
       $table_rows = $total / $table_columns;
       if ($total >= $table_columns && !is_integer($table_rows)) {
         $table_rows = intval($table_rows) + 1;
       }
     }
MAKE SURE U DIDNT LEAVE OR REMOVE ANY EXTRA BRACKETS!

117
FAQ, Tips / How can I change max rating?
« on: March 12, 2005, 10:36:50 PM »
In includes/constants.php change:
Quote
define('MAX_RATING', 5);

Then edit templates/<your template>/rate_form.html
and add more options acording to your max rating value
Code: [Select]
                <option value="5">5</option>
                <option value="4">4</option>
                <option value="3">3</option>
                <option value="2">2</option>
                <option value="1">1</option>

118
On windows systems when ImageMagick or NetPBM used, a blank page displays when one trying create thumbnails or resize images through ACP (Admin Control Panel)

To fix that open includes/image_utils.php
Find:
Code: [Select]
    if (!@is_executable($convert_options['convert_path'])) {Replace with:
Code: [Select]
/*
  FIX BLANK PAGE ON WINDOWS SYSTEMS
  ORIGINAL CODE:
    if (!@is_executable($convert_options['convert_path'])) {
*/
    if (function_exists('is_executable') && !@is_executable($convert_options['convert_path'])) {
(when ImageMagick used)

Find:
Code: [Select]
    if (!@is_executable($convert_options['convert_path']."/".check_executable("pnmscale"))) {Replace with:
Code: [Select]
/*
  FIX BLANK PAGE ON WINDOWS SYSTEMS
  ORIGINAL CODE:
    if (!@is_executable($convert_options['convert_path']."/".check_executable("pnmscale"))) {
*/
    if (function_exists('is_executable') && !@is_executable($convert_options['convert_path']."/".check_executable("pnmscale"))) {
(when NetPBM used)

119
Bug Fixes & Patches / [1.7] PHP5 compatible
« on: March 12, 2005, 01:08:22 AM »
In PHP v5.x some default settings are turned off, which makes 4images not compatible with it.

Here are few changes u should make in order to make it to work with PHP5

1) Open global.php
Find:
Code: [Select]
if (get_magic_quotes_gpc() == 0) {Insert above:
Code: [Select]
/*
  FIX PHP5
  START INSERT
*/
if (!isset($HTTP_GET_VARS)) {
  $HTTP_GET_VARS    = &$_GET;
  $HTTP_POST_VARS   = &$_POST;
  $HTTP_COOKIE_VARS = &$_COOKIE;
  $HTTP_POST_FILES  = &$_FILES;
}
/*
  FIX PHP5
  END INSERT
*/


2) Open includes/upload.php
Find two (2) times:
Code: [Select]
  var $upload_errors = array();Remove one (1) of them (doesnt metter which one)



P.S. If I or someone else remmember anything else it will be added to this topic ;)

120
Bug Fixes & Patches / [1.7] User deleted after email change.
« on: March 12, 2005, 12:38:53 AM »
When a user changes their email address, and 4images set to activate user by email or by admin, the user might get deleted from the database if some other visitor enter register page, before the user get activated.

Open register.php
Find two (2) times this line:
Code: [Select]
WHERE (".get_user_table_field("", "user_joindate")." < $expiry) AND ".get_user_table_field("", "user_level")." = ".USER_AWAITING;
Replace both lines with this:
Code: [Select]
WHERE (".get_user_table_field("", "user_lastaction")." < $expiry) AND ".get_user_table_field("", "user_level")." = ".USER_AWAITING;

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 14