News:

Wondering if this will always be free?  See why free is better.

Main Menu

nneonneo's Shoutbox

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

Previous topic - Next topic

natefish

#4520
The changes to the replies and posts are awesome! I love it! I have one last suggestion and I need help accomplishing it.

To help with the log file and html requests coming from the AJAX portion of the shoutbox I had an idea. How about a timeout type deal?

When someone hasn't posted to the shoutbox for 60s (or any set amount of time), I would like it to "turn off" and just show text that says something like "The shoutbox is in inactive mode. To leave this mode, click on the refresh button if visible, otherwise press the F5 key to reload you browser's page." Then this would keep the shoutbox disabled for that person until they refreshed the page, or went to another page.

That way if someone leaves the page open, but isn't necessarily using the shoutbox it turns it off and will stop sending html requests to that particular user.


Also, on the links for posts and replies, it opens them in another window. Is there a way to keep them in the same window?

zakwan

help me..
i got problem yesterday..
the SB working fine yesterday..
6 hour later i get this error

Warning: session_start() [function.session-start]: open_basedir restriction in effect. File(/home/motoxtre/tmp) is not within the allowed path(s): (/home/lenzacor:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/lenzacor/public_html/forum/yshout/yshout.php on line 42

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/lenzacor/public_html/forum/yshout/yshout.php on line 42

tommys67

#4522
Installed the AJAX SB yesterday (1.1.7) - works perfectly

My users LOVE it!

Thanks!

[my site - www.suspectsunlimited.com [nofollow]]

zakwan

for me it work fine about 1 week..
then i get there error on my SB

Warning: session_start() [function.session-start]: open_basedir restriction in effect. File(/home/motoxtre/tmp) is not within the allowed path(s): (/home/lenzacor:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/lenzacor/public_html/forum/yshout/yshout.php on line 42

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/lenzacor/public_html/forum/yshout/yshout.php on line 42

nneonneo

@freudlund: Different themes may differ in their treatment of the "box" style. I recommend that you read the manual install instructions for the AdvSB package, which will tell you basically how to install it to other themes, but the style may require tweaking to work on your theme.

@swampy: Edit the CSS (yshout.css) and reduce the width of #shout-text.

@F.L.A.M.E.R: Change what is in the makeShout function, for example
makeShout('[color=red]New Topic in board [url='.$scripturl.'?board='.$board.']'.html_entity_decode($boardName).'[/url]: [url='.$scripturl . '?topic=' . $topic . '.new#new'.']'.html_entity_decode($_POST['subject']).'[/url][/color]');

@natefish: For the same window, try "iurl" instead of "url".

For the periodic stop-refresh, I think it is doable in JS. Try this in yshout.js:
Replace
// Start refreshing the chat after a message has been sent
function shoutDone() {
startRefresh();
}

var refreshSet = false;

function startRefresh() {
if (!refreshSet) {
setTimeout("doRefresh()", refreshTime);
refreshSet = true;
}
}

function schedRefresh() {
if (refreshSet) {
setTimeout("doRefresh()", refreshTime);
}
}

by
var lastShoutTime=(new Date()).getTime(); // last time a shout was made
// Start refreshing the chat after a message has been sent
function shoutDone() {
lastShoutTime=(new Date()).getTime();
startRefresh();
}

var refreshSet = false;

function startRefresh() {
if (!refreshSet) {
refreshSet = true;
schedRefresh();
}
}

function pauseRefresh() {
$("shouts").innerHTML='<div id="refreshwarning">Automatic refresh halted. Click <a href="javascript:resumeRefresh()">here</a> to resume.</div>'+$("shouts").innerHTML;
refreshSet=false;
}

function resumeRefresh() {
lastShoutTime=(new Date()).getTime();
loadChat();
}

function schedRefresh() {
if ((new Date()).getTime() - lastShoutTime > 60000) {
setTimeout("pauseRefresh()", 50);
} else if (refreshSet) {
setTimeout("doRefresh()", refreshTime);
}
}


Change 60000 as necessary.

@zakwan: Please don't double-post. Try commenting out the three lines starting with session_: session_start(), session_write_close() and @session_start().
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!

InternetMafia

Is the smiley bar supposed to show as default in Advanced SB?  I cant get it to show at all.  Am I doing something wrong?
Its better to be dead and cool than alive and uncool.

nneonneo

@InternetMafia: Nope, it is not default with AdvSB. You should install it per the smiley guide.
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!

Final60

Heya I followed the guide to get the scroll bar to work, and it does seem to work here:
http://www.dcpryzom.co.uk/forum/index.php?yshout&action=forum&file=home&history

But it doesnt work at all in the actual block itself!

feel free to see it here www.dcpryzom.co.uk/forum
username: forest gump, password: test

Im using v1.21

Ive attached the files if you like to take a look :)


nneonneo

You need to edit index.template.php to add the "height:" code.
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!

Final60

#4529
Thanks  the scroll bar show up now, but if i set the width to anything wider then about 550px it disappears. Id like it to sit on the right edge of the center block.

Also how can i change the amount the scroll bar scrolls up?

nneonneo

It disappears because the sizes you chose are large enough to fit the whole shoutbox, so the scroll bars are unnecessary.

You could try shrinking the height: until the scrollbar becomes necessary, or just add more shouts via $maxLines.
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!

bavica

hello nneonneo, You Shoutbox is beautiful

I am using smf 1.1.7 and hxxp:tinyportal.today [nonactive] i Installed sb 1.22 and done editing for my theme.i added the instant add-on code to the one of the article in the tpblock. The shoutbox appeared,but when i entered to shout,nothing happening and shoutbox is inactive. i tried default smf 1.1.6 code to article also ,but it just showing "shoutbox is loading" but nothing happens. Sir plzz solve my problem

if u want to see u can visit my forum hxxp:www.hyderabadrockerz.com [nonactive]

user: test123
pass: test

Waiting for ur reply  :)

Final60

Quote from: nneonneo on January 19, 2008, 11:01:07 AM
I'm reposting pongsak's smiley guide because the recent server crash has deleted the smiley.php attachment.

Quote from: pongsak on August 18, 2007, 11:10:08 PM
For adding smiley .Let's go.
1. Adding 1 line of script between <head> and </head> index.template.php  .


<script src="',$boardurl,'/mymod/animatedcollapse.js" type="text/javascript"></script>


This file will create sliding effect.

2. Create "mymod" dir in root forum dir and put the attached animatedcollapse.js in that dir.

3. download smiley.php and safe in mymod dir. (download smiley_SMF2.php instead for SMF 2.x, but name it smiley.php)

4. Search after in index.template.php or boardindex.template.php depend on where u put shout box.

<div id="yshout"', empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>
or
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>
or
<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>

   add

<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';
require('mymod/smiley.php');
loadSmileys();
echo '
<div id="smiley_pic">';
printSmileys('shout_form','shout_text');
echo '
</div>
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse1=new animatedcollapse("smiley_pic", 1000, false)
</script>
</div>

NOTE: Don't put it after the '; or it will not work!

5. Open yshout.php for namely some input.

find and replace (up to 4 times)

*id="shout-form"

with

*id="shout-form" name="shout_form"

find and replace (up to 4 times)

*id="shout-text"

with

*id="shout-text" name="shout_text"

That's it.  :D



EDIT [Feb 4 2008]: Updated a few instructions. Changes are noted in red, changes to code marked with a red *.
EDIT [June 22 2008]: Clarified instructions.
EDIT [June 27 2008]: Add 1.20 instructions.
EDIT [June 29 2008]: Moved animatedcollapse.js to an attachment, added a version of smiley.php for SMF 2.x.
EDIT [July 15 2008]: Clarified a common error.


Does this work for v1.21?

Threepwud

Hi nneonneo - thanks for your advice so far on previous matters.

I'm currently having big issues with my site. A while ago I mentioned that I installed simple portal and you got the shoutbox to work for me by having added some code somewhere (can't remember where, sorry). It still works but I am getting this message on the shoutbox - Undefined index: sp-forum in /home/hldrforu/public_html/forum/Sources/Subs.php on line 3901

The error log is pretty much being filled constantly by this and I have just received an e-mail from my host telling me off - http://hldrforum.com/02-12-2008-hldrforum.com.jpg saying I am using far too much cpu time.

I think the error logging would cause this (do you think?). I need to know how to stop this error from logging and would you also have any other tips for easing the cpu load? The bandwidth is not a problem.

Many thanks for any info you might have.

Cheers,

Steephh

Quote from: Steephh on November 17, 2008, 03:58:51 PM
Quote from: nneonneo on November 14, 2008, 03:40:44 PM
@HR, Steephh: No limit, no reset. You will have to clear it manually.

@bfeo: The guide also reduces the number of simultaneous connections.

Uhmm.... This was just a reply to your question if my history was empty.

http://www.simplemachines.org/community/index.php?topic=137508.msg1794603#msg1794603

Thx anyways :)

@nneonneo:

You won't help me anymore?  :'(

If you want to help: look at my history:

http://www.simplemachines.org/community/index.php?action=profile;u=181542;sa=showPosts

You can try making an account on the forum:

http://forum.peellan.nl/ [nofollow]

swampy

#4535


I finally got what I wanted and it is all due to nneonneo 's patience and assistance.

Thanks for everything!!!!

By the way, where do we find the wonderful select code and copy mod for smf 2 beta 4?

Again much thanks for all you do!!!!!!!!!!!!

nneonneo

@bavica: the <head> code in that theme is from an older version. You should just remove it and replace it by newer code (in index.template.php)

@Final60: It should (I have tested it and it works for me)

@Threepwud: One thing you can try is just to stick "$txt['sp-forum']='';" in Modifications.<language>.php (better yet, find out what it should say, and add that to the Modifications language file). For CPU usage, try disabling $gzipCompression if you haven't already, and, if your host allows it (script max execution time), increase $updateTimeout (the timeout loop uses very little CPU, only some memory to keep the process alive)

@Steephh: if you are getting a blank History page, try chmod'ding the history.home.txt file to 755. Sorry I missed you last time.
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!

Savvra

If I try to delete anything from the shoutbox using the admin links I get the error

"Session verification failed. Please try logging out and back in again, and then try again"

No matter how many times I relog I stil get the same error.  I'm the admin of the forums and I'm using 1.22 and my smf stuff is all up to date.  Any suggestions?

Steephh

That did the trick! Thank you! :-*  :P :P


Final60

Quote from: Final60 on December 02, 2008, 01:26:40 PM
Quote from: nneonneo on January 19, 2008, 11:01:07 AM
I'm reposting pongsak's smiley guide because the recent server crash has deleted the smiley.php attachment.

Quote from: pongsak on August 18, 2007, 11:10:08 PM
For adding smiley .Let's go.
1. Adding 1 line of script between <head> and </head> index.template.php  .


<script src="',$boardurl,'/mymod/animatedcollapse.js" type="text/javascript"></script>


This file will create sliding effect.

2. Create "mymod" dir in root forum dir and put the attached animatedcollapse.js in that dir.

3. download smiley.php and safe in mymod dir. (download smiley_SMF2.php instead for SMF 2.x, but name it smiley.php)

4. Search after in index.template.php or boardindex.template.php depend on where u put shout box.

<div id="yshout"', empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>
or
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>
or
<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>

   add

<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';
require('mymod/smiley.php');
loadSmileys();
echo '
<div id="smiley_pic">';
printSmileys('shout_form','shout_text');
echo '
</div>
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse1=new animatedcollapse("smiley_pic", 1000, false)
</script>
</div>

NOTE: Don't put it after the '; or it will not work!

5. Open yshout.php for namely some input.

find and replace (up to 4 times)

*id="shout-form"

with

*id="shout-form" name="shout_form"

find and replace (up to 4 times)

*id="shout-text"

with

*id="shout-text" name="shout_text"

That's it.  :D



EDIT [Feb 4 2008]: Updated a few instructions. Changes are noted in red, changes to code marked with a red *.
EDIT [June 22 2008]: Clarified instructions.
EDIT [June 27 2008]: Add 1.20 instructions.
EDIT [June 29 2008]: Moved animatedcollapse.js to an attachment, added a version of smiley.php for SMF 2.x.
EDIT [July 15 2008]: Clarified a common error.


Does this work for v1.21?

Heya
Im having trouble doing step 4 in this guide. I cant find any of the 3 markups that it asks me to find in my index.template.php.
attached is my index.template.php file

Advertisement: