forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: spa2036 on March 07, 2006, 08:33:40 pm

Title: Remove favorites at once.
Post by: spa2036 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
Title: Re: Remove favorites at once.
Post by: Nibbler 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>
Title: Re: Remove favorites at once.
Post by: spa2036 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.