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

DJ Bert

In control panel/Smiley's & Avatars i can't add/delete/edit the smiley's, (smiley's not found). When i removed the code then i can add/delete/edit smiley's.

nneonneo

That's very odd, though I suppose it might have something to do with the shoutbox loading the smileys.

I'm going to try it out on my local forum, and let you know what happens.
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!

nneonneo

Aha. Found it.

Of course, the problem is that the smiley.php file is overwriting some other variable.

Below are the two changes you need to make in order for this to work; make both changes to smiley.php.
Change
$context['smileys'] = array(
'postform' => array(),
'popup' => array(),
);

to
if(isset($context['smileys']))
{
$context['smileys']['postform'] = array();
$context['smileys']['popup'] = array();
}
else
{
$context['smileys'] = array(
'postform' => array(),
'popup' => array(),
);
}


Change
foreach (array_keys($context['smileys']) as $location)
to
foreach (array('postform','popup') as $location)
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!

2pac

awesome! got it to work! just had to change the permission to 0755

Theler

This is an awesome shoutbox, and I really liked it (after I fixed the whole ...loading shoutbox... problem). I just have one slight problem I need to make it so only certain members can see this and others dont. I did not see a function that allows one group to view the shoutbox and another to see it blank. Is this possible?

nneonneo

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!

colorgoddess

#1486
Hi there, I just installed the shoutbox on my third forum, so I'm used to doing it and all, but this is the first time that it only appears on the homepage.  I am using the 'bright forest' theme found at smf machines.  I have never used this theme before so figure it must have something to do with that.  Any ideas on how I can have the shoutbox visable on all pages....  Ah, another thing to mention is this theme using both the index.templete.php and boardtemplate.php  So I had to install first code in the index.templete and the next go (to place shoutbox) in the boardtemplate file.

Thanks,
Tina

Theler

Quote from: nneonneo on January 13, 2008, 02:09:10 AM
@Theler -- probably by using http://www.simplemachines.org/community/index.php?topic=137508.msg1358011#msg1358011 or something similar.
Thanks for the quick response, I tried to follow that but it just made the shoutbox go away even for membergroups that I allowed to see it. (I went with the membergroup IDs listed in the panel. Such as ...action=membergroups;sa=members;group=1 I put in as the number 1. Also I was wondering if there was a way to display the shoutbox in an actual board of its own and not at all on the mainpage?

DJ Bert

Quote from: nneonneo on January 12, 2008, 05:48:41 PM
Aha. Found it.

Of course, the problem is that the smiley.php file is overwriting some other variable.

Below are the two changes you need to make in order for this to work; make both changes to smiley.php.
Change
$context['smileys'] = array(
'postform' => array(),
'popup' => array(),
);

to
if(isset($context['smileys']))
{
$context['smileys']['postform'] = array();
$context['smileys']['popup'] = array();
}
else
{
$context['smileys'] = array(
'postform' => array(),
'popup' => array(),
);
}


Change
foreach (array_keys($context['smileys']) as $location)
to
foreach (array('postform','popup') as $location)

Thank you nneonneo.

I have made the changes and is working now. ;)

nneonneo

@colorgoddess: Do you mean the BoardIndex template? That controls only the home page (the listing of all boards), and not any other pages. Hence, to get the shoutbox on other pages too, install to index.template.php.

@Theler: Oops, I should have had
global $user_profile;
before the "if" statement.
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!

Theler

Quote from: nneonneo on January 13, 2008, 09:41:48 PM
@colorgoddess: Do you mean the BoardIndex template? That controls only the home page (the listing of all boards), and not any other pages. Hence, to get the shoutbox on other pages too, install to index.template.php.

@Theler: Oops, I should have had
global $user_profile;
before the "if" statement.
Thanks a lot the script works as intended now. :)

colorgoddess

Okay thanks, I had already tried that, and it either went way above the whole page (even the logo) or at the bottom.  That is why I used the BoardIndex.... So I have chosen just to have the shoutbox on the bottom; at least it is on every page this way.

Tina

Satfiles

can this also been placed above the board index with a theme frame? and not in the Welcome area?    please pm when you have the anwser.

greetz Satfiles

wiidice

So i did some searching for how to disable bbc code, and found it in the yshout/yshout.php doing a kill some search, but when i add more to that list it does not stop users from using the bbc.. I dont know why

