News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Intergrating smf with my cbox.ws shoutbox

Started by im1, July 10, 2008, 10:19:32 PM

Previous topic - Next topic

im1

QuoteIf you host your own website with its own userbase, it is quite easy to integrate Cbox so that it automatically assigns the correct names to users logged in to your website.

If your site is PHP-based (e.g. phpNuke, vBulletin, phpBB), alter your Cbox HTML code in the following way:

...&amp;sec=form&amp;nme=<?=urlencode($name)?>&amp;nmekey=<?=md5('16o92fcc913bo2i6'.$name)?>

Where the variable $name appears, insert the variable that represents the user's name as retrieved from your userbase. This will vary depending on your CMS or forum system. After changing your code, enable user override below.

Does anyone know how I can implement this on my shoutbox?

ExcalibursZone

If you need the variable to replace $name with, you'd want $user_info['username']. If your shoutbox has access to SSI.php from your SMF installation that is (otherwise it won't work). Well, if the shoutbox code goes directly in your index.php code for your SMF forums, then you probably won't need to include SSI.php, but if the shoutbox is separate, then yeah, you'll need it.

I hope that's clear ;)

im1

Quote from: ExcalibursZone on July 14, 2008, 07:29:39 PM
If you need the variable to replace $name with, you'd want $user_info['username']. If your shoutbox has access to SSI.php from your SMF installation that is (otherwise it won't work). Well, if the shoutbox code goes directly in your index.php code for your SMF forums, then you probably won't need to include SSI.php, but if the shoutbox is separate, then yeah, you'll need it.

I hope that's clear ;)
The shoutbox is loaded by an iframe, how would I intergrate it with that?

ExcalibursZone

Ah, an iFrame. Well then, you'll need to include SSI.php or the smf_api.php. I use SSI... Anyway, at the top of your shoutbox code (the index if you will) you'll need to include SSI.php thusly:

<?php include('<path to your SMF forum>/SSI.php'); ?>

Or you could put it at the beginning of the shoutbox's php code, as long as the SSI include is at the top of the file.

That should take care of it... you can then use $user_info['username'] in place of $name.


im1

I havent checked it just yet, Im gonna try it tomorrow as I dont really have much time today. I'll get back to you and let you know.

Advertisement: