Okey, this is a final version MOD "One photo big, and other small"
Version 1.1Javascript support
Version 1.0First release
This was created with a big V@no support! Many thanks V@no!
Description: This mod will give you possible to show one thumbnail BIG, and other small. I.E. For something tops, when you want to see first place of image big, and second and third small images.
With new version you may add javascript support, for change thumbnails on mouseover...
DEMO
There (See TOP Shots)
RMK: For this mod you need to install [MOD] Second Thumbnail Size -
http://www.4homepages.de/forum/index.php?topic=25017.0This MOD include [MOD] - Most Rates Images Today
New files: msrates.php, msrates_image.html
Files to edit: index.php, functions.php
Install1. Create a file msrates.php with code then upload file to main directory:
<?php
$msrates_images = time() - 60 * 60 * 24 * 2;
$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.image_date >= " . $msrates_images . " AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_rating DESC
LIMIT 4";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$msrates_new_images = "<table align=\"center\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
$msrates_new_images .= $lang['no_today_images'];
$msrates_new_images .= "</td></tr></table>";
}
else {
$msrates_new_images = "<table align=\"center\" width=\"250\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$msrates_new_images .= "<td width=\"25\" align=\"center\"" . (!$count ? 'colspan="3"' : '') .">";
show_image($image_row);
$site_template->register_vars("msrates_images_type", ($count)); //is $count > 0 ?
$msrates_new_images .= $site_template->parse_template("msrates_image");
$msrates_new_images .= "</td>";
if (!$count)
{
$msrates_new_images .= "</tr>";
}
$count++;
} // end while
$msrates_new_images .= "</table>";
} // end else
$site_template->register_vars("msrates_images", $msrates_new_images);
unset($msrates_new_images);
?>
2. Create file msrates_image.html with code: {ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}{if msrates_images_type}{thumbnail_small}{endif msrates_images_type} then upload to your templates directory
3. Add to your index.php next line:
Search:
include(ROOT_PATH.'global.php');
Add after:
include(ROOT_PATH.'msrates.php');
----------------------------Update for V1.1----------------------------4. Download attached file
thumbnailviewer2.js
and upload it to the root gallery
5. Open templates/
msrates_image.html and replace:
{ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}{if msrates_images_type}{thumbnail_small}{endif msrates_images_type}
With this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="thumbnailviewer2.js"></script>
<div id="loadarea">{ifno msrates_images_type}{thumbnail}{endifno msrates_images_type}<br></div>
{if msrates_images_type}{thumbnail_small}{endif msrates_images_type}</div>6. Open includes/functions.php and search:
Take care, this must be your small size thumnail code!$thumb = "<img src=\"".$file_src."\" style=\"border:0;width:$thumb_width ; height:$thumb_height ;\" alt=\"".$image_name."\" />";Replace:
$thumb = "<a href=\"".$file_src."\" rel=\"enlargeimage\" target=\"_blank\" rev=\"targetdiv:loadarea,fxduration: 700,link:".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\"><img src=\"".$file_src."\" style=\"border:0;width:$thumb_width;height:$thumb_height;link:$image_url\"/></a>";
Installation complete! I hope you enjoy it!!!
P.S. In this path you can set how many pictures to show
1.
LIMIT 4";
- It will show 4 images
2.
You can set how sort you top.
ORDER BY i.image_rating DESC
Change this part to change sort what you want. I.E. i.image_hits ....
DEMO:In my gallery this MOD show as: see attach