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 ... 5 6 7 8 [9] 10 11 12 13 ... 23
121
I have a problem when using this mod together with the search by color mod...  On the 200 word keyword page I am seing the color codes show up as key words in the cloud....

Since I can no longer find the search by color mod thread I am unsure what to do... Any help would be appreciated...

I just remembered if you ad this
Code: [Select]
AND c.colorsearch_colors_match = 0
to this
Code: [Select]
WHERE keys_match > 0
it fixes the problem in the flash keyword mod....

And it fixes the error with this page too... !

122
Chit Chat / Re: KurtW MODs and Templates
« on: May 02, 2009, 04:34:32 AM »
When I search for them it says they have dissappeared or no longer have permission to view them. So which is it? Are they gone or am I banned from them?


123
Any way to say how many images were found in each of the categories listed with a number?

Great mod thanks!

124
This is a great mod that works on categories, index and details php...

however when I try to get it to work on search.php I get the error
Code: [Select]

Notice: Undefined variable: news_type in /home/lifephotography/htdocs/search.php on line 605

Notice: Undefined variable: additional_sql_2 in /home/lifephotography/htdocs/search.php on line 624

Notice: Undefined variable: newstype in /home/lifephotography/htdocs/search.php on line 637

Notice: Undefined variable: news_type in /home/lifephotography/htdocs/search.php on line 804

If any one could tell me why it doesnt work id appreciate it.

here 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.                              *
 *                                                                        *
 *************************************************************************/
$templates_used 'thumbnail_bit,whos_online';
$main_template 'search';
define('GET_CACHES'1);
define('GET_USER_ONLINE'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');
include(
ROOT_PATH.'includes/search_utils.php');
include(
ROOT_PATH.'includes/shout.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();
  
$who = ($user_info['user_level'] == GUEST) ? "guests" : (($user_info['user_level'] <= USER) ? "users" "admins");
if (count($split_words) > 1) {
  $sql "UPDATE ".SEARCH_STATS_TABLE."
   SET count = count + 1, date = "
.time().", ".$who." = ".$who." + 1
   WHERE text LIKE '"
.addslashes(str_replace("*"""$search_keywords))."' AND word = 0";
  $site_db->query($sql);
if (!$site_db->affected_rows()) {
  $sql "INSERT INTO ".SEARCH_STATS_TABLE."
          (text, date, "
.$who.")
          VALUES
          ('"
.addslashes(str_replace("*"""$search_keywords))."', ".time().", 1)";
  $site_db->query($sql);
}
}

  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 {if (
count($split_words) == 1) {
    
  $sql "UPDATE ".SEARCH_STATS_TABLE."
        SET count = count + 1, word = 1, date = "
.time().", ".$who." = ".$who." + 1
        WHERE text LIKE '"
.addslashes(str_replace("*"""$split_words[$i]))."' AND word = 1";
    
  $site_db->query($sql);
    
if (!$site_db->affected_rows()) {
    
  $sql "INSERT INTO ".SEARCH_STATS_TABLE."
               (text, word, date, "
.$who.")
               VALUES
               ('"
.addslashes(str_replace("*"""$split_words[$i]))."', 1, ".time().", 1)";
    
  $site_db->query($sql);
    
}
}

      
$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 {
// --- Start Mod: Colorsearch by KW --------------------------------------------
$show_colors 200;                                // how many colors show in table
$show_colors_lines_br 11;                       // how many colors in one line
$show_colors_size $config['colorsearch_size'];  //size from the color cells (in ACP settings)

$sql "SELECT w.word_id, w.word_text, m.word_id, COUNT(w.word_text) AS quantity
        FROM ("
.WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m)
        WHERE w.word_id = m.word_id AND m.colorsearch_colors_match = 1
        GROUP BY w.word_text
        ORDER BY quantity DESC
        LIMIT 
$show_colors";
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$image_farbton_suche "";
}
else  {
  
$image_farbton_suche "";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
    
$image_farbton_suche .= "<tr> \n";
    }
    
$image_farbton_suche .= "<form method=\"post\" action=\"./search.php\"> \n";
    
$image_farbton_suche .= "<td width=\"".$show_colors_size."\" height=\"".$show_colors_size."> \n";
    
$image_farbton_suche .= "<input name=\"search_fields\" value=\"image_farbton\" type=\"hidden\"> \n";
    
$image_farbton_suche .= "<input name=\"search_keywords\" value=\"".$image_row['word_text']."\" type=\"hidden\"> \n";
    
$image_farbton_suche .= "<input name=\"show_result\" value=\"1\" type=\"hidden\"> \n";
    if (
$image_row['quantity'] > 1) {
     
$image_farbton_suche .= "<input style=\"background-color: #".$image_row['word_text']."; font-size: 1px; WIDTH: ".$show_colors_size."px; HEIGHT: ".$show_colors_size."px; border: 1px; cursor: pointer;\" type=\"submit\" value=\"\" title=\"".$lang['farbton_suche_color']." #".$image_row['word_text']."".$lang['farbton_suche_found']." ".$image_row['quantity']." ".$lang['farbton_suche_found_2']."\"> \n";
    } else {
     
$image_farbton_suche .= "<input style=\"background-color: #".$image_row['word_text']."; font-size: 1px; WIDTH: ".$show_colors_size."px; HEIGHT: ".$show_colors_size."px; border: 1px; cursor: pointer;\" type=\"submit\" value=\"\" title=\"".$lang['farbton_suche_color']." #".$image_row['word_text']."".$lang['farbton_suche_found_1']."\"> \n";
    }
    
$image_farbton_suche .= "</td> \n";
    
$image_farbton_suche .= "</form> \n";
    
$count++;
    if (
$count == $show_colors_lines_br) {
      
$image_farbton_suche .= "</tr> \n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($show_colors_lines_br $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$image_farbton_suche .= "<td>&nbsp;</td> \n";
      }
      
$image_farbton_suche .= "</tr> \n";
    }
  }
  
$image_farbton_suche .= "";
// end else

$site_template->register_vars(array(
  
"image_farbton_suche" => $image_farbton_suche,
  
"lang_farbton_suche" => $lang['farbton_suche']
));
unset(
$image_farbton_suche);
// --- End Mod: Colorsearch by KW ----------------------------------------------
  
$site_template->register_vars(array(
    
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
    
"search_stats" => "<a href=\"".$site_sess->url(ROOT_PATH."search_stats.php")."\">".$lang['search_stats']."</a>",
    
"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");
}
//######################## Start MOD Ajax Slideshow/Diashow with piclens #######################
$ajax_slideshow_piclens_button "";
$slideshow_rss "";
if (
$num_rows_all && $show_result == 1)  {
$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'].", i.image_id ".$config['image_sort']."
        LIMIT 
$offset$perpage";

$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);
$ajax_slideshow_piclens_view 0;

if (!
$num_rows)  {
  
$slideshow_rss "";
  
$ajax_slideshow_piclens_button "";
} else {
  
$ajax_slideshow_piclens_view 1;
  
$slideshow_id $session_info['session_ip'];
  
$slideshow_id str_replace(".","",$slideshow_id);
  
$slideshow_id = ($slideshow_id -117);
  
$slideshow_time date("s");
  
$ist=0;
  
$absoluter_pfad getcwd();
  
$pfad $absoluter_pfad."/data/tmp_mods/slideshow_piclens/";
  
$directory=opendir ($pfad);
  
$deletime time()-10*60// 10 Minuten Cache-Time
  
while ($dat=readdir($directory))
  {
  if (
filetype($pfad.$dat)!="dir")
  {
  
$ist++;
  if (
filemtime($pfad.$dat)<$deletime)
  {
  @
unlink($pfad.$dat);
  }
  }
  }
  
closedir($directory);

  
$fp fopen("./data/tmp_mods/slideshow_piclens/slideshow_".$slideshow_id."".$slideshow_time.".rss""w+");
  function 
leeren($file) {
     
$datei fopen($file,"w");
     
fputs($datei,"");
     
fclose($datei);
  }
  
leeren("./data/tmp_mods/slideshow_piclens/slideshow_".$slideshow_id."".$slideshow_time.".rss"); // Datei die geleert werden soll.
  
$fp fopen("./data/tmp_mods/slideshow_piclens/slideshow_".$slideshow_id."".$slideshow_time.".rss""w+");
   
$text_ajax_slideshow_piclens "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
\n";
   $text_ajax_slideshow_piclens .= "<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\"> \n";
   $text_ajax_slideshow_piclens .= "<channel> \n";
   if ($config['ajax_slideshowviewer_piclens_bgsound']) {
   $text_ajax_slideshow_piclens .= "<audio url=\"".$config['ajax_slideshowviewer_piclens_bgsound']."\"/> \n";
   }
   if ($config['ajax_slideshowviewer_piclens_logo']) {
   $text_ajax_slideshow_piclens .= "<logo url=\"".$config['ajax_slideshowviewer_piclens_logo']."\"/> \n";
   }
   $text_ajax_slideshow_piclens .= "<title></title> \n";
   $text_ajax_slideshow_piclens .= "<link></link> \n";
   $text_ajax_slideshow_piclens .= "<description></description> \n";
  $count = 0;
  $bgcounter = 0;
  while ($image_slideshow_row = $site_db->fetch_array($result)) {
   $ext = get_file_extension($image_slideshow_row['image_media_file']);
   $config['ajax_slideshowviewer_piclens_Types_array'] = explode(",", $config['ajax_slideshowviewer_piclens_Types']);
   if (in_array($ext, $config['ajax_slideshowviewer_piclens_Types_array'])) {
   $ajax_slideshow_piclens_view = 1;
   show_image($image_slideshow_row);
   $text_ajax_slideshow_piclens .= "<item> \n";
   $text_ajax_slideshow_piclens .= "<title>".$image_slideshow_row['image_name']."</title> \n";
   $text_ajax_slideshow_piclens .= "<link>details.php?image_id=".$image_slideshow_row['image_id']."</link> \n";
   $text_ajax_slideshow_piclens .= "<guid>".$image_row['image_id']."</guid> \n";
   $text_ajax_slideshow_piclens .= "<media:thumbnail url=\"".$script_url."/".THUMB_DIR."/".$image_slideshow_row['cat_id']."/".$image_slideshow_row['image_thumb_file']."\" /> \n";
   if ($ext == 'flv') {
   $text_ajax_slideshow_piclens .= "<media:content url=\"".$script_url."/".MEDIA_DIR."/".$image_slideshow_row['cat_id']."/".$image_slideshow_row['image_media_file']."\" type=\"pl_video/x-flv\" /> \n";
   } else {
   $text_ajax_slideshow_piclens .= "<media:content url=\"".$script_url."/".MEDIA_DIR."/".$image_slideshow_row['cat_id']."/".$image_slideshow_row['image_media_file']."\" type=\"\" /> \n";
   }
   $text_ajax_slideshow_piclens .= "</item> \n";
   $text_ajax_slideshow_piclens .= "\n";
   }
 }
  if ($count > 0)  {
  $leftover = ($config['image_cells'] - $count);
  }
  $text_ajax_slideshow_piclens .= "</channel> \n";
  $text_ajax_slideshow_piclens .= "</rss> \n";
 fwrite($fp, $text_ajax_slideshow_piclens);
 fclose($fp);

if ($user_info['user_level'] == GUEST && $config['ajax_slideshowviewer_piclens_Show'] == "1" && $ajax_slideshow_piclens_view == "1") {
  $ajax_slideshow_piclens_button = "<img src=\"".get_gallery_image("diashow_off.gif")."\" border=\"0\" alt=\"\" />";
} elseif ($user_info['user_level'] != GUEST && $config['ajax_slideshowviewer_piclens_Show'] == "1" && $ajax_slideshow_piclens_view == "1" || $config['ajax_slideshowviewer_piclens_Show'] == "2" && $ajax_slideshow_piclens_view == "1") {
  $ajax_slideshow_piclens_button = "<a href=\"javascript:PicLensLite.start();\"><img src=\"".get_gallery_image("diashow.gif")."\" border=\"0\" alt=\"\" /></a>";
  $slideshow_rss = "./data/tmp_mods/slideshow_piclens/slideshow_".$slideshow_id."".$slideshow_time.".rss";
}
}
unset($ajax_slideshow_piclens);
}
//######################## End MOD Ajax Slideshow/Diashow with piclens #######################
//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "has_rss"   => true,
  "rss_title" => "RSS Feed: ".format_text($config['site_name'], 2)." (".str_replace(':', '', $lang['new_images']).")",
  "rss_url"   => $script_url."/rss.php?action=images"
));

$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;
  }
}

