Help with Hardcoding Usernames into Shout Box

Started by flamechica, March 23, 2009, 02:10:33 AM

Previous topic - Next topic

flamechica

I am running SMF 1.1.8 with several mods. I use a shout box from www.shoutmix.com and have placed it into an HTML block in SimplePortal. I was wondering if someone could help me hardcode the member's username into the Username slot so that my members are forced to user their username's in the shout box.

The code below is the code I have used in the HTML box in SimplePortal to make the shoutbox show up on my forum. I have edited out the URLs to my shoutbox for privacy reasons.
<!-- Begin ShoutMix - http://www.shoutmix.com -->
<iframe title="rsdlaughter" src="URL TO SHOUTBOX" width="200" height="400" frameborder="0" scrolling="auto">
<a href="URL TO SHOUTBOX">View shoutbox</a>
</iframe>
<!-- End ShoutMix -->


Thanks in advance for any help that is provided.

onepiece

I believe you can't do that. I suggest trying a shoutbox that completely integrates with your forum, rather than being embedded. In this way, you don't have much control over the shoutbox I believe. There are some shoutbox mods in the Mod Site you could check.

flamechica

Hmmm....there has got to be a way. It was feasible in phpbb.

I actually have a lot of control over this shoutbox. I like it cuz I can add smilies and change to look of the shoutbox anytime I want. Plus, shoutmix.com stores the conversations for me.

onepiece

There seems to be an "Integrated" mode but it requires Premium account. I can help you with switching to that mode, if you have a premium account.

flamechica

#4
Yes, I have a permium account....which I guess is also why I would really rather stick with it (since I have already paid for it). That would be great, if you could help. I looked at the instructions for the "Integrated mode" but they didn't really make sense to me.

onepiece

#5
Create a PHP block with these codes:

global $context;

if ($context['user']['is_guest'])
{
echo 'You are not allowed to view shoutbox!';
return;
}

$unique_code = 'YOUR_UNIQUE_CODE_HERE';

$url_vars = htmlspecialchars('&name=' . rawurlencode($context['user']['name']) . '&code=' . md5($context['user']['name'] . $unique_code));

echo '
<iframe title="rsdlaughter" src="http://shoutmix.com/?shoutmixusername', $url_vars, '" width="200" height="400" frameborder="0" scrolling="auto">
<a href="URL TO SHOUTBOX">View shoutbox</a>
</iframe>';


You only have to change "YOUR_UNIQUE_CODE_HERE" as your unique code and url to to your shoutbox.

flamechica

QuotePHP Syntax Error. Please check the code.

Now, I just get that error in the php block.

onepiece

For some reason, my codes were truncated. I've edited my post, would you try it again?

flamechica


shady586

YOU ARE THE BEST!!!!  I have been searching for hours trying to figure out how to get integration mode to work with SMF.  I can attest that this works by adding that code to a new PHP block using Simple Portal.

Advertisement: