Remove favorites at once. Remove favorites at once.
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Remove favorites at once.

Started by spa2036, March 07, 2006, 08:33:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

spa2036

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


<?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
Thanks for sharing this wonderful program

Nibbler

Taking the example given:

<a href="del-bestel.php">Verwijder bestellijst</a>

change to

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

spa2036

Thanks for your answer.
I put the snippet of code in my "Theme".php and it works perfect.
Thanks for sharing this wonderful program