building a "Stumble" button for coppermine building a "Stumble" button for coppermine
 

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]

Main Menu

building a "Stumble" button for coppermine

Started by nickfzx, July 05, 2007, 08:49:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

I want to build a mod for cpg that adds a new button to the main menu with the similar functionality of the Stumble Upon toolbar's (http://www.stumbleupon.com/) stumble button.

basically every time you hit this button you are shown a new random image from the gallery...in the diplayimage.php screen.

the following code is a quick hack to show what I mean...it uses none of coppermines classes or functions and also does not work properly (because this bypasses all coppermine privilleges and also deleted images also seem to have database entries)...but it gives the general idea and is a fun way to browse a gallery.
$random_image = "SELECT pid FROM copper_pictures ORDER BY RAND( ) LIMIT 1";
$result = mysql_query($random_image)  or die(mysql_error());
$bow = mysql_fetch_assoc($result);
echo "<a href='./galleries/displayimage.php?pos=-".$bow['pid']."' title='random artwork'>Stumble</a>";
mysql_free_result($result);


so what I would like a bit of advice with is how do I make the above idea use coppermines classes and functions in the correct way so that permissions are taken into account and it becomes a valid mod?

skidpics

Lets say you have the variable, $fullsize_url..

What is the coding in PHP to make this HTML link button code:

Quote<a href="http://www.stumbleupon.com/submit?$fullsize_url"> <img border=0 src=""**LINK TO stumbleit.gif**"" alt="StumbleUpon Toolbar"> Stumble It!</a>

the solution is based on the Image Link v1.0. by STRAMM - we just need to alter the output from:

Quote$pic_data['html'] = $pic_data['html'].'<br>http://www.stumbleupon.com/submit?'.$fullsize_url.'<br>'; 

to a button link..  will be working on it..