$newText = $args.' ';
$newText = $func['htmlspecialchars'](stripslashes($newText), ENT_QUOTES);
$newText = str_replace(array("[list]","[center]","[left]","[right]","[img]","[youtube]","[font]","[color]","[size]","[glow]","[quote]","[code]"),"",$newText); // kill some BBCode--these tags are useless and can be abused
preparsecode($newText); // gah, sanitize input!!
$newText = parse_bbc($newText); // w00t!


Can someone help me with that?  Forums is on 1.1.4 with the latest version of this mod. I am using a skin that is not default so... that could be one reason, I can get the mod to work very well in the boardindex.template.php

You can see my dev forums hxxp:wii.bydice.com [nonactive]

also it seems that guests are allowed to use the shout even though i turned it off... is there a different place for the restrictions?

Thanks for your help

Dice :)

falconforce

#1494
I try modified own shout box, so it can turn off sound  ;)

after you modified mod with sound...

in yshout.js, after
if (oldShouts != null && oldShouts != $("shouts").innerHTML)
{


add
if(get_cookie("shoutSound") == "true")
{
soundManager.setVolume('sound',200); // my addition line, you can remove it
soundManager.play('sound');
}


and add this to first line of file
if (delete_cookie('shoutSound'))
{
set_cookie('shoutSound','true',3600*24);
}


in yshout.php, add this to anywhare are you need
if(!isset($_COOKIE['shoutSound'])) {
echo '&nbsp;<a href="javascript:delete_cookie(\'shoutSound\');set_cookie(\'shoutSound\',\'true\',3600*24);delete_cookie(\'yShout_open\');loadChat();">Use Sound</a>';
} else {
echo '&nbsp;<a href="javascript:delete_cookie(\'shoutSound\');delete_cookie(\'yShout_open\');loadChat();">No Sound</a>';
}


PS. I'm add that after...
case "init":
if($gzipCompression) ob_start("ob_gzhandler"); // GZip for everything BUT the 404 header
echo '<a href="javascript:goTo(\'file=',checkName($chatFile),'&amp;history\')">',$txt['yshout_history'],'</a>&nbsp;<a href="javascript:goTo(\'help\')">',$txt['yshout_commands'],'</a>';

livedown

hey nneo is it possible for the shoutbox to appear  only in the board index page instead of the index.template.php? if so wat edits should i make?

plz help me!!!

thank you very much! i love your shoutbox!!!!!!

nneonneo

Sorry for not responding to these recent posts.

@Satfiles: Yes. The following code should be used somewhere to make it work. (good place: right after the global line in theme_linktree in index.template.php):
// YSHOUT HERE
global $txt;
echo '
<div class="tborder" style="margin-top: 0;' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">
<div class="catbg" style="padding: 5px 5px 5px 10px;">Shoutbox Test
</div>
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">
<tr><td class="windowbg2"><div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div></td></tr></table>
</div><br />';
// YSHOUT END

Note that you must remove the existing location of the shoutbox, or it will not load.

@wiidice: To do this, you have to remove the ] from the matches: some tags take arguments (e.g. [ quote author=... ]). Also, to turn it off for guests, set $guestsAllowed in yshout.php to false.

@falconforce: That's very useful, and is certainly a nice addition for sound. I'll add it to the main mod page.

@www.livedown.us: Yes, but it will restrict the places you can put the shoutbox. First, remove the code from index.template.php leaving only the part in the <head> section (the one with many script tags and CSS).

Next, add the following to BoardIndex.template.php (I recommend before
/* Each category in categories is made up of:
id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?),
new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image),
and boards. (see below.) */
):
// YSHOUT HERE
echo '
<div class="tborder" style="margin-top: 0;' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">
<div class="catbg" style="padding: 5px 5px 5px 10px;">Shoutbox Test
</div>
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">
<tr><td class="windowbg2"><div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div></td></tr></table>
</div><br />';
// YSHOUT END
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!

gusX

I'm not able to download your mod. (Version 1.11 http://custom.simplemachines.org/mods/index.php?action=download;mod=585;id=42153). Coming from me or due to the recent crash of the server? Version until 1.08 can be downloaded. Could you upload it again, or give us a link ? Thx

nneonneo

Thank you for letting me know. 1.09 to 1.11 have been reuploaded.

EDIT: Also re-uploaded the language packs for the first post.
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!

nneonneo

#1499
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.
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!

Advertisement: