Показать сообщение отдельно

Помогите с кодом
  #14  
Старый 07.07.2009, 14:31
Komyak
Участник форума
Регистрация: 15.01.2009
Сообщений: 158
С нами: 9116253

Репутация: 26
Question Помогите с кодом

Помогите пожалуйста с кодом кто разбирается.
Это из файла "main.lib.php" последнего скрипта. Пробовал требуемую операцию проводить "ручками", но в ней идёт сравнение с переменными "$len" и ''$str" но в этом не хватает знаний...
Цитата:
function serial( $str = "", $email = "" ) { global $settings; $type = substr( $str, 0, 3 ); $len = substr( $str, strlen( $str ) - 1, strlen( $str ) ) + 4; $str = substr( $str, 3, strlen( $str ) - $len ); $search = array( "wq", "re", "yt", "iu", "po", "sa", "fd", "hg", "kj", "lk" ); $replace = array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ); switch ( $type ) { case "1st" : $serials = explode( "@%", $str ); if ( isset( $serials[1] ) ) { $host = "scriptoprofessional_".rethostex( )."scripto_time"; if ( md5( $host ).md5( $host.$host ).md5( $host.$host.$host ).md5( $host.$host.$host.$host ).md5( $host.$host.$host.$host.$host ).md5( $host.$host.$host.$host.$host.$host ) == $serials[1] ) { $time = str_replace( $search, $replace, $serials[0] ); if ( eregi( "^[0-9]{1,}\$", $time ) ) { if ( time( ) <= $time ) { $timestamp = $time - time( ); if ( $timestamp / 86400 <= 2 ) { echo "Внимание! Действие лицензии Scripto catalog заканчивается ".date( "d-m-Y", $time )."<br>"; } return true; } return false; } return false; } return false; } return false; case "1sn" : $host = "scriptoprofessional_".rethostex( )."scripto_notime"; if ( md5( $host ).md5( $host.$host ).md5( $host.$host.$host ).md5( $host.$host.$host.$host ).md5( $host.$host.$host.$host.$host ).md5( $host.$host.$host.$host.$host.$host ) == $str ) { return true; } return false; case "unt" : if ( isset( $settings['mailadmin'] ) ) { $mail = $settings['mailadmin']; } else { $mail = $email; } $serials = explode( "@%", $str ); if ( isset( $serials[1] ) ) { $host = "scriptoprofessional_".$mail."supernick"; if ( md5( $host ).md5( $host.$host ).md5( $host.$host.$host ).md5( $host.$host.$host.$host ).md5( $host.$host.$host.$host.$host ).md5( $host.$host.$host.$host.$host.$host ) == $serials[1] ) { $time = str_replace( $search, $replace, $serials[0] ); if ( eregi( "^[0-9]{1,}\$", $time ) ) { if ( time( ) <= $time ) { $timestamp = $time - time( ); if ( $timestamp / 86400 <= 2 ) { echo "Внимание! Действие лицензии Scripto catalog заканчивается ".date( "d-m-Y", $time )."<br>"; } return true; } return false; } return false; } return false; } return false; case "unn" : if ( isset( $settings['mailadmin'] ) ) { $mail = $settings['mailadmin']; } else { $mail = $email; } $host = "scriptoprofessional_".$mail."supernick_noptim e"; if ( md5( $host ).md5( $host.$host ).md5( $host.$host.$host ).md5( $host.$host.$host.$host ).md5( $host.$host.$host.$host.$host ).md5( $host.$host.$host.$host.$host.$host ) == $str ) { return true; } return false; } }
Как писать код в столбик, что то получается только в строчку или так.

Последний раз редактировалось Komyak; 07.07.2009 в 14:44..
 
Ответить с цитированием