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

Spike Saunders

Not sure what happened. I upgraded to 1.08, but got error sayin the shoutbox was open in another window. Error wouldn't go away to i uninstalled 1.08 and reinstalled 1.07. I still get that error. And in no way is my shoutbox open in another window! lol just using Firefox, nothing else opened.

Any idea what's up? It almost sounds like since it's being kept allive, it thinks the box is still open even after uninstalling?

husmen73 (Gulhin)

~nneonneo

I have installed your modification, its working on default theme, but I didnt work on another theme. I added some codes from default/index.template.php to mytheme/index.template.php about Ajax Chat

Only seems,
Quote
Shout Box

...loading shoutbox...
-Kurumsal Kimlik Web Tasarım Hizmeti.
Gülhin Portal Sistemi hakkında yorumlarınızı bekliyorum.
SMF
Referanslar --> http://www.gulhin.com/referanslar-portfoy/
-Web Tasarımı ve Tema Tasarımı Sitesi www.gulhin.com
-TOPLU MAİL GÖNDERİMİ --> http://www.toplumailsms.com
E-Ticaret Sistemi yaptırmak mı istiyorsunuz?

brianjw

#782
husmen73: Did you use the custom theme instructions on the modsite page for this? I will post them here for you....


Find:

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

Add After:

// YSHOUT HERE
global $boardurl;
echo '
<script src="',$boardurl,'/yshout/js/prototype.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/behaviour.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/domFunction.js" type="text/javascript"></script>
<script type="text/javascript">

var myfunc = new domFunction(function()
{
',empty($options['collapse_header']) ? 'loadChat();':'','
}, { "yshout":"id"});
var board_url = "', $boardurl, '";

</script>
<script src="',$boardurl,'/yshout/js/yshout.js?Mar42007" type="text/javascript"></script>
<script type="text/javascript">var shoutFile = "home.txt";</script>
<style type="text/css">
#yshout {
font-size: 10px;
}
#yshout p {
margin: 0 0 0; /* Top Bottom Linespacing */
}
.shout-invalid {
background: #FFFDD1;
}
#yshout fieldset {
border: none;
}
#yshout em {
font-style: normal;
}
#yshout p {
line-height: 1;
margin-top: 0;
}
#yshout {
overflow: hidden;
}
#yshout .shout-timestamp {
font-weight: normal;
color: #000;
}
#forum-name, #shout-text, #shout-button {
font-size: 9px;
margin: 0;
padding: 0;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
color: #000000;
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#shouts .owner a {
color: #F00;
}
#shouts .moderator a {
color: #00F;
}
</style>';
// YSHOUT END

Find The Desired Location of Shoutbox and place:

// 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


