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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 345
  • Total: 345

Change the position of shoutbox text entry in TP1.0 Beta 4

Started by sburke930, May 24, 2009, 10:12:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZarPrime

You may be right.  I did make one mistake, even though it worked fine on my test site.  Try the following as the replacement code instead of what I posted in the message above.  Find the same area and replace it with this ...

function template_tpshout_shoutblock()
{

global $context, $settings, $options, $scripturl, $txt, $modSettings, $sourcedir;

// Show the shoutbox, takes settings from tpadmin
$tp_where=$_SERVER['QUERY_STRING'];

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

$context['shoutbox_form'] = 'tp_shoutbox';
$context['shout_post_box_name'] = 'tp_shout';

echo  '
<div class="tp_shoutboxblock">';

if(!empty($context['TPortal']['show_shoutbox_smile']))
shout_smiley_code();
if(!empty($context['TPortal']['show_shoutbox_icons']))
shout_bcc_code();
if(!empty($context['TPortal']['show_shoutbox_smile']))
print_shout_smileys();

echo '
</div>';

//Move Form to Start Here
echo '
<form  accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 8px 0 8px 0; text-align: center;" name="'. $context['shoutbox_form']. '"  id="'. $context['shoutbox_form']. '" action="'.$scripturl.'?action=tpmod;shout=save" method="post" >';

if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest']))
{
echo '
<textarea class="editor" name="'. $context['shout_post_box_name']. '" id="'. $context['shout_post_box_name']. '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" style="width: 80%;margin-top: 1ex; height: 50px;"  tabindex="', $context['tabindex']++, '"></textarea><br />
<input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'" />';
}
if($context['user']['is_guest'] && allowedTo('tp_can_shout'))
echo '<br />
<input style="margin-top: 4px;" size="20" class="smalltext" type="text" name="tp-shout-name" value="'.$txt['tp-guest'].'" />';
else if(allowedTo('tp_can_shout'))
echo '
<input type="hidden" name="tp-shout-name" value="'.$context['user']['name'].'" />';

echo '
<a href="' , $scripturl , '?action=tpmod;shout=show50">' . $txt['tp-showlatest'] . '</a>
<input name="tp-shout-url" type="hidden" value="'. htmlspecialchars($tp_where).'" />
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
//Move Form to End Here

if($context['TPortal']['shoutbox_usescroll']=='1')
echo '
<div id="shoutcontainer">
'.$context['TPortal']['shoutbox'].'
</div>';
elseif($context['TPortal']['shoutbox_usescroll']=='2')
echo '<br />
<div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
<div id="vmarquee" class="smalltext" style="text-align: left;position: absolute; width: 98%;">
'.$context['TPortal']['shoutbox'].'
</div>
</div>';
else
echo '
<table cellpadding="0" align="center" width="100%" cellspacing="0" style="table-layout: fixed;">
<tr>
<td><div class="smalltext" style="width: 99%; height: '.$context['TPortal']['shoutbox_height'].'px; overflow: auto;">', $context['TPortal']['shoutbox'], '</div></td>
</tr>
</table>';

//Move Form From Start Here
// echo '
// <form  accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 8px 0 8px 0; text-align: center;" name="'. $context['shoutbox_form']. '"  id="'. $context['shoutbox_form']. '" action="'.$scripturl.'?action=tpmod;shout=save" method="post" >';
//
// if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest']))
// {
// echo '
// <textarea class="editor" name="'. $context['shout_post_box_name']. '" id="'. $context['shout_post_box_name']. '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" style="width: 80%;margin-top: 1ex; height: 50px;"  tabindex="', $context['tabindex']++, '"></textarea><br />
// <input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'" />';
// }
// if($context['user']['is_guest'] && allowedTo('tp_can_shout'))
// echo '<br />
// <input style="margin-top: 4px;" size="20" class="smalltext" type="text" name="tp-shout-name" value="'.$txt['tp-guest'].'" />';
// else if(allowedTo('tp_can_shout'))
// echo '
// <input type="hidden" name="tp-shout-name" value="'.$context['user']['name'].'" />';
//
// echo '
// <a href="' , $scripturl , '?action=tpmod;shout=show50">' . $txt['tp-showlatest'] . '</a>
// <input name="tp-shout-url" type="hidden" value="'. htmlspecialchars($tp_where).'" />
// <input type="hidden" name="sc" value="', $context['session_id'], '" />
// </form>';
//Move Form From End Here

}


I just tested this on my test site and it works fine.

ZarPrime

sburke930

When I removed the following from the code you posted before it worked fine
//Move Form From Start Here
// echo '
// <form  accept-charset="', $context['character_set'], '" class="smalltext" style="padding: 0; margin: 8px 0 8px 0; text-align: center;" name="'. $context['shoutbox_form']. '"  id="'. $context['shoutbox_form']. '" action="'.$scripturl.'?action=tpmod;shout=save" method="post" >';
//
// if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest']))
// {
// echo '
// <textarea class="editor" name="'. $context['shout_post_box_name']. '" id="'. $context['shout_post_box_name']. '" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);" style="width: 80%;margin-top: 1ex; height: 50px;"  tabindex="', $context['tabindex']++, '"></textarea><br />
// <input style="margin-top: 4px;" class="smalltext" type="submit" name="shout_send" value="'.$txt['shout!'].'" />';
// }
// if($context['user']['is_guest'] && allowedTo('tp_can_shout'))
// echo '<br />
// <input style="margin-top: 4px;" size="20" class="smalltext" type="text" name="tp-shout-name" value="'.$txt['tp-guest'].'" />';
// else if(allowedTo('tp_can_shout'))
// echo '
// <input type="hidden" name="tp-shout-name" value="'.$context['user']['name'].'" />';
//
// echo '
// <a href="' , $scripturl , '?action=tpmod;shout=show50">' . $txt['tp-showlatest'] . '</a>
// <input name="tp-shout-url" type="hidden" value="'. htmlspecialchars($tp_where).'" />
// <input type="hidden" name="sc" value="', $context['session_id'], '" />
// </form>';
//Move Form From End Here

IchBin

In the TPShout.php file you'll find this section that creates the shouts.
while($row = tpdb_fetch_assoc($request))
{
$ns[] = '<div class="singleshout">
<div style="margin: 4px;"><div class="shoutheader windowbg2"><b>'.$row['value3'].'</b></div><div style="padding: 2px;"> '. timeformat($row['value2']).'</div><div style="padding: 4px;">
' . doUBBC(censorText($row['value1'])) . '</div></div></div>';
}


If you want the time and date removed you can probably remove just this part:
'. timeformat($row['value2']).'

sburke930

Thank you, I will try that!

EDIT!  The template file right?  I can't find it in the template; control F and nothing.  :(

G6Cad

Not the template file but in the /sources/ directory TPShout.php

IchBin

Quote from: sburke930 on June 03, 2009, 06:50:56 AM
Thank you, I will try that!

EDIT!  The template file right?  I can't find it in the template; control F and nothing.  :(

No, I would have typed TPShout.template.php if it was the template file. :D

sburke930

Ahhh shucks, I found it!  It was well down into the modules where I hadn't expected it to be.  It's all set now.  Thank you for your help IchBin and ZarPrime.

SOLVED!

This website is proudly hosted on Crocweb Cloud Website Hosting.