News:

SMF 2.1.4 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

JohnnyMcKinney

#380
Hey how do I disable bbc code. Not all codes, but some I dont like going to the site and there being annoying by posting random images.....

Also can someone type out exactly how to use the impercinate feature I cant get it to work.

JohnnyMcKinney

#381
Quote from: nneonneo on December 28, 2006, 04:15:53 PM
Find
return $chatText.' '; // hack: totally empty responses can break some browsers in the readChat function and replace the line with
return str_replace("\n","\n<hr>",$chatText.' '); // hack: totally empty responses can break some browsers

Hope that helps.

Where is the readchat function located?

nneonneo

#382
@Johnny:
1) Disabling BBC: there are two spots in yshout/yshout.php where the code "[list]" (*with quotes*) is found. Add "[img" (no closing bracket) and whatever other tags you want to disable to *each* instance of the replacing code.
It should look a bit like this
str_replace(array("[list]",[*other replaces*],"[right]","[img")"",$newText));
It will disable images, but please do note that some raw BBC will show through (unless you do some more advanced PHP stuff, like adding preg_replace).
2) readChat is in yshout/yshout.php.
3) Type /help impersonate to get help on that command. [/list][/list]
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!

emrys01

Quote from: nneonneo on January 12, 2007, 02:41:03 PM

Quote from: Beatrix on January 12, 2007, 09:10:17 AM
How can I change the position of the shoutbox? I would like to place it under the top horizontal menu (  Forum Help Search Profile My Messages Calendar Members Logout) and just above the forums.
In index.template.php, try to locate the <div id="yshout"> piece of code (in between //YSHOUT HERE and //YSHOUT END so you know where to cut). Move that piece to another location, wrapping it in a div/table/what-have-you if desired. Voila, a moved shoutbox.

that's not sufficient.  you also have to modify the domFunction in index.template.php, to wit:


    var myfunc = new domFunction(function()
    {
        loadChat();
    }, { "yshout":"id"});


to remove all reference to the open/close state of any boxes/areas on the page.


kichu

How to Display the Moderators Colors in Shoutbox..

emrys01

Quote from: Sarke on February 13, 2007, 11:39:19 PM
I have one concern with the this shoutbox.  I've been using it for a few days now, and my logs are filled with "404 /yshout/yshout.php".  I realise that this is how the shoutbox works, but it's quite significant.

Just today, I have about 115,000 error messages logged because of the 404 that the shoutbox uses, and that's about 87% of the total hits on my site (today).  Put another way, the amount of requests increased by about 650%.

Isn't there another way of doing this?  Can't the server contact the client when a new shout is made, instead of the client having to check in all the time?

in my /etc/httpd/conf/httpd.conf file, inside the VirtualHost directive for the sites using this shoutbox, i replaced the line
CustomLog logs/my.access.log combined
   with
SetEnvIf Request_URI /yshout/yshout.php shout
CustomLog logs/amber-access_log combined env=!shout

  poof... no more /yshout/yshout.php 404s.

tsmalmbe

I added my shoutbox to the Boardindex, and it works OK. But the links (history, commands, etc..) open fullsize in the same window, which is really ugly. Like having a href with target="_top" that is. Where can i fix this? Woulöd it be possible to open the shoutbox in a new window? If I create  a new php-file in my theme with the shoutbox-stuff, would it be possible?
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

nneonneo

@Sarke: The "404" are due to a hack I had to do for Opera. Evidently, if I do not send a 404, but use a 302 (content not modified), Opera will repeatedly close and reopen the shoutbox. So, I had to resort to using 404 to prevent this behaviour. Also, sending the entire content of the shouts is a quick way to waste bandwidth, which is why I chose to use a 404 message (which uses much less bandwidth).

@tsmalmbe: Are you using 1.06? I thought I fixed that...
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!

tsmalmbe

Quote from: nneonneo on March 07, 2007, 02:19:25 PM
@tsmalmbe: Are you using 1.06? I thought I fixed that...

AMF 1.1.2 and SB1.0.6, yes.
..:: http://www.kontrollrummet.com - Studio och musik ::.. RSS?

Sarke

#389
Quote from: nneonneo on March 07, 2007, 02:19:25 PM
@Sarke: The "404" are due to a hack I had to do for Opera. Evidently, if I do not send a 404, but use a 302 (content not modified), Opera will repeatedly close and reopen the shoutbox. So, I had to resort to using 404 to prevent this behaviour. Also, sending the entire content of the shouts is a quick way to waste bandwidth, which is why I chose to use a 404 message (which uses much less bandwidth).

Thanks for being thorough and replying after such a long time, but you missed my point; a 304 (302 is "found" ;)) would still be logged, and it would still be a request to the server.  This can be very taxing on a server if there are lots of viewers of the shoutbox (as some replies in this thread show).  It is a resource heavy mod because of the short refresh rate.

