TinyPortal

Development => Support => Topic started by: Przemek84 on September 30, 2008, 10:30:28 PM

Title: Change shoutbox layout
Post by: Przemek84 on September 30, 2008, 10:30:28 PM
I really did search but I haven't found a concrete answer how to do that apart from pointing where I can find the code.

My problem:
I want shouts to be displayed in the following pattern: Nick Date Shout (in one line)
I managed to incorporate date next to the nickname but I have problems with the content of the shout

Here is the code:

{
$shouts= $txt['tp-last'].' '.$limit.' '.$txt['tp-shouts'].'<hr />';

while($row = mysql_fetch_assoc($request))
{
$shouts .='<div style="margin: 4px;">
<div style="border: dotted 1px; padding: 2px 4px 2px 4px;" class="windowbg2"><b>'.$row['value3'].'</b>
'.timeformat($row['value2']).'</div>
<div style="padding: 4px;">';
$myshout='';
$myshout=$row['value1'];
$shouts .= doUBBC(censorText($myshout));
$shouts .= '</div></div>';
}
$context['TPortal']['shoutbox']=$shouts;
mysql_free_result($request);
}



Link to my site: http://dreamlords.ovh.org/index.php?action=forum
SMF version: SMF ver. 1.1.6
TP version: TP ver. 0983
Theme name and version: mysticjade
Mods installed: Fix Emoticon's Positions for SMF

For testing: login: test password: test
Title: Re: Change shoutbox layout
Post by: IchBin on October 01, 2008, 12:30:46 AM
From the Posting guidelines:
Please do not ask your own question in a topic. In other words, please don't hijack the topic and make it  yours. Start your own topic and reference the other topic related to your issue.

This necessary for two reasons. To not hijack another users topic, and to make searching easier to find related topics.

The versions are important because there is a difference between TP 0.9.8 and TP 1.x., so we need to know which version you are using.  Thanks for the other info, I'll now split the topic since you didn't start your own topic.
Title: Re: Change shoutbox layout
Post by: Przemek84 on October 01, 2008, 12:59:56 AM
Thanks and sorry for giving you additional work :/
I have edited the first post to describe my problem.
Title: Re: Change shoutbox layout
Post by: IchBin on October 01, 2008, 01:09:39 AM
How can you put the Shout on the same line? That doesn't make much sense to me at this point. That would be over-crowded in the block wouldn't it?
Title: Re: Change shoutbox layout
Post by: IchBin on October 01, 2008, 01:13:10 AM
By looking at the code you provided I would say all you probably have to do is remove the one div that separates the body from the topic.

{
$shouts= $txt['tp-last'].' '.$limit.' '.$txt['tp-shouts'].'<hr />';

while($row = mysql_fetch_assoc($request))
{
$shouts .='<div style="margin: 4px;">
<div style="border: dotted 1px; padding: 2px 4px 2px 4px;" class="windowbg2"><b>'.$row['value3'].'</b>
'.timeformat($row['value2']);
$myshout='';
$myshout=$row['value1'];
$shouts .= doUBBC(censorText($myshout));
$shouts .= '</div></div>';
}
$context['TPortal']['shoutbox']=$shouts;
mysql_free_result($request);
}


I don't imagine this will look pretty. Don't forget to BACKUP your file before you make any changes.
Title: Re: Change shoutbox layout
Post by: Przemek84 on October 01, 2008, 01:15:50 AM
Well, maybe it would but I'd like to see it nevertheless. If it looks bad I'll try to alter something else. I want to make the shoutbox as small as possible but showing a good amount of content so I'd like to try out various configurations. Apart from that, Even if it is not such a good idea I want to know how to solve this as it may come in handy in the future.

EDIT:

Ok... thank you for help IchBin the effect is exactly what I wanted. It doesn't look great but I think that if work a little bit with the style it will be superb :)

Great to have such helping hand.

Edit: Oopps... There is however something wrong still :/ Scrolling doesn't seem to work after that change :/
Title: Re: Change shoutbox layout
Post by: IchBin on October 01, 2008, 06:43:10 AM
How many shouts do you have set to show at a time?
Title: Re: Change shoutbox layout
Post by: Przemek84 on October 01, 2008, 09:23:00 AM
I had 5 and scrolling wasn't workin so i tried different configurations and when I set to 7 ro more everything works fine.
Other solution is to decrease the height of shoutbox and then it works with 5 as well. There appears to be an interrelationship between the height of the shoutbox and the scrolling ability.

Thanks for everything IchBin.
Title: Re: Change shoutbox layout
Post by: IchBin on October 01, 2008, 04:01:16 PM
Anytime! Glad I could help.