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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,242
  • Total Topics: 21,353
  • Online today: 192
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 138
  • Total: 139
  • lurkalot

How can i make all shouts centered ?

Started by knat, April 30, 2007, 10:02:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knat

Like the topics says  ::)

I need this because i use the shoutbox to show scrolling thumbnails and it would look a lot more cool if they where centered..

Cheers

Knat

IchBin

Probably add the center attribute to the div for shouts in TPortal.php would do it.
Quotewhile($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; text-align: center;">';
            $myshout='';
            $myshout=$row['value1'];
            $shouts .= doUBBC(censorText($myshout));
            $shouts .= '</div></div>';
         }

knat

Thanks for leading me in the right direction, i was looking at template files..new even thought of looking at tp files in the source folder.  ::)

I had to do this to make it work.  :)

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"><center>';
$myshout='';
$myshout=$row['value1'];
$shouts .= doUBBC($myshout);
$shouts .= '</center></div></div>';
}


BTW: Do you know how i can change the limit for max characters in one single shout ?

IchBin

In TPortalBlocks.template.php you can change the shoutbox textbox to have a limit on it.

knat

#4
I cant find it..   :o

I found this in sources/TPortal.php, can it be this limit i need tochange ??

// get x number of shouts
// set context info for profile shouts hide
$context['TPortal']['profile_shouts_hide'] = empty($context['TPortal']['profile_shouts_hide']) ? '0' : '1';
if(isset($using_shoutbox) || (isset($_GET['sa']) && $_GET['sa']=='shoutbox'))
{
$limit=$context['TPortal']['shoutbox_limit'];

if(isset($_GET['sa']) && $_GET['sa']=='shoutbox'){
if(isset($_GET['shouts']) && is_numeric($_GET['shouts']))
$limit=$_GET['shouts'];
}

if($limit>100) $limit=100;
$request = db_query("SELECT * FROM {$tp_prefix}variables WHERE type='shoutbox'  ORDER BY value2 DESC LIMIT $limit", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
$shouts= $txt['tp-last'].' '.$limit.' '.$txt['tp-shouts'].'<hr />';

IchBin

You need to ADD the limit to the textbox in the template file. Its not set. Google html textbox so you can see the properties you can set on it.

knat

Quote from: IchBinÃ,â,,¢ on May 03, 2007, 09:49:26 PM
You need to ADD the limit to the textbox in the template file. Its not set. Google html textbox so you can see the properties you can set on it.

Thats strange i was shure that there was a limit set.. and i wanted to remove that limit actually.. i use the shoutbox for image thumbnails but if members post more than one image the text gets cut off.. thats why i thought there might be some kind of limit.. anyway thanks for the help ;)

IchBin

Can you show me what you mean? There may be some other type of limit on the query or something, but I thought you wanted to limit the amount of text typed.

knat

Yes lets say someone wants to post 3 thumbs he would use this code


[URL=http://pixfarm.net/upload/2/originals/bc/bc42eb4834fc08697025766def41c50f.gif][IMG]http://pixfarm.net/upload/2/thumbs/bc/bc42eb4834fc08697025766def41c50f.gif[/IMG][/URL]
[URL=http://pixfarm.net/upload/2/originals/bc/bc42eb4834fc08697025766def41c50f.gif][IMG]http://pixfarm.net/upload/2/thumbs/bc/bc42eb4834fc08697025766def41c50f.gif[/IMG][/URL]
[URL=http://pixfarm.net/upload/2/originals/bc/bc42eb4834fc08697025766def41c50f.gif][IMG]http://pixfarm.net/upload/2/thumbs/bc/bc42eb4834fc08697025766def41c50f.gif[/IMG][/URL]


But this is what will happen

http://pixfarm.net/upload/2/originals/bc/bc42eb4834fc08697025766def41c5

Only one picture and a bit of the code for the next picture

But in Shoutbox admin i can type in all the links i want without this happening..

I hope you see what i meen  ::)

Resident Geek

Wow. This has me thoroughly confused. I had often thought to change this but had never gotten around to changing it at all.
Now, looking at the code, I can't find anywhere that affects the limit in characters for the shoutbox.
I've looked at the code in TPortalBlocks.template.php, and NOWHERE can I find any limiter for the shoutbox input. Take a look:

       <form  accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 0; 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 class="smalltext" name="tp-shout" style="width: 80%;margin-top: 1ex; height: 50px;" wrap="auto"></textarea><br />';
          echo '<input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'">';


I'm not seeing anything that would limit the input to a certain number of characters.

This website is proudly hosted on Crocweb Cloud Website Hosting.