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

  #7  
Старый 08.10.2006, 19:26
DIAgen
Познавший АНТИЧАТ
Регистрация: 02.05.2006
Сообщений: 1,191
Провел на форуме:
7364332

Репутация: 1276


По умолчанию

Ничего сложного:
PHP код:
<?
 
/*
 =====================================================
  DataLife Engine - by SoftNews Media Group 
 -----------------------------------------------------
  http://www.pc-soft.ru/
 -----------------------------------------------------
  Copyright (c) 2004,2006 SoftNews Media Group
 =====================================================
  Данный код защищен авторскими правами
 =====================================================
  Файл: init.php
 -----------------------------------------------------
  Назначение: Инициализация
 =====================================================
 */
 
 
function convert_unicode($t$to 'windows-1251')
 {
         
$t preg_replace'#%u([0-9A-F]{1,4})#ie'"'&#' . hexdec('\\1') . ';'"$t );
         
$t urldecode ($t);
         
$t html_entity_decode($tENT_NOQUOTES$to);
         return 
$t;
 }
 
 function 
send_activation ($host,$query,$others=''){
    
$path=explode('/',$host);
    
$host=$path[0];
    unset(
$path[0]);
    
$path='/'.(implode('/',$path));
    
$post="POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 4.0\r\nContent-length: ".strlen($query)."\r\nConnection: close\r\n\r\n$query";
    
$h=fsockopen($host,80);
 
     if (!
$h) {
        return 
"-1";
     }
 
    
fwrite($h,$post);
    for(
$a=0,$r='';!$a;){
        
$b=fread($h,8192);
        
$r.=$b;
        
$a=(($b=='')?1:0);
    }
    
fclose($h);
 
   if (
stristr$r"antw:activated" )) return "1";
   if (
stristr$r"antw:denied" )) return "0";
 
    return 
"undefined";
 }
 
 
 function 
dle_activation($name$key$site_key){
 
 include (
'../data/config.php');
 include (
'../../language/'.$config['langs'].'/adminpanel.lng');
 
 
$name urlencode(strip_tags ($name));
 
$key  strip_tags ($key);
 
 
$buffer send_activation ("www.dle-news.ru/extras/activate45.php""name={$name}&key={$key}&site_key={$site_key}");
 
 
 switch (
$buffer) {
 
 case 
"-1" :
     
$buffer $lang['trial_act1'];
     break;
 
 case 
"0" :
     
$buffer $lang['trial_act2'];
     break;
 
 case 
"1" :
     
$config['key'] = $site_key;
 
     
$handler fopen('../data/config.php'"w");
     
fwrite($handler"<?PHP \n\n//System Configurations\n\n\$config = array (\n\n");
     foreach(
$config as $name => $value)
     {
     
fwrite($handler"'{$name}' => \"{$value}\",\n\n");
     }
     
fwrite($handler");\n\n?>");
     
fclose($handler);
 
     
$buffer $lang['trial_act3'];
     break;
 
 default:
     
$buffer $lang['trial_act4'];
 }
 
 @
header("HTTP/1.0 200 OK");
 @
header("HTTP/1.1 200 OK");
 @
header("Cache-Control: no-cache, must-revalidate, max-age=0");
 @
header("Expires: 0");
 @
header("Pragma: no-cache");
 @
header("Content-type: text/css; charset=".$config['charset']);
 echo 
$buffer;
 die ();
 }
 
 
     
$site_key explode('.'$_SERVER['HTTP_HOST']);
     
$count_key count($site_key) - 1;
     unset (
$site_key[$count_key]);
     if (
end($site_key) == "com" OR end($site_key) == "net"$count_key --;
     
$site_key $site_key[$count_key-1];
     
$site_key md5(md5($site_key."780918"));
     
$trial_version false;
     
$trial true;
 
     if (
$site_key == $config['key']) {
     
$trial false;
     }
 
     if (
$_REQUEST['activation'] == "yes"dle_activation (convert_unicode($_REQUEST['name']), convert_unicode($_REQUEST['dle_key']), $site_key);
 
 
define('DATALIFEENGINE'true);
 
extract($_REQUESTEXTR_SKIP);
 
 require_once(
ENGINE_DIR.'/inc/mysql.php');
 require_once(
ENGINE_DIR.'/data/dbconfig.php');
 require_once(
ROOT_DIR.'/language/'.$config['langs'].'/adminpanel.lng');
 require_once(
ENGINE_DIR.'/inc/functions.inc.php');
 require_once(
ENGINE_DIR.'/skins/default.skin.php');
 
 if (isset (
$_REQUEST['action'])) $action $_REQUEST['action']; else $action "";
 if (isset (
$_REQUEST['mod'])) $mod $_REQUEST['mod']; else $mod "";
 if (isset (
$_COOKIE['lastusername'])) $lastusername $_COOKIE['lastusername']; else $lastusername "";
 
 if ((
$mod != "editnews" AND $mod != "main" AND $mod != "") AND $trial) {
 
$row $db->super_query("SELECT COUNT(*) as count FROM " PREFIX "_post");
 
$stats_news $row['count'];
 
 
$row $db->super_query("SELECT COUNT(*) as count FROM " PREFIX "_comments");
 
$count_comments $row['count'];
 
 if (
$stats_news 500msg("info","error"$lang['trial_limit']);
 if (
$count_comments 1000msg("info","error"$lang['trial_limit']);
 
 }
 
 
//################# Определение групп пользователей
 
$user_group get_vars ("usergroup");
 
 if (!
$user_group) {
   
$user_group = array ();
 
     
$result $db->query("SELECT * FROM " PREFIX "_usergroups ORDER BY id ASC");
 
   while(
$row $db->get_row($result)){
 
    
$user_group[$row['id']] = array ();
 
      foreach (
$row as $key => $value)
      {
        
$user_group[$row['id']][$key] = $value;
      }
 
   }
   
set_vars ("usergroup"$user_group);
   
mysql_free_result($result);
 }
 
//#################
 
?>
 
Ответить с цитированием