$num_new_images = 12;
$config['image_cells'] = 3;
$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 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $new_images .= $lang['no_new_images'];
  $new_images .= "</td></tr></table>";
}
else  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $new_images .= "<td class=\"imagerow\" width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($image_row);
    $new_images .= $site_template->parse_template("thumbnail_bit");
    $new_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $new_images .= "</tr>\n";
    }
  }
  $new_images .= "</table>\n";
} // end else

$site_template->register_vars("new_images", $new_images);
unset($new_images);
///--------------------------------------------------------
// Latest and Archive News Mod --
// --
// User configurable variables --
// You must change the first 4 variables to meet --
// your requirements:     (see notes below) --
//     $display_by_count --
//     $latest_news_day --
//     $show_news_articles --
//     $news_image --
//--------------------------------------------------------
  $display_by_count = "0";      // values 0 or 1 ....
                                // .... change this to 0 if display by days posted
                                // .... or 1 to display fixed number of news articles as Latest
                               
  $latest_news_days = "31";     // Number of days news displays at Latest ....
                                // .... change This to the number of days news shows as Latest
                               
  $show_news_articles = "5";    // Number of news articles to show ....
                                // .... change This to fixed number of articles to display for latest news
                               
  $news_image = "172";          // Change This to your Latest news image id
