Since every category can have one of four options that affect it's display, how to get category picture differs,
depending on which option you have your categories set to use..
I'll assume your categories use the "Top" option, since that is what is assigned by default..
So, make a backup of /include/functions.php and open the file for editing in any plain text editor
such as Notepad.
Locate the function "top_children" , which is called when a category is set to use the "Top" option, mine starts around line #297
Within that function, you should find the following 3 lines of code, mine are around line #419
| Code: |
$cat_html .= " <a class=\"subCategory\" href=\"./directory/" . $gtc_array[cat_id] . ".html";
if ($usesession =="yes"){$cat_html .= "?". session_name()."=".session_id() ."";}
$cat_html .= "\">" . eregi_replace("_"," ",$gtc_array[cat_name]) . "</a>";
|
So, you could create a directory, I'll call mine "catpics" and upload your category pictures to
it. The files would all need to be the same type of image, jpg, gif, png.. whatever you prefer.
You will also probably want to ensure all the images have identical dimensions, in my example, I'll use PNG
images...
After creating the "catpics" directory and uploading my images to it, 1.png for category #1, 2.png for category #2 and so on...
| Code: |
$cat_html .= " <a class=\"subCategory\" href=\"./directory/" . $gtc_array[cat_id] . ".html";
if ($usesession =="yes"){$cat_html .= "?". session_name()."=".session_id() ."";}
$cat_html .= "\">";
// start category pictures
if (is_file('/INSTALLDIR/catpics/'.$gtc_array[cat_id].'.png')){
$cat_html .='<img src="/INSTALLDIR/catpics/'.$gtc_array[cat_id].'.png"
border=0 align=middle />';
}
// end category pictures
$cat_html .= eregi_replace("_"," ",$gtc_array[cat_name]) . "</a>";
|