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: favpics in cookie ?  (Read 4104 times)

0 Members and 1 Guest are viewing this topic.

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
favpics in cookie ?
« on: September 07, 2006, 03:38:20 pm »

Hello
I want to do an other php webpage php but i want to do some <img src=> with images i added in favorites.
I see that favorites images are stocked in a cookie.
How can i read it to do <img src"[cookie]" ?

I could do something like that, but this code doesn't work  :-\

Quote
<?php

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





if (isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_fav'])) {
    $FAVPICS = @unserialize(@base64_decode($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_fav']));
} else {
    $FAVPICS = array();
}


 $album_name = $lang_meta_album_names['favpics'];
                                $rowset = array();
                if (count($FAVPICS)>0){
                        $favs = implode(",",$FAVPICS);
                        $result = db_query("SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND pid IN ($favs)");
                        $nbEnr = mysql_fetch_array($result);
                        $count = $nbEnr[0];
                        mysql_free_result($result);

                        $select_columns = '*';

                        $result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ($favs) $limit");
                        $rowset = db_fetch_rowset($result);

                        mysql_free_result($result);

                        if ($set_caption) foreach ($rowset as $key => $row){
                                $caption = $rowset[$key]['title'] ? "<span class=\"thumb_caption\">".($rowset[$key]['title'])."</span>" : '';
                                $rowset[$key]['caption_text'] = $caption;
                        }
                }
                return $rowset;
pagefooter();
?>

Thanks
« Last Edit: September 08, 2006, 02:15:17 am by antisa33 »
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.