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: Excluding Album(s) from Random Image block  (Read 5466 times)

0 Members and 1 Guest are viewing this topic.

Aadilya

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Excluding Album(s) from Random Image block
« on: October 01, 2003, 07:14:54 pm »

Is there a way to exclude the pictures in a specific album from appearing in my "Random Images" block?

Aad
Logged

gtroll

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 618
    • CPG-Nuke
Excluding Album(s) from Random Image block
« Reply #1 on: October 02, 2003, 02:06:00 am »

In block-Random_pictures.php
aid!=4 AND aid!=6 AND aid!=7 were the directories i wanted to exclude change those aid to your own..
~= line 48 was
Code: [Select]
$result = sql_query("SELECT count(*) from cpg_pictures", $dbi);

change to
Code: [Select]
$result = sql_query("SELECT count(*) from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7", $dbi);

~=line 59 was
Code: [Select]
$result2 = sql_query("SELECT pid, aid, filepath, filename  from cpg_pictures WHERE approved='YES' LIMIT $random_number,1", $dbi);
change to:
Code: [Select]
$result2 = sql_query("SELECT pid, aid, filepath, filename  from cpg_pictures WHERE aid!=4 AND aid!=6 AND aid!=7  AND approved='YES' LIMIT $random_number,1", $dbi);
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 18 queries.