Hello;
I'm a total ignorant in interaction between Flash and PHP, sorry for first request.
For second request, maybe I can help. In fact, we do not have to modify "thumbnail_bit.html" in the used template, as a few files parse it. So we have to rewrite some bits of code, and create our own html file to generate links. So let's go on:
REWRITE NEW_IMAGES TO LINK TO CATEGORIES: Files to modify:
_
/includes/functions.php _
index.php File to create:
_
/templates/your_template/catthumb_bit.html>>>>>>>>> STEP 1_ Edit the file
/includes/functions.php, and find:
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
Insert after:
"catthumb" => get_catthumb_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
Find after, around the line #500:
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
Just after, add this code:
//--Function catthumb to link thumbnail to its category
function get_catthumb_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
global $site_sess, $config;
if (!check_media_type($media_file_name)) {
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
}
else {
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
}
else {
$file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
}
}
if ($show_link) {
if ($open_window) {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id.((!empty($mode)) ? "&mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
}
else {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
//--End function catthumb
Save this file.
>>>>>>>> STEP 2_ Edit
index.php Find:
$templates_used = 'home,category_bit,whos_online,thumbnail_bit';
Replace by:
$templates_used = 'home,category_bit,whos_online,thumbnail_bit,catthumb_bit';
Then, find:
$num_new_images = $config['image_cells'];
To display 5 thumbnails tiled horizontally, change by:
$num_new_images = 5;
$config['image_cells'] = 5;
And finally, find:
$new_images .= $site_template->parse_template("thumbnail_bit");
To activate the HTML link to categories, replace by:
$new_images .= $site_template->parse_template("catthumb_bit");
>>>>>>>>> STEP 3_ Well now, it's time to create a file
/templates/your_template/catthumb_bit.html with this code:
<div align="center">{catthumb}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
{lightbox_button}</div>
Save this file and test your website, better in local, not to alter your live site.
Now, you should have new_images in your homepage, and each thumbnail has to link to its own category page, and not to the details page.
Hope it could help.