4images Issues / Ausgaben > Discussion & Troubleshooting
Excluding categorys (advanced)
(1/1)
trez:
Hi
I've seen many topics about this but i still don't found an answer ralated to my problem.
My site is dealing with pics, but to make the visit for my users more pleasent, i addet some categorys like "FUN" and "Other" to my site. But that pictures have really nothing to do with the site, and when a new user visit the site, he sees pictures from all categorys.
What i want to do, is exclude particular categorys from:
- Random new images on the main site
- Random image (on the left)
- and from the search, when a user clicks on "new images"
The third point is most important for me. So, for the new images on the main page i tried
--- 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" ) ."140,5)
--- End code ---
but it's not excluding the pictures from 140 and 5.
Can someone please post the three lines i need, i would really appreciate it.
Greetings
Georgi
V@no:
I should exclude the 5 category....double check it ;)
add coma infront of 140:
[qcode]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" ) .",140,5) [/qcode]
trez:
oh yes, the only thing i hate aabout php is, that a breaket can be so important ;) thanks.
So about he aearch, i used your line and it works too, but what about the random image on the left? Is it rndimg.php ? Because i cannot find a line there, that looks like the one i'am searching for.
greetings
georgi
V@no:
http://www.4homepages.de/forum/index.php?topic=6918.0 <- searched for random image exclude category
niad:
All the above solutions didn't work for me, so I did this:
In the Search.php
Find this:
AND c.cat_id = i.cat_id $cat_id_sql
and replace it with this:
AND c.cat_id = i.cat_id AND i.cat_id NOT IN (1,2,3)
where the 1,2,3 are the categories you want to exclude from the "new images" results.
This is a very easy solution and works great!
Navigation
[0] Message Index
Go to full version