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

Adish - (F.L.A.M.E.R)

Quote from: SunKing on September 26, 2008, 10:17:39 PM
@F.L.A.M.E.R.

I had this happen to my site and found that it was more than one javascript using a form of the onload event handler.  Nneonneo found this page that really helped me understand.


Its a bit long.. but i will read it out. Well can you try the solution for the 1st problem ?

popabawa

Hi, Sorry if this is an obvious one...

Just instaled the most recent advanced Shoutbox which works perfectly but I'd like to get rid of the 2-line display back to the 1-line display, can anyone help me?

Rafferty

Don't Follow me I got No Idea what I'm Doing

Shadis

I've been trying to get a scroll bar to appear in the shout box, I have it on default settings within a 1.15 install (haven't upgraded yet) and I've followed the instructions here... but I find it's not working... I'll post code blocks as needed if desired to help me trouble shoot, just let me know from where and what you need to get this scroll bar to function.

picos

#3964
nneonneo

When deleting I get this error
Session verification failed. Please try logging out and back in again, and then try again.

my forum is at www.err-clan.com/forum/

Thanks for any help


I have noticed that I get this error on login which might explain the above error
An Error Has Occurred!
You were unable to login. Please check your cookie settings. 


I have checked my server settings and followed the help in this post
http://www.simplemachines.org/community/index.php?topic=239613.msg1545009#msg1545009

but that never helped

pipo_il_primero

#3965
Hello again all,
I need your help again with three (yes I know...) very small questions... Here it goes:

1- How can I make the "help", "history", and "extended history" links to be opening in new windows when clicked upon?

2- How can I increase the size of input box?

3- How can I increase the size of the FONTS of the input box?

Also, sometimes there's a cursor blinking in the input box (which is great help for correcting text), sometimes not. Why?

Many thanks!

edit: just for info, I have version 1.21 installed.

zach21uk

I tried to install the Advanced Shoutbox on the next Beta 4 version, and got the following errors:


mathmission

nneonneo -

Tried your suggestion, still didn't work. Came back with just the header, and a message that says:

QuoteShout Box

Nothing to do.

Nequil

Quoteglobal $ip;
if(!isMod() && preg_match($ip, file_get_contents($chatPath))>3)
{
   echo "Sorry, you've already posted 3 messages...";
   return;
}

Quoteyshout/yshout.php

nneonneo: I know, I must paste this to to writeLine(), but I don't understand where... please help... in which line....

machmanx

Hey, the shoutbox works fine, but sometimes it lags.  Been getting this error a lot:-

PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 4971099 bytes) in (url)/forum/yshout/yshout.php on line 716

So, I just added this line to the top of yshout.js:-

ini_set("memory_limit","40M");

Hopefully, that will fix the issue.  Now, my next problem is this:-

Undefined index:  yshout_shoutbox in /(url)/forum/Sources/Load.php(1927) : eval()'d code on line xxx

How do I fix this?



nneonneo

Oh my. I was ill over the weekend, so I apologize for not responding...

@yoeri: And the window.onload fix did not help? That is odd, because I just tested it and it worked for me.

Nevertheless, it is not hard to remove the error by changing IE settings. Go to Tools -> Internet Options -> Advanced -> Uncheck "Display a notification about every script error" (I am using IE 8, so it may look a bit different for you). This option should be near the "Disable script debugging" option.

@F.L.A.M.E.R: Try turning off gzipCompression -- it should make the history work and possibly solve the collapsing issue. As for the Session bug, I would need an account which can delete shouts to check.

@Rafferty, popabawa: Two options: one, you install SB_1.21 (the regular shoutbox), or two, you edit the output and CSS to make it one-line:
First, edit yshout/settings.php. Change
return '&nbsp;&nbsp;&nbsp;'. timeformat(intval($matches[1]), true).'<br />';
to
return '['.timeformat(intval($matches[1]), true).']';
Second, edit yshout/yshout.php. Change
return str_replace("\n","\n<hr class=\"shout-separator\" />",$chatText.' '); // hack: totally empty responses can break some browsers
to
return $chatText.' '; // hack: totally empty responses can break some browsers

@Shadis: What does the CSS block look like?

@picos: Hmm, it kind of sounds like the same problem as F.L.A.M.E.R. I don't know why this happens. I added some protection against hacking in the latest version (otherwise users may be able to delete shouts without permission). As long as the shouts were generated on 1.21 and the shoutbox is 1.21, it *should* work, but I think the login problem may have something to do with it. Are you at least able to delete forum posts? How about shoutbox bans?

@pipo_il_primero:
1) edit yshout/js/yshout.js, change
function goTo(args) {
if(request) request.abort();
document.location=getURL(args);
}

to
function goTo(args) {
if(request) request.abort();
window.open(getURL(args));
}

2,3) edit the CSS block (yshout.css for AdvSB, index.template.php for SB), #yshout #shout-text -> width for 2, #yshout -> font-size for 3.
About the cursor: I don't know. Maybe it is your browser, maybe it is because of the background color. Try removing "background: #FFFDD1;" from the CSS.

