News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

superboomz

I have a problem..

after I tried to upgrade from version 1.05 to 1.11 I got the problem.
the message '...loading shoutbox...' is frozen and the shoutbox doesn't show up.

I tried chmod the yshout.php to 777 and access it directly, then it shown me 500 internal server error. but it never been like this since I install the version 1.11.

If you don't mind, here's url to my forums

http://www.nekojumpfan.com/webboard

you can access it using the information below

username: test
password: test



thank you very much.

nneonneo

Have you checked the server error logs?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

superboomz

today, everything is work fine now. thanks

endiZ

Great Mod, thanks!

Is there any possible way to change the default line history for all users?

nneonneo

Line history?

Do you mean number of lines shown? In that case, set $max_lines in yshout/yshout.php.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

endiZ

Great, thanks.

Is it possible to limit shouts to lets say one per hour?

nneonneo

Once per _hour_? That's quite a long time.

Is this one shout per person per hour, or one shout per hour regardless of who does it?

For the former, I'd recommend putting some timer in the session global, but there is a possibility that someone could get around that by logging out and back in. Aside from that, I'm not familiar with the SMF methods for storing data long-term, so I can't answer your question if the shoutbox restriction must be strict.

For the latter, this is fairly easy: check the modification time on the chat file, and only allow shouts if the file is old enough.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

examino

#1507
Using this mod has been great, really. I' m having some issues with my host though and i was hoping you could help modifying the code to solve them. They say the sb causes problems with the server as it consumes too many system resources. Propably as of the Ajax function. Could this be solved in anyway? Any suggestions? Thanks in advance.

Also, please post me back the link where the process to make smilies appear on the sb is described. 76 pages now and i don't seem to be able to find it.

Plus, is there anyway to auto erase History? It takes time and webspace.

Thanks.

nneonneo

The link for smilies is on the main mod page.

As for reducing system load, I've done what I can to avoid having the shoutbox use too much load -- however, if it is still a problem, try to increase the $updateTimeout in yshout/yshout.php. Also, maybe consider increasing refreshTime in yshout/js/yshout.js (this does very little compared with updateTimeout).

The technique I am now using is one Sarge described a long time ago. It holds a connection open for several seconds, during which any updates will be immediately refreshed to the user and the connection reopened. This technique drastically lowers server usage, but is only present in recent versions of the shoutbox.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

examino

#1509
Quote from: nneonneo on January 23, 2008, 05:04:47 PM
The link for smilies is on the main mod page.

As for reducing system load, I've done what I can to avoid having the shoutbox use too much load -- however, if it is still a problem, try to increase the $updateTimeout in yshout/yshout.php. Also, maybe consider increasing refreshTime in yshout/js/yshout.js (this does very little compared with updateTimeout).

The technique I am now using is one Sarge described a long time ago. It holds a connection open for several seconds, during which any updates will be immediately refreshed to the user and the connection reopened. This technique drastically lowers server usage, but is only present in recent versions of the shoutbox.

I 'm using 1.09. Is this version considered as recent? Would you recommend an update in order to quite solve this problem? I already increased $updateTimeout, i'll try increasing refreshTime as well.

Thank you.

nneonneo

1.09 is recent enough (I think the new code went into effect at 1.08). I don't think any of the newer updates deal specifically with performance, so if it works for you, it's not necessary to upgrade.

I know versions prior to 1.08 had performance issues. This caused a few hosts to block or impede the shoutbox, and since hosts are usually slow to undo those kinds of changes, the shoutbox is not always well-accepted by hosts (though I can assure you that the newer version should put its refresh rate and resource consumption on par with other non-AJAX shoutboxes, aside from the potential opening of several server processes; usually, most hosts do not worry about that though in my experience).
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

examino

Well, my host shot down the entire website. I thought whis was inexcusable but even so...

So, all i can do is increase some more $updateTimeout and refreshTime or change my server!  ;)

nneonneo

Aiee, that's no fun.

I wonder why? Does your host provide some sort of monitoring? There should be some way to see what is going on.

$updateTimeout has a maximum, however! It cannot exceed the maximum script execution time. If it does, users will just get broken shoutboxes.

As for refreshTime, increasing that significantly will make it randomly laggy, which would also be quite strange. What I don't get is why this is a major problem.