And sometimes custom themes include there own modifications.english.php (if your theme doesn't have this then don't follow this step.
Add before ?>

// ---- Begin modification - nneonneo's Shoutbox ----
$txt['yshout_shoutbox'] = 'Shout Box';
$txt['yshout_loading'] = '...loading shoutbox...';
$txt['yshout_rp_banned'] = "Sorry, you've been banned from the shoutbox.";
$txt['yshout_no_guests'] = 'Sorry, you must be logged in to use the shoutbox!';
$txt['yshout_ban_conf'] = 'Ban Confirmation';
$txt['yshout_select_mode'] = 'Select Ban Mode:';
$txt['yshout_rp'] = 'Reading and Posting';
$txt['yshout_p'] = 'Posting only';
$txt['yshout_error'] = 'ERROR: ';
$txt['yshout_no_user'] = 'User not found.';
$txt['yshout_del_success'] = 'Shout deleted.';
$txt['yshout_no_action'] = 'Nothing to do.';
$txt['yshout_history'] = 'History';
$txt['yshout_commands'] = 'Commands';
$txt['yshout_exthistory'] = 'ExtendedHistory';
$txt['yshout_hide'] = 'Hide';
$txt['yshout_show'] = 'Show';
$txt['yshout_admlinks'] = 'AdminLinks';
$txt['yshout_return'] = 'ReturnToShoutbox';
$txt['yshout_p_banned'] = 'You are banned from posting.';
$txt['yshout_banned'] = 'Banned';
$txt['yshout_shout_button'] = 'Shout!';
$txt['yshout_banlist_caption'] = 'Shout Box Bans (click to unban)';
$txt['yshout_ip_bans'] = 'IP Bans for ';
$txt['yshout_username_bans'] = 'Username Bans for ';
$txt['yshout_ban_type_error'] = 'use /banuser or /banip!';
$txt['yshout_ban_mode_error'] = 'Must have mode argument.';
$txt['yshout_imp_slash_error'] = 'Prefix shout with "/" (slash character)! See "/help impersonate" for details.';
$txt['yshout_imp_uname_error'] = 'No username given!';
$txt['yshout_imp_max4_error'] = 'Maximum 4 arguments!';
$txt['yshout_cmd_reference'] = 'Command Reference';
$txt['yshout_cmdlist'] = array( '/help'    => ' [command]: Help on a command, or all if no command is specified.',
'/return' =>    ': Go back to the Shout Box.',
'/pi' =>    ' [digits]: What is the value of pi to the nth digit?',
'/me' =>    ' &lt;message&gt;: Emotes the message (e.g. <font color="red"> * Nathaniel likes dogs</font>)');
$txt['yshout_cmdlistadmin'] = array('/clear' =>   ': Completely empty the Shout Box.',
'/help'    => ' [command]: Help on a command, or all if no command is specified.',
'/return' =>    ': Go back to the Shout Box.',
'/banlist'   => ': List all bans currently in place. Unban the users by clicking on their names.',
'/banuser'   => ' &lt;mode&gt; &lt;username&gt;: Ban a user by name. You should use the user\'s real username, otherwise the ban can be evaded. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/banip' =>   ' &lt;mode&gt; &lt;IP&gt;: Ban a user by IP. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/impersonate'=>' &lt;user&gt; [userlevel] [ip] [userid] /[shout text]: Impersonate a user. Shout text must be prefixed by a "/" or else it will fail.<blockquote>
&lt;user&gt;: Username to use<br />
[userlevel]: User Level to use. 0=normal, 1=mod, 2=admin<br />
[ip]: IP address to use, as 1.2.3.4<br />
[userid]: User ID from forum, to fix profile link</blockquote>');

// ---- End modification - nneonneo's Shoutbox ----


Brianjw :)

bobbbb


Spike Saunders

Guess I am the only one that is having issues with 1.08, lol.

husmen73 (Gulhin)

#785
~brianjw

I know manuel setup but I dont understand why it isnt working :S

You can look on attachment.

[if I upload default/index.template.php, its working]
-Kurumsal Kimlik Web Tasarım Hizmeti.
Gülhin Portal Sistemi hakkında yorumlarınızı bekliyorum.
SMF
Referanslar --> http://www.gulhin.com/referanslar-portfoy/
-Web Tasarımı ve Tema Tasarımı Sitesi www.gulhin.com
-TOPLU MAİL GÖNDERİMİ --> http://www.toplumailsms.com
E-Ticaret Sistemi yaptırmak mı istiyorsunuz?

comptech

#786
"Test Failed" on index.template.php when trying to apply this mod (v1.08) to SMF v1.1.3 on default theme.

Any idea why this is so?

to nneonneo:
I have emailed you my index.template.php file.

nneonneo

@Spike: Very odd, considering that 1.08 has the code for duplication checking disabled by default, so this shouldn't happen at all, *unless* there is a very aggressive caching system on your server or client (which is caching the 1.07 Javascript).

I would try clearing the browser cache and see if that helps. I have also seen problems where intermediate proxy servers would cache the data, even if it was out of date, so try that as a "last resort".

Finally, the cookie "yshout_open" controls that duplication check; removing it may help.

@bobbbb: Good to hear :)

