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: PHP Warning  (Read 2334 times)

0 Members and 1 Guest are viewing this topic.

Anne

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
PHP Warning
« 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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: PHP Warning
« Reply #1 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?
Logged
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
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.