forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Anne on March 24, 2005, 05:17:32 am

Title: PHP Warning
Post by: Anne on March 24, 2005, 05:17:32 am
I get this message on the top of my full-size pics:

Code: [Select]
Warning: in_array(): Wrong datatype for second argument in /home/mysite/public_html/gallery/displayimage.php on line 447

Warning: array_push(): First argument should be an array in /home/mysite/public_html/gallery/displayimage.php on line 450

Here's part of the code from displayimage.php:

Code: [Select]
// Display the full size image
function display_fullsize_pic()
{
    global $CONFIG, $HTTP_GET_VARS, $THEME_DIR, $ALBUM_SET, $USER, $HTTP_COOKIE_VARS;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;
   
    $pid = $HTTP_GET_VARS['pid'];
   
    // Add 1 to hit counter
    if (!in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
        user_save_profile();
    }

    if (function_exists('theme_display_fullsize_pic')) {
        theme_display_fullsize_pic();
        return;
    }

    ?>

This is on line 447:

Code: [Select]
   if (!in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {
And on line 450:

Code: [Select]
       array_push($USER['liv'], $pid);
Help would be appreciated.
Title: Re: PHP Warning
Post by: kegobeer on March 24, 2005, 05:29:50 am
Have you modified your Coppermine files in any way?

Have you searched the forums for in_array(): Wrong datatype for second argument or array_push(): First argument should be an array and read those posts?

How about a link to your site?