4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: mark1491 on August 18, 2006, 05:27:02 AM
-
I there any way to add paging to my home.html template. Right now I have it manually set to show the lastest 8 images in index.php and that is it.
But I would like it to show the 8 images, plus have paging at the bottom so that the rest of my pictures in all categories can be shown if the users want to see them all together according to the date.
Thanks
Mark
-
hmmm...how come this wasnt ever requested before?...its quet good idea ;)
In index.php find:$num_new_images = $config['image_cells'];
Insert below:$sql = "SELECT COUNT(image_id) as num
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")";
if (!$result = $site_db->query_firstrow($sql))
{
$result['num'] = 0;
}
$link_arg = $site_sess->url(ROOT_PATH."index.php");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $num_new_images, $result['num'], $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
Then find: LIMIT $num_new_images";
Replace with: LIMIT $offset, $num_new_images";
And finaly add {paging} and {paging_stats} tags in home.html template :)
-
V@no:
When cache is enabled the pages to do not change, but when I disable it, it works right,
Is there any way I can enable caching for the index still?
Thanks,
Mark
-
In index.php find:
isset($user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 0, 8) : 0,
Insert above: $page,
$config['image_cells'],
Should work now :)
-
great! works perfect
Thanks,
Mark
-
Hi,
if a user click on a image, the next/previous links in the details page show the next/previous image by date from the category of this image
waht i need:
when a user click on a image FROM THE INDEX PAGE, the next/previous links on the details page should link to the next/previous images ( by date) from all images , not only from the image category
any idea how it could work ?
-
brilliant and easy modification!
thanks a lot for sharing! :thumbup:
-
great mod successfully installed on 1.7.6 thanks
-
I love the paging mod on index.php and implemented it successfully within 4images, but now I want to have 12 "new" images show on index.php, not the default 4 images.
I used a code I found in another topic,
Multiple New Images on Index.php code
$num_new_images = 12; (This works with 4images naturally, but with the paging mod, it causes an error)
Paging mod code
$num_new_images = $config['image_cells'];
How do I integrate both mods together? Which results in index.php paging &&& Specified amount of new images shown on index.php?
The link to the index.php paging mod is: http://www.4homepages.de/forum/index.php?topic=14195.msg156293#msg156293
Thanks
-
How can I add more than (4) new images on index.html with this mod. I've tried the code
$num_new_images = 36;
but it causes an error, I'd appreciate a way to implement this within this paging mod. Thanks!
-
anyone?
-
what error?
-
Well I tried to recreate the error and now it works, i'll be damned. lol :P