With updateTimeout at 20 seconds (the default), the shoutbox updates less frequently on average than most other shoutboxes. If the resource usage of a few extra server processes is so much, then I think the host has problems (though that's not something we can really fix!).

Which host are you using?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

Mick.

#1513
Wow!   I was very hesitant on uploading this mod for months as i feared it create errors but nope.  It installed great,it works just perfect.  Very cool.

One question 'tho...... is there a tutorial or a direct link on how to move the shoutbox to right under "users online" at the bottom of the forum page only?

Mick.

Quote from: BlueDevil on January 24, 2008, 05:54:22 PM
Wow!   I was very hesitant on uploading this mod for months as i feared it create errors but nope.  It installed great,it works just perfect.  Very cool.

One question 'tho...... is there a tutorial or a direct link on how to move the shoutbox to right under "users online" at the bottom of the forum page only?

Nevermind.  I figured it out.


...also...how do i prevent guests from posting?

Mick.

Quote from: BlueDevil on January 24, 2008, 07:29:33 PM
Quote from: BlueDevil on January 24, 2008, 05:54:22 PM
Wow!   I was very hesitant on uploading this mod for months as i feared it create errors but nope.  It installed great,it works just perfect.  Very cool.

One question 'tho...... is there a tutorial or a direct link on how to move the shoutbox to right under "users online" at the bottom of the forum page only?

Nevermind.  I figured it out.


...also...how do i prevent guests from posting?

LOL....nevermind.  Got it.

nneonneo

I'm glad you like it.

As for moving the shoutbox: this is actually pretty easy.

In index.template.php, there are three blocks of code delimited by "// YSHOUT HERE" and "// YSHOUT END". Delete the last two, leaving the first one (the one with several script tags and CSS) intact.

In BoardIndex.template.php, put
// YSHOUT HERE
echo '<br />
<div class="tborder" style="margin-top: 0;' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: center; ">Shoutbox </div>
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">
<tr><td class="windowbg2"><div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div></td></tr></table>
</div>';
// YSHOUT END

immediately before
}

?>

at the very end of the file.

Voila, a shoutbox after Users Online.

EDIT: Darn it, I'm late with the reply. Oh well, I'll leave this here in case anyone else needs it.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

Mick.

#1517
Thanx for the reply anyways nneonneo but i have 1 question.

I want to extend to the right the "typing box" longer so i can read a sentence better before i shout.

Where i edit this?  I want to double the lenght if its possible.


also.....is there an update for using member colors for 1.11?  Someone posted one 50 pages back but i think is for the previous version.

Mick.

Quote from: BlueDevil on January 24, 2008, 11:39:21 PM
Thanx for the reply anyways nneonneo but i have 1 question.

I want to extend to the right the "typing box" longer so i can read a sentence better before i shout.

Where i edit this?&nbsp; I want to double the lenght if its possible.


also.....is there an update for using member colors for 1.11?&nbsp; Someone posted one 50 pages back but i think is for the previous version.

Hahahaha!!  Im bad.

I found it after playing a bit.

I changed the text area to look longer.

From:
#yshout #shout-text {
         color: #000000;
         width: 310px;
         margin-right: 5px;
      }


to:
#yshout #shout-text {
         color: #000000;
         width: 750px;
         margin-right: 5px;
      }


much much better.

nneonneo

There's also an option $maxShoutChars to control the actual number of characters you can type into the box.

As for member colours: hmm, I'm trying to remember how that's supposed to be done.

OK, here goes nothing...Edit yshout/yshout.php
Find
$p_class = "";

if($user['is_admin']) $p_class = ' class="owner"';
if($user['is_mod']) $p_class = ' class="moderator"';
if(!$user['is_logged']) $p_class = ' class="guest"';
$shoutName=$user['name'];
$userID=$user['id'];
$writeText="<p$p_class><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span> ";
if($user['is_logged'])
$writeText.="<a href=\"index.php?action=profile;u=$userID\">$shoutName</a>";

Replace with
$a_class = "";
global $user_profile;
if(loadMemberData(Array($user['id']),false,'profile')!==false)
$a_class = ' style="color: '.$user_profile[$user['id']]['member_group_color'].'"';

$shoutName=$user['name'];
$userID=$user['id'];
$writeText="<p><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span> ";
if($user['is_logged'])
$writeText.="<a$a_class href=\"index.php?action=profile;u=$userID\">$shoutName</a>";

Find
$chatText = preg_replace('/<a href="index\.php\\?action=profile;u=(\\d+)">/','<a href="javascript:ajaxGet(\'banid=\\1\')"><span class="adminlink">ban</span></a>&nbsp;<a href="index.php?action=profile;u=\\1">',$chatText);
Replace with
$chatText = preg_replace('/<a([^>]*)href="index\.php\\?action=profile;u=(\\d+)">/','<a href="javascript:ajaxGet(\'banid=\\2\')"><span class="adminlink">ban</span></a>&nbsp;<a\\1href="index.php?action=profile;u=\\2">',$chatText);

The first causes the shoutbox to load the user's data, including their member group color, then outputs it to the <a> tag.
The second fixes the ban listing stuff to work with the new styling info.

This will be a standard feature of 1.12, which is up-and-coming and is currently in the feature/bugfix stage.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

Advertisement: