Author Topic: Please help with functions.php...  (Read 4112 times)

0 Members and 1 Guest are viewing this topic.

Offline neuroticvixen

  • Newbie
  • *
  • Posts: 10
    • View Profile
Please help with functions.php...
« on: September 21, 2006, 04:47:12 AM »
Hey there... I'm not sure if this is the right place to post this. I don't know much about mysql so I'm going to try to explain it the best I can. :oops:

I'm having an issue with my functions.php file and an old mod. I just updated to the new version and I'm trying to get an old mod to work with it. I can't find the mod anymore but I was hoping someone could help me.

I have SSL's static icons mod but I don't want to have to have an icon for all the categories as I have hundreds. So, I found a mod a long time ago that let me put a folder next to the ones that didnt have an icon uploaded. I know that it was a mod to functions.php and I had to add this code:

Code: [Select]
"cat_image" => (file_exists($cat_image)) ? $cat_image : get_gallery_image("folder.gif"),
After this code:
Code: [Select]
"cat_id" => $category_id,
So, I added it and now all the icons are folders. Including the ones I have uploaded (which are the ones on the gallery's main page). I hope I didn't confuse anyone. Let me know if I need to explain it better.

Thank you for any help anyone can give. I REALLY appreciate it. Oh and here is an example of what I am trying to do this one of my galleries with the old version with the working mod:

http://www.laurengrahamfan.com/gallery

and this is the site with the new version and the mod that isn't working:

http://www.alexisbledelfan.com/gallery

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Please help with functions.php...
« Reply #1 on: September 21, 2006, 07:16:21 AM »
I think this mod you were looking for?
http://www.4homepages.de/forum/index.php?topic=6922.0
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline neuroticvixen

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Please help with functions.php...
« Reply #2 on: September 21, 2006, 08:40:16 PM »
No, that wasn't it. :( But thank you for trying.

Offline neuroticvixen

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Please help with functions.php...
« Reply #3 on: September 23, 2006, 06:07:17 PM »
After searching through the page I found the missing code. Just in case anyone else has this problem. You have to add this line:

Code: [Select]
$cat_image = get_gallery_image("category".$category_id.".gif");
above this section:

Code: [Select]
$site_template->register_vars(array(

      "cat_id" => $category_id,

      "cat_image" => (file_exists($cat_image)) ? $cat_image : get_gallery_image("folder.gif"),

  "cat_name" => format_text($cat_cache[$category_id]['cat_name'], 2),

      "cat_description" => format_text($cat_cache[$category_id]['cat_description'], 1),

      "cat_hits" => $cat_cache[$category_id]['cat_hits'],

      "cat_is_new" => $is_new,

      "lang_new" => $lang['new'],

      "sub_cats" => get_subcategories($category_id),

      "cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$category_id),

      "random_cat_image_file" => $random_cat_image_file,

      "num_images" => $num_images

    ));

Alls working now.   :D