Page 1 of 1

Shoutmix

Posted: Wed Mar 04, 2009 5:22 pm
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.

Re: Shoutmix

Posted: Thu Mar 05, 2009 12:32 am
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']

Re: Shoutmix

Posted: Thu Mar 05, 2009 11:50 am
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

Re: Shoutmix

Posted: Thu Mar 05, 2009 12:07 pm
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?

Re: Shoutmix

Posted: Thu Mar 05, 2009 1:59 pm
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

Re: Shoutmix

Posted: Thu Mar 05, 2009 2:22 pm
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

Re: Shoutmix

Posted: Thu Mar 05, 2009 3:35 pm
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

Re: Shoutmix

Posted: Thu Mar 05, 2009 4:32 pm
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">

Re: Shoutmix

Posted: Fri Mar 06, 2009 2:04 am
by Graham
Thanks David,

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

Your Friend
Graham