nneonneo's Shoutbox

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

Previous topic - Next topic

nneonneo

@psynx: By default, shoutbox uses whatever your profile is set to, but you can change it: http://www.simplemachines.org/community/index.php?topic=137508.msg1630065#msg1630065

To make links like History show up in a new window, change
document.location=getURL(args);
to
window.open(getURL(args));
in yshout/js/yshout.js

@asmith: On non-forum pages, you need to include the JS files (moo.ajax.js and yshout.js in yshout/js) for the shoutbox to work properly.

file_exists is relative to yshout.php, so it won't work. Use
$writeText="<a$a_style href=\"/forums/index.php?action=profile;u=$userID\">$shoutName</a>"
instead (absolute path from server root)

Edit preg_timeformat in yshout/settings.php and add <br /> after
return '['.timeformat(intval($matches[1])).']

@Roo: Though it is probably not very relevant to the allowedTo problem, it looks like the language files aren't installed. As for the error, I still don't have a clue.

@machmanx: Hmm, allowing images for only a set period of time? The main issue is that it may interfere with smileys, since they also use <img> tags. Stripping or modifying them at the <img> level *could* work, but would be more than a simple line of code (something along the lines of adding a timeout to each image tag which is then scanned by Javascript). Perhaps a better option would be to simply replace images with links, so people could view them separately from the shoutbox if they so wish. That is easy to do, and simply requires replacing [ img ] and [ /img ] with [ url ] and [ /url ] respectively before parse_bbc. It's not a totally perfect solution, but it should work to reduce the effect images have on the shoutbox.
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!

synicfan

Hi nneonneo,

My shoutbox was working just fine until a couple of days ago.
Now when I click on history, all it says is:

Error 500 - Internal server error
An internal server error has occured!
Please try again later.


Any idea what this could be?
Thank you!

virtualxtc

QuoteThank man, I got it working ^^

How can i insert a line between shout box messegaes?

I tried : 

writeLine("<p class=\"shout\">$timestamp&nbsp;$adminlinks$text</p><hr />\n",$chatPath);

in the yshout.php, but its not working?

This mod uses <hr /> to add a line between the shouts. <hr /> displays differently in different browsers so it would be a good idea to remove the <hr /> and put a border on the shouts.

virtualxtc

#4163
I have installed the shoutbox on my forum with no issues. I would also like to add it to my regular site pages, how would i go about it? What code would i add?

Forum version : SMF V2.0 Beta 4

Jirsh

How do you set the usernames color in the shoutbox when they shout?

adamcanada

The shoutbox loads the top of it, but not the rest, any ideas?


bfeo

Adam, that looks like a block without content.  Check the block type.  Should be PHP.

asmith

$writeText="<a$a_style href=\"/forums/index.php?action=profile;u=$userID\">$shoutName</a>"


is not working.

I tried to mess it, but i couldn't succeed either.  I tried putting  "test" next to index, see if the url changes , like :
$writeText="<a$a_style href=\"/forums/TESTindex.php?action=profile;u=$userID\">$shoutName</a>"

But even url is not changing, what's wrong with that?

adamcanada

Ya I have it set to 'phpbox' currently

nneonneo

@synicfan: I have absolutely no idea. Check your error logs for any messages, and/or contact your host.

@virtualxtc: Look at yshout/index.php to get an idea of what to do.

@Jirsh: They should already be set to the membergroup/postgroup colors...

@adamcanada: Are all the <div>s closed?

@asmith: It affects new shouts only.
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!

adamcanada


asmith

thanks nneonneo, Last thing :

shoutbox is not working on non-forums pages . It shows ALL the messages , but when i type a message there and click on the shout, the whole page refreshes without adding my new message, after that the shout button just do nothing.

I've checked scripts, they are all fine :
Quote
   <script src="http://www.example.com/forums/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="http://www.example.com/forums/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   window.onload=function(){loadChat();};
   var shoutFile="home";
   var yshout_php="/forums/index.php?yshout";
   // ]]></script>
   <script src="http://www.example.com/forums/yshout/js/yshout.js?July062008" type="text/javascript"></script>

I added this line to the top of yshout.php

$yshoutdir=(defined('SMF')||isset($yshout_from_index))?'yshout/':'';
// Check configuration files
$yshoutdir = ((file_exists('forums/index.php'))? 'forums/' : '').$yshoutdir;


and tested $yshoutdir variable. the variable worked ok, in forum pages it was yshout/ and in non-forum pages it was forums/yshout/ .  But still no success .

What's wrong?

virtualxtc