@husmen73: It may be a caching problem; change Mar42007 to Jun222007 and see if that works. I've also updated the instructions to reflect that change.

@ruelnov: Resend it as an attachment (it was truncated for some reason)
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!

Spike Saunders

Thank nneon, I've already decided to uninstall the mod manually as a whole. And then reinstall 1.07 and try the upgrade again afterwards. :) Haven't got around to taking the code out yet, just the template stuff so it quit showing on the board lol.

cru

hi, i just installed 1.08. on the default theme of smf1.1.3. i have no other mod aside from pretty url.

but what i see on my shoutbox is

...loading shoutbox...

pls help me.

nneonneo

@Spike: there is no upgrade... 1.08 must be installed over SMF without 1.07. However, the linking code for 1.07 works for 1.08 (though browser caches should be cleared), with the minor change that "Mar42007" should be changed to "Jul222007" to force a cache update.

@cru: No idea -- have you checked server error logs?
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!

comptech

nneonneo:

resent as an attachment already.

hoping to get your reply then.

Thanks.

Spike Saunders

Yeah I had to do a complete uninstall. Then installed 1.08. SEems to be all working now.

Any luck with adding an anonymous function?
Or scroll bars for the main chat window?

My users would like to be able to scroll the chat instead of checkin the history, since it's used so often. Heh. Maybe ability to scroll back the last 50 or so entries? The rest just have to go check the history?

nneonneo

For scroll bars, here's what you would do: Change the CSS in index.template.php.
Specifically, change #yshout {
overflow: hidden;
}

to
#yshout {
height: 200px;
}


This *should* force the height to be constant, while permitting scroll bars to appear. Then, just change max_lines in yshout.php.
This is entirely untested, and I don't know how usable it would be.

As for an anonymous function: I just realized the easiest way to do this would *probably* be to implement it as a command, so, for example, to be anonymous, the user would enter "/anon <message>". This can be implemented quite easily; just let me know if this is desirable.
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!

Spike Saunders

#794
I tried the css you mentioned. Found that didn't do anything. But if you change overflow: hidden to overflow: scroll, the scrollbars appear. And if you add in the height as well, it works nicely. But... the problem is it makes the whole area scroll, and the chat entry box shouldn't, that should stay put. lol i might have to tinker with that.

As for the anonymous function, that would work well. Any way to make it so if you clicked a checkmark box next to the shout button, it would automatically add the /anon into the field, and then people just have to write after that? :)

Edit: Also, I don't know why, but permission is denied when trying to do anything inside the yshout folder, lol. I can't delete the files, edit them, or even replace them. The chmod's 755, which should still give that ability. So not sure why that's the only folder like that lol.

jossanaijr

Hi,
just installed on 1.1.3 but I did not understand if I can limit shoutbox only to registered users.

Zenboy

#796
Cru:

I had the same issue on my live forum after bumping up to 1.0.8. So, I installed a brand new instance of SMF 1.1.3 in a new directory to try and figure out what was going on. This was the situation:

Brand new instance of SMF 1.1.3 (no mods)
Brand new install of nneonne's shoutbox 1.08
Installation via package manager (proper chmods in place)
Installer said it was successful, but all I saw was ....loading shoutbox...

I investigated the mod.english & englishUTF8 as well as the index.template. All looked well, but it just wasn't working. I removed the mod, which was successful. I know this because I went back through the previously mentioned files to make sure the entries had been removed.

I had at it one more time, this time using 1.07... NO LUCK. I used the same checks and balances to make sure the install had actually worked. It had, all entries were correct. I un-installed, and double checked the files to make sure 1.0.7 had been removed.

Now I moved onto a manual install. I ran 1.08 through the package parser to gain the instruction set. I followed the edits to the "T". As well, I created the "Yshout" directory myself and its subdirectories as well. I then individually uploaded each directories contents.

Bingo! The shoutbox was working. But why didn't this work for the package installer. I was still curious...
I removed the successful install and tried to use the package manager again. Interestingly enough, even though the chmod levels were correct, the yshout directories files were not being populated with the code that runs the program. Those files in the directory were completely empty...

