Advanced search  

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

Pages: [1]   Go Down

Author Topic: building a "Stumble" button for coppermine  (Read 2614 times)

0 Members and 1 Guest are viewing this topic.

nickfzx

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 285
building a "Stumble" button for coppermine
« on: July 05, 2007, 08:49:36 pm »

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.
Code: [Select]
$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?
Logged

skidpics

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 223
Re: building a "Stumble" button for coppermine
« Reply #1 on: September 29, 2007, 08:55:25 pm »

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..






Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.