This page was printed from dotFAF.com on 21 Nov., 2008

Shoutbox Imposter Hack Addon

Author: Faf
Date: Friday, February 07, 2003
Date/Time: 18:49 GMT
Permanent URL: http://dotfaf.com/archives/20030207_shoutbox_imposter_hack_addon.php
Ok so you've installed Shoutbox[1]. And you're having some problems with people posing as you so you add the imposter hack[2]. Then all of a sudden you realise that it works against you too.

Why? because the imposter hack thinks you're an imposter if you forget and type your name in. Annoying eh? Worse still after calling you an imposter, it remembers you as "Imposter" so even after you go into shoutbox admin and modify the name, you still have to remember everytime to type your codename.

Here's how to fix it:

//### IMPOSTER HACK ADDON STARTS ###
function storeCookie($nick,$BSpattern0) {
if ($nick == "Imposter")
{
setcookie("shoutinfo","|$url",2147483647);
}
elseif ($nick == "your_name")
{
setcookie("shoutinfo","$BSpattern0|$url",2147483647);
}
else {
setcookie("shoutinfo","$nick|$url",2147483647);
}
}
//### IMPOSTER HACK ADDON ENDS ###
Copy the code above, find the file in your shoutbox installation called shoutbox.php. Open it in a text editor and scroll to the bottom. Place the code just before the closing PHP tags ie. ?>. Edit it by changing your_name to the value you set in the imposter ban script. ie. What is shown when you enter your codename. Note that if you set the imposter script to show anything other than Imposter when someone tries to pose as you, then you'll need to change the script you just added to pick up that value as well.

Now scroll up till you see this line:
// *BOB* --- Set the users nick and url in a cookie for next time:

replace the line after that with:
storeCookie($nick,$BSpattern0); That's it. You're done.

WHAT THE CODE DOES:
The line you replaced is what tells shoutbox to store a cookie to remember a person so they dont have to type thier name an URL everytime. You replaced it to call the new function you added.

The function get's the nickname as would be displayed on the page not what the person entered. It also gets your codename. ie. what you enter so that your real "shoutbox name" is displayed.

It then checks to see if the person commenting is an imposter. If they are... then it doesnt store thier name. So that when you forget sometimes and you entered your name instead of your shoutbox name, at least you'll get an error next time you try to comment it'll be blank. Sort of a reminder about "last time".

If you entered your codename, it'll show the name you want to appear in shotbox alright, but it'll remember you codename so you dont have to type it again.

If it doesnt fit any of the two categories, that is, not an imposter nor is it you, then it treats it like normal and saves whoever is shouting's name.

NB: This script only works after you've installed the imposter hack script.


Comments on this entry:

Author: Amit [Netahoy] Agarwal
Date/Time: February 18, 2003 6:30 PM
URL: http://www.netahoy.org

thxs man!



TrackBack URL for this entry:
http://www.dotfaf.com/cgi-bin/mt/mt-tb.cgi/209

Trackback Pings Received count (0)


Trackback Pings Sent count (0):


Hyperlinks in entry:
1) http://www.webfroot.co.nz/shoutbox/
2) http://bswebdesign.net/scripts/bsximposter.php