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.


Messages - AntiNSA2

Pages: 1 ... 8 9 10 11 [12] 13 14 15 16 ... 23
167
I dont understand... with yahoo pipes you can geocode rdd feeds.... google mapds offer the api...
geocode.ip offers country information... and you can see the IP in many posts...


In fact in a lot of signatures you can see the persons ip address... and a little man holding up a sighn that says the name of the city the visitor is from...

Its nots that hard to install the google map....

Google has the databse...

How hard is it to make everything meet?

168
Mods & Plugins (Releases & Support) / Re: [MOD] Histogram
« on: March 11, 2009, 10:05:45 AM »
BTW thanks cool mod.. I wanted to sak... do you know how much externally added before 4images watermarks alter the histogram?

169
Mods & Plugins (Releases & Support) / Re: [MOD] Histogram
« on: March 11, 2009, 10:04:50 AM »
Ah German , english... its all the same : ) the people that read histogram need no translations :) If I get time (Really bigt if always busy) Ill put the stuff up here in English :)

170
Mods & Plugins (Releases & Support) / Re: [MOD] Search Statistics v1.2
« on: March 11, 2009, 09:59:07 AM »
elseif ($split_words[$i] != "" && strlen($split_words[$i]) >= MIN_SEARCH_KEYWORD_LENGTH && strlen($split_words[$i]) <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($split_words[$i], $stopword_list)) {

is not in my search.php

This is my search.php
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: search.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'search';

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/search_utils.php');
error_reporting(E_ALL);
$org_search_keywords $search_keywords;
$org_search_user $search_user;

if (isset(
$HTTP_GET_VARS['search_terms']) || isset($HTTP_POST_VARS['search_terms'])) {
  
$search_terms = isset($HTTP_POST_VARS['search_terms']) ? $HTTP_POST_VARS['search_terms'] : $HTTP_GET_VARS['search_terms'];
  
$search_terms $search_terms == "all" 0;
}
else {
 
$search_terms 1;
}

if (isset(
$HTTP_GET_VARS['search_fields']) || isset($HTTP_POST_VARS['search_fields'])) {
  
$search_fields = isset($HTTP_POST_VARS['search_fields']) ? trim($HTTP_POST_VARS['search_fields']) : trim($HTTP_GET_VARS['search_fields']);
}
else {
  
$search_fields "all";
}

$search_cat $cat_id;

$search_id = array();

if (
$search_user != "" && $show_result == 1) {
  
$search_user str_replace('*''%'trim($search_user));
  
$sql "SELECT ".get_user_table_field("""user_id")."
          FROM "
.USERS_TABLE."
          WHERE "
.get_user_table_field("""user_name")." LIKE '$search_user'";
  
$result $site_db->query($sql);
  
$search_id['user_ids'] = "";
  if (
$result) {
    while (
$row $site_db->fetch_array($result)) {
      
$search_id['user_ids'] .= (($search_id['user_ids'] != "") ? ", " "").$row[$user_table_fields['user_id']];
    }
    
$site_db->free_result($result);
  }
}

if (
$search_keywords != "" && $show_result == 1) {
  
$split_words prepare_searchwords($search_keywordstrue);

  
$match_field_sql = ($search_fields != "all" && isset($search_match_fields[$search_fields])) ? "AND m.".$search_match_fields[$search_fields]." = 1" "";
  
$search_word_cache = array();
  
  for (
$i 0$i sizeof($split_words); $i++) {
    if (
$split_words[$i] == "and" || $split_words[$i] == "und" || $split_words[$i] == "or" || $split_words[$i] == "oder" || $split_words[$i] == "not") {
      
$search_word_cache[$i] = ($search_terms) ? "and" $split_words[$i];
    }
    else {
      
$sql "SELECT m.image_id
              FROM ("
.WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m)
              WHERE w.word_text LIKE '"
.addslashes(str_replace("*""%"$split_words[$i]))."'
              AND m.word_id = w.word_id
              
$match_field_sql";
      
$result $site_db->query($sql);
      
$search_word_cache[$i] = array();
      while (
$row $site_db->fetch_array($result)) {
        
$search_word_cache[$i][$row['image_id']] = 1;
      }
      
$site_db->free_result();
    }
  }

  
$is_first_word 1;
  
$operator "or";
  
$image_id_list = array();
  for (
$i 0$i sizeof($search_word_cache); $i++) {
    if (
$search_word_cache[$i] == "and" || $search_word_cache[$i] == "und" || $search_word_cache[$i] == "or" || $search_word_cache[$i] == "oder" || $search_word_cache[$i] == "not") {
      if (!
$is_first_word) {
        
$operator $search_word_cache[$i];
      }
    }
    elseif (
is_array($search_word_cache[$i])) {
      if (
$search_terms) {
        
$operator "and";
      }
      foreach (
$search_word_cache[$i] as $key => $val) {
        if (
$is_first_word || $operator == "or" || $operator == "oder") {
          
$image_id_list[$key] = 1;
        }
        elseif (
$operator == "not") {
          unset(
$image_id_list[$key]);
        }
      }
      if ((
$operator == "and" || $operator == "und") && !$is_first_word) {
        foreach (
$image_id_list as $key => $val) {
          if (!isset(
$search_word_cache[$i][$key])) {
            unset(
$image_id_list[$key]);
          }
        }
      }
    }
    
$is_first_word 0;
  }

  
$search_id['image_ids'] = "";
  foreach (
$image_id_list as $key => $val) {
    
$search_id['image_ids'] .= (($search_id['image_ids'] != "") ? ", " "").$key;
  }
  unset(
$image_id_list);
}

if (
$search_new_images && $show_result == 1) {
  
$search_id['search_new_images'] = 1;
}

if (
$search_cat && $show_result == 1) {
  
$search_id['search_cat'] = $search_cat;
}

if (!empty(
$search_id)) {
  
$site_sess->set_session_var("search_id"serialize($search_id));
}

include(
ROOT_PATH.'includes/page_header.php');

$num_rows_all 0;
if (
$show_result == 1) {
  if (empty(
$search_id)) {
    if (!empty(
$session_info['search_id'])) {
      
$search_id unserialize($session_info['search_id']);
    } else {
      
$search_id unserialize($site_sess->get_session_var("search_id"));
    }
  }

  
$sql_where_query "";

  if (!empty(
$search_id['image_ids'])) {
    
$sql_where_query .= "AND i.image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty(
$search_id['user_ids'])) {
    
$sql_where_query .= "AND i.user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty(
$search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    
$new_cutoff time() - 60 60 24 $config['new_cutoff'];
    
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
  }

  if (!empty(
$search_id['search_cat']) && $search_id['search_cat'] != 0) {
    
$cat_id_sql 0;
    if (
check_permission("auth_viewcat"$search_id['search_cat'])) {
      
$sub_cat_ids get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
      
$cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty(
$sub_cat_ids[$search_id['search_cat']])) {
        foreach (
$sub_cat_ids[$search_id['search_cat']] as $val) {
          if (
check_permission("auth_viewcat"$val)) {
            
$cat_id_sql .= ", ".$val;
          }
        }
      }
    }
    
$cat_id_sql $cat_id_sql !== "AND i.cat_id IN ($cat_id_sql)" "";
  }
  else {
    
$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");
    
$cat_id_sql $cat_id_sql !== "AND i.cat_id NOT IN (".$cat_id_sql.")" "";
  }

  if (!empty(
$sql_where_query)) {
    
$sql "SELECT COUNT(*) AS num_rows_all
            FROM "
.IMAGES_TABLE." i
            WHERE i.image_active = 1 
$sql_where_query
            
$cat_id_sql";
    
$row $site_db->query_firstrow($sql);
    
$num_rows_all $row['num_rows_all'];
  }
}

if (!
$num_rows_all && $show_result == 1)  {
  
$msg preg_replace("/".$site_template->start."search_keywords".$site_template->end."/"$search_keywords$lang['search_no_results']);
}

//-----------------------------------------------------
//--- Show Search Results -----------------------------
//-----------------------------------------------------
if ($num_rows_all && $show_result == 1)  {
  
$link_arg $site_sess->url(ROOT_PATH."search.php?show_result=1");

  include(
ROOT_PATH.'includes/paging.php');
  
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
  
$offset $getpaging->get_offset();
  
$site_template->register_vars(array(
    
"paging" => $getpaging->get_paging(),
    
"paging_stats" => $getpaging->get_paging_stats()
  ));

  
$imgtable_width ceil((intval($config['image_table_width'])) / $config['image_cells']);
  if ((
substr($config['image_table_width'], -1)) == "%") {
    
$imgtable_width .= "%";
  }

  
$additional_sql "";
  if (!empty(
$additional_image_fields)) {
    foreach (
$additional_image_fields as $key => $val) {
      
$additional_sql .= ", i.".$key;
    }
  }

  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
          FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE i.image_active = 1
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY "
.$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT 
$offset$perpage";
  
$result $site_db->query($sql);

  
$thumbnails "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";

  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)) {
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
    
show_image($image_row"search");
    
$thumbnails .= $site_template->parse_template("thumbnail_bit");
    
$thumbnails .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$thumbnails .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++) {
        
$thumbnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$thumbnails .= "</tr>\n";
    }
  }
  
$thumbnails .= "</table>\n";
  
$content $thumbnails;
  unset(
$thumbnails);
// end if
else {
  
$site_template->register_vars(array(
    
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
    
"search_user" => format_text(stripslashes($org_search_user), 2),
    
"lang_search_by_keyword" => $lang['search_by_keyword'],
    
"lang_search_by_username" => $lang['search_by_username'],
    
"lang_new_images_only" => $lang['new_images_only'],
    
"lang_search_terms" => $lang['search_terms'],
    
"lang_or" => $lang['or'],
    
"lang_and" => $lang['and'],
    
"lang_category" => $lang['category'],
    
"lang_search_fields" => $lang['search_fields'],
    
"lang_all_fields" => $lang['all_fields'],
    
"lang_name_only" => $lang['name_only'],
    
"lang_description_only" => $lang['description_only'],
    
"lang_keywords_only" => $lang['keywords_only'],
    
"category_dropdown" => get_category_dropdown($cat_id)
  ));

  if (!empty(
$additional_image_fields)) {
    
$additional_field_array = array();
    foreach (
$additional_image_fields as $key => $val) {
      if (isset(
$lang[$key.'_only'])) {
        
$additional_field_array['lang_'.$key.'_only'] = $lang[$key.'_only'];
      }
    }
    if (!empty(
$additional_field_array)) {
      
$site_template->register_vars($additional_field_array);
    }
  }
  
$content $site_template->parse_template("search_form");
}

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

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"content" => $content,
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_search" => $lang['search']
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


with 1.7.6 if you could up grade you mod instructions that would be great!

171
I find it confusing when installiing mods which contain multiple pages over a long timespan.

When a person releases a modification and supports it, I think there should be an enforced standard.

1. When ever there are updates to the original code of the MOD , which are made byu the mod owner, or fixes, they should be marked on the initial mod post.

2. They should also list the redundant pages ....


like this..

intitial release: 01.01.10
MOD :    Blah blah blah....

Blah blah blah......


last up date: 20.02.12
pages of mod post covered/included in update : 1-6
Start at: top page 7

AND WITHIN EACH ACCEPTED CODE CHANGE BY ORIGINAL MOD THERE SHOULD BE CLEAR MARKING IN RED TEXT ORIGINAL MOD CODE UPDATE  ON : DATE

What do you think?

It is hard to know which changes to initial mod releases have been modified within each thread vs. the posted mod code...

So troubleshooting is very difficult when a mod doesnt work because you dont know which directions to follow... the directions in the threads pages or the directions of the thread posted on the initial page.

Thanks


172
How hard would it be to use a google map to geocode visitors and show them on a small google map on the front page of current visitors? I mean if yiou can find the location and place a flag?

173
[REQ] Show recent guestbook entries on Front page  (home.html)...


Anyone know how to do this, and show posters flag ?

Thanks!

174
This Mod= Show Flags of visitors

That mod= Show Latest comments on front page


ME: I want to show the flags of people within the recent comment mod http://www.4homepages.de/forum/index.php?topic=15701.0

Two mods.. one Author... one place... one question... Post in this thread or that one? not sure....

Thanks though :) Let me know iif I am missing anything :)

175
Mods & Plugins (Releases & Support) / Re: [MOD] Histogram
« on: March 10, 2009, 05:29:11 PM »
Wow... dont know where those characters came from.. I use ultraedit... weird I think that was a forum error ... my files dont look like that . sorry...


I lived in Brotterode Thuringen for many years... So my German is not that bad.... Aber ich haub keine lust fur schreiben ich weisse meine deutsche ich sehr schreklische und hwssiliche und unbekkant. Naja///

So you see it is cool when I read German and speaking it probably sounds funny enough... but I still think it is better than my Chinese :) THAnk god 4images is  not Chinese as I cant read it at all even after 8 years...

ANyways the problem I made was I created the directory in the wrong directory. I was confused as you have support in the forum on your download page, and people replying to the original thread on this page/// It seems like they are replying to the original threads modifications and not to the modifications made to the version on your site. SO I was not sure what was up and tried to follow through using the original one in the thread.....


I think you shouls put the changes in the mod from your forum onto this one so people could follow the changes and know which is the one to troubleshoot. Right now it is like two different mods in one thread.. or two threads in two forums...  8O

176
Mods & Plugins (Releases & Support) / Re: [MOD] Photo Preview Hack
« on: March 10, 2009, 10:46:12 AM »
I know... I dont want to polute this thread... but in that mod you said you had to copy all modifications to the ajaxcomments thread just like the details.php.....



I guess only those mods related to co0mments, not every kind of mod?

177
This mod only returns images with the exact keywords... is there away to say like with most of these keywords, and return a search in relevance to keyword search?

178
Mods & Plugins (Releases & Support) / Re: [MOD] Histogram
« on: March 10, 2009, 10:31:19 AM »
continuing from previous post


I have created the data/histo directory
I have uploaded the background.php file to the root directory

I get a broken image.... if I try to view the broken image I get a ton of errors pages long. I think this is a cool mod if anyone has =any idea....


179
Mods & Plugins (Releases & Support) / Re: [MOD] Histogram
« on: March 10, 2009, 10:27:30 AM »
Im having big problems with 1.7.6 and using php5

site:
http://www.thelifephotography.com/details.php?image_id=184

histo.php in root:
Code: [Select]
<?php
//&#160; &#160; &#160; Histogram creation
//&#160; &#160; &#160; Created by Anton Sparrius (Spaz) 6/9/05&#160; anton_spaz@yahoo.com
//&#160; &#160; &#160; Free to use and change, provided you keep these lines :)
//


&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; if (file_exists($hist_path.$hist_file)) {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $im=imagecreatefromPNG($hist_path . $hist_file);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagePNG($im);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagedestroy($im);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; } else {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $im=imagecreatefromjpeg($hist_path.$hist_image);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for($i=0;$i<imagesx($im);$i+=2)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for($j=0;$j<imagesy($im);$j++)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $rrggbb=imagecolorsforindex ($im, imagecolorat($im,$i,$j));
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $r[$rrggbb['red']]+=1;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $g[$rrggbb['green']]+=1;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $b[$rrggbb['blue']]+=1;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for ($i=0;$i<256;$i++)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $max[$i]=($r[$i]+$g[$i]+$b[$i])/3;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $max_value=max($max)/150;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $m[0]=max($r);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $m[1]=max($b);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $m[2]=max($g);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $max_rgb=max($m)/150;

&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $im_out = imageCreate (280, 164);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $background = imageColorAllocate($im_out,70,70,70);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $hist=ImageColorAllocate($im_out,0,0,0);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $white=ImageColorAllocate($im_out,143,143,134);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $red=ImageColorAllocate($im_out,255,0,0);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $green=ImageColorAllocate($im_out,0,255,0);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $blue=ImageColorAllocate($im_out,0,0,255);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $ry=107;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $gy=107;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $by=107;

&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; for($i=0;$i<256;$i++)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out, $i+14, 157, $i+14, 157-($max[$i]/$max_value),$white);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out, $i+13, $ry, $i+14, 157-($r[$i]/$max_rgb), $red);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out, $i+13, $gy, $i+14, 157-($g[$i]/$max_rgb), $green);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out, $i+13, $by, $i+14, 157-($b[$i]/$max_rgb), $blue);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $ry=157-($r[$i]/$max_rgb);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $gy=157-($g[$i]/$max_rgb);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $by=157-($b[$i]/$max_rgb);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out,13,158,270,158,$hist);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out,13,6,270,6,$hist);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out,13,6,13,158,$hist);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageLine($im_out,270,6,270,158,$hist);

&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagePNG($im_out,$hist_path . $hist_file);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imageDestroy($im);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagedestroy($im_out);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $im=imagecreatefromPNG($hist_path . $hist_file);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagePNG($im);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; imagedestroy($im);
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
?>


details.php :
Code: [Select]
<?php
/**************************************************************************
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; 4images - A Web Based Image Gallery Management System&#160; &#160; &#160; &#160; &#160; &#160; &#160;  *
 *&#160; &#160; ----------------------------------------------------------------&#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160;  File: details.php&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; Copyright: (C) 2002 Jan Sorgalla&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160; Email: jan@4homepages.de&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; Web: http://www.4homepages.de&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;  *
 *&#160; &#160; Scriptversion: 1.7.6&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; Never released without support from: Nicky (http://www.nicky.net)&#160;  *
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 **************************************************************************
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-&#160; &#160; &#160;  *
 *&#160; &#160; bedingungen (Lizenz.txt) f&#252;r weitere Informationen.&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;  *
 *&#160; &#160; ---------------------------------------------------------------&#160; &#160;  *
 *&#160; &#160; This script is NOT freeware! Please read the Copyright Notice&#160; &#160; &#160;  *
 *&#160; &#160; (Licence.txt) for further information.&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *
 *************************************************************************/

$main_template 'details';

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');
/*
&#160; MOD AJAX COMMENTS
&#160; BEGIN INSERT
*/
include(ROOT_PATH."ajaxcomments.php");
/*
&#160; MOD AJAX COMMENTS
&#160; END INSERT
*/
if (!$image_id) {
&
#160; &#160; redirect($url);
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
&
#160; foreach ($additional_image_fields as $key => $val) {
&#160; &#160; $additional_sql .= ", i.".$key;
&#160; }
}

$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
&#160; &#160; &#160; &#160; FROM ("
.IMAGES_TABLE." i,&#160; ".CATEGORIES_TABLE." c)
&#160; &#160; &#160; &#160; LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
&#160; &#160; &#160; &#160; WHERE i.image_id = 
$image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 0;

if (!
check_permission("auth_viewcat"$cat_id) || !check_permission("auth_viewimage"$cat_id) || !$image_row) {
&
#160; redirect($url);
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image($cat_id);
$site_template->register_vars("random_cat_image"$random_cat_image);
unset(
$random_cat_image);

//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------

//--- Start Histogramm 27.02.2006 ----------------------
$hist_image $image_row['image_media_file'] ;
$hist_file"hist_".substr($hist_image,0,strlen($hist_image)-4).".png";
$hist_path "data/histo/";

$ext substr($hist_imagestrpos($hist_image".")+1strlen($hist_image));
$AutorisedImageType = array ("jpg""jpeg""JPG""JPEG");&#160; // Dateitypen f&#252;r die das Histogramm gezeigt werden soll

if (in_array($ext$AutorisedImageType)) {
 
$histogramm_image "<img src=\"histo.php?hist_image_id=".$image_row['image_id']."\" border=\"1\">"
} else {
&
#160;  $histogramm_image = REPLACE_EMPTY;
}

$site_template->register_vars(array(
&
#160;  "histogramm" => "Histogramm:",
&#160;  "histogramm_image" => $histogramm_image
));
//--- Ende Histogramm 27.02.2006 ------------------------

$image_allow_comments = (check_permission("auth_readcomment"$cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name format_text($image_row['image_name'], 2);
show_image($image_row$mode01);

$in_mode 0;

$sql "";
if (
$mode == "lightbox") {
&
#160; if (!empty($user_info['lightbox_image_ids'])) {
&#160; &#160; $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
&#160; &#160; $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
&#160; &#160; &#160; &#160; &#160; &#160; FROM ".IMAGES_TABLE."
&#160; &#160; &#160; &#160; &#160; &#160; WHERE image_active = 1 AND image_id IN ($image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
&#160; &#160; &#160; &#160; &#160; &#160; ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
&#160; &#160; $in_mode = 1;
&#160; }
}
elseif (
$mode == "search") {
&
#160; if (!isset($session_info['searchid']) || empty($session_info['searchid'])) {
&#160; &#160; $session_info['search_id'] = $site_sess->get_session_var("search_id");
&#160; }

&#160; if (!empty($session_info['search_id'])) {
&#160; &#160; $search_id = unserialize($session_info['search_id']);
&#160; }

&#160; $sql_where_query = "";

&#160; if (!empty($search_id['image_ids'])) {
&#160; &#160; $sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
&#160; }

&#160; if (!empty($search_id['user_ids'])) {
&#160; &#160; $sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
&#160; }

&#160; if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
&#160; &#160; $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
&#160; &#160; $sql_where_query .= "AND image_date >= $new_cutoff ";
&#160; }

&#160; if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
&#160; &#160; $cat_id_sql = 0;
&#160; &#160; if (check_permission("auth_viewcat", $search_id['search_cat'])) {
&#160; &#160; &#160; $sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
&#160; &#160; &#160; $cat_id_sql .= ", ".$search_id['search_cat'];
&#160; &#160; &#160; if (!empty($sub_cat_ids[$search_id['search_cat']])) {
&#160; &#160; &#160; &#160; foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
&#160; &#160; &#160; &#160; &#160; if (check_permission("auth_viewcat", $val)) {
&#160; &#160; &#160; &#160; &#160; &#160; $cat_id_sql .= ", ".$val;
&#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; }
&#160; &#160; &#160; }
&#160; &#160; }
&#160; &#160; $cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";
&#160; }
&#160; else {
&#160; &#160; $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
&#160; &#160; $cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
&#160; }

&#160; if (!empty($sql_where_query)) {
&#160; &#160; $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
&#160; &#160; &#160; &#160; &#160; &#160; FROM ".IMAGES_TABLE."
&#160; &#160; &#160; &#160; &#160; &#160; WHERE image_active = 1
&#160; &#160; &#160; &#160; &#160; &#160; $sql_where_query
&#160; &#160; &#160; &#160; &#160; &#160; $cat_id_sql
&#160; &#160; &#160; &#160; &#160; &#160; ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
&#160; &#160; $in_mode = 1;
&#160; }
}
if (!
$in_mode || empty($sql)) {
&
#160; $sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
&#160; &#160; &#160; &#160; &#160; FROM ".IMAGES_TABLE."
&#160; &#160; &#160; &#160; &#160; WHERE image_active = 1 AND cat_id = $cat_id
&#160; &#160; &#160; &#160; &#160; ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
}
$result $site_db->query($sql);

$image_id_cache = array();
$next_prev_cache = array();
$break 0;
$prev_id 0;
while(
$row $site_db->fetch_array($result)) {
&
#160; $image_id_cache[] = $row['image_id'];
&#160; $next_prev_cache[$row['image_id']] = $row;
&#160; if ($break) {
&#160; &#160; break;
&#160; }
&#160; if ($prev_id == $image_id) {
&#160; &#160; $break = 1;
&#160; }
&#160; $prev_id = $row['image_id'];
}
$site_db->free_result();

if (!
function_exists("array_search")) {
&
#160; function array_search($needle, $haystack) {
&#160; &#160; $match = false;
&#160; &#160; foreach ($haystack as $key => $value) {
&#160; &#160; &#160; if ($value == $needle) {
&#160; &#160; &#160; &#160; $match = $key;
&#160; &#160; &#160; }
&#160; &#160; }
&#160; &#160; return $match;
&#160; }
}

$act_key array_search($image_id$image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key 1])) ? $image_id_cache[$act_key 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key 1])) ? $image_id_cache[$act_key 1] : 0;
unset(
$image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
&
#160; $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
&#160; $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
&#160; if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
&#160; &#160; $next_image_file = ICON_PATH."/404.gif";
&#160; }
&#160; else {
&#160; &#160; $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
&#160; }
&#160; if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
&#160; &#160; $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
&#160; }
&#160; else {
&#160; &#160; $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
&#160; }
}
else {
&
#160; $next_image_name = REPLACE_EMPTY;
&#160; $next_image_url = REPLACE_EMPTY;
&#160; $next_image_file = REPLACE_EMPTY;
&#160; $next_thumb_file = REPLACE_EMPTY;
}

if (!empty(
$next_prev_cache[$prev_image_id])) {
&
#160; $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
&#160; $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
&#160; if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
&#160; &#160; $prev_image_file = ICON_PATH."/404.gif";
&#160; }
&#160; else {
&#160; &#160; $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
&#160; }
&#160; if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
&#160; &#160; $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
&#160; }
&#160; else {
&#160; &#160; $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
&#160; }
}
else {
&
#160; $prev_image_name = REPLACE_EMPTY;
&#160; $prev_image_url = REPLACE_EMPTY;
&#160; $prev_image_file = REPLACE_EMPTY;
&#160; $prev_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
&
#160; "next_image_id" => $next_image_id,
&#160; "next_image_name" => $next_image_name,
&#160; "next_image_url" => $next_image_url,
&#160; "next_image_file" => $next_image_file,
&#160; "next_thumb_file" => $next_thumb_file,
&#160; "prev_image_id" => $prev_image_id,
&#160; "prev_image_name" => $prev_image_name,
&#160; "prev_image_url" => $prev_image_url,
&#160; "prev_image_file" => $prev_image_file,
&#160; "prev_thumb_file" => $prev_thumb_file
));
unset(
$next_prev_cache);
/*--------------------------------------------- Start MOD: Photo Preview Hack ----------------------------------------- */
$result $site_db->query($sql);

while(
$row $site_db->fetch_array($result)){
&
#160; &#160; $image_preview[] = $row['image_id'];
&#160; &#160; $preview_row[$row['image_id']] = $row;
}
$lastPage count($image_preview);
$t_template "<table height=\"0\"width=\"600\"&#160; border=\"0\" cellspacing=\"5\" cellpadding=\"3\" align=\"center\"><tr>\n";
if(
$lastPage 6){
&
#160; &#160; $start = 0;
&#160; &#160; $end = $lastPage -1;
} elseif ($act_key == || $act_key == 1){
&
#160; &#160; $start = 0;
&#160; &#160; $end&#160;  = 4;
} elseif ($act_key == $lastPage-|| $act_key == $lastPage -2){
&
#160; &#160; $start = $lastPage - 5;
&#160; &#160; $end = $lastPage - 1;
} else {
&
#160; &#160; $start = $act_key -2;
&#160; &#160; $end&#160;  = $act_key +2;
}
$sizeTimes 0.5;
for(
$i=$start$i<=$end$i++){
&
#160; &#160; if ($preview_row[$image_preview[$i]]['image_id'] == $image_row['image_id']) {
&#160; &#160; $t_template .= "<td style=\"border: 1px dashed #004C75; text-align:center; padding: .1cm \">\n";
&#160; &#160; } else {
&#160; &#160; $t_template .= "<td style=text-align:center; padding: .1cm\">\n";
&#160; &#160; }
&#160; &#160; $tag = get_thumbnail_code($preview_row[$image_preview[$i]]['image_media_file'], $preview_row[$image_preview[$i]]['image_thumb_file'], $preview_row[$image_preview[$i]]['image_id'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);
&#160; &#160; $oriWidth = substr($tag, strpos($tag, "width")+7, strpos($tag, "\" height")-strlen($tag));
&#160; &#160; $oriHeight = substr($tag, strpos($tag, "height")+8, strpos($tag, " alt")-strlen($tag)-1);
&#160; &#160; $tag = str_replace('width="'.$oriWidth.'"', 'width="'.$oriWidth*$sizeTimes.'"', $tag);
&#160; &#160; $tag = str_replace('height="'.$oriHeight.'"', 'height="'.$oriHeight*$sizeTimes.'"', $tag);
&#160; &#160; $t_template .= $tag."<br>\n";
&#160; &#160; $t_template .= "<font class=\"smalltext\">".$preview_row[$image_preview[$i]]['image_name']."</font>\n";
}
$t_template .= "</td></table>\n";
$site_template->register_vars("preview_box"$t_template);
unset(
$image_preview);
/*--- End MOD: Photo Preview Hack&#160; ------------------------------------------ */
//-----------------------------------------------------
//--- Show Count Lightbox -----------------------------
//-----------------------------------------------------

$sql "SELECT COUNT(*) AS counter
&#160; &#160; &#160; &#160; FROM "
.LIGHTBOXES_TABLE."
&#160; &#160; &#160; &#160; WHERE lightbox_image_ids REGEXP '([^0-9]|^)"
.$image_row['image_id']."([^0-9]|$)'";
&
#160; &#160; &#160; &#160; 
$lightbox_count $site_db->query_firstrow($sql);

$site_template->register_vars(array(
&
#160; "lang_image_lightbox_count" => $lang['image_lightbox_count'],
&#160; "lightbox_count" => (isset($lightbox_count['counter']) && $lightbox_count['counter']) ? $lightbox_count['counter'] : 0
));

unset(
$lightbox_count);

//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error 0;
if (
$action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
&
#160; $id = intval($HTTP_POST_VARS[URL_ID]);
&#160; $sql = "SELECT cat_id, image_allow_comments
&#160; &#160; &#160; &#160; &#160; FROM ".IMAGES_TABLE."
&#160; &#160; &#160; &#160; &#160; WHERE image_id = $id";
&#160; $row = $site_db->query_firstrow($sql);

&#160; if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
&#160; &#160; $msg = $lang['comments_deactivated'];
&#160; }
&#160; else {
&#160; &#160; $user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
&#160; &#160; $comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
&#160; &#160; $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

&#160; &#160; $captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

&#160; &#160; // Flood Check
&#160; &#160; $sql = "SELECT comment_ip, comment_date
&#160; &#160; &#160; &#160; &#160; &#160; FROM ".COMMENTS_TABLE."
&#160; &#160; &#160; &#160; &#160; &#160; WHERE image_id = $id
&#160; &#160; &#160; &#160; &#160; &#160; ORDER BY comment_date DESC
&#160; &#160; &#160; &#160; &#160; &#160; LIMIT 1";
&#160; &#160; $spam_row = $site_db->query_firstrow($sql);
&#160; &#160; $spamtime = $spam_row['comment_date'] + 180;

&#160; &#160; if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)&#160; {
&#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
&#160; &#160; &#160; $error = 1;
&#160; &#160; }

&#160; &#160; $user_name_field = get_user_table_field("", "user_name");
&#160; &#160; if (!empty($user_name_field)) {
&#160; &#160; &#160; if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
&#160; &#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
&#160; &#160; &#160; &#160; $error = 1;
&#160; &#160; &#160; }
&#160; &#160; }
&#160; &#160; if ($user_name == "")&#160; {
&#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
&#160; &#160; &#160; $error = 1;
&#160; &#160; }
&#160; &#160; if ($comment_headline == "")&#160; {
&#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
&#160; &#160; &#160; $error = 1;
&#160; &#160; }
&#160; &#160; if ($comment_text == "")&#160; {
&#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
&#160; &#160; &#160; $error = 1;
&#160; &#160; }

&#160; &#160; if ($captcha_enable_comments && !captcha_validate($captcha)) {
&#160; &#160; &#160; $msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
&#160; &#160; &#160; $error = 1;
&#160; &#160; }

&#160; &#160; if (!$error)&#160; {
&#160; &#160; &#160; $sql = "INSERT INTO ".COMMENTS_TABLE."
&#160; &#160; &#160; &#160; &#160; &#160; &#160; (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
&#160; &#160; &#160; &#160; &#160; &#160; &#160; VALUES
&#160; &#160; &#160; &#160; &#160; &#160; &#160; ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
&#160; &#160; &#160; $site_db->query($sql);
&#160; &#160; &#160; $commentid = $site_db->get_insert_id();
&#160; &#160; &#160; update_comment_count($id, $user_info['user_id']);
&#160; &#160; &#160; $msg = $lang['comment_success'];
&#160; &#160; }
&#160; }
&#160; unset($row);
&#160; unset($spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
&
#160; $site_template->register_vars(array(
&#160; &#160; &#160; "has_rss"&#160;  => true,
&#160; &#160; &#160; "rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
&#160; &#160; &#160; "rss_url"&#160;  => $script_url."/rss.php?action=comments&amp;".URL_IMAGE_ID."=".$image_id
&#160; ));

&#160; $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").", u.userpic


,
c.comment_rating,c.comment_votes,c.comment_rating_users
&#160; &#160; &#160; &#160; &#160; FROM ".COMMENTS_TABLE." c
&#160; &#160; &#160; &#160; &#160; LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
&#160; &#160; &#160; &#160; &#160; WHERE c.image_id = $image_id
&#160; &#160; &#160; &#160; &#160; 


ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."";
&#160; 
$result = $site_db->query($sql);

&#160; 
$comment_row = array();
&#160; while (
$row = $site_db->fetch_array($result)) {
&#160; &#160; 
$comment_row[] = $row;
&#160; }
&#160; 
$site_db->free_result($result);
&#160; 
$num_comments = sizeof($comment_row);

&#160; if (!
$num_comments) {
&#160; &#160; 
$comments = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
&
#160; }
&#160; else {
&#160; &#160; $comments = "";
&#160; &#160; $bgcounter = 0;
&#160; &#160; for ($i = 0; $i < $num_comments; $i++) {
&#160; &#160; &#160; $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

&#160; &#160; &#160; $comment_user_email = "";
&#160; &#160; &#160; $comment_user_email_save = "";
&#160; &#160; &#160; $comment_user_mailform_link = "";
&#160; &#160; &#160; $comment_user_email_button = "";
&#160; &#160; &#160; $comment_user_homepage_button = "";
&#160; &#160; &#160; $comment_user_icq_button = "";
&#160; &#160; &#160; $comment_user_profile_button = "";
&#160; &#160; &#160; $comment_user_status_img = REPLACE_EMPTY;
&#160; &#160; &#160; $comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2);
&#160; &#160; &#160; $comment_user_info = $lang['userlevel_guest'];

&#160; &#160; &#160; $comment_user_id = $comment_row[$i]['user_id'];
&#160; &#160; &#160; 
&#160; &#160; &#160; if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
&#160; &#160; &#160; &#160; $comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);

&#160; &#160; &#160; &#160; $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
&#160; &#160; &#160; &#160; $comment_user_profile_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";

&#160; &#160; &#160; &#160; $comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";

&#160; &#160; &#160; &#160; $comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
&#160; &#160; &#160; &#160; if (!empty($comment_user_homepage)) {
&#160; &#160; &#160; &#160; &#160; $comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
&#160; &#160; &#160; &#160; }

&#160; &#160; &#160; &#160; $comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
&#160; &#160; &#160; &#160; if (!empty($comment_user_icq)) {
&#160; &#160; &#160; &#160; &#160; $comment_user_icq_button = "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
&#160; &#160; &#160; &#160; }

&#160; &#160; &#160; &#160; if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
&#160; &#160; &#160; &#160; &#160; $comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]);
&#160; &#160; &#160; &#160; &#160; $comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]));
&#160; &#160; &#160; &#160; &#160; if (!empty($url_mailform)) {
&#160; &#160; &#160; &#160; &#160; &#160; $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
&#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; else {
&#160; &#160; &#160; &#160; &#160; &#160; $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
&#160; &#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; &#160; $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
&#160; &#160; &#160; &#160; }

&#160; &#160; &#160; &#160; if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
&#160; &#160; &#160; &#160; &#160; $comment_user_info = $lang['userlevel_user'];
&#160; &#160; &#160; &#160; }
&#160; &#160; &#160; &#160; elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
&#160; &#160; &#160; &#160; &#160; $comment_user_info = $lang['userlevel_admin'];
&#160; &#160; &#160; &#160; }

&#160; &#160; &#160; &#160; $comment_user_info .= "<br />";
&#160; &#160; &#160; &#160; $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
&#160; &#160; &#160; &#160; $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
&#160; &#160; &#160; }

&#160; &#160; &#160; $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

&#160; &#160; &#160; $admin_links = "";
&#160; &#160; &#160; if ($user_info['user_level'] == ADMIN) {
&#160; &#160; &#160; &#160; $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
&#160; &#160; &#160; &#160; $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
&#160; &#160; &#160; }
&#160; &#160; &#160; elseif ($is_image_owner) {
&#160; &#160; &#160; &#160; $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
&#160; &#160; &#160; &#160; $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
&#160; &#160; &#160; }

&#160; &#160; &#160; //--- Kommentar-Autor COUNTRY FLAGS ---
&#160; &#160; if (!class_exists("GeoIP"))
&#160; &#160; {
&#160; &#160; &#160; include(ROOT_PATH."includes/geoip.inc");
&#160; &#160; }
&#160; &#160; $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
&#160; &#160; $countries = array();
&#160; &#160; $cid = geoip_country_code_by_addr($gi, $comment_row[$i]['comment_ip']);
&#160; &#160; if (empty($cid)) $cid = "lan";
&#160; &#160; $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
&#160; &#160; $comment_user_flag = "<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>";
//--- Kommentar-Autor COUNTRY FLAGS ---

&#160; &#160; &#160; $site_template->register_vars(array(
&#160; &#160; &#160; &#160; "comment_id" => $comment_row[$i]['comment_id'],
&#160; &#160; &#160; &#160; "comment_user_flag" => $comment_user_flag,
&#160; &#160; &#160; &#160; "comment_user_id" => $comment_user_id,
&#160; &#160; &#160; &#160; "comment_user_status_img" => $comment_user_status_img,
&#160; &#160; &#160; &#160; "comment_user_name" => $comment_user_name,
&#160; &#160; &#160; &#160; "comment_user_info" => $comment_user_info,
&#160; &#160; &#160; &#160; "comment_user_profile_button" => $comment_user_profile_button,
&#160; &#160; &#160; &#160; "comment_user_email" => $comment_user_email,
&#160; &#160; &#160; &#160; "comment_user_email_save" => $comment_user_email_save,
&#160; &#160; &#160; &#160; "comment_user_mailform_link" => $comment_user_mailform_link,
&#160; &#160; &#160; &#160; "comment_user_email_button" => $comment_user_email_button,
&#160; &#160; &#160; &#160; "comment_user_homepage_button" => $comment_user_homepage_button,
&#160; &#160; &#160; &#160; "comment_user_icq_button" => $comment_user_icq_button,
&#160; &#160; &#160; &#160; "comment_user_ip" => $comment_user_ip,
&#160; &#160; &#160; &#160; "comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",
&#160; &#160; &#160; &#160; "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
&#160; &#160; &#160; &#160; "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
&#160; &#160; &#160; &#160; "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
&#160; &#160; &#160; &#160; "row_bg_number" => $row_bg_number,
&#160; &#160; &#160; &#160; "admin_links" => $admin_links
&#160; &#160; &#160; ));
&#160; &#160; &#160; /*
&#160; MOD AJAX COMMENTS
&#160; BEGIN INSERT
*/
&
#160; &#160; &#160; if (COMMENT_RATING_ANABLE)
&#160; &#160; &#160; {
&#160; &#160; &#160; &#160; $comment_row[$i]['cat_id'] = $cat_id;
&#160; &#160; &#160; &#160; $comment_row[$i]['image_allow_comments'] = $image_allow_comments;
&#160; &#160; &#160; &#160; comment_rating_template($comment_row[$i]);
&#160; &#160; &#160; }
/*
&#160; MOD AJAX COMMENTS
&#160; END INSERT
*/
&#160; &#160; &#160; $comments .= $site_template->parse_template("comment_bit");
&#160; &#160; } // end while
&#160; } //end else
&#160; /*
&#160; MOD AJAX COMMENTS
&#160; START REPLACE
*/
&
#160; $site_template->register_vars(array(
&#160; &#160; "comments" => $comments,
&#160; &#160; "comments_num" => $num_comments,
&#160; &#160; "commentbg" => (isset($row_bg_number)) ? $row_bg_number : 0,
&#160; &#160; "page" => $page,
&#160; &#160; "perpage" => $commentperpage,
&#160; ));

/*
&#160; MOD AJAX COMMENTS
&#160; END REPLACE
*/
&#160; unset($comments);

&#160; //-----------------------------------------------------
&#160; //--- BBCode & Form -----------------------------------
&#160; //-----------------------------------------------------
&#160; $allow_posting = check_permission("auth_postcomment", $cat_id);
&#160; $bbcode = "";
&#160; if ($config['bb_comments'] == 1 && $allow_posting) {
&#160; &#160; $site_template->register_vars(array(
&#160; &#160; &#160; "lang_bbcode" => $lang['bbcode'],
&#160; &#160; &#160; "lang_tag_prompt" => $lang['tag_prompt'],
&#160; &#160; &#160; "lang_link_text_prompt" => $lang['link_text_prompt'],
&#160; &#160; &#160; "lang_link_url_prompt" => $lang['link_url_prompt'],
&#160; &#160; &#160; "lang_link_email_prompt" => $lang['link_email_prompt'],
&#160; &#160; &#160; "lang_list_type_prompt" => $lang['list_type_prompt'],
&#160; &#160; &#160; "lang_list_item_prompt" => $lang['list_item_prompt']
&#160; &#160; ));
&#160; &#160; $bbcode = $site_template->parse_template("bbcode");
&#160; }

&#160; if (!$allow_posting) {
&#160; &#160; $comment_form = "";
&#160; }
&#160; else {
&#160; &#160; $user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
&#160; &#160; $comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
&#160; &#160; $comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";

&#160; &#160; $site_template->register_vars(array(
&#160; &#160; &#160; "bbcode" => $bbcode,
&#160; &#160; &#160; "user_name" => $user_name,
&#160; &#160; &#160; "comment_headline" => $comment_headline,
&#160; &#160; &#160; "comment_text" => $comment_text,
&#160; &#160; &#160; "lang_post_comment" => $lang['post_comment'],
&#160; &#160; &#160; "lang_name" => $lang['name'],
&#160; &#160; &#160; "lang_headline" => $lang['headline'],
&#160; &#160; &#160; "lang_comment" => $lang['comment'],
&#160; &#160; &#160; "lang_captcha" => $lang['captcha'],
&#160; &#160; &#160; "lang_captcha_desc" => $lang['captcha_desc'],
&#160; &#160; &#160; "captcha_comments" => (bool)$captcha_enable_comments
&#160; &#160; ));
&#160; &#160; $comment_form = $site_template->parse_template("comment_form");
&#160; }
&#160; $site_template->register_vars("comment_form", $comment_form);
&#160; unset($comment_form);
// end if allow_comments

// Admin Links
$admin_links "";
if (
$user_info['user_level'] == ADMIN) {
&
#160; $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
&#160; $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif (
$is_image_owner) {
&
#160; $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
&#160; $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
$site_template->register_vars("admin_links"$admin_links);

// Update Hits
if ($user_info['user_level'] != ADMIN) {
&
#160; $sql = "UPDATE ".IMAGES_TABLE."
&#160; &#160; &#160; &#160; &#160; SET image_hits = image_hits + 1
&#160; &#160; &#160; &#160; &#160; WHERE image_id = $image_id";
&#160; $site_db->query($sql);
}

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

if (
$mode == "lightbox" && $in_mode) {
&
#160; $page_url = "";
 
if (preg_match("/".URL_PAGE."=([0-9]+)/"$url$regs)) {
&
#160; &#160; if (!empty($regs[1]) && $regs[1] != 1) {
&#160; &#160; &#160; $page_url = "?".URL_PAGE."=".$regs[1];
&#160; &#160; }
&#160; }
&#160; $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
}
elseif (
$mode == "search" && $in_mode) {
&
#160; $page_url = "";
&#160; if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
&#160; &#160; if (!empty($regs[1]) && $regs[1] != 1) {
&#160; &#160; &#160; $page_url = "&amp;".URL_PAGE."=".$regs[1];
&#160; &#160; }
&#160; }
&#160; $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
&
#160; $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
&
#160; "msg" => $msg,
&#160; "clickstream" => $clickstream,
&#160; "lang_category" => $lang['category'],
&#160; "lang_added_by" => $lang['added_by'],
&#160; "lang_description" => $lang['description'],
&#160; "lang_keywords" => $lang['keywords'],
&#160; "lang_date" => $lang['date'],
&#160; "lang_hits" => $lang['hits'],
&#160; "lang_downloads" => $lang['downloads'],
&#160; "lang_rating" => $lang['rating'],
&#160; "lang_votes" => $lang['votes'],
&#160; "lang_author" => $lang['author'],
&#160; "lang_comment" => $lang['comment'],
&#160; "lang_prev_image" => $lang['prev_image'],
&#160; "lang_next_image" => $lang['next_image'],
&#160; "lang_file_size" => $lang['file_size']
));

$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>

180
everyone the mod here is the best solution. It does work wqith 1.7.6. Make sure you alter the template with the coreet guestbook_comment tag

Pages: 1 ... 8 9 10 11 [12] 13 14 15 16 ... 23