forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Tranz on January 30, 2005, 07:23:54 pm

Title: Re: Restricting an album to appear in random
Post by: Tranz 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.
Title: Re: Restricting an album to appear in random
Post by: legend_neo 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
Title: Re: Restricting an album to appear in random
Post by: legend_neo 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
Title: Re: Restricting an album to appear in random
Post by: Casper 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
Title: Re: Restricting an album to appear in random
Post by: legend_neo 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 ???
Title: Re: Restricting an album to appear in random
Post by: Nibbler 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.
Title: Re: Restricting an album to appear in random
Post by: legend_neo 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) 

Title: Re: Restricting an album to appear in random
Post by: Tranz 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.
Title: Re: Restricting an album to appear in random
Post by: legend_neo 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 :)
Title: Re: Restricting an album to appear in random
Post by: Tranz on February 05, 2005, 12:59:41 am
That does seem to be the easier solution. Glad it's working.