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: XP Web Publishing Wizard Client and Album Order  (Read 1746 times)

0 Members and 1 Guest are viewing this topic.

meriturva

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
XP Web Publishing Wizard Client and Album Order
« on: July 13, 2007, 03:03:16 pm »

I have found in xp_publish.php file a little bug...when you create a new album you assign it a default pos value = 0
When you upload many albums with the xp wizard there is no way to have the albums ordered!

This is the line i have found in function create_album()
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($_POST['new_alb_name']) . "', 'NO',  '0')";

I have modified the xp_publish.php and now:
Code: [Select]
//Diego corretto bugs
$diegoNum=0;
$query = "SELECT MIN(pos) as minnum FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='$category'";
$resultDiego = cpg_db_query($query);
$rowDiego = mysql_fetch_array($resultDiego);
$diegoNum = $rowDiego["minnum"] - 1;
   
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($_POST['new_alb_name']) . "', 'NO',  '$diegoNum')";

So now you are sure that the new albums comes always in first position!

If you know a different and better way to do it please inform me!

Meriturva
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.