News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

nneonneo's Shoutbox

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

Previous topic - Next topic

nneonneo

Aha.

The code you've entered isn't quite correct. Below is the code as it is in the file...
// If you want to put some ads or something on your pages, add them in this.
echo '
<div id="blank-box">
// YSHOUT HERE
echo '
<br /><b>Shout Box</b><br /><br />
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
// YSHOUT END

</div>';

...and how it probably should be.
// If you want to put some ads or something on your pages, add them in this.
echo '
<div id="blank-box">';
// YSHOUT HERE
echo '
<br /><b>Shout Box</b><br /><br />
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
// YSHOUT END
echo'
</div>';
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!

Chalk

Ah, I see what was wrong now. I'm still pretty new to some languages, like php for example.

Btw, is there a way to not let guests shout anything? I saw a few links that retricts it to membergroups but wasn't sure which one would achieve the thing I want. Basically all members can use it, but just not the guests.

nneonneo

$allowGuestsPost - set it to false and guests will be barred from posting.

If you set $allowGuests to false, then guests will be presented with "You must be logged in to use the shoutbox!" instead.
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!

sudip

I'm using SMF 1.1.4 version and I Installed shoutbox in my forum and i installed SB_1.11.tgz package in my forum.. but  my problem is that it only shows "Loading shoutbox" but the shoutbox  doesnt loads.. how can i fix the problem.. please help me..

nneonneo

Odd, I thought I fixed that, though sometimes there are many causes.

First, try to chmod yshout/yshout.php to 755 or 777.
If that doesn't work, look in your server error logs for errors.
Finally, if neither of those turn up anything, post or PM your forum URL and I'll take a look.
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!

Bulakbol

Hi nneonneo. The shoutbox work perfectly and formatted the way I wanted.  Shout messages scroll up which is ok. The only thing I wanted is to display the <hr> after the shout messages and not before.  Is there a way to do that?

Thanks for the mod. It's great.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

nneonneo

<hr> before and not after? Hmm...probably just a case of adjusting the \n<hr> or similar code.

Post your "readChat" function. It starts with
function readChat($chatFile, $logDir) {
and ends with
   return $chatText.' '; // hack: totally empty responses can break some browsers
}
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!

Bulakbol

Thanks for the quick reply nneonneo. Here's part of the readChat function.


$chatText=preg_replace_callback("/\[<timeval=(\d+)>\]/",create_function('$matches','return "";'),$chatText);
// $chatText=preg_replace_callback("/<timeval=(\d+)>/","preg_timeformat",$chatText);
$chatText=implode("\n", (array_reverse(explode ( "\n", $chatText )))); // will reverse display from top to bottom
// return $chatText.' '; // hack: totally empty responses can break some browsers
return str_replace("\n","\n<hr>",$chatText.' ');  // hack: totally empty responses can break some browsers


The "last line" (for now) is sorrounded with <hr>. It looks ok but I feel like it's not the right way.


return str_replace("\n","\n<hr>",$chatText.'<hr>');  // hack: totally empty responses can break some browsers



Merry Christmas!
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

nneonneo

The extra hr at the top is due to the trailing \n at the end of the file.

To fix, use
$chatText=implode("\n", array_reverse(explode ( "\n", trim($chatText)))); // will reverse display from top to bottom

trim will remove the extra newline.

Also, for a tiny efficiency boost, use
implode("\n<hr>"...
return $chatText...
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!

Bulakbol

It work! Thanks a lot nneonneo. 

One last thing  ;) I want the history in another page. 

My members don't call this shoutbox. They call it chatbox. They use it for chatting which is great. Thanks again nneonneo.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

nneonneo

The history in another page? Do you mean as in opening in a separate window?

If that's the case, then change (in yshout/js/yshout.js)
function goTo(args) {
document.location=yshout_php+'?'+args;
}

to
function goTo(args) {
window.open(yshout_php+'?'+args);
}
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!

alobar

hi nneonneo,
thanks for this great mod. i ve been looking for it for a long time.
I have smf 1.1.4 and using 7dana theme in turkish.
I tried it at local, there was no problem. then uploaded the server. it works fine but
I am getting an error:

http://mydomain/index.php?action=viewErrorLog;desc 
8: Undefined index: path
Dosya: /home/xxxxxxx/public_html/Themes/default/Errors.template.php (eval?)
Satır: 107

please help.

nneonneo

hmm...odd...

Try this: in Themes/<themename>/index.template.php, change
var board_url = "'; $boardurlparsed = parse_url($boardurl); echo $boardurlparsed['path'], '";
to
var board_url = "/";
(assuming your forum is at http://mydomain/ and not in a subdirectory)
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!

alobar

#1413
I ve tried it
var board_url = "/";
but it gives error again..

then I tried

var board_url = "http://www.mydomain.com/";

it gives no error now. is the code ok? please inform me if anything I did wrong. thanks.

is there a way to delete all history. I mean without loggin in to server and deleting history.home file.

nneonneo

Did you actually put the brackets in? That doesn't seem right (without the brackets, it would work fine).

As for deleting all history: no, I don't have an option for that (mainly to avoid people accidentally zapping all their history when they meant to /clear)
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!

Bulakbol

The hr work like a charm nneonneo. Thanks a lot. It's working perfectly. One last thing...  :P Just kidding. I am ok now. Great job and great support.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Andy134

Hmm, I'm getting that error: "parent.document.sbox.ts is null or not an object" everytime I post in the shoutbox. What do I do to fix it?

nneonneo

@JohnyB: Glad to hear it all works.
@Andy134: I don't have "sbox" or "ts" in my shoutbox (an error like that would refer to "yshout"). Perhaps you have a different shoutbox installed?
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!

Andy134

Oops sorry. Lol, posted this in the wrong shoutbox mod topic :P. Meant to put it in the other one. Sorry xD

alobar

I could not find a way to delete history from server.  how can I empty history.home.txt ? I used ftp client, cpanel file manager but it did not work. I cant change file permissions of this file also.

Advertisement: