SimplePortal

Support => English Support => Topic started by: Burke Knight on September 18, 2014, 06:38:22 PM

Title: Shoutbox Editing
Post by: Burke Knight on September 18, 2014, 06:38:22 PM
Trying to edit the way the shoutbox looks for one site:

Code: [Select]
if (!empty($shoutbox['shouts']))
foreach ($shoutbox['shouts'] as $shout)
echo '
<li class="smalltext">', !$shout['is_me'] ? '<a href="javascript:void(0);" title="'.$txt['sp_shoutbox_pm_title'].'" onclick="document.getElementById(\'new_shout_'. $shoutbox['id']. '\').value=\'@' . $shout['author']['name'] . ': \'">@</a> <strong>' . $shout['author']['link'] . ':</strong> ' : '', $shout['text'], '<br />', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '<span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';

To:

Code: [Select]
if (!empty($shoutbox['shouts']))
foreach ($shoutbox['shouts'] as $shout)
echo '
<li class="smalltext">', !$shout['is_me'] ? '<a href="javascript:void(0);" title="'.$txt['sp_shoutbox_pm_title'].'" onclick="document.getElementById(\'new_shout_'. $shoutbox['id']. '\').value=\'@' . $shout['author']['name'] . ': \'">@</a> <strong>' . $shout['author']['link'] . ' - <span class="smalltext shoutbox_time">'. $shout['time']. '</span>:</strong> ' : '', $shout['text'], ' ', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '</li>'

It works and displays like I want it to, when refresh the whole page. However, when I post a shout, it reverts to the old layout. Any idea why it wont stick to the changes?

EDIT:

Attached pics:

First is new way that I changed code to, code in 2nd code box above.
Second, is the default way that it reverts to, when post new shout.
Title: Re: Shoutbox Editing
Post by: PokemonS on September 19, 2014, 01:01:46 AM
You should edit the code in portal.js too.
Make the style same, but in JS language.

This line:

Code: [Select]
new_body += '<li class="smalltext">' + (is_me == 0 ? '<strong>' + author + ':</strong> ' : '') + content + '<br />' + (delete_link != 0 ? ('<span class="shoutbox_delete">' + delete_link + '</span>') : '') + '<span class="smalltext shoutbox_time">' + time + '</span></li>';
Title: Re: Shoutbox Editing
Post by: Burke Knight on September 19, 2014, 05:29:00 AM
Ended up being this:

Code: [Select]
new_body += '<li class="smalltext">' + (is_me == 0 ? '<a href="javascript:void(0);" title="'+ author_name_txt +'" onclick="document.getElementById(\'new_shout_'+ shoutbox_id +'\').value=\'@' + author_name + ': \'">@</a> <strong>' + author + ' - <span class="smalltext shoutbox_time">' + time + '</span>:</strong> ' : '') + content + ' ' + (delete_link != 0 ? ('<span class="shoutbox_delete">' + delete_link + '</span>') : '') + '</li>';
Thank you, I never even thought of the js....LOL
Shows that at times, you DO need to get some rest, when doing site development....  ;D
Title: Re: Shoutbox Editing
Post by: [SiNaN] on October 11, 2014, 06:44:45 AM
I'm marking the topic as solved then.
SimplePortal 2.3.8 © 2008-2024, SimplePortal