TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 302
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 212
  • Total: 212

Forum post layout on front page

Started by mekon, April 08, 2009, 01:32:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mekon

OK ive kinda sorted it, in the way that I managed to add avatars to the normal view, I found this layout works and looks better for my style.

Anyway this is what I did to get that incase anyone else has same problems and is interested.

open TPortal.template.php in your themes/default folder.

find the following code.
// normal render
case '1':
if($story['is_boardnews'] || $story['frame']=='theme')
echo '
<div class="tborder tp_article_frame">';


$ntime='
<span class="tp_month">' . date("M",$story['timestamp']). '</span><span class="tp_thindivider">  </span><span class="tp_day">'. date("d",$story['timestamp']) . '</span> <span class="tp_year"> '. date("Y",$story['timestamp']) . '</span>';

if($story['is_boardnews'] || isset($story['options']['title']) || !isset($story['options']))
{
echo '
<div' , $story['is_featured'] ? ' id="featured_article"' : '' , ' class="' , $story['is_boardnews'] ? 'catbg' : 'titlebg' , ' tp_subject">';

if($context['TPortal']['print_articles']==1)
echo '<a style="display: block; float: right;" class="smalltext" href="' . $story['print_href'] . '">' . $txt['tp-print'] . '</a>';

if(isset($story['options']['date']) || $story['is_boardnews'])
echo $ntime;

echo '
<a href="' , $story['href'] , '">' , $story['subject'] , '</a>
</div>';
}
// render the text
echo '
<table width="100%"  class="windowbg2" cellspacing="1" cellpadding="0"><tr>
<td valign="top">';


after add
// show authors avatar?
if(isset($story['options']['avatar']) && !empty($story['avatar']['image']))
echo '
<div class="tp_avatar' , ($context['TPortal']['mycat']!='' || !empty($context['TPortal']['is_front'])) ? '_category' : '' , '"><a href="' , $story['poster']['href'] , '" title="' , $story['poster']['name'] , '">' , $story['avatar']['image'] , '</a></div>';


The code was taken from the next part of the php file, for showing "any category icon", or Normal + lcon layout.

hope this helps anyone else having this problem, its not a fix for the normal + icon layout but more as a quick alternative until the problem is resolved.

mekon

ok another small problem, after adding the above code, I cant seem to get the avatar to float right to the text. it pushes the text below the image. ive tried everything in the css i can think of, using position: absolute throws the avatar to the top right of the page.

I am basically trying to get my forum blocks to looks like on this site.

http://www.fallenheroesguild.com/smf/index.php
again any help on this would be appriciated.

This website is proudly hosted on Crocweb Cloud Website Hosting.