coppermine-gallery.com/forum

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:

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:

// 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:

   if (!in_array($pid, $USER['liv']) && isset($HTTP_COOKIE_VARS[$CONFIG['cookie_name'] . '_data'])) {

And on line 450:

       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?