1 (edited by 2008-12-30 13:50:09)

Topic: [HACK] Tripcodes

Name: Tripcode
Author: FUNimations
Debugging: Stuff
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: the tripcode function is some simple encoding script i found on the web. I could have written my own but the definition of a prgrammer is that he's lazy. So what this hack does is add a tripcode after a persons name in the Comments.
Discussion Topic: here
Instructions:
in functions.inc.php find

?>

add above

///////////////////////////////////////////////////////
// Function:         Tripcode
// Description:      encrypt your personal password. (this is a simple encryption, never use it to secure your website)
function tripcode($plain)
{
    $salt = substr($plain."H.",1,2);
    $salt = ereg_replace("[^\.-z]",".",$salt);
    $salt = strtr($salt,":;<=>?@[\\]^_`","ABCDEFGabcdef");
    return substr(crypt($plain,$salt),-10);
}


next in shows.inc.php find

//----------------------------------
    // Add The Comment ... Go Go GO!
    //----------------------------------

add under

if(!empty($_POST['trip']))
$name = $name."!".tripcode($_POST['trip']);


to add a password in the form
go to your template and in the comments form add

tripcode: <input type="text" name="trip">