favpics in cookie ? favpics in cookie ?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

favpics in cookie ?

Started by antisa33, September 07, 2006, 03:38:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

antisa33

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