Shoutmix

Need help with your forum? Ask away. Remember though that there's always http://www.phpbb.com/community

Moderator: Experts

Post Reply
Graham
Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK
Contact:

Shoutmix

Post by Graham » Wed Mar 04, 2009 5:22 pm

Hi David,

I'm using a program called Shoutmix it's a chatbox panel all works well but I can get it so that only members can see and use it.
The instructions to do this are below, where would I best place the script?
And is $name the same variable as is used by phpBB?

Thanks
Graham


PHP Function

If you're using PHP, you can add the following function to your script for quick integration. The function will produce correct parameters to be appended at the end of your shoutbox URL.

Code: Select all

function shoutmix($name = '') { 
return htmlspecialchars(
 '&name='.rawurlencode($name)
 .'&code='.md5($name.'fbf2f9ab7c')); 
}
Then alter your shoutbox HTML codes by adding the following codes (after your shoutbox URL):

Example
...mix.com/?poemchat<?=shoutmix($name);?>" width="...

Replace $name with the variable that holds the name of your member, as retrieved from the database.

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ » Thu Mar 05, 2009 12:32 am

You would put this before the shoutbox code added to the template file:

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
and after the added code:

Code: Select all

<!-- ENDIF -->
If you're looking for the username of the logged in user:

Code: Select all

$user->data['username']

Graham
Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK
Contact:

Re: Shoutmix

Post by Graham » Thu Mar 05, 2009 11:50 am

David

Just to clarify then at the moment in overall_header I have the following

Code: Select all

<!-- Begin ShoutMix - http://www.shoutmix.com -->
<iframe title="poemchat" src="http://www2.shoutmix.com/?poemchat" width="960" height="200" frameborder="0" scrolling="auto">
<a href="http://www2.shoutmix.com/?poemchat">View shoutbox</a>
</iframe>
<!-- End ShoutMix -->
Are you saying I need to just surround the above with this?

Code: Select all

<!-- IF S_USER_LOGGED_IN -->
<!-- ENDIF -->
And change this

Code: Select all

<iframe title="poemchat" src="http://www2.shoutmix.com/?poemchat"
to this

Code: Select all

<iframe title="poemchat" src="http://www2.shoutmix.com/?poemchat<?=shoutmix($user->data['username']);?>" 
Thanks
Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ » Thu Mar 05, 2009 12:07 pm

You've got the first part right but the second part:

Code: Select all

<iframe title="poemchat" src="http://www2.shoutmix.com/?poemchat<?=shoutmix($user->data['username']);?>" 
is not going to work.

Is there a PHP shoutmix function somewhere? What's the URL supposed to end up looking like?

Graham
Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK
Contact:

Re: Shoutmix

Post by Graham » Thu Mar 05, 2009 1:59 pm

Hi David,

What you see is all I have, the bit of code placed in the overall_header puts the shoutmix box on my site.

Here is a link to the site that host it
http://www.shoutmix.com/main/

If you need my user name and password to take a closer look, then I have no problem with that.

Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ » Thu Mar 05, 2009 2:22 pm

What should this end up looking like for the forum user's username to be used in the chat?

Code: Select all

http://www2.shoutmix.com/?poemchat

Graham
Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK
Contact:

Re: Shoutmix

Post by Graham » Thu Mar 05, 2009 3:35 pm

David,

This is the information given

Then alter your shoutbox HTML codes by adding the following codes (after your shoutbox URL):

Example
...mix.com/?poemchat<?=shoutmix($name);?>"


Replace $name with the variable that holds the name of your member, as retrieved from the database.

Graham

User avatar
DavidIQ
Site Admin
Posts: 581
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ » Thu Mar 05, 2009 4:32 pm

That's not for phpBB3 :|
But I THINK this should work for you:

Code: Select all

<iframe title="poemchat" src="http://www2.shoutmix.com/?poemchat&name={S_USERNAME}" width="960" height="200" frameborder="0" scrolling="auto">

Graham
Posts: 76
Joined: Mon Oct 20, 2008 3:31 am
Location: UK
Contact:

Re: Shoutmix

Post by Graham » Fri Mar 06, 2009 2:04 am

Thanks David,

That's done it, if you're not logged in then the chat box does not show.

Your Friend
Graham

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests