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,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 90
  • Total: 90

Can I get the shoutbox to appear on other areas of my site?

Started by General_Sun, July 14, 2007, 06:59:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

You just need to learn the proper code for the echo statement. Feel free to read my little tutorial. :)

http://www.ichbin.us/index.php?topic=19.0

General_Sun


General_Sun

Ahh a follow up question, where do I set how many lines the shoutbox shows or what size it is?

IchBin

You can view the settings in the admin panel for the shoutbox in the TP section. If you want to change any other settings than that you'll have to modify the actual function code in the TPortalBlocks.template.php file.

General_Sun

Thank you a lot. More questions from the coding noob. I've been thumbing through the TPtemplate files for a while but still don't understand them as well as I like. Expect more questions! :)

I edited the changes in the admin, but it still doesn't look 100% like I want. My biggest grip right now is how much horizontal space is being wasted. How do I get the timestamp to appear right next to the name.

For example it would be something like General_Sun - Today at 11:30:37 PM

I took a look in TPortalBlocks but it doesn't seem to be there...

This looks more promising:

case 'shoutbox':
// show the linktree
theme_linktree();

// Show the shoutbox, takes settings from tpadmin
if(isset($context['TPortal']['querystring']))
$tp_where=$context['TPortal']['querystring'];
else
$tp_where='';

if(!isset($context['TPortal']['shoutbox']))
$context['TPortal']['shoutbox']='';

echo '
<div class="tborder">
<table style="margin-bottom: 2px; table-layout: fixed;" class="windowbg" cellpadding="20" cellspacing="0" border="0" width="100%">
<tr>
<td>', $context['TPortal']['shoutbox'], '</td>
</tr>
</table>
<div class="windowbg2" style="padding-top: 10px;">
<form accept-charset="', $context['character_set'], '"  style="margin-top: 8px; text-align: center;" name="tp-shoutbox" action="'.$scripturl.'?action=tpmod&id=shout" method="post">';
if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest']))
echo '
<textarea name="tp-shout" style="width: 50%; height: 50px;" type="text"></textarea><br /><input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'">';

if($context['user']['is_guest'] && $context['TPortal']['guest_shout'])
echo '
<br /><input style="margin-top: 4px;" size="20"  type="text" name="tp-shout-name" value="'.$txt['tp-guest'].'">';
else
echo '<input type="hidden" name="tp-shout-name" value="'.$context['user']['name'].'">';

echo '<input name="tp-shout-url" type="hidden" value="'.$tp_where.'">
<input name="sc" type="hidden" value="'.$context['session_id'].'">
</form>
</div>
</div>';


Doing my noobie scanning of the code, it seems as if what I want is near the bottom. I see where it echos the value="'.$context['user']['name'].'" but what about the time?

tick

Just now getting back in and saw this.  Care to post the way you got it to work.

General_Sun

Certainly, I added a bit of css to get my recent post and shoutbox to display side by side.

/* Sun's custom classes */
#lastest_post_table
{
float:left;
}

#shoutbox_table
{
float:right;
}


The echo maze is here:

// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table id="lastest_post_table" cellpadding="0" cellspacing="0" width="40%" border="0">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<tr>
<td class="middletext" align="center" valign="top"><b>', $post['link'], '</b> <br>', $txt[525], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</td>
</tr>
';
echo '
</table><table id="shoutbox_table" width="50%" valign="top"><tr><td>';
echo TPortal_shoutbox();
echo '</td></tr></table>';
}
echo '
</td>
</tr>';
}

IchBin

Actually the code you posted General is the code for the layout of the block. The actual content is formated in TPortal.php.

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></div><div style="padding: 2px;"> '.timeformat($row['value2']).'</div><div style="padding: 4px;">';
$myshout='';
$myshout=$row['value1'];
$shouts .= doUBBC($myshout);
$shouts .= '</div></div>';
}


Notice the "timeformat" ? :)

General_Sun


This website is proudly hosted on Crocweb Cloud Website Hosting.