//----------------------------------------------------

$new_news = (time() - 60 * 60 * 24 * $latest_news_days);

 

  $additional_sql = "";

  if ($news_type == "latestnews") {

    if ($display_by_count) {
        $additional_sql .= "  c.image_id = '".$news_image."'";
    }
    else {
        $additional_sql .= " c.comment_date > '".$new_news."' AND c.image_id = '".$news_image."'";
        $additional_sql_2 .= "";
    }
  }

  else {
    $additional_sql .= " c.image_id = '".$news_image."'";
    $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>&nbsp;/&nbsp;Archived News";
  }

  $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2 ;

  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  $news_comment_row = array();

  while ($row = $site_db->fetch_array($result)) {
    $news_comment_row[] = $row;
  }

  $site_db->free_result($result);
   
// This is the Paging stuff
  if ($newstype == "latestnewsall") {
       
    include(ROOT_PATH.'includes/paging.php');
    $perpage = $show_news_articles;
    $link_arg = $site_sess->url(ROOT_PATH."index.php?newstype=latestnewsall");
    $getpaging = new Paging($page, $perpage, $num_rows, $link_arg);
    $offset = $getpaging->get_offset();

    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
      "paging_stats" => $getpaging->get_paging_stats()
    ));
     
    $sql = "SELECT c.comment_headline, c.comment_text, c.comment_date, c.image_id
            FROM ".COMMENTS_TABLE." c
            WHERE ".$additional_sql."
            ORDER BY c.comment_date DESC" .$additional_sql_2." 
            LIMIT $offset, $perpage";

          $result = $site_db->query($sql);
          $num_rows = $site_db->get_numrows($result);
          $news_comment_row = array();
           
      while ($row = $site_db->fetch_array($result)) {
            $news_comment_row[] = $row;
          }
  }

  if (!$num_rows) {
      $news_comments = "&nbsp;&nbsp;&nbsp;<b>No New News to report within the last ".$latest_news_days." days.</b>";
  }
  else {
      $news_comments = "";
      $bgcounter = 0;

    for ($i = 0; $i < $num_rows; $i++) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

        $site_template->register_vars(array(
            "news_comment_headline" => format_text($news_comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
            "news_comment_text" => format_text($news_comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
            "news_comment_date" => format_date($config['date_format']." ".$config['time_format'], $news_comment_row[$i]['comment_date']),
            "row_bg_number" => $row_bg_number));

        $news_comments .= $site_template->parse_template("news_comment_bit");
    }

  }
  $site_template->register_vars("news_comments", $news_comments);
  unset($news_comments);

//-----------------------------------------------------
//---End of Show Latest News   -------------------------------
//-----------------------------------------------------
//-----------------------------------------------------
//--- 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>";
/*
  MOD LAST COMMENTS
   START INSERT
*/
//Settings
$num = 7; //how many comments to show
$thumb_size = 150; //max dim of thumbnails in pixels
$text_len = 200; //max lenght of the text to show (bbcode and html are counted too)
//End settings

$last_comments = "";
$sql = "SELECT c.image_id, c.comment_id, c.user_id as comment_user_id, c.user_name as guest_user_name, c.comment_headline, c.comment_text, c.comment_date, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file".get_user_table_field(", u.", "user_name")." as user_name".get_user_table_field(", s.", "user_name")." as comment_user_name
        FROM ".COMMENTS_TABLE." c
        LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
        LEFT JOIN ".USERS_TABLE." u ON ".get_user_table_field("u.", "user_id")." = i.user_id
        LEFT JOIN ".USERS_TABLE." s ON ".get_user_table_field("s.", "user_id")." = c.user_id
        WHERE i.image_active = 1 AND i.image_allow_comments = 1 AND i.cat_id NOT IN (".get_auth_cat_sql('auth_readcomment', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewcat', 'NOTIN').") AND i.cat_id NOT IN (".get_auth_cat_sql('auth_viewimage', 'NOTIN').")
        ORDER BY c.comment_date DESC
        LIMIT ".$num;
$result = $site_db->query($sql);
$bgcounter = 1;
while ($row = $site_db->fetch_array($result))
{
  $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
  if (empty($row['image_thumb_file']))
  {
    $thumb_file = ICON_PATH."/".get_file_extension($row['image_media_file']).".gif";
  }
  else
  {
    $thumb_file = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$row['cat_id']."/".$row['image_thumb_file'];
  }
  $thumb_info = @getimagesize($thumb_file);
  $width = ($thumb_info[0]) ? $thumb_info[0] : $thumb_size;
  $height = ($thumb_info[1]) ? $thumb_info[1] : $thumb_size;
  if ($width > $thumb_size && $height > $thumb_size)
  {
    $ratio = $width / $height;
    if ($ratio > 1) {
      $new_width = $thumb_size;
      $new_height = round(($thumb_size/$width) * $height);
    }else {
      $new_width = round(($thumb_size/$height) * $width);
      $new_height = $thumb_size;
    }
  }
  else
  {
    $new_width = $width;
    $new_height = $height;
  }
  $view_image = true;
  $thumb = "<img class=\"slt\" src=\"".$thumb_file."\" border=\"".$config['image_border']."\" width=\"".$new_width."\" height=\"".$new_height."\" alt=\"".$row['image_name']."\" />";
/*
  $view_image = check_permission('auth_viewcat', $row['cat_id']);
  $thumb = "<img src=\"".$thumb_file."\"".(($view_image) ? "" : " onClick=\"alert('".(($lang['auth_alert'][$cat_id]) ? $lang['auth_alert'][$cat_id] : $lang['auth_alert']['default'])."');\"")." border=\"".$config['image_border']."\" width=\"".$new_width."\" height=\"".$new_height."\" alt=\"".$row['image_name']."\" />";
*/
  $image_user_name = ($row['user_id'] != GUEST) ? $row['user_name'] : $lang['userlevel_guest'];
  $image_user_link = ($row['user_id'] != GUEST) ? $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id']) : "";
  $comment_user_name = ($row['comment_user_id'] == GUEST) ? ((empty($row['guest_user_name'])) ? $lang['userlevel_guest'] : $row['guest_user_name']) : $row['comment_user_name'];
  $comment_user_link = ($row['comment_user_id'] != GUEST) ? $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['comment_user_id']) : "";
  $text = $row['comment_text'];
  if (strlen($text) > $text_len) {
    $text = substr($text, 0, $text_len)." ...";
  }
 
      $site_template->register_vars(array(
    "last_comments_more" => "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showcomments", "&")."\">".$lang['last_comments_more']."</a>",
    "comment_image" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\" class=\"slt\">".$thumb."</a>" : $thumb,
    "comment_guest" => ($row['comment_user_id'] == GUEST && !empty($row['guest_user_name'])) ? $lang['userlevel_guest'] : "",
    "comment_image_name" => ($view_image) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$row['image_id'])."\" class=\"nsslt\">".stripslashes($row['image_name'])."</a>" : stripslashes($row['image_name']),
    "image_cat_name" => (check_permission('auth_viewcat', $row['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$row['cat_id'])."\" class=\"slt\">".$cat_cache[$row['cat_id']]['cat_name']."</a>" : $cat_cache[$row['cat_id']]['cat_name'],
    "image_user_name" =>   ($image_user_link) ? "<a href=\"".$image_user_link."\">".$image_user_name."</a>" : $image_user_name,
    "comment_user_name" => ($comment_user_link) ? "<a href=\"".$comment_user_link."\" class=\"slt\">".$comment_user_name."</a>" : $comment_user_name,
    "comment_user_id" => $row['comment_user_id'],
    "comment_headline" => format_text($row['comment_headline'], 0, $config['wordwrap_comments'], $config['bb_comments'], 0, 1),
    "comment_text" => format_text($text, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'], 1, 0),
    "comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
    "row_bg_number" => $row_bg_number
  ));
  $last_comments .= $site_template->parse_template("last_comment_bit");
}
/*
if (empty($last_comments))
{
  $last_comments = $lang['no_comments'];
}
*/
$site_template->register_vars(array(
  "lang_last_comments" => $lang['last_comments'],
  "last_comments" => $last_comments
));
/*
  MOD LAST COMMENTS
  START INSERT
*/           
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "content" => $content,
  "msg" => $msg,
  //###################### Start MOD Ajax Slideshow/Diashow with piclens #######################
  "slideshow_rss" => $slideshow_rss,
  "ajax_slideshow_piclens_button" => $ajax_slideshow_piclens_button,
//######################## End MOD Ajax Slideshow/Diashow with piclens #######################
  "clickstream" => $clickstream,
  "lang_search" => $lang['search']
));
if ($news_type == "latestnewsall") { 
  $site_template->print_template($site_template->parse_template(archive));     

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



125
Mods & Plugins (Releases & Support) / Re: [MOD] Language select
« on: April 08, 2009, 01:43:03 PM »
1) I've asked you once before, please do not reply twice to the same topic, edit your previous reply with additional info, questions, unless someone replied after you or if no one replied for a long time. I ask you that, because if you look at the history of your replies, you'd see that almost all your recent replies to any topics are following by one to three additional replies by you.  It is called "flood". Even though flooding is not in our forum's rules, I bet it's not granted on any forums.

so.... if I edit a previous poist will it reappear at the end of the thread as a new post would? I think for now on unless I have some information that helps I will delete all previous posts and have only one post... the linear fashion of this forum is lacking... I think internet forums need an evolutionary advancement....


Quote
2) more often then not it's more helpful see the original reply instead of just a quote from it, aka provide a link to the message you are referring to, along with the quote if you feel like it.. The original replies and replies before them can provide more useful information. A link to a specific reply can be found at it's headline or icon.
 

I will try something different soon.

Quote
3) did you try the code? from what I recall it has nothing to do with version A or B and from what I see it should work on v1.7.6 as well.

I am in a hurry working on other things... I will try it soon... the serious issue is it prevents flash keywords from working in other languages but english... willl get back with more feedback asap.
Quote

P.S.
Please don't get offended by what I said or will say, it wasn't my intention. But you seems to rush into post a reply without first checking if it's a mistake you made, then after 5 minutes with "gee I forgot something" post another reply...please don't do that, edit your previous post instead.
I understand you don't have enough time to do everything you'd like to do, we all like that, but if you'd spent the same amount of time that required to post a message on the forum, to actually double check your steps, you'd probably save a lot of time for yourself then waiting for the other's replies ;)
Sorry for the lecture.


hmmm... I know you are the masta hacka (err master hacker)......