@Nequil: Right at the top of the function (i.e. after {)

@mathmission: Err...that should really never happen. Is yshout.js the right version?

@machmanx: Replace
$txt['yshout_shoutbox']
in index.template.php by the text "Shoutbox".

Alternatively, you can stick the line "global $txt;" above the echo line containing the $txt.



Revised Beta 4 installation instructions!

First, it is likely that many, if not all, of the theme edits will fail to go through. This is because various changes have been made to the theme system and the templates, changing all the anchors which were previously used.

You should make the edits manually, at least until I can roll out a new version (but it seems that the theme changes may continue, so I might wait until beta 5 or final to release a new version). The anchors have not changed so much as to make them unrecognizable, so it is still possible.

You will also have to apply a patch to the shoutbox to make it functional. This is due to changes in SMF's string handling library, on which my shoutbox depends to do text processing.
See http://www.simplemachines.org/community/index.php?topic=137508.msg1697317#msg1697317 for the details.
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!

machmanx

Quote from: machmanx on September 30, 2008, 08:58:24 PM

PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 4971099 bytes) in (url)/forum/yshout/yshout.php on line 716

So, I just added this line to the top of yshout.js:-

ini_set("memory_limit","40M");


Well, after adding this, I've been getting an "Object Expected on Line 4" error, because that's where I inserted the above code.  What am I doing wrong?

meyersmp

Is there a way to make shouts expire after a period of time rather than after a certain number of other shouts have happened?

My forum doesn't get a ton of traffic so it would be nice if old shouts expired after a period of 20 minutes or something. I'm looking in the yshout.php file for the right place. I can't seem to find how old shouts are archived and add a time feature to it.

Any help would be appreciated. Thanks in advance.

nneonneo

@machmanx: Wait, on yshout.js? JS doesn't affect PHP scripts. You might want to try adding it to yshout.php

How big is home.txt? You probably should not have more than 1000 chats there. If it is very big, I recommend you archive it, which should prevent the error from happening. If it happens on the history page, try archiving history.home.txt.

@meyersmp: Above the line
$chatText=preg_replace_callback("/<timeval=(\d+)>/","preg_timeformat",$chatText);
add
$minTime = time()-20*60; // 20*60 is number of seconds, in this case, 20 minutes
$chatText=preg_replace_callback("/<p[^>]*>.*<timeval=(\d+)>.*\n/",create_function('$matches','if(intval($matches[1])>'.$minTime.') return $matches[0]; else return "";'),$chatText);


Both $maxLines and the time limit will apply to a given shout (i.e. if more than $maxLines shouts are made in a 20-minute interval, the oldest will not be shown even if it is within 20 minutes). This code basically sets a minimum threshold for the time (current time minus 20*60 seconds, i.e. 20 minutes, which you can easily change), then runs a function over each shout which hides it if it is too old.
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!

Nequil

#3974
dammit... @nneonneo can you paste this code to my yshout.php?... please I can't do this...

global $ip;
if(!isMod() && preg_match($ip, file_get_contents($chatPath))>3)
{
   echo "Sorry, you've already posted 3 messages...";
   return;
}

fofobody

Can someone help me? All I need to do is change the title of my Shout Box to something else. I can't seem to find where this is defined.. Thanks in advance.

meyersmp

Quote from: nneonneo on September 30, 2008, 11:06:14 PM

@meyersmp: Above the line
$chatText=preg_replace_callback("/<timeval=(\d+)>/","preg_timeformat",$chatText);
add
$minTime = time()-20*60; // 20*60 is number of seconds, in this case, 20 minutes
$chatText=preg_replace_callback("/<p[^>]*>.*<timeval=(\d+)>.*\n/",create_function('$matches','if(intval($matches[1])>'.$minTime.') return $matches[0]; else return "";'),$chatText);


Both $maxLines and the time limit will apply to a given shout (i.e. if more than $maxLines shouts are made in a 20-minute interval, the oldest will not be shown even if it is within 20 minutes). This code basically sets a minimum threshold for the time (current time minus 20*60 seconds, i.e. 20 minutes, which you can easily change), then runs a function over each shout which hides it if it is too old.

Thanks nneonneo. It worked great for limiting the time each is shown. I found that this also removes 20 minute old shouts from the history as well. Is there a way to keep the history with this time hack?

Ditron

Hello!

Is it possible, to move the SB on another place (standart theme)? The SB should appear below the topics.

Adish - (F.L.A.M.E.R)

Quote from: nneonneo on September 30, 2008, 10:00:03 PM
@F.L.A.M.E.R: Try turning off gzipCompression -- it should make the history work and possibly solve the collapsing issue. As for the Session bug, I would need an account which can delete shouts to check.

PM'ed you the details (admin login). Kindly do it all if possible. It has all the admin account permissions.

meyersmp

@fofobody In the index.template.php file of your theme find

<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />

and change to

<br /><b>Your new name here</b><br /><br />

Advertisement: