Author Topic: Excluding categorys (advanced)  (Read 8170 times)

0 Members and 1 Guest are viewing this topic.

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Excluding categorys (advanced)
« 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Excluding categorys (advanced)
« Reply #1 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]
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: Excluding categorys (advanced)
« Reply #2 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


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Excluding categorys (advanced)
« Reply #3 on: February 26, 2006, 09:17:59 AM »
http://www.4homepages.de/forum/index.php?topic=6918.0 <- searched for random image exclude category
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline niad

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Re: Excluding categorys (advanced)
« Reply #4 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!
I love 4images, it is really great work!