nneonneo's Shoutbox

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

Previous topic - Next topic

ivo2296

Quote from: nneonneo on March 25, 2008, 07:25:51 PM
To show it only on the main forum page, put that code on BoardIndex.template.php.

As for the error -- I don't know, but you may want to lower $updateTimeout in yshout/yshout.php.

Thanks a lot!

Ricardo-san

Hey guys, i put my chat on a seperate page, but i want it to go below the menubar. help? thanks.

http://www.codetalk.b3ta.org [nofollow]
Free cPanel Hosting! [nofollow]
Free WHM Reseller Hosting! [nofollow]
Fantastico, Installatron, RVSkin, PHP, Perl, CGI-Bin, are included!

nneonneo

@Krato: No idea, please post yshout.php (in code tags, please)

@Ricardo-san: In index.template.php are four blocks of code starting with "// YSHOUT HERE" and ending with "// YSHOUT END". Remove all of them. Next, follow the instructions for installing to a custom theme (see main mod page), and when it comes time to insert the yshout div, instead add this:
// YSHOUT HERE
global $txt;
echo '
<div class="tborder" style="margin-top: 0;' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">
<div class="catbg" style="padding: 5px 5px 5px 10px;">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><br />';
// YSHOUT END

right before the end of either the theme_linktree function (to put it after the link tree) or after the template_menu function (to put it before the link tree). You may wish to add <br /> tags to adjust the layout.

If you only want it on the main page, and not every page, you should put that code in BoardIndex.template.php instead, right above /* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
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!

WRABBIT

Hi, I can't seem to find a place to put it in at all.  I just wanted to add it right under the Nav bar but it never seems to work right..

Stef001

Hi! Is it possible to make the chat hide, just like it is with the smileys???

Stef.
SMF 2.0.2 | SimplePortal 2.3.5

madman71

nneonneo,


I just had my site temporarily pulled offline because it was hogging resources.

Im gonna assume that the cause was this:
http://www.simplemachines.org/community/index.php?topic=137508.msg879828#msg879828

I guess i missed that part and had the shotbox on every single page of my forum. LOL

So if i edit the script to what you have suggested in the above link, all should be better on resources, right?

also, is there anything else i can do to prevent this awesome script of yours from taxing CPU/ram resources??


nneonneo

@Normally: In the default theme, with the default position, etc., using upshrink will hide the shoutbox. To hide it in general would require some more code, which will depend on what hiding you want to do, etc.

@madman71: The newer revisions of the script allow users to open multiple shoutbox instances. This may not be desirable. Set checkDuplicates to true in yshout/js/yshout.js (hmm, I've forgotten about this as a perf improvement). That will re-enable that check, and prevent users from having more than one shoutbox open.

As for general performance: a PHP accelerator will make this script vastly more efficient, owing to the fact that it is loaded fairly frequently. Ask your host what the script timeout is, and set $updateTimeout to a few seconds less than that value. The script will run for exactly that length of time, and then quit (and be re-requested) if no new shouts occur during that time. This, unfortunately, will trade CPU usage for memory usage: the script will use less CPU (being requested much less often) but will use more memory (as many instances of it may be running at once). Different hosts have different limits on this.

In general, decreasing updateTimeout biases the script to use more CPU and less memory (and vice-versa). If you decrease updateTimeout to below about 10 seconds, please increase refreshTime in yshout/js/yshout.js (default 150 milliseconds, higher means a laggier shoutbox).

If you don't need a high refresh rate, it is safe to set refreshTime to about 10000 (10 seconds), and have updateTimeout to around 2-5 seconds. Your mileage may vary (wildly), so there's no hard-and-fast rule for making this script more efficient.
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!

madman71

Thanks for your quick reply, Nneonneo.

I'll try what you suggest :)

Stef001

Quote from: nneonneo on April 03, 2008, 12:47:27 PM
@Normally: In the default theme, with the default position, etc., using upshrink will hide the shoutbox. To hide it in general would require some more code, which will depend on what hiding you want to do, etc.


Thanks for the quick reply,
I use the classic theme and only the smileys are upshrink.
Is it possible to do the same with the while shoutbox.
So that there is something like open shoutbox - close shoutbox.
SMF 2.0.2 | SimplePortal 2.3.5

WRABBIT

Anyone?

Sorry I know its a really stupid question, but when I tried putting it in it always gets the template parse error.  I am just trying to find the location right below the navigation bar

nneonneo

@Normally: I suppose you could adapt the animatedCollapse.js stuff to make it work. I don't know enough about that library (pongsak wrote the original smiley code) to do anything serious with it.

@WRABBIT: See this post: http://www.simplemachines.org/community/index.php?topic=137508.msg1487885#msg1487885. It describes what you need to do, plus the locations for where you want 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!

Captain_Morrigan

#1931
Nevermind.

Stef001

Quote from: nneonneo on April 03, 2008, 05:32:45 PM
@Normally: I suppose you could adapt the animatedCollapse.js stuff to make it work. I don't know enough about that library (pongsak wrote the original smiley code) to do anything serious with it.

nneonneo thanks for the reply,

Is there someone else who knows how i can make the whole Schoutbox collapse in the classic theme?
Thanks,
Stef.
SMF 2.0.2 | SimplePortal 2.3.5

crazyASD

#1933
When install shoutbox into wrapped in joomla forum i got this error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: http://***/forum/yshout/js/moo.ajax.js :: anonymous :: line 26"  data: no]
source: http://*****.ru/forum/yshout/js/moo.ajax.js
Line: 26

(Error reporter from firefox says this)

Please help me!

nneonneo

Huh? That's really bizarre! In index.template.php, change the line
var board_url = "'; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";
to
var board_url = "/forum";
and see if that fixes 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!

Fatality-

I try to install SB_1.13_SMF2.tgz on a fresh copy of SMF 2 but got this error instead. Please advise.

The package you tried to upload either is not a valid package or has become corrupted.

nneonneo

Try the .zip file I just uploaded. It is identical, except that it uses ZIP format instead of TAR.GZ. Perhaps some hosts can't use .tgz.
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!

Fatality-

Thanks for the speedy reply. I can install it now, however I cant locate the settings for it in the ACP.

nneonneo

There are none :o

All major settings are done via the yshout/yshout.php file, and minor settings via yshout/js/yshout.js. There's a historical reason for this, though I am intending to write an ACP component for SMF 2.0 Final.
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!

crazyASD

Quote from: nneonneo on April 04, 2008, 05:57:55 PM
Huh? That's really bizarre! In index.template.php, change the line
var board_url = "'; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";
to
var board_url = "/forum";
and see if that fixes it.
I tried to change it to
var board_url = "/forum";
or
var board_url = "http://softmachine.ru/forum";
And it not takes any effect :(
In not wrapped forum it works fine.
It also fine works on another page:
http://softmachine.ru/forum/chat.php [nofollow]
Please help!

Advertisement: