News:

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

Main Menu

Ultimate Shoutbox

Started by Grudge, March 28, 2004, 09:11:20 AM

Previous topic - Next topic

Grudge

Griffen,

This is VERY basic, you may need to tweak it to make it look good, but basically, in BoardIndex.php, find:


// Here's where the "Info Center" starts...


And before it add:

echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr class="titlebg">
<td align="center">Shoutbox</td>
</tr><tr class="windowbg">
<td align="center">', smfshout(), '</td>
</tr>
</table></div>';


Col,

A refresh option may not be a bad idea. I'm now toying with the idea of a more advanced auto refresh option, but I'll have to see if I can find the time!
I'm only a half geek really...

edchapman

Quote from: Grudge on March 27, 2005, 05:53:07 AM
Griffen,

This is VERY basic, you may need to tweak it to make it look good, but basically, in BoardIndex.php, find:


// Here's where the "Info Center" starts...


And before it add:

echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr class="titlebg">
<td align="center">Shoutbox</td>
</tr><tr class="windowbg">
<td align="center">', smfshout(), '</td>
</tr>
</table></div>';


I think You mean the BoardIndex.template.php

Griffen

Quote from: Grudge on March 27, 2005, 05:53:07 AM
Griffen,

This is VERY basic, you may need to tweak it to make it look good, but basically, in BoardIndex.php, find:


// Here's where the "Info Center" starts...


And before it add:

echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
<tr class="titlebg">
<td align="center">Shoutbox</td>
</tr><tr class="windowbg">
<td align="center">', smfshout(), '</td>
</tr>
</table></div>';


Col,

A refresh option may not be a bad idea. I'm now toying with the idea of a more advanced auto refresh option, but I'll have to see if I can find the time!
Thanks  :-[

Col

Quote from: edchapman on March 27, 2005, 11:20:11 AMI think You mean the BoardIndex.template.php

Yes, I'm sure he does.

What template do you use?

Col

Griffin,

I have looked at the templating system, but it is largely beyong my abilities for the moment. I was going to to place the shout box to the right in the info center, and use the rowspan attribute, but I only really understand html, and it looks to be more complicated to do this in these template. I'm sure it's possible, it's just I haven't the time to work it out right now.

I hope someone else will read this, and do this for you. For someone else, I'm sure this would be pretty straight forward.

edchapman

#325
Quote from: Col on March 27, 2005, 11:58:28 AM
Quote from: edchapman on March 27, 2005, 11:20:11 AMI think You mean the BoardIndex.template.php

Yes, I'm sure he does.

What template do you use?

I just installed it into that one... It works fine in Safari but not IE or fire fox. It shows that there is a message but you don't see the message in IE. In fire fox you see the messages...without scroll... but can't shout.
This is the site that I have it on--->http://www.youth.kumcministries.com/newforum/index.php

edchapman

Note.. I don't really know what I'm doing either... Just at the mercy of the good people here.

This is the code I haveecho '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4">
     
       </tr><tr class="windowbg"><div class="tborder"><table border="1" width="100%" cellspacing="1" cellpadding="4">
     <tr class="titlebg">
               <td align="center"><script type="text/javascript"><!--
google_ad_client = "pub-2450911192681153";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
               <td align="center">', smfshout(), '</td>
     </tr>
</table></div>';

// Here's where the "Info Center" starts...
echo '
<br />

I added a google ad too as you can see.... I'm sure i did not do it right but it is the way I want it in Safari.
Can someone help me with getting it to work right in other browsers please?

Col

#327
I see the messages fine in IE6. It doesn't scroll for me either in firefox. The only other thing I can suggest is you try this instead.

<td align="center">'. smfshout(). '</td>

I understand that in some instances you need to replace the commas with full stops. I have no idea why, or if it will work for you. - Worth a try though.

P.S. I notice that you are missing your closing </td> tag with google ads. Maybe it's because of that?

Grudge

Col,

I've been hard at work the last couple of days to try add some automatic reloading to the shoutbox - and wondered if you'd fancy giving it a try? You'd have to uninstall the old version, and install the version attached (Upload it to your packages folder). Note that the auto refresh is browser dependant - and uses some of the technology used in SMF 1.1 (You can see the effect here when you preview a post).

Basically, what it does is "secretly" queries the server every 5 seconds after the page has loaded to see if there has been any more shouts. If there have it simply adds them to the list. It doesn't do any page refreshes or anything - it's simply using javascript to do it all in the background.

Note that it won't work on every browser under the sun I doubt - it would need to be fairly new - it certainly works on IE and Firefox, and if it doesn't work it just won't refresh - simple. Please note that this contains a little code form 1.1 in the form of a javascript file, so hence it is under the same license as SMF.

Let me know how you get on if you decide to try it. If it works I may even make it so it can add a shout without a page refresh - neglecting the need for an iframe completely.
I'm only a half geek really...

Col

This sounds like a great solution. I'll probably try it on a separate test board as I'm in the middle of testing out the converted files on my proper test board, and am hoping to transfer properly sometime in the hext 24-48 hours. I'll deffinately look at this a bit later though, as I'd like to include it with the new forum. My members will be very pleased to see the return of a shoutbox, and this extra functionality is great bonus.

Thanks.

loudog

sounds like a great idea Grudge. I dont have a test board set up, or I'd help you out.

Col

Hi,

Just installed it, and it appeared to install with no errors, but when I refreshed the screen I got this:

Fatal error: Cannot redeclare smfshout() (previously declared in /home/######/public_html/smf5test/Sources/Subs.php:1822) in /home/######/public_html/smf5test/Sources/Subs.php on line 1829

I'll have another go tomorrow.

Grudge

Sounds like the previous version wasn't uninstalled first?
I'm only a half geek really...

Col

Hi,

I can't be bothered to repair that board, but I just looked via ftp and your shoutbox appears to be the only package downloaded. I also downloaded the installed list, and it is as follows:

Ultimate Shoutbox|^|shout1.tar.gz|^|grudge:ultimate_shout|^|1.3

I'm new to this, so don't know what that means. I'll install a new board and try this again.

Grudge

It's just that error almost certainly means it's been installed twice somehow. I didn't really change the mod file other than to add an option for guests not to have to enter their email address.
I'm only a half geek really...

Col

What does the installed list suggest about that? Is that just one install of the shoutbox or not?

Anyway, I've installed this another test board, and it seems fine. I have to still test it properly though, and have to wait for my fellow admin to test it with me.

Having it refresh without an iframe would be a great feature too if you can do it. I'll let you know how I get on with it asap.

Col

Hiya Grudge,

Initial tests prove to be positive. I can detect no problems with it. My fellow admin forgot, made a shout, and lost a post, so I think a shoutbox only refresh would help a lot. I'll place the Shoutbox in an iframe till you can sort that out.

This tweak is a great improvement!

Thanks.

Grudge

Glad to hear it seems to work. I'll try take a look at getting posting to work this way over the next few days. FYI a package is only shown as installed once, even if you install it 10 times, I'm afraid.
I'm only a half geek really...

Col

Hey Grudge,

How about the ability to remove the 'view all' option from members? I suppose I could do that by hand, or at least remove the link, but to turn off access would be better. It's just I have had some problems in the past, and the ability to turn off access to old shouts might be useful, rather just having delete them straight way if there is a problem.

What do you think?

Col

Grudge,

Thought I'd let you know in case you've not had any feed-back from Mac users, it apparently works as you intended for them too. ;)

Advertisement: