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: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 352
  • Total: 352

Yet Another Shoutbox Layout Question

Started by Xtreme4U2NV, May 04, 2011, 11:00:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Xtreme4U2NV


Link to my site: http://www.ontariocolorados.com
SMF version: 2.0 RC5
TP version: 1.102
Default Forum Language: English
Theme name and version: Black Head
Browser Name and Version: Firefox 4 & IE 9
Mods installed:
Welcome Topic Mod
SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update
SMF 1.0.12 / 1.1.4 / 2.0 b1.1 Update
TinyPortal 1.102
Related Error messages: None

So, I researched and found out how to removed the avatars from the Shoutbox.  My next task is to get the shout text to appear to the right of the persons name.

As we know, by default, the name is over the time stamp which is over the shout.  I would like to know the best route to get it to look as follows;

Xtreme4U2NV says: shout shout shout shout shout shout

I have searched and found threads about moving the actual shout above the persons name who posted it, but nothing about beside.

If anyone is able to give me a hand, that would be great appreciated.  And if I missed a thread in my search, please do no hesitate to post it so I can read it.

Any and all help is greatly appreciated.

Thanks,

Shane

IchBin

At the bottom of the Themes/default/TPShout.template.php file is the template_singleshout() function which controls the layout of the shouts. You can modify that code to your hearts content to get what you want. :)

Xtreme4U2NV

So, I have tried with a whole lotta fail.  I am usually pretty decent at editing code, but for some reason, I can't get it to look the way I want it.

How it looks now:


And how I would like it to look:


Any and all help is greatly appreciated.

Xtreme4U2NV

Wow, I have only a measly two posts here, three including this one.

On a side not, anyone have any ideas/suggestions?

WillyP

Try something like this and  post a reply when you do if you need help with the css:
function template_singleshout($row)
{
global $scripturl,$context, $settings, $txt;
$return = '
<div style="padding-bottom: 5px;">
<div class="tp_shoutcontainer">
' . (allowedTo('tp_shoutbox') ? '
<div class="single_shout">
<a href="' . $scripturl. '?action=tpmod;shout=admin;s=' . $row['id'] . ';' . $context['session_var'] . '=' . $context['session_id'].'"><img src="' . $settings['tp_images_url'] . '/TPmodify.gif" alt="'.$txt['tp-edit'].'" /></a>' : '') . '
<a href="' . $scripturl. '?action=profile;u=' . $row['value5'] . '">' . strip_tags($row['realName']) . '</a>
<span class="time_shout">
'. timeformat($row['value2']).'
</span>
<span class="single_shoutbody">
' . (parse_bbc(censorText(strip_tags(html_entity_decode($row['value1']))),true)) . '
</span>
</div>
</div>
</div>';

return $return;
}

I haven't tested this or anything, so let me see what is going on with it.

Xtreme4U2NV

Quote from: WillyP on May 17, 2011, 11:47:32 AM
Try something like this and  post a reply when you do if you need help with the css:
function template_singleshout($row)
{
global $scripturl,$context, $settings, $txt;
$return = '
<div style="padding-bottom: 5px;">
<div class="tp_shoutcontainer">
' . (allowedTo('tp_shoutbox') ? '
<div class="single_shout">
<a href="' . $scripturl. '?action=tpmod;shout=admin;s=' . $row['id'] . ';' . $context['session_var'] . '=' . $context['session_id'].'"><img src="' . $settings['tp_images_url'] . '/TPmodify.gif" alt="'.$txt['tp-edit'].'" /></a>' : '') . '
<a href="' . $scripturl. '?action=profile;u=' . $row['value5'] . '">' . strip_tags($row['realName']) . '</a>
<span class="time_shout">
'. timeformat($row['value2']).'
</span>
<span class="single_shoutbody">
' . (parse_bbc(censorText(strip_tags(html_entity_decode($row['value1']))),true)) . '
</span>
</div>
</div>
</div>';

return $return;
}

I haven't tested this or anything, so let me see what is going on with it.

I'm putting this somewhere in here right; Themes/default/TPShout.template.php ?

IchBin

Yes you are modifying the same code that is in the same function in that file. You will of course make a backup of the file before editing right? :)

Xtreme4U2NV

Excellent, will do, and will report back.

Xtreme4U2NV

Installed and looks perfect.  Just got to learn how to bold peoples names.  I can't thank you enough.

Also, just throwing this out there, you know how people can have their name a certain colour when they are in a certain membergorup?  Is there any way to have their name reflect that colour as well in the shoutbox?

IchBin

The membergroup color has been added for the next release, which I'm hoping won't be too long now.

This website is proudly hosted on Crocweb Cloud Website Hosting.