I had to resolve that my server and the package installer are not happy with each other...

At the end of the day, I'm thinking this might help you as well... Do the install by hand, even creating the directory structure and populating those directories with the appropriate files.

Now if I could just figure out why it refreshes fine in Mozilla, but not at all in IE. All of my IE users have to manually refresh the shoutbox by entering a character. Again, Mozilla is fine, although the entire shoutbox window collapses in between new shouts...I wish it just stayed open.

FYI... I run SB 1.0.8 with Tinyportal... It's in a center block, which I really like...looks great. Thanks for the TP instructions and the excellent SB nneonne.

Best Regards,

Zenboy

nneonneo

@Spike:
The folder might be 755, but are the files 755 as well?

I suppose, to make just the shouts work, you could try using
#yshout #shouts
instead of just #yshout (all shouts are contained in #shouts div)

For anonymous function, in processUserCommand, add the following code before "default:" (around line 550):
case "/anon":
$fakeuser=array('id'=>0,'name'=>"Anonymous",'is_admin'=>0,'is_mod'=>0,'is_logged'=>0); // fake SMF $user array
writeLine($chatFile, $logDir, $args, $fakeuser);
truncateChat($chatFile, $logDir, $max_lines);
echo readChat($chatFile, $logDir);
return true;

Then, after
<input id="shout-button" type="button" value="',$txt['yshout_shout_button'],'" />
add
<input id="anon-button" type="button" value="Shout Anonymously" onClick="$(\'shout-text\').value=\'/anon \'+$(\'shout-text\').value;doSend();" />

It's not a checkbox (it's a button), but hopefully that fulfills your need. You'll want to style the anon-button ID (#anon-button), if you've made modifications to the CSS for shout-button.

@jossanaijr: In yshout/yshout.php, change $allowGuests to false.

@Zenboy: Wow, that sounds very strange. I have tested the mod on IE (Windows; 6 and 7), Firefox (2, Mac and Windows), Safari (2 and 3, Mac), Opera (9, Mac) and it works fine on all four browsers (it autorefreshes, does not collapse between shouts, etc.). So, I do not know what is going on on your end -- some kind of server misconfiguration maybe?
Knowing what host you are on would be useful. The fourm root folder must be chmod 755 *if* it's owned by the web user, otherwise, try 777 (security hazard, yes, but if the folder isn't owned by the web user, then permissions will be wrong). I also suspect that doing the install half-manually: e.g. unpacking yshout manually, but using Package Manager to perform the theme modifications, should work.

I would like to help you resolve these issues; give me a URL and I'll hop over with Firebug :)

Oh, finally, I'd like to note that in a very early revision (never released to public) of this shoutbox, I had a problem where Opera would collapse between shouts; that was eventually resolved. I never had issues with Firefox though...
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!

jossanaijr

Quote@jossanaijr: In yshout/yshout.php, change $allowGuests to false.
Yes... already done.  Working perfectly.  Newbie... Thanks.

crucify

#799
I have been trying to get this thing to work all night but it seems I'm a idiot.
SMF is 1.1.3 and I'm using Blocs Mesh theme.Doesnt matter because it doesnt work on base theme either.
When I used the Package manager to install this shoutbox it seemed to have went well.

I then added the lines to the Mesh theme refreshed the forum and I got nuttin.
I then looked for the yshout folder on ftp and it wasn't there, this I guess means the install puked or something.
I ftp'd up the Yshout folder and the other files along with it to my forum folder. Still nothing but a text line at top of the forum that says SHOUTBOX.

I'm about to back up 10 feet and punt.

How do I resolve the problem now? What other info do you need?
Here is what is showing on my forum.

If ya ask me that Package mangler is broke, Unless I can install something manually it ends up not working, such as this chatbox.

Are the files available so I can install manually? I much prefer it over the Package Mangler.

Advertisement: