Blame | Last modification | View Log | Download
<?php/*************************Coppermine Photo Gallery************************Copyright (c) 2003-2005 Coppermine Dev Teamv1.1 originaly written by Gregory DEMARThis program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.********************************************Coppermine version: 1.3.3$Source: /cvsroot/coppermine/stable/addfav.php,v $$Revision: 1.6 $$Author: gaugau $$Date: 2005/04/19 03:12:58 $**********************************************/define('IN_COPPERMINE', true);define('RATEPIC_PHP', true);require('include/init.inc.php');// Check if required parameters are presentif (!isset($HTTP_GET_VARS['pid'])) cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);$pic = (int)$HTTP_GET_VARS['pid'];// If user does not accept script's cookies, we don't accept the voteif (!isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {header('Location: displayimage.php?pos=' . (- $pid));exit;}// See if this picture is already present in the arrayif (!in_array($pic, $FAVPICS)) {$FAVPICS[] = $pic;} else {$key = array_search($pic, $FAVPICS);unset ($FAVPICS[$key]);}$data = base64_encode(serialize($FAVPICS));setcookie($CONFIG['cookie_name'] . '_fav', $data, time() + 86400 * 30, $CONFIG['cookie_path']);$location = "displayimage.php?pos=" . (- $pic);$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';header($header_location . $location);pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"1;url=$location\">");msg_box($lang_info, $lang_rate_pic_php['rate_ok'], $lang_continue, $location);pagefooter();ob_end_flush();?>