4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: trez on February 25, 2006, 02:26:13 PM

Title: Excluding categorys (advanced)
Post by: trez on February 25, 2006, 02:26:13 PM
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: [Select]
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)
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
Title: Re: Excluding categorys (advanced)
Post by: V@no on February 25, 2006, 05:54:21 PM
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]
Title: Re: Excluding categorys (advanced)
Post by: trez on February 26, 2006, 02:21:35 AM
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

Title: Re: Excluding categorys (advanced)
Post by: V@no on February 26, 2006, 09:17:59 AM
http://www.4homepages.de/forum/index.php?topic=6918.0 <- searched for random image exclude category
Title: Re: Excluding categorys (advanced)
Post by: niad on August 06, 2021, 07:19:41 PM
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!