Re: Restricting an album to appear in random Re: Restricting an album to appear in random
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Re: Restricting an album to appear in random

Started by Tranz, January 30, 2005, 07:23:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tranz


legend_neo

#1
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

legend_neo

#2
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

$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

Casper

Try changing

WHERE aid <> 11 AND

to;

WHERE (aid < '11' OR aid > '11') AND
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

#4
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 ???

Nibbler

Your post makes no sense.

You can use IN to specify multiple albums:

WHERE aid NOT IN (10,11,12)

that will exclude albums with aid 10,11,12. And using:

WHERE cid <> 8

will exclude albums in category 8.

legend_neo

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) 


Tranz

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.

legend_neo

Yes, I also think so. I need to modify the code in order to use " cid "
Any way , Many Thankxx to  " Nibbler "
I used

WHERE aid NOT IN (10,11,12)


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

The Issue Solved :)

Tranz

That does seem to be the easier solution. Glad it's working.