|
|
Hinzufügen eines neuen Songs
_key = "test";
return 1;
}
function keyED($txt)
{
$encrypt_key = md5($this->_key);
$ctr=0;
$tmp = "";
for ($i=0;$i encrypt($txt));
}
function encrypt($txt)
{
// Public key, which we always set to a unique value.
$encrypt_key = md5(microtime());
$ctr=0;
$tmp = "";
for ($i=0;$ikeyED($tmp);
}
function html_decrypt($txt)
{
return $this->decrypt(urldecode($txt));
}
function decrypt($txt)
{
$txt = $this->keyED($txt);
$tmp = "";
for ($i=0;$i tag? We can tell because
// we are passed a different variable name - $img_code.
$img_code = $HTTP_GET_VARS["img_code"];
if(!empty($img_code))
{
$enc = new cls_encrypt;
// We add spaces just for padding
// $img_code = $enc->html_decrypt($img_code);
// Change this to whatever you want. 5 is just a nice size
$font = 5;
$height = imagefontheight($font);
$width = imagefontwidth($font)*strlen($img_code);
$im = imagecreate($width,$height);
$im_final = imagecreate($width*2,$height*2);
$gray = imagecolorallocate($im, 0x1f, 0x1f, 0x1f);
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
// Our shades of grey
$rwhite[0] = imagecolorallocate($im_final, 0xcf, 0xcf, 0xcf);
$rwhite[1] = imagecolorallocate($im_final, 0xdf, 0xdf, 0xdf);
$rwhite[2] = imagecolorallocate($im_final, 0x9f, 0x9f, 0x9f);
imagefill($im,0,0,$white);
imagestring($im, $font,0,0,$img_code,$gray);
// We increase the image size as even the "5" font is a bit too small
// for me. We just double the height and width.
imagecopyresized( $im_final, $im, 0,0,0,0,
$width*2,$height*2, $width,$height);
// Draw the "fuzzy" background.
for($y=0;$y<$height*2;$y+=6)
{
imageline($im_final,0,$y,$width*2,$y,$rwhite[rand(0,2)]);
}
for($x=0;$x<$width*2;$x+=6)
{
imageline($im_final,$x,0,$x,$height*2,$rwhite[rand(0,2)]);
}
// Return as PNG. Returning as a JPG may make the image even more fuzzy.
// Try it, you may like it.
header("Content-type: image/png");
imagepng($im_final);
imagedestroy($im_final);
imagedestroy($im);
}
else
{
// Otherwise we are validating if we have POSTed $check_code or are just
// generating the initial code.
$check_code = $HTTP_POST_VARS["check_code"];
$hidden_code = $HTTP_POST_VARS["hidden_code"];
$validated = 0;
if(!empty($check_code))
{
$enc = new cls_encrypt;
// $hidden_code is the encrypted 4 digit code
// $hidden_code = $enc->html_decrypt($hidden_code);
// If the decrypted version matches the inputted text,
// we are good to go!
if($hidden_code==$check_code)
{
$validated=1;
}
else
{
$validated=-1;
}
}
// If we have been validated or are starting from the
// beginning, generate the 4 digit code
if($validated<>1)
{
// This is our character pool, with confusing letters removed
$chars = "ABCDEFGHJKMNPRSTUVWXYZabcdefghzkmnprstuvwxyz23456789";
$len = strlen($chars)-1;
for($i=0;$i<4;$i++)
{
$show_code .= substr($chars,rand(0,$len),1);
}
// And we encrypt it
// $enc = new cls_encrypt;
// $show_code = $enc->html_encrypt($show_code);
}
}
?>
Danke, Dein Song wurde hinzugefügt. Er wird nun begutachtet und in Kürze freigeschaltet. |
|
Du möchtest gerne über ein Lied abstimmen und hast es hier nicht gefunden? Kein Problem! Starte einfach einen neuen Song Contest. Fülle die folgenden Felder aus, und schon ist Dein eigener Song Contest online, und jeder kann abstimmen.
Es müssen alle Felder ausgefüllt werden. Bitte versuche alle Daten korrekt einzugeben und achte auch auf die richtige Schreibweise.
Sollten Dir einzelne Informationen fehlen, www.songfacts.com ist eine gute Quelle.
|