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

mechwarrior

You can change the reverse order in the settings.php file, not sure about point 2 myself, I dont think so, well I have not found it yet if there is, apart from doing /help in the txt box.

Hope this helps.

--

Quote from: StaticFX on October 21, 2008, 10:20:50 AM
2 Questions:

1) How do I reverse the order, so new shouts are on top.
2) Is there supposed to be an admin section? I dont see it


StaticFX

Quote from: SunKing on October 21, 2008, 05:15:53 PM
You have to set the permissions for your membergroups in SMF's admin (permissions) area
well, it doesnt show up in the admin panel?

i have looked everywhere....nothing. help?


[unplugged]

http://www.yoursite.com/yourforum/index.php?action=admin;area=permissions should take you to your permissions area. Once there, check all of the membergroups you want to allow to view the shoutbox then select "Add Permission" from the dropdown list and then under [Shoutbox] select "View shoutbox" from the other dropdown list.

Repeat this for the "Post in shoutbox" and "Moderate shoutbox" permissions.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



StaticFX

@sunking that is not there...... what part of the code added it?

[unplugged]

What version of SMF are you running?
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



StaticFX


[unplugged]

« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



adamcanada

It's at:

http://www.okclan.net/smf/

I have PM'd you the login information to test the forum, thanks!

[unplugged]

nneonneo, I am working on a shoutbox for someone who asked me to put the name above the timestamp. I cannot for the life of me figure out exactly where to change that. I can move the ban/del links, and I can move the timestamp to the very bottom after the actual shout, but I cannot put it between the name and the shout. What am I missing?
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



nneonneo

@Nequil: http://www.simplemachines.org/community/index.php?topic=137508.msg1741547;topicseen#msg1741547

@SunKing: The main reason it isn't so easy to do is because of the /me function, since that puts the name immediately before the message. It would not be difficult to *repeat* the username up top, but since splitting a /me line looks really weird, it isn't exactly easy to do. So, I guess it depends on what is needed for that.

P.S. if you are going to move the timestamp I suggest you change
$newFileContents=preg_replace('/<p[^>]*><span class="shout-timestamp" title="'.str_replace('|','\|',$spanTitle).'">.+\n/','',$fileContents);
by
$newFileContents=preg_replace('/<p.*?<span class="shout-timestamp" title="'.str_replace('|','\|',$spanTitle).'">.+\n/','',$fileContents);
just so that deleting shouts still works.
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

Is there a way to remove the link that says:

History Commands Extended History

As well as the box that shows your Username next to where you put in what you want to shout?

nneonneo

Both can be achieved in CSS.

1) Add "display: none;" after
#yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */


2) Add "display: none;" after
#yshout #forum-name {
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 nneoneo,
Shoutbox has been working great! Thank you!

I have a question. Is there a way to make every other line on the shouts appear a slightly different color? maybe they can alternate grey/blue or something like that? some users are asking about it and if possible, I'd like to change it for them.

Thank you.

mechwarrior

#4233
I am pretty much there with my shoutbox now, just need some help, I have attached my index.template.php file for point 2).  I would really appreciate it if you can amend the code for me. :)

1) how to add the timestamp to the right of all text lines (currently removed completely) - no worries I have added to the left on single line :)

2) how to centre the entire shoutbox table (Not the text, that must remain left justified) within the forum default theme?, I have made the SB smaller using the below:

#yshout #shouts {
         overflow: auto;
         width: 500px;       /* the width you want to display */
         height: 80px;     /* the height you want to display */

I have searched the forum for ages, but cant put my finger on exactly what to do for the above.  Running adv1.21 and smf 1.1.6

Forum here http://mechwarrior.org.uk/lol/index.php [nofollow]

A great SB by the way!! :)

Thanks in advance.

Ferretness

@nneonneo

If one did want to split teh /me

would it look like

Quote*Ferretness

Timestamp

Text
?

Because if so, that doesn't bother me, and if it wouldn't be too hard I would appreciate knowing how to do it.


Thanks =]

StaticFX

#4235
@nneonneo & sunking

its not there! there are NO permission settings for the shoutbox. help!!

Im am much more used to phpbb3 and am doing this for a friend... how does the admin section get its data?
was there something maybe i missed in the install?
could it be because the main code is in the index.php but the box is called in SimplePortal?

Ok, i found the "permissions" section in the code (modifications.english.php) .. they dont seem to be loading?
i tried putting them in the simple portal file because those load in the admin... still no good? are there supposed to be Database mods? (i didnt see any)

StaticFX

Quote from: mechwarrior on October 22, 2008, 03:44:37 AM
I am pretty much there with my shoutbox now, just need some help, I have attached my index.template.php file for point 2).  I would really appreciate it if you can amend the code for me. :)

1) how to add the timestamp to the right of all text lines (currently removed completely) - no worries I have added to the left on single line :)

2) how to centre the entire shoutbox table (Not the text, that must remain left justified) within the forum default theme?, I have made the SB smaller using the below:

#yshout #shouts {
         overflow: auto;
         width: 500px;       /* the width you want to display */
         height: 80px;     /* the height you want to display */

I have searched the forum for ages, but cant put my finger on exactly what to do for the above.  Running adv1.21 and smf 1.1.6

Forum here http://mechwarrior.org.uk/lol/index.php

A great SB by the way!! :)

Thanks in advance.

to center the shoutbox table:

open yshout.php
find:
if(!$shoutFormOnTop)
change the next line to: (Note the <center></center>)
echo '<center><div id="shouts">',readChat(),'</div></center>';

then find:
if($shoutFormOnTop)
change the next line to: (Note the <center></center>)
echo '<center><div id="shouts">',readChat(),'</div></center>';

so now the table for that chat is centered... but the text will be as well...
open yshout.css

add text-align: left;
in the #shouts section



Nequil

Quote from: nneonneo on October 21, 2008, 10:24:56 PM
@Nequil: http://www.simplemachines.org/community/index.php?topic=137508.msg1741547;topicseen#msg1741547

@SunKing: The main reason it isn't so easy to do is because of the /me function, since that puts the name immediately before the message. It would not be difficult to *repeat* the username up top, but since splitting a /me line looks really weird, it isn't exactly easy to do. So, I guess it depends on what is needed for that.

P.S. if you are going to move the timestamp I suggest you change
$newFileContents=preg_replace('/<p[^>]*><span class="shout-timestamp" title="'.str_replace('|','\|',$spanTitle).'">.+\n/','',$fileContents);
by
$newFileContents=preg_replace('/<p.*?<span class="shout-timestamp" title="'.str_replace('|','\|',$spanTitle).'">.+\n/','',$fileContents);
just so that deleting shouts still works.

thanks, all works :)

leonardus

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]

is it possible to install shoutbox just after the news lin, in a separate theme box?
i do no use default them, but blackrain theme in my smf 2.0b4.

thank you.

PLAYBOY

is this mod good for 2.0 beta 4?

Advertisement: