TinyPortal

Development => Support => Topic started by: morskisrle on October 29, 2007, 01:26:53 AM

Title: Error: Undefined index: smf_news_3
Post by: morskisrle on October 29, 2007, 01:26:53 AM
In the error log i just keep getting these error logs while on the forums eveything seems fine..
Undefined index: smf_news_3 and
Undefined index: smf_news_2
in
/home/www/smf/Sources/TPortal.php

and it keeps giving me the lines 1796-1799
I'm using 0.9.8 version with new def TP theme.

The code begins et line 1796 and ends at 1799
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['numReplies'] . ' ' . ($row['numReplies'] == 1 ? $txt['smf_news_1'] : $txt['smf_news_2']) . '</a>',
'replies' => $row['numReplies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['numReplies'] . ';num_replies=' . $row['numReplies'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl .


What can be the problem?


Title: Re: Error: Undefined index: smf_news_3
Post by: IchBin on October 29, 2007, 02:04:33 AM
You should see these 3 lines in your stats.*language*.php file.
$txt['smf_news_1'] = 'comment';
$txt['smf_news_2'] = 'comments';
$txt['smf_news_3'] = 'Write Comment';
Title: Re: Error: Undefined index: smf_news_3
Post by: morskisrle on October 29, 2007, 03:17:17 AM
Yes..they are present in the file
Title: Re: Error: Undefined index: smf_news_3
Post by: IchBin on October 29, 2007, 03:45:29 AM
The theme you are using, does it contain a stat.language file? Do these errors only happen in a certain theme? Do they happen in the default theme?
Title: Re: Error: Undefined index: smf_news_3
Post by: morskisrle on October 29, 2007, 03:52:07 AM
No the custom theme does not have it's own stat.language file, it doesn;t even have it's own source directory...i'll try to copy the stat file to it and see if it's ok...
Title: Re: Error: Undefined index: smf_news_3
Post by: morskisrle on October 29, 2007, 03:53:40 AM
and it doesn't have it's own language directory too..
Title: Re: Error: Undefined index: smf_news_3
Post by: morskisrle on October 29, 2007, 04:01:13 AM
Ok..I made it;s own languages directory and copied the stats.languafe file in it and it doesn't seem to give any errors. But i ned to go to work and look later if i get some

Offtopic
Is it preferable to have all the neccesary files in the each theme directory rather than having them only in default?
My custom theme has only the custom modified files and the rest sits in the default one.
Title: Re: Error: Undefined index: smf_news_3
Post by: IchBin on October 29, 2007, 05:19:19 AM
Its not necessary. If you're theme does not have the file, it will automatically use the files that are in the default theme.