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

Pages: [1] 2
1
Hello,


Hope all is well,


Please could someone tell me how can i limit the number of categories on home page


i.e. I want only do display 10 categories and then if visitor wants to see all categories he/she should click on "View All categories" link,


I wish that someone could help me with my request


thanks in advance,








2
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: November 12, 2008, 10:11:14 AM »
I solved it  :D

the code is meant to be used with index.php /home page
i wanted to use it with page_header.php & i was getting errors on search page
so what i did i copied the code that is missing from index.php
& it's working like a charm

here's the code i'm using in pager_header.php before ?>

Thanks vano for ur code & help
Code: [Select]
//------------------------------------
//------- Random Images by v@no --------------
//------------------------------------


$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 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
        ORDER BY RAND()
        LIMIT 6";
// end new
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

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

    show_image($image_row);
    $random_images .= $site_template->parse_template("thumbnail_bit");
    $random_images .= "\n</td>\n";
    $count++;
    if ($count == 6) {
      $random_images .= "</tr>\n";
      $count = 0;
    }
  } // end while
  $site_template->val_cache['image'] = $image_backup;
  unset($image_backup);

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


$site_template->register_vars("random_images", $random_images);
unset($random_images);

//----- End Random Images---------

3
thanks millions  :D :D :D
such a great MOD!

4
great Mod thanks :)
working perefectly

5
ما فتح الموقع عندي!!!

6
فكرة حلوة يعطيك العافية

7
واي مود بدك اياه بنترجمه انشاءالله

8
such a great Mod  :D
thanks V@no

9
شكرا لك ارجوان يستفيد الأخوة من موضوعك

10
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: November 06, 2008, 02:06:11 PM »
I'm using this code     LINK
with a freash clean copy of 4images 1.7.6
it's working fine but i'm noticed that rating stopped working!!!! when i remove the code it works!!!!
so please could u advise
note hat i add the code directly above the Print Out and i use it in details.php


I have removed the code from details.php and i'm using  the code on page_header.php
the rating & votes are working fine but now another problem appeared on search

this is the error
Code: [Select]
Notice: Undefined variable: additional_sql in /hermes/web05/b1164/pow.txttv/htdocs/includes/page_header.php on line 427when i search the pager header file the line 427 is
Code: [Select]
$sql = "SELECT i.image_id, i.catso any ideas?
thanks

Note: the url is http://www.txttv.tv/search.php

11
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: November 05, 2008, 12:02:12 PM »
I'm using this code     LINK
with a freash clean copy of 4images 1.7.6
it's working fine but i'm noticed that rating stopped working!!!! when i remove the code it works!!!!
so please could u advise
note hat i add the code directly above the Print Out and i use it in details.php


12
Thanks V@no  :D
as usual u r very helpful

13
Thanks xox
it's a very nice mod
but my question is how can i make it compatible with V@no's [MOD] Multi-Language support for any text (updated 05-11-2005) ]

I wanted only to take the english name! 
i have used this line
Code: [Select]
$cat_url  = '-'.str_replace('+','-',urlencode(multilang($row['cat_name']))).'-'.$cat_id.$cat_url;\
but when i change the lang it changes everything
thanks in advance!

14
Mods & Plugins (Releases & Support) / Re: [MOD] Language select
« on: October 12, 2008, 10:33:11 AM »
V@no thank you very much   :D
 :thumbup:

15
Mods & Plugins (Releases & Support) / Re: [MOD] Language select
« on: October 12, 2008, 09:22:47 AM »
on Lanuage select is it possible to for user to see another template??
let's say i have english and farsi
i want the user when he chooses the farsi to get a totally different template!

u'll need delete from global.php:
Code: [Select]
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
and this:
Code: [Select]
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

And then find:
Code: [Select]
include(ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');and insert above this:
Code: [Select]
if ($config['language_dir'] == $l) $config['template_dir'] .= "_".$l;
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
include(ROOT_PATH.'includes/template.php');
$site_template = new Template(TEMPLATE_PATH);

With this change you will need create template for each language with this name format: <template name>_<language>
for example your default language is english and have also deutsch and spanish languages.
the default template used has name blah
Then you must have three templates with names:
blah
blah_deutsch
blah_spanish


P.S. I've removed your page_header.php source, so it wont cloag up the search engine ;) next time if u want to show something like, attach the file as a .txt file ;) (or zip it)


Hi V@no
kindly is it possible to update the code so it works with 4images 1.7.6
Apparently  the global.php is 1.7.6 is not the same as the old one  :oops:
i have tried using KurtW code which is found here
http://www.4homepages.de/forum/index.php?topic=4743.msg85742#msg85742
but it didn't work
time & again we apperciate your help & your prompt replies
thanks in advance

Pages: [1] 2