PHP Warning PHP Warning
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

PHP Warning

Started by Anne, March 24, 2005, 05:17:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Anne

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.

kegobeer

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?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots