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 »

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.
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ »

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 »

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
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ »

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 »

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
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ »

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 »

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
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Re: Shoutmix

Post by DavidIQ »

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 »

Thanks David,

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

Your Friend
Graham
Post Reply