I went through some of the suggestions in the forum and it somehow disappeared but the number just stays the same in the Category Image ID and I don't see any category image either.
This is my coding for admin/categories.php
// Category image
$cat_image = "";
if ($result['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$result['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
}
$file_info = @getimagesize($cat_image);
$dim = 50;
$width = $file_info[0];
$height = $file_info[1];
if ($width && $height) {
if ($width > $dim || $height > $dim) {
@$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dim;
$new_height = round(($dim/$width) * $height);
}else {
$new_width = round(($dim/$height) * $width);
$new_height = $dim;
}
}else{
$new_width = $width;
$new_height = $height;
}
}else{
$new_width = $dim;
$new_height = $dim;
}
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a> <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
}
}
$value = $result['cat_image'];
if (isset($HTTP_POST_VARS['cat_image'])/* && $value == ""*/) {
$value = stripslashes($HTTP_POST_VARS['cat_image']);
}
echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">Category image</p></td>\n<td><p><input type=\"text\" size=\"5\" name=\"cat_image\" value=\"".$value."\"> $cat_image</p></td>\n</tr>\n";
//End Category image
Coding for category_bit.html
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> {ifno cat_image}<a href="{cat_url}" class="maincat"><img src="{cat_image}"></a>{endifno
cat_image} </td>
<td> <p><a href="{cat_url}" class="maincat">{cat_name}</a> ({num_images})
{if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}<br>
{if cat_description}<span class="smalltext">{cat_description}</span><br />
{endif cat_description} {if sub_cats}{sub_cats}{endif sub_cats} </p>
</td>
</tr>
</table>
Melissa