Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Re: Restricting an album to appear in random  (Read 3111 times)

0 Members and 1 Guest are viewing this topic.

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Restricting an album to appear in random
« on: January 30, 2005, 07:23:54 pm »

http://forum.coppermine-gallery.net/index.php?topic=10087.0

You need to figure out what you want to exclude.
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Restricting an album to appear in random
« Reply #1 on: January 30, 2005, 08:00:56 pm »

I m figuring it out how I missed that thread ;)  (I did search before posting this)

I will apply that modification tomorrow and let u know if I got any trouble. (time to sleep now)

Thanks for the help
« Last Edit: February 03, 2005, 09:31:08 pm by legend_neo »
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Restricting an album to appear in random
« Reply #2 on: February 03, 2005, 08:27:01 pm »

I guess ppl dont reply on threads that are marked as "Solved" coz i posted my problem in the thread that u gave to me but no reply so i m posting it here again

i dont know if i have done wrong
but instaed of using title, i used "aid" , but nothing happen. Still images from that album was coming on randome files
i did this
Code: [Select]
$sql = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE aid <> 11 AND approved = 'YES' $ALBUM_SET ORDER BY RAND() LIMIT $limit2";
               
As suggested by rs25.com  in the topic.
Also , I need to use this for 3 albums, How coud  possibly I do this ?
Is this possible to do the same thing with Category Name or (cid) , Its because i have 4 albums in one category and i want to restrict all of them

Waiting fot ur Guidence
« Last Edit: February 03, 2005, 09:23:30 pm by legend_neo »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Restricting an album to appear in random
« Reply #3 on: February 03, 2005, 09:38:00 pm »

Try changing

Code: [Select]
WHERE aid <> 11 AND
to;

Code: [Select]
WHERE (aid < '11' OR aid > '11') AND
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Restricting an album to appear in random
« Reply #4 on: February 03, 2005, 11:41:01 pm »

Ok.. I did it , SO far its working fine for one Album.
But
I need to do it with three albums ( aid 10 , 11 , 12 ).  All these albums belong to One category (cid= 8 )

SO is there Any way i can do this  bu using cid or aid ???
« Last Edit: February 04, 2005, 09:30:17 pm by legend_neo »
Logged

Nibbler

  • Guest
Re: Restricting an album to appear in random
« Reply #5 on: February 04, 2005, 02:41:20 pm »

Your post makes no sense.

You can use IN to specify multiple albums:

Code: [Select]
WHERE aid NOT IN (10,11,12)
that will exclude albums with aid 10,11,12. And using:

Code: [Select]
WHERE cid <> 8
will exclude albums in category 8.
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Restricting an album to appear in random
« Reply #6 on: February 04, 2005, 09:36:56 pm »

SORRY

I guess i was feeling sleepy when i posted the last message. I used cid on both places. What i mean was 3 albums that belong to One category.

I have corrected the post.

I have tried ""   WHERE cid <> 8   "" before but it didnt work. i get some error message while using  " cid  ".
I think i must use aid . So how can i restrict three albums that has " aid 10, 11 , 12 "  (These are Album ID's) 

Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Restricting an album to appear in random
« Reply #7 on: February 04, 2005, 09:45:40 pm »

There is no cid in the pictures table. If you want to use it, you would need to call up the category table and/or the albums table.
Logged

legend_neo

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 54
Re: Restricting an album to appear in random
« Reply #8 on: February 04, 2005, 10:50:48 pm »

Yes, I also think so. I need to modify the code in order to use " cid "
Any way , Many Thankxx to  " Nibbler "
I used
Code: [Select]
WHERE aid NOT IN (10,11,12)


And These Three albums r not showing in Randoom . Working Perfect :)

The Issue Solved :)
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Restricting an album to appear in random
« Reply #9 on: February 05, 2005, 12:59:41 am »

That does seem to be the easier solution. Glad it's working.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.