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,970
  • Latest: bynw
Stats
  • Total Posts: 196,053
  • Total Topics: 21,337
  • Online today: 239
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

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.

sburke930

I have looked at IchBins post regarding the change in a previous version of TP but that no longer works.  Is there a way to move text entry to the top in 1.0 Beta 4?  I have not been able to find anything on this subject.

My members are used to having the text box on the top and have complained about it since we converted to SMF.

Thank you in advance!

EDIT~ Changed the topic line since I recently installed beta 4.

IchBin

Open the TPShout.template.php file and edit the function template_tpshout_shoutblock()

You will see all of the input boxes for this if you need to change them.

sburke930

* sburke930 scratches her head

I see all the code but I do not know what I am supposed to edit. ???

sburke930

After asking the members exactly what they were looking for they have stated they want the time stamp removed, the entry box at the top, and the background color changed.  I can change the background in the style sheet but I have no idea how to remove the time stamp or move the text entry to the top.

Please help!

sburke930

I still cannot figure it out.  If someone could help me I would really appreciate it!

Thank you!

sburke930

I know I should not be posting over and over again but is there anyone that can help me to change the shoutbox text entry location?  I am not an expert and have no clue what changes I need to make.

Thank you!

ZarPrime

sburke930,

I'll see if I can figure it out, but it will be tomorrow now before I can even look at it.  In the meantime, please post back here exactly what order you want the various stuff in the shoutbox  to be in.  I can't guarantee that what I do will work as I'm not the best at php, but I'll see if I can figure it out if you give me the exact order you want stuff to be in.

ZarPrime

sburke930

Thank you!

The order should be:
  • BBC Code
  • Emotes
  • Shoutbox Entry
  • Shouts


If you can, please do NOT include the time stamp.  We just want the members name (centered if possible) above the shouts.

Whatever you can do is appreciated very much!

ZarPrime

Hi sburke930,

Sorry it took so long.  I've had a lot to do this week.

First of all, as far as removing the time stamp and centering the member's name, maybe someone else can help you with that.  I'm not a coder.

To move the entry box up to below the the smileys, open up the /public_html/YourSite/Themes/default/TPShout.template.php file and ...

Find 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>';
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>';

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>';

}


and Replace 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();

//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

echo '
</div>';
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

}


That's it.  Your shoutbox should now look like the image below.  I recommend you make a backup of the original file before doing the edits.

ZarPrime

sburke930

Well that did not work.

Here is the error I got

There was a problem loading the /Themes/default/TPShout.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\)

Thank you very much for trying.

EDIT~ I had to remove a bunch of code that was left over in your post.  I am assuming it wasnt meant to be there anyway.

It is the way we want it now.  At least the text area.

If someone can help me remove the time stamp and date that would be awesome!

This website is proudly hosted on Crocweb Cloud Website Hosting.