Quote@virtualxtc: Look at yshout/index.php to get an idea of what to do.
Ive implemented that code every which way but all i can see is "Loading..." but no actual shout box.

virtualxtc

Quote from: asmith on October 17, 2008, 06:15:55 PM
thanks nneonneo, Last thing :

shoutbox is not working on non-forums pages . It shows ALL the messages , but when i type a message there and click on the shout, the whole page refreshes without adding my new message, after that the shout button just do nothing.

I've checked scripts, they are all fine :
Quote
   <script src="http://www.example.com/forums/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="http://www.example.com/forums/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   window.onload=function(){loadChat();};
   var shoutFile="home";
   var yshout_php="/forums/index.php?yshout";
   // ]]></script>
   <script src="http://www.example.com/forums/yshout/js/yshout.js?July062008" type="text/javascript"></script>

I added this line to the top of yshout.php

$yshoutdir=(defined('SMF')||isset($yshout_from_index))?'yshout/':'';
// Check configuration files
$yshoutdir = ((file_exists('forums/index.php'))? 'forums/' : '').$yshoutdir;


and tested $yshoutdir variable. the variable worked ok, in forum pages it was yshout/ and in non-forum pages it was forums/yshout/ .  But still no success .

What's wrong?

What browser are you using?
I find that happens with "Google Chrome" but other browsers are fine.

Mikeric

Quote from: ameo on May 07, 2008, 11:46:19 AM
I made sort of guide for dummies, or something like that, to place this shoutbox in News field, and make it look cool on forum.
Personally, I believe this is the best position for shoutbox, and if you don't need News on your forum you could place shoutbox instead.


NOTE: I wrote tutorial and it works for 1.17 !!!

NOTE 2: With nneonneo's help - this works like a charm with version 1.21 also :)
            For 1.21 installation see step instead of step, and then 
            follow all other steps normally.



First steps you already know, but I'll repeat it just in case;

First download yShout and install it.
If you're using different theme than default one after

[/s][/s]
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';


you must add this code into your index.template.php :

[/s][/s]
// 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()
{
loadChat();
}, { "yshout":"id"});
var board_url = "'; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";

</script>
<script src="',$boardurl,'/yshout/js/yshout.js?Mar072008" 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;
}
#yshout .adminlink {
font-size: 6pt;
color: #141414;
}
#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;
}
</style>';
// YSHOUT END



Then do this:


Of course you need news box to be displayed in order to see shoutbox in your index page.
To do that go to Theme options and click to:

1. DISABLE eNews   [it is very dangerous to leave it enabled, so if it is checked,
    you must uncheck it]

&[/i]


2. Show news fader on board index [check it]

3. fading delay - set to 0

Click save, then in News box put this code

a) for 1.15-1.17       <div id="yshout">',$txt['yshout_loading'],'


b) for 1.21              [/s][/s]
<div id="yshout">Loading shoutbox...</div>

instead of putting second code somewhere else:


And save it.



If you wish to change News to Shout box or Shoutbox you'll need to find file index.english-utf8.php / index.english.php or of  any other language file you're using.  They are stored under Forum/Themes/default/languages/  In there you'll need to edit string    $txt[102] = 'News';   
to   $txt[102] = 'Shoutbox';  and re-upload that file to it's place. You'll need to replace old file with that new-one if you didn't delete old one first. 



// GUIDE FOR DUMMIES IS FINISHED //
I guess that's it. I hope it shall be helpful to at least someone.

Step 4 is actually step 1 FOR 1.21 installation


In index.template.php, after
   // If we're in a board, or a topic for that matter, the index will be the board's index.
   if (!empty($context['current_board']))
      echo '
   <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

add
   // YSHOUT HERE - <head> code
   global $boardurl,$shoutFile;
   $shoutFile='home';
   $scripturlparsed = parse_url($scripturl);
   $scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
   $args='';
   foreach($_GET as $key => $value) // passthrough $_GET
      $args.='&'.urlencode($key).'='.urlencode($value);
   echo '
   <script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   window.onload=function(){loadChat();};
   var shoutFile="',$shoutFile,'";
   var yshout_php="',$scriptpath,'?yshout',$args,'";
   // ]]></script>
   <script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
   <style type="text/css">
      #yshout {
         font-size: 10px;
         overflow: hidden;
      }
      #yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
      }
      #yshout #shouts { /* main shouts area */
      }
      #yshout .shout { /* one shout */
         margin: 0 0 0; /* Top Bottom Linespacing */
         line-height: 1;
      }
      #yshout .shout-timestamp {
         font-style: normal;
         font-weight: normal;
      }
      #yshout .shout-adminlinks { /* del and ban buttons */
         font-size: 6pt;
         color: #141414;
      }
      #yshout #shout-form {
         margin: 0;
         padding: 0;
      }
      #yshout #shout-form fieldset {
         border: none;
      }
      #yshout #forum-name {
         width: 70px;
         margin-right: 5px;
      }
      #yshout #shout-text {
         width: 310px;
         margin-right: 5px;
      }
      #yshout #shout-button {
         width: 55px;
      }
      #yshout .shout-invalid { /* invalid shout (shout textbox) */
         background: #FFFDD1;
      }
   </style>';
   // YSHOUT END - <head> code




