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: Look at potential 'Mod' script  (Read 3614 times)

0 Members and 1 Guest are viewing this topic.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Look at potential 'Mod' script
« on: November 22, 2004, 02:56:38 pm »

Can I get a couple sets of eyes to look at this and let me know if it would cause any trouble before I post it as a Mod? It's working perfect at my site, but I just want some pros to look at it and let me know if it's 'error free' or "this could cause problems if..." type thing.  I have CPG ver 1.3.2 and I have no special settings changed. Paths are based on 'albums/userpics/blah'.

It builds an xml file for a Flash slideshow and can be used anywhere in the gallery - fullscreen down to a thumbnail.  Pulls out titles, and can be totally customized (random, desc, asc, normal_, full, thumb_, as many pics as you want to pull out, etc.....). This particular will pull out the last 5 pic uploads - Sample output attached.

Code: [Select]
<?
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$xml .= '<?xml version="1.0" encoding="UTF-8" ?>';
$xml .= '<slideshow><settings><image_folder></image_folder><time>3</time><fade>1</fade><repeat>true</repeat><captions>true</captions></settings><images>';
$result = mysql_query("SELECT a.pid, a.aid, a.filename, a.filepath, a.pwidth, a.pheight, a.title, a.caption, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid AND filename LIKE '%.jpg' order by a.aid, a.pid desc LIMIT 5");
global $xml;
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap']);
$p_aid = -1 ;
   while ($row = mysql_fetch_array($result))
        {
                if ($row[aid] != $p_aid){
                }
                if (max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']){

               $xml .= "<image><file><![CDATA[$CONFIG[fullpath]$row[filepath]$CONFIG[normal_pfx]$row[filename]]]></file><caption><![CDATA[$row[title]]]></caption></image>";
} else {
               $xml .= "<image><file><![CDATA[$CONFIG[fullpath]$row[filepath]$row[filename]]]></file><caption><![CDATA[$row[title]]]></caption></image>";
}
               $p_aid = $row[aid] ;
}
$xml .= '</images></slideshow>';
echo $xml;
?>

Until I receive a couple of thumbs up, I'll hold off on submit.  Thanks for all the help.



[attachment deleted by admin]
« Last Edit: November 22, 2004, 09:25:47 pm by Casper »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Look at potential 'Mod' script
« Reply #1 on: November 22, 2004, 08:22:29 pm »

Please use '[code ]' and '[/code ]' not '[php ]'/[/php ]'
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

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Look at potential 'Mod' script
« Reply #2 on: November 22, 2004, 09:04:49 pm »

Please use '[code ]' and '[/code ]' not '[php ]'/[/php ]'

Could you 'please' edit my post correctly?

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Look at potential 'Mod' script
« Reply #3 on: November 22, 2004, 09:27:00 pm »

Hmmmm, don't know what happened there, it was ok when I checked it.

Anyway, done now.
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

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Look at potential 'Mod' script
« Reply #4 on: November 22, 2004, 10:20:06 pm »

Thanks Casper, I was just messin'with ya'. Didn't know you didn't like the php tag.  Most dev boards frown on not using them.

Do 'you' see any trouble with that script? Should I just go ahead and post the stuff and let the stones fly?  I mean, it's only that file and a small swf file.  I was just hopin' to get one of you [dev] guys to comment whether it will conflict with anything.  Ah, heck with it.  Maybe just delete this post alogether and I can post in the Mod/Hack section and see what happens?

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Look at potential 'Mod' script
« Reply #5 on: November 23, 2004, 12:22:22 am »

Yep, the best way is to post it with a warning that it's not fully tested, and see what comes back at you.
I'm too busy on other things to have a go at this myself at the moment.
And besides, I'm not really a coder at all.
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
Pages: [1]   Go Up
 

Page created in 0.036 seconds with 20 queries.