TinyPortal

Development => Support => Topic started by: bradfrank on August 18, 2008, 04:51:58 PM

Title: TPortal.template.php errors reported by SMF
Post by: bradfrank on August 18, 2008, 04:51:58 PM
I'm on a quest to squash all forum errors, but I cannot figure these two out. They could be related.

SMF: 1.1.5
TinyPortal v0.9.8
Theme: PDX-DK
Site URL: http://www.shinsei-guild.org (http://www.shinsei-guild.org)

Other mods:

The errors:
Quote2: implode() [<a href='function.implode'>function.implode</a>]: Bad arguments.
File: /homepages/8/***********/htdocs/Themes/default/TPortal.template.php (eval?)
Line: 73

8: Undefined variable: opts
File: /homepages/8/***********/htdocs/Themes/default/TPortal.template.php (eval?)
Line: 73

Investigating, I pulled up line 73 of that file:
// layout option 2 - 1 on top, 2 columns after
elseif($context['TPortal']['frontpage_layout']=='1'){
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%">';
$first=true;
$second=false;
$half=floor($end/2);
$finish=false;
} // LINE 73
// layout option 3 - single left column, multiple right column
elseif($context['TPortal']['frontpage_layout']=='2'){
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%">';
$first=true;
$second=false;
}


Since that didn't seem to offer any insights, I had to move down to line 231 to find the first instance of the $opts variable:
// ..and for views and ratings , even comments?
echo '</div><div style="text-align: right; margin-top: 1ex;">';
$opts=array();
if(isset($story['options']['views']) || $story['is_boardnews'])
$opts[] = '<span class="smalltext">' . $story['views'] . ' ' . $txt['tp-views'] . '</span>';
if(isset($story['options']['comments']) || $story['is_boardnews']){
if($story['is_boardnews'] && ($story['comments']>1 || $story['comments']==0))
$what=$txt[110];
elseif($story['is_boardnews'] && $story['comments']==1)
$what=$txt[146];
else
$what='<a href="'.$scripturl.'?page='.$story['id'].'#tp-comment">'.$txt['tp-comments'].'</a>';

$opts[] = '<span class="smalltext">' . $story['comments'] . ' ' . $what . '</span>';
}
if(isset($story['options']['rating']))
$opts[] = '<span class="smalltext">' . $txt['tp-ratingaverage'] . ' ' . ($context['TPortal']['showstars'] ? (str_repeat('<img src="'.$settings['images_url'].'/tpblue.gif" style="width: .7em; height: .7em; margin-right: 2px;" alt="" />', $story['rating_average'])) : $story['rating_average']) . ' (' . $story['rating_votes'] . ' ' . $txt['tp-ratingvotes'] . ') </span>';

                     echo implode("&nbsp;|&nbsp;",$opts);


I will gladly offer up any more information that will help me eliminate this error.
Thank you for your time and help.
Title: Re: TPortal.template.php errors reported by SMF
Post by: G6Cad on August 18, 2008, 05:24:43 PM
Can you add the info according to our posting gude, especially the "other mods installed" part  :up:
Title: Re: TPortal.template.php errors reported by SMF
Post by: bradfrank on August 18, 2008, 05:35:30 PM
Missing information added to original post.