I dont know about you but I spend like 150 hours a week working and like 90% is on this 4images site I am trying to make and others......


I dont have the super fly secret coding power skills you clearly possess.... so even the simple shit can sometimes take me hours and hours...............

I dont just doible check.. I am doing in like 10 times check or something....

I am trying to get better at it.

My kids don not get to see me at all because I am double checking so much.....


I mean if I could solve all the problems myself than why even come to the forum :)

Ill try to be ever more efficient...

126
I can make Show new images anywhere... categories.... guestbook, etc... But when I make show new images on details.php it works, but it causes the iptc exif mod to stop working, and the photo preview hack shows a different picture than what is acutallly displayed...


Id really like to do this on details.php .... any one know if there is somehting special to do to make it work on details. php, without breaking the other functions?

127
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1.1.0
« on: April 01, 2009, 03:12:16 PM »
Greetigns...

Two questions

1) I tried to get user flags to work with this mod, but they always show the lan.gif.... even though the user flags mods works in the other comment areas...

And...

how can you get the google Ajax translation from this thread http://www.4homepages.de/forum/index.php?topic=24018.new#new

to work on this? I tried to change the code by replacing this in

<div id="translate_comment_{comment_id}">{comment_text}</div>


last_comment_bit.html

and I added this

<p>View this Comment in: <a href="javascript:google_translate('en','comment',{comment_id});"><img src="{template_url}/images/gb.png" border="0"></a> <a href="javascript:google_translate('de','comment',{comment_id});"><img src="{template_url}/images/de.png" border="0"></a> <a href="javascript:google_translate('fr','comment',{comment_id});"><img src="{template_url}/images/fr.png" border="0"></a></p>

I can see the flags but it doesnt translate....

however the mod does work fine in the normal comment_bit template....



Thanks great master for your input.... :)

128
After following the directions to try to get this to work with latest comments on front page mod by V@no... I can say it does not work when adding the code to the last_comment.html template......

I will post to that thread to ask for help......

129
Ok, I will try it.... but how to change the variables in the Javascript to make it work with

{image_description}
and {image_keywords} ?


I know these things must be changed :

 var original_posts = new Array();
    var original_comments = new Array();

And some others I think... but I dont know how to change them.. what to change them to.



If this mod could be made to work with V@nos multiple Language MOD (version b) that would even be super cool. If not it is ok to see the little flags by the keywords and image description.

I can say this mod DOES Work with the Ajax image comment/rating mod...

130
HAs anyone gotten this to work together with ajax show comments without page reload/ comments rating mod?

131
Is it possible to get this mod to work for image description?

132
Mods & Plugins (Releases & Support) / Re: [MOD] Language select
« on: April 01, 2009, 01:13:19 PM »
Can you clarify this? you said to use this code:
Code: [Select]
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
  $requested_l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
  if (file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
    if (!isset($HTTP_COOKIE_VARS['4images_lang'])) $l = $requested_l;
    $config['language_dir'] = $requested_l;
    setcookie('4images_lang', $requested_l, (time()+ 60 * 60 * 24 * 365), "/", "", 0);
  }
}
else
{
  if (isset($HTTP_COOKIE_VARS['4images_lang']) && file_exists(ROOT_PATH.'lang/'.$HTTP_COOKIE_VARS['4images_lang'].'/main.php'))
  {
    if ($HTTP_COOKIE_VARS['4images_lang'] != $config['language_dir']) $l = $HTTP_COOKIE_VARS['4images_lang'];
    $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
  }
  else
  {
    //http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt
    $lang_codes = array(
      "aa"=>"afar","ab"=>"abkhazian","ae"=>"avestan","af"=>"afrikaans","ak"=>"akan","am"=>"amharic","an"=>"aragonese","ar"=>"arabic","as"=>"assamese","av"=>"avaric","ay"=>"aymara","az"=>"azerbaijani",
      "ba"=>"bashkir","be"=>"belarusian","bg"=>"bulgarian","bh"=>"bihari","bi"=>"bislama","bm"=>"bambara","bn"=>"bengali","bo"=>"tibetan","br"=>"breton","bs"=>"bosnian",
      "ca"=>"catalan","ce"=>"chechen","ch"=>"chamorro","co"=>"corsican","cr"=>"cree","cs"=>"czech","cu"=>"church_slavic","cv"=>"chuvash","cy"=>"welsh",
      "da"=>"danish","de"=>"deutsch","dv"=>"divehi","dz"=>"dzongkha",
      "ee"=>"ewe","el"=>"greek","en"=>"english","eo"=>"esperanto","es"=>"spanish","et"=>"estonian","eu"=>"basque",
      "fa"=>"persian","ff"=>"fulah","fi"=>"finnish","fj"=>"fijian","fo"=>"faroese","fr"=>"french","fy"=>"frisian",
      "ga"=>"irish","gd"=>"gaelic","gl"=>"galician","gn"=>"guarani","gu"=>"gujarati","gv"=>"manx",
      "ha"=>"hausa","he"=>"hebrew","hi"=>"hindi","ho"=>"hiri_motu","hr"=>"croatian","ht"=>"haitian","hu"=>"hungarian","hy"=>"armenian","hz"=>"herero",
      "ia"=>"interlingua","id"=>"indonesian","ie"=>"interlingue","ig"=>"igbo","ii"=>"sichuan_yi","ik"=>"inupiaq","io"=>"ido","is"=>"icelandic","it"=>"italian","iu"=>"inuktitut",
      "ja"=>"japanese","jv"=>"javanese",
      "ka"=>"georgian","kg"=>"kongo","ki"=>"kikuyu","kj"=>"kuanyama","kk"=>"kazakh","kl"=>"kalaallisut","km"=>"khmer","kn"=>"kannada","ko"=>"korean","kr"=>"kanuri","ks"=>"kashmiri","ku"=>"kurdish","kv"=>"komi","kw"=>"cornish","ky"=>"kirghiz",
      "la"=>"latin","lb"=>"luxembourgish","lg"=>"ganda","li"=>"limburgan","ln"=>"lingala","lo"=>"lao","lt"=>"lithuanian","lu"=>"luba-katanga","lv"=>"latvian",
      "mg"=>"malagasy","mh"=>"marshallese","mi"=>"maori","mk"=>"macedonian","ml"=>"malayalam","mn"=>"mongolian","mo"=>"moldavian","mr"=>"marathi","ms"=>"malay","mt"=>"maltese","my"=>"burmese",
      "na"=>"nauru","nb"=>"norwegian","nd"=>"ndebele","ne"=>"nepali","ng"=>"ndonga","nl"=>"dutch","nn"=>"norwegian","no"=>"norwegian","nr"=>"ndebele","nv"=>"navajo","ny"=>"chichewa",
      "oc"=>"occitan","oj"=>"ojibwa","om"=>"oromo","or"=>"oriya","os"=>"ossetian",
      "pa"=>"panjabi","pi"=>"pali","pl"=>"polish","ps"=>"pushto","pt"=>"portuguese",
      "qu"=>"quechua",
      "rm"=>"romansh","rn"=>"rundi","ro"=>"romanian","ru"=>"russian","rw"=>"kinyarwanda",
      "sa"=>"sanskrit","sc"=>"sardinian","sd"=>"sindhi","se"=>"sami","sg"=>"sango","si"=>"sinhala","sk"=>"slovak","sl"=>"slovenian","sm"=>"samoan","sn"=>"shona","so"=>"somali","sq"=>"albanian","sr"=>"serbian","ss"=>"swati","st"=>"sotho","su"=>"sundanese","sv"=>"swedish","sw"=>"swahili",
      "ta"=>"tamil","te"=>"telugu","tg"=>"tajik","th"=>"thai","ti"=>"tigrinya","tk"=>"turkmen","tl"=>"tagalog","tn"=>"tswana","to"=>"tonga","tr"=>"turkish","ts"=>"tsonga","tt"=>"tatar","tw"=>"twi","ty"=>"tahitian",
      "ug"=>"uighur","uk"=>"ukrainian","ur"=>"urdu","uz"=>"uzbek",
      "ve"=>"venda","vi"=>"vietnamese","vo"=>"volapük",
      "wa"=>"walloon","wo"=>"wolof",
      "xh"=>"xhosa",
      "yi"=>"yiddish","yo"=>"yoruba",
      "za"=>"zhuang","zh"=>"chinese","zu"=>"zulu",
    );
   
    //http://www.thefutureoftheweb.com/blog/use-accept-language-header
    $langs = array();
   
    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
        // break up string into pieces (languages and q factors)
        preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
   
        if (count($lang_parse[1])) {
            // create a list like "en" => 0.8
            $langs = array_combine($lang_parse[1], $lang_parse[4]);
       




            // set default to 1 for any without q factor
            foreach ($langs as $key => $val) {
                if ($val === '') $langs[$key] = 1;
            }
   
            // sort list based on value




            arsort($langs, SORT_NUMERIC);
        }
    }
    foreach ($langs as $key => $val)
    {
      $key = explode("-", $key);
      if (isset($lang_codes[$key[0]]) && file_exists(ROOT_PATH.'lang/'.$lang_codes[$key[0]].'/main.php'))
      {
        $config['language_dir'] = $lang_codes[$key[0]];
        if ($lang_codes[$key[0]] != $config['language_dir']) $l = $lang_codes[$key[0]];
        setcookie('4images_lang', $lang_codes[$key[0]], time()+ 60 * 60 * 24 * 365, "/", "", 0);
        break;
      }
    }
    unset($langs);
    unset($lang_codes);
  }
}


If you wanted to automatically detect the language of the visitor. BUT
How do you use this code if you are using version B of this mod and 1.7.6 ?

With great appreciation thanks----
Robert

133
Mods & Plugins (Releases & Support) / Re: [MOD] Language select
« on: April 01, 2009, 12:58:58 PM »
This has always been a great  mod, but for some reason it stops the Flash Keyword Cloud mod from working in every language except for English... .any one have any ideas on 1.7.6 ???

134
Feedback & Suggestions / Re: 4images the best ??
« on: April 01, 2009, 11:41:37 AM »
ITs my favorite for years...

135
Mods & Plugins (Releases & Support) / Re: [MOD] Photo Preview Hack
« on: March 30, 2009, 11:43:31 AM »
how hard would it be to include the image preview thumbnails descriptions of each thumbnail in a nice jquery pop up window with rounded courners and adjustable font color?

Pages: 1 ... 5 6 7 8 [9] 10 11 12 13 ... 23