Announcement

#1 2011-07-20 15:53:45

Billr
Piwigo Team, forum moderator
2011-06-22
144

Undefined index: Name

I'm getting more errors about Undefined index: NAME.

At first it showed up when using the 'download_multi' plugin and when on a page with thumbnails:
Notice: Undefined index: NAME in /var/www/piwigo/plugins/download_multi/include/class.inc.php on line 248


Now when I load the "Most Commented" page from the 'Special' menu - put there by the 'Most Commented' plugin:
Undefined index: NAME in /var/www/piwigo/plugins/MostCommented/most_commented.php on line 59

The error repeats for every thumbnail present on the page.

Bill

Offline

 

#2 2011-07-20 17:07:54

flop25
Piwigo Team
2006-07-06
6932

Re: Undefined index: Name

hello

have you chosen to hide the name of thumbnails ?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2011-07-20 17:34:52

Billr
Piwigo Team, forum moderator
2011-06-22
144

Re: Undefined index: Name

Not yet.  I can't find an option to do that.  Is it in a plugin?

Bill

Offline

 

#4 2011-07-20 17:39:59

flop25
Piwigo Team
2006-07-06
6932

Re: Undefined index: Name

No it's in the config file : this file is golden for customization

Btw, have your pics names ?
Also can you copy/paste the code at the lines indicated in php files indicated : not just the lines but also some from before and after (Am I understandable ? sry for my English)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2011-07-20 18:28:51

Billr
Piwigo Team, forum moderator
2011-06-22
144

Re: Undefined index: Name

This message is in two parts:

1) Excuse me for being new to this.  I don't know PHP and I don't know what config file to change.  Please tell me what config file to change for taking out the display of the thumbnail names and what code to change.

2) This part is in two parts:
    a) Code in 'download_multi/include/class.inc.php' around line 248


  // Affiche l'entrée HTML du formulaire
  function DmFormThumbnail() {
    global $template;
    $template->concat('PLUGIN_INDEX_CONTENT_BEGIN', '<form id="dl" action="#" name="DmForm" method="post">');
  }

  // Affiche les cases à cocher derrière le nom de l'image
  function DmCategoryThumbnail($tpl_var) {
    foreach($tpl_var as $cle=>$valeur) {
(Line 248)      $tpl_var[$cle]['NAME'] = $tpl_var[$cle]['NAME'].'&nbsp;<input type="checkbox" name="id_images[]" value="'.$tpl_var[$cle]['ID'].'">';
    }

    return $tpl_var;
  }


   b) Code in 'MostCommented/most_commented.php' around line 59

  // Affichage du nombre de commentaires si désactivé pour l'utilisateur
  if (!$user['show_nb_comments'])
  {
    foreach ($tpl_thumbnails_var as $key => $row)
    {
      $query = 'SELECT COUNT(*) AS nb_comments
        FROM '.COMMENTS_TABLE.'
        WHERE image_id = '.$row['ID'].'
        AND validated = "true";';

      list($nb_comments) = mysql_fetch_array(pwg_query($query));

(line 59)      $tpl_thumbnails_var[$key]['NAME'] = '(' . $nb_comments . ') ' . $tpl_thumbnails_var[$key]['NAME'];
    }
  }

  return $tpl_thumbnails_var;
}
?>

Last edited by Billr (2011-07-20 18:31:50)

Offline

 

#6 2011-07-20 18:37:05

flop25
Piwigo Team
2006-07-06
6932

Re: Undefined index: Name

About the config file -which is not part of your problem I think- use the plugin Localfile editor and see the local one with this plugin

Do you have a link to your gallery in private if you want : i'll check your other problem with chrome

About this problem : the plugin works fine even with these errors displayed ?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2011-07-20 20:00:44

Billr
Piwigo Team, forum moderator
2011-06-22
144

Re: Undefined index: Name

I assume that the plugins work fine with the errors displayed.   

With the 'download multi' plugin, there are occasional problems where clicking on links like "Select All" sometimes don't work.

Bill

Offline

 

#8 2011-07-21 20:05:43

Billr
Piwigo Team, forum moderator
2011-06-22
144

Re: Undefined index: Name

Thanks to Flop25.  He explained how these error notices were not bugs and that my theme, flop_mauve, uses config parameters. 

Here's his suggestion:
You know these notice errors are just to prevent problems but there are not bug. So I recommend to put in local config only :
$conf['show_php_errors'] = E_ALL & ~E_NOTICE;

I did that and now I don't see the error messages.  Of course, if I need to debug sometime, I will comment that out temporarily.

Bill

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact