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: Remove favorites at once.  (Read 5779 times)

0 Members and 1 Guest are viewing this topic.

spa2036

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
Remove favorites at once.
« on: March 07, 2006, 08:33:40 pm »

I am using the code for clearing all the favorites at once with next code:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  
  Code to clear all files from the user's favorites (lightbox).
  
  It does this simply by clearing the data in the appropriate cookie.
  
  To use it, add a button link to this file in your template theme.php file,
  eg. <a href="del-bestel.php">Verwijder bestellijst</a>
  
**********************************************/

define('IN_COPPERMINE'true);
require(
'include/init.inc.php');

setcookie($CONFIG['cookie_name'] . '_fav'""time() + 86400 30$CONFIG['cookie_path']); //The "" bit is what resets the cookie data to nothing

$referer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php'//Sets the index page as your previous location if it can't determine where you came from by reading the referer from the browser

pageheader($lang_info"<META http-equiv=\"refresh\" content=\"3;url=$referer\">"); //Sends you back to the page you came from (or index.php) after 3 secs if you don't click the continue button
msg_box($lang_info"Uw bestellijst is verwijderd"$lang_continue$referer);
pagefooter();
ob_end_flush(); //Sends all this to the browser and flushes the php output buffer
?>


Is there an option to have the people asked if they are sure to remove all favorites? Y/N


Thanks again, Rob
« Last Edit: March 08, 2006, 01:02:09 am by Nibbler »
Logged
Thanks for sharing this wonderful program

Nibbler

  • Guest
Re: Remove favorites at once.
« Reply #1 on: March 07, 2006, 08:37:04 pm »

Taking the example given:

Code: [Select]
<a href="del-bestel.php">Verwijder bestellijst</a>
change to

Code: [Select]
<a href="del-bestel.php" onclick="return confirm('Are you sure ?');">Verwijder bestellijst</a>
Logged

spa2036

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
Re: Remove favorites at once.
« Reply #2 on: March 08, 2006, 12:59:39 am »

Thanks for your answer.
I put the snippet of code in my "Theme".php and it works perfect.
Logged
Thanks for sharing this wonderful program
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.