TinyPortal

Development => Support => Installation => Topic started by: alex777 on April 20, 2008, 04:54:21 AM

Title: TinyPortal v1.0.5 beta
Post by: alex777 on April 20, 2008, 04:54:21 AM
Hi, I've just installed TinyPortal v1.0.5 and it works fine so far. Just have one small problem...in the error log file I got the following message:

8: Undefined index: 0
Datei: /srv/www/xxx/xxx/Sources/TPortal.php
Line: 1574

I just understand that there must be something in the TPortal.php on line 1574...

Does anybody know what to do?
Title: Re: TinyPortal v1.0.5 beta
Post by: IchBin on April 20, 2008, 05:14:17 AM
See if you can narrow down when you are getting the error. Since we can't reproduce it, its going to take some work on your part. One window on your error log, and another on your site. Click through your site and check the error log. See if you can narrow down when the error is appearing and on which pages.
Title: Re: TinyPortal v1.0.5 beta
Post by: alex777 on April 20, 2008, 05:38:53 AM
This error appears all the time when I go to the frontpage.

In the TPortal.php on line 1574 I have the following code:

$context['TPortal']['current_category']=$context['TPortal']['catnames'][$row['category']];


Code from line 1510-1575

// If we're always html resizing, assume it's too large.
if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
{
$avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
$avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
}
else
{
$avatar_width = '';
$avatar_height = '';
}

$bt[] = array(
'id' => $row['id'],
'icon' => '',
'pos' => $row['parse'],
'subject' => $row['subject'],
'time' => timeformat($row['date']),
'timestamp' => tp_forum_time(true,$row['date']),
'body' => $row['useintro']==-2 ? parse_bbc($row['body']) : $row['body'],
'href' => '' . $scripturl . '?page='.$row['shortname'],
'print_href' => $scripturl . '?page='.$row['shortname'].';print',
'link' => '',
'replies' => '',
'new_comment' => '',
'poster' => array(
'id' => $row['authorID'],
'name' => $row['realName'],
'href' => !empty($row['authorID']) ? '' . $scripturl . '?action=profile;u=' . $row['authorID'] : '',
'link' => !empty($row['authorID']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['authorID'] . '">' . $row['realName'] . '</a>' : $row['realName']
),
'is_last' => false,
'is_php' => $phplink=='-1' ? true: false,
'is_bbc' => $phplink=='-2' ? true: false,
'is_import' => $phplink=='-3' ? true: false,
'is_boardnews' => false,
'options' => $aoptions,
'is_featured' => true,
'frame' => $row['frame'],
'category' => !empty($context['TPortal']['caticons'][$row['category']]) ? '<a href="' . $scripturl . '?cat=' . $row['category'] . '"><img src="' . $boardurl . '/tp-files/tp-articles/icons/' . $context['TPortal']['caticons'][$row['category']] . '" alt="' . $context['TPortal']['catnames'][$row['category']] . '" align="left" style="border: 0; margin: 0.5ex 2ex 1ex 1ex;" /></a>' : '' ,
'catlink' => !empty($context['TPortal']['catnames'][$row['category']]) ? '<a href="' . $scripturl . '?cat=' . $row['category'] . '">' . $context['TPortal']['catnames'][$row['category']]. '</a>' : '' ,
'use_intro' => $row['useintro']==1 ? true : false ,
'introtext' => html_entity_decode($row['intro']),
'ID_CAT' => $row['category'],
'comments' => $row['comments'],
'comments_var' => $row['comments_var'],
'views' => $row['views'],
'rating_votes' => $rating_votes,
'rating_average' => $rating_average,
'can_rate' => (in_array($context['user']['id'],explode(",",$row['voters'])) && $context['user']['is_logged']) ? '0' : '1' ,
'featured' => true,
'avatar' => array(
'name' => &$row['avatar'],
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
),
'sticky' => $row['sticky'],
'lock' => $row['locked'],
'fileimport' => $row['fileimport'],
'topic' => $row['topic'],
'illustration' => $row['illustration'],
);
$current_comments=$row['comments'];
$context['TPortal']['current_category']=$context['TPortal']['catnames'][$row['category']];
$context['page_title'] = $row['subject'];
Title: Re: TinyPortal v1.0.5 beta
Post by: dkillers on April 20, 2008, 05:55:38 AM
i think there is problem with your theme
Title: Re: TinyPortal v1.0.5 beta
Post by: alex777 on April 20, 2008, 06:00:38 AM
I don't think that's a problem with the theme...I use a TP-Theme from DzinerStudio and also when I change the theme to the default theme the error still appears. The only thing which may could be a problem is that the tp-theme was made for tiny portal 0.983.....I somewhere read that such themes are not needed anymore for the new tinyportal and that just a link to the frontpage has to be added to ordinary themes...I didn't had to do this because my old tp-theme still works fine.

According the error log file it must have to do with the TPortal.php in the source file....line 1574
Title: Re: TinyPortal v1.0.5 beta
Post by: IchBin on April 20, 2008, 07:39:07 AM
The error isn't always the file it says it is. If the error only appears on the frontpage you should try some different things on your frontpage to see if you can narrow down what it is on your frontpage that causes it.
Title: Re: TinyPortal v1.0.5 beta
Post by: alex777 on April 20, 2008, 01:03:09 PM
Okay, now I think I know where the problem is.....when I go in the admin section to "Tiny Portal" and then to "Settings and Frontpage"  to "Tiny Portal - Frontpage Settings" and there activate "only forum-posts" this problem with the errors in the error log file appears.

But when I for example just activate "Front page blocks" as it was before (also with the old tp version) I do not get error messages at all.

So I think it must have something to do with the forum-posts I'd like to have on the frontpage.
Title: Re: TinyPortal v1.0.5 beta
Post by: IchBin on April 20, 2008, 06:39:57 PM
Good work. If you'd like you can file the bug report. I'm busy on a couple of other things here for the next bit, so you can do it if you'd like. There's a bugtracker link up top if you're using the sites default theme bz15.