SOLUCIONADO:
Código PHP:
Ver original<?php
function generateKey($webroot,$shortname,$version){
for($i=0;$i<strlen($webroot);$i++){ $alpha = substr($webroot,$i,$i+1); $key1="";
$thisS=getValue($alpha);
$key1= $key1 + $thisS;
}
for($i=0;$i<strlen($shortname);$i++){ $alpha = substr($shortname,$i,1);
$key3="";
$key3= $key3 + $thisS;
}
for($i=0;$i<strlen($version);$i++){ $alpha = substr($version,$i,1); $key4 ="";
$key4 =$key4+$thisS;
}
$hkey1 = ($key1 + $key3 * $key4) * 9;
$hkey2 = ($key1 * $key3 - $key4) * 2;
$hkey3 = ($key1 - $key3 * $key4) * 3;
$hkey4 = ($key1 - $key3 - $key4) * 5;
return $ckey1."-".$ckey2."-".$ckey3."-".$ckey4;
}
function getValue($alpha){
switch($alpha){
case 'a': return 6678 ; break;
case 'b': return 1712 ; break;
case 'c': return 5513 ; break;
case 'd': return 6648 ; break;
case 'e': return 7626 ; break;
case 'f': return 4581 ; break;
case 'g': return 7221 ; break;
case 'h': return 4891 ; break;
case 'i': return 4441 ; break;
case 'j': return 8503 ; break;
case 'k': return 7567 ; break;
case 'l': return 8028 ; break;
case 'm': return 2074 ; break;
case 'n': return 1770 ; break;
case 'o': return 2442 ; break;
case 'p': return 3321 ; break;
case 'q': return 3899 ; break;
case 'r': return 2474 ; break;
case 's': return 5313 ; break;
case 't': return 7505 ; break;
case 'u': return 9808 ; break;
case 'v': return 3571 ; break;
case 'w': return 3352 ; break;
case 'x': return 3410 ; break;
case 'y': return 7058 ; break;
case 'z': return 5847 ; break;
case '0': return 15058 ; break;
case '1': return 89739 ; break;
case '2': return 27663 ; break;
case '3': return 53044 ; break;
case '4': return 74136 ; break;
case '5': return 89338 ; break;
case '6': return 17816 ; break;
case '7': return 93186 ; break;
case '8': return 84464 ; break;
case '9': return 58450 ; break;
default: return 1419 ; break;
}
}
$webroot = "insanomus.freecoolsite.com";
$shortname = "crazyandmaniac";
$version = "666";
echo generateKey($webroot,$shortname,$version);
?>
le aumente un S a $this porque no esta en una clase