My point was that it would be better if the server contacted the client instead.  Perhaps have a long timeout period where the client is waiting for info, and then the server can check on it's side if it receives a new shout and if it does send the new info.  If there's no new shout before the timeout period then just send a 404 and the client will send another request that starts a new timeout period.

Basically, put something like this in refreshChats().  I'm just thinking out loud and haven't really tested this, but you know what I mean:

<?php
$start_time time();
while (time() - $start_time 20 && $time == filemtime("$logDir/$chatFile"))
{
sleep(1);
clearstatcache();
}
?>


It would remove the need for a short refresh with the client since the checking would all be done server side.  Something like a timeout period of 60 sec would reduce the number of requests by a factor of 40.

My MODs          Please don't PM me for support, post in the appropriate topic.

kichu

Hi Sarke, I think u can help me . I already asked 2 times and again asking 3rd time.

How to Display the Moderators color in Shoutbox

Only Admin (red colour ) is showing, i want to display all the membergroups color in Shoutbox.

Ty in Advance

Sarke

#391
Quote from: kichu on March 08, 2007, 06:39:24 AM
Hi Sarke, I think u can help me . I already asked 2 times and again asking 3rd time.

How to Display the Moderators color in Shoutbox

Only Admin (red colour ) is showing, i want to display all the membergroups color in Shoutbox.

Ty in Advance

Since you asked so nicely... ;)

In yshout/yshout.php, find:


    $p_class = "";

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


replace with:


    global $user_profile;
    loadMemberData(array($user['id']));
    if (!empty($user_profile[$user['id']]['member_group_color']))
       $color = ' style="color: ' . $user_profile[$user['id']]['member_group_color'] . '"';
    elseif (!empty($user_profile[$user['id']]['post_group_color']))
       $color = ' style="color: ' . $user_profile[$user['id']]['post_group_color'] . '"';
    else
       $color = '';

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



This will make the shoutbox use the forum group colours.

My MODs          Please don't PM me for support, post in the appropriate topic.

kichu

#392
its working Sarke .. Ty very much. You helped me in two times, one is CPU Overloading Problem, second is Membergroup color.  :D Thx a lot Sarke.

DJ Rg

Hi

i just installed SB 106 ..where can i disable guest from reading or typing in the shoutbox?

Thanks much.

Rg

nneonneo

@DJ: in yshout/yshout.php, change allowGuests to false.
It should read
$allowGuests=false;
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!

DJ Rg

thanks nneonneo ..that seemed to do it ..do you have any other addons for smf ..you do great work..

:D


JSizzal

Hi maybe im just weird but when I open up a new page I get this where the shoutbox should be:
QuoteShoutbox loaded in another window. Retrying...

Any help on what to do!!! Thanks in advance!

DJ Rg

if your using tab browsing or have more than one browser/window open with more than one incident of the shout box ..it will say that in one incident. close the second incident.

hope that helps.

JSizzal

Yes I know, I meant if I wanted to have 2 (or more) different windows running the same shoutbox. How would I fix that.

DJ Rg

sorry cant help ya there ..nneonneo or someone could tho..


Advertisement: