4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Rembrandt on May 09, 2013, 06:49:27 PM
-
Hi!
1.) search in index.php:
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
insert above:
// ############# Start Paging new images #######################
$sql = "SELECT COUNT(image_id) AS new_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id not in (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND image_date >= $new_cutoff
";
$result = $site_db->query_firstrow($sql);
$num_rows_all = (isset($result['new_images'])) ? $result['new_images'] : 0;
$link_arg = $site_sess->url(ROOT_PATH."index.php");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"page" => $page,
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
// ############# End Paging new images #######################
1.1) search:
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT $num_new_images";
and replace:
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND image_date >= $new_cutoff
ORDER BY i.image_date DESC
LIMIT $offset, $perpage";
2.) search in your template/home.html:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="head1" valign="top">{lang_new_images}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="head1">{new_images}</td>
</tr>
</table>
insert above:
{paging_stats}
insert below:
<br>
{paging}
<br>
mfg Andi
-
Great job. What can I do to have three rows of new pictures on the home page?
-
ACP /General / Settings / Image settings / Image table rows
or search in the code above:
include(ROOT_PATH.'includes/paging.php');
insert above:
$perpage = ceil(3 * $config['image_cells']);
mfg Andi
-
or search in the code above:
include(ROOT_PATH.'includes/paging.php');
insert above:
$perpage = ceil(3 * $config['image_cells']);
mfg Andi
works great, thanks
-
Hi!
...How to make a page for this code?
...
http://www.4homepages.de/forum/index.php?topic=28819.msg154776#msg154776
mfg Andi