News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Errors in logs

Started by SteveW, May 03, 2009, 11:44:47 AM

Previous topic - Next topic

SteveW

I've been overlooking these errors as I couldn't work them out and was wondering if someone could enlighten me how to fix them or what to look for.

Ok I have enabled debug in settings.php and the first errors are on the menu at the top:

QuoteNotice: Undefined index: href in /home/******/public_html/Themes/EDSO_2/index.template.php on line 473
Notice: Undefined index: title in /home/******/public_html/Themes/EDSO_2/index.template.php on line 474

I am also getting errors with this piece of code which is on my frontpage:

QuoteNotice: Undefined variable: context
QuoteUndefined variable: settings

global $scripturl;
global $txt;
$what=ssi_recentTopics('20', NULL, 'array');

echo '<table border="0" width="100%" cellspacing="1" cellpadding="3" class="bordercolor">';
echo '<tr class="catbg3"><td align="center">Subject</td><td align="center">Board</td><td align="center">Member</td><td align="center">Date & Time</td></tr>';

$bg=0;
foreach ($what as $topic)
  {
    echo '<tr>';
    if ($bg == 0) {
      echo '<td class="windowbg" valign="middle">';
      $bg = 1;
    }
    else {
      echo '<td class="windowbg2" valign="middle">';
      $bg = 0;
    }
    echo $topic['link'];
    // Is this topic new? (assuming they are logged in!)
    if (!$topic['new'] && $context['user']['is_logged'])
      echo '<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="New', $txt[302], '" border="0" align="right", valign="absmiddle"/></a>';
      echo '</td><td class="windowbg2" valign="middle" >', $topic['board']['link'], '</td>';
      echo '</td><td class="windowbg2" valign="middle" >', $topic['poster']['link'], '</td><td class="windowbg2" valign="middle" >';
      if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
      echo '<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/Themes/airy_midnight20rc/images/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
      echo '<span class="smalltext">', $topic['time'], '</span></td></tr>';
  }

echo '</table>';


Thankyou
Watch the skies!!

greyknight17

Do you get these errors on the default theme also?

SteveW

I get these errors in the default theme and nothing else loads:

QuoteNo user is in chat.
      Notice: Undefined index: chat in /home/******/public_html/Themes/default/index.template.php on line 317
      Notice: Undefined index: title in /home/******/public_html/Themes/default/index.template.php on line 317
      Notice: Undefined index: href in /home/******/public_html/Themes/default/index.template.php on line 319
Fatal error: Call to undefined function shoutbox() in /home/******/public_html/Themes/default/index.template.php on line 398

I can see there is a problem with the chat mod so will try uninstalling going from there.
Sorry i didn't check the default theme first.

Are the other errors I first posted related do you think?
Watch the skies!!

SteveW

#3
Ok, after a long night reinstalling my site (had major problems with permission), I'm still getting the following errors:

Quotehttp://www.alienexistence.com/index.php?topic=2557.0
Apply Filter: Only show the errors with the same message
8: Undefined index: title
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Themes/EDSO_2/index.template.php
Line: 500

QuoteApply Filter: Only show the error messages of this URL  http://www.alienexistence.com/index.php?topic=2557.0
Apply Filter: Only show the errors with the same message
8: Undefined index: href
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Themes/EDSO_2/index.template.php
Line: 499

Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined offset: 111
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 27

Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined variable: settings
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 27

Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined variable: context
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 22

This is the code relating to lines 499/500 in index.template.php

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="menucontainer">
<div id="menunav">
<ul>';

foreach ($context['menu_buttons'] as $act => $button)
{
$classes = array();
if (!empty($button['active_button']))
$classes[] = 'active';
if (!empty($button['is_last']))
$classes[] = 'last';
$classes = implode(' ', $classes);

echo '
<li id="button_', $act, '"', !empty($classes) ? ' class="' . $classes . '"' : '', '>
<a title="', $act, '" href="', $button['href'], '">
<span>', ($button['active_button'] ? '<em>' : ''), $button['title'], ($button['active_button'] ? '</em>' : ''), '</span>
</a>
</li>';
}

echo '
</ul>
</div></div>';
}
Watch the skies!!

Robbo_

For the index errors add...


if (!isset($button['href']))
    $button['href'] = $scripturl;

if (!isset($button['title']))
    $button['title'] = '';


Other problems you should ask about on portamx.com
Aus-Newerth

Quote from: IRC
Roph> I just finished a double 1/2lb cheese, bacon & salad beef burger
Roph> no woman on earth could satisfy me as much as I am satisfied right now by this burger
... later on ...
Roph> how could ensie go about satisfying me =o
<Ensiferous> Roph: Merely looking at me would yield far more pleasure than a burger can provide.

feline

Quote from: SteveW
Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined offset: 111
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 27

Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined variable: settings
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 27

Quotehttp://www.alienexistence.com/index.php?http://www.alienexistence.com/
Apply Filter: Only show the errors with the same message
8: Undefined variable: context
Apply Filter: Only show the errors from this file
File: /home/alienex/public_html/Sources/PortaMx/Class/php.php(31) : eval()'d code
Line: 22

You have to add the globals $context and $settings at the top of your php script ...
For the error 111 you have to look at your php script whats is it.

Fel

SteveW

Thankyou Robbo_ and feline.

I have applied the fixes and they are fixing the problems that I previously posted. I still have the following errors which one is to do with this:

      echo '<a href="', $scripturl,  '?action=calendar;sa=post;month=', $month, ';year=', $year, ';sesc=', $context['session_id'], '">','<br />', create_button('calendarpe.gif', 'calendar23', 'calendar23', 'align="middle"'), '</a>';

This come up with error :
QuoteApply Filter: Only show the errors with the same message
8: Undefined index: calendar23

I am also getting errors undefined offset 111 and errors 302, although I cannot see this in the source code so don't know where to start looking. When I clear the log files and press refresh , the errors appear in the admin log straight away if thats any help.

Thankyou :) at least my log isn't filling as much as it was !! ;)
Watch the skies!!

feline

I think, you have ported that script from SMF 1.1.x ... In SMF 2 the text strings are changed.
So you have to change that to the equivalent strings in SMF 2 ...

for $txt[111] ... $txt['last_post']
for $txt[302] ... $txt['new']
for $txt['calendar23'] ... $txt['calendar_post_event']

so you have to replace:
111 -> 'last_post'
302 -> 'new'
'calendar23' -> 'calendar_post_event'

Fel

SteveW

feline your an absolute star!!! The fixes worked in recent topics code and calendar code thankyou very much :) and my log is now error free
Watch the skies!!

feline

Thanks  :) .. next time call direct portamx, I can't read all here

Fel

Advertisement: