4images Issues / Ausgaben > Discussion & Troubleshooting
Exclude Category from New Images
jrey:
Im using this solution for my gallery and works fine, but the problem that I have is that the statistics in category "New Images" are showing the total number of images ( the real number, counting the images that Im not showing in "New Images" ) and its showing the paging of this result, then if for example I have 50 images but Im showing only 12, there is not really a second page with more images, but paging says that yes, and if you press in the link to the second page you will not see anything, only a page with not images. How can I adapt the "real" statistics and paging to my modified/restricted results ?. I want that statistics says " There are 12 new images" and not "There are 50 new images" in three pages - Got to page 2,3 " ( continuing with the example ).
Thanks in advance.
Javi
mawenzi:
@jrey
in search.php find
--- Code: ---if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
}
--- End code ---
and change it to
--- Code: ---if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND i.image_date >= $new_cutoff AND i.cat_id NOT IN (1,2,3)";
}
--- End code ---
where (1,2,3) are the categories you want to exclude ...
Loda:
another solution:
you create a table called e.g. "digi_cat_id" in the 4images_settings table
then you insert in admin/settings.php after:
--- Code: --- show_setting_row("random_cat_id", $random_cat_id);
--- End code ---
this:
--- Code: --- show_setting_row("digi_cat_id", $digi_cat_id);
--- End code ---
and in the lang/your lang/admin.php:
--- Code: ---$setting['digi_cat_id'] = "Exclude Category from all Images";
--- End code ---
and then in every page e.g. index.php, search.php, top.php etc..
you can insert this in the sql:
--- Code: ---AND i.cat_id NOT IN (".$config['digi_cat_id'].")
--- End code ---
in the acp you see in the settings a new field. insert in this field the cat id exclude from images
you can insert there many cat ids for example:
1, 2, 3
jrey:
:D :D :D :D :D Yes, its perfect !!. Thank you very much to both, I did it and now I can configure in my acp the categories that I want to hide and showing the correct statistics. Great help. Thanks again.
Bye
jrey
webmaster73:
--- Quote from: mawenzi on January 29, 2007, 10:08:46 AM ---... in index.php find in //--- Show New Images ---- the following ...
--- Code: ---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").")
--- End code ---
... and add after ...
--- Code: ---AND i.cat_id NOT IN (24)
--- End code ---
--- End quote ---
this is sweet. but this must be a parameter to be set in the admin panel, not a hack to the core script.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version