Best of luck 2 everyone[/hr]

I tried doing what is says in here, but my shoutbox is still at the higher part of the page. All it says in the news area is Shoutbox is loading.....

leonardus

#4175
Quote from: nneonneo on October 15, 2008, 11:22:45 AM
@leonardus: add the string
$txt['permissiongroup_simple_yshout'] = 'Shoutbox';

thank you nneonneo! but i have inster your string here:
// Permissions
$txt['permissiongroup_simple_yshout'] = 'Shoutbox';
$txt['permissiongroup_yshout'] = 'Shoutbox';
$txt['permissionname_yshout_view'] = 'View shoutbox';
$txt['permissionname_yshout_post'] = 'Post in shoutbox';
$txt['permissionname_yshout_moderate'] = 'Moderate shoutbox';
$txt['permissionhelp_yshout_view'] = 'This permission allows access to the shoutbox. If it is enabled, users will see the shoutbox and the chats in it.';
$txt['permissionhelp_yshout_post'] = 'This permission allows users to post messages to the shoutbox. If it is disabled, users cannot enter any messages.';
$txt['permissionhelp_yshout_moderate'] = 'If this permission is set, users will be allowed to moderate the shoutbox -- deleting, banning and clearing among other features.';
// ---- End modification - nneonneo's Shoutbox ----


but nothing has happened. why? thx

now, another question for you:

i use black rain theme (v.1). but your shout box doesn't appear in a "box theme". can you help me to insert the shout box in a box? thx


http://i38.tinypic.com/207b1j4.png

ShotgunFR

Hey there.

I've made the first edit, however I am uncertain on where to place the second edit. Please help me out, thanks!

Where does this go? How do I find the location of where I want to put the shoutbox?

"Second, find the desired location of the shoutbox and place at that location (in the index.template.php file!) *one* of the two blocks below:

For an "instant-on" shoutbox which loads with the page:"

Quote// YSHOUT HERE - shoutbox code
   global $txt,$context,$boarddir;
   if(allowedTo('yshout_view'))
   {
      echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
      echo '<div id="yshout">';
      include_once($boarddir.'/yshout/yshout.php');
      echo '</div>';
   }
   elseif($context['user']['is_guest'])
      echo $txt['yshout_no_guests'];
   // YSHOUT END - shoutbox code

Thanks.

machmanx

I see.  So what you suggested will only affect posted images, but not the smilies, right?  I guess I can live with that.  So where exactly to I make this modification?

nneonneo

@adamcanada: Can I see the forum (when modified)?

@asmith: You need to also include Themes/default/script.js or Themes/default/scripts/script.js.

@virtualxtc: $boardurl needs to be set correctly.

@Mikeric: You need to remove the existing shoutbox, by removing the "shoutbox code" block from index.template.php (NOT the <head> code block!). Only one shoutbox can be active per page.

@leonardus: For the $txt thing, is it in Modifications.<your language>.php?

As for a block, try this code (non-collapsible; for a collapsible block, you should look at the code for AdvSB):
echo '<div class="catbg" style="padding: 5px 5px 5px 10px;border-top:1px solid #ffffff;">';
// Block Title
echo '<span style="width:49%"></span><span>ShoutBox</span>';

echo '</div>
<table border="0" width="100%" cellspacing="1" cellpadding="1" class="bordercolor" style="margin-top: 1px;">
<tr>
<td class="windowbg" width="6%" align="left" valign="top">';
<<SHOUTBOX CODE HERE>>
echo '
</td>
</tr>
</table>';


@ShotgunFR: Where do you want it?

@machmanx: After
foreach($bannedCode as $searchString)
$text = preg_replace('/'.preg_quote($searchString,'/').'/i','',$text);

add
$text = preg_replace('~\[(/?)img~i','[\\1url',$text);
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!

ShotgunFR

I'd like it at the top, please. :)

Advertisement: