Дезендите 2 файла пожалуйста!

Статус
В этой теме нельзя размещать новые ответы.

Pigini

Знаток
Регистрация
28 Апр 2009
Сообщения
173
Реакции
29
Модуль доски объявлений.
Всего 2 файла php ... но Зенд защита.
Все работает, но хотелось бы видеть код.

Вот 2 файла -



Пробовал сам дезендить, но не до конца правильно получается -
PHP:
<?php 
class Site_Board 
{ 

    public $db = null; 
    public $tpl = null; 
    public $sec = array( ); 
    public $cat = array( ); 
    public $con = array( ); 
    public $tag = ""; 
    public $key = ""; 

    public function __construct( ) 
    { 
        global $db; 
        global $tpl; 
        require_once( ENGINE_DIR."/data/board_config.php" ); 
        $this->db = $db; 
        $this->tpl = $tpl; 
        $this->con = $board_config; 
        if ( $this->con['key']( $this->con['key'] ) == true ) 
        { 
            $this->get_cache( ); 
            if ( $_GET['do'] == "board" ) 
            { 
                $this->router( ); 
            } 
        } 
        else 
        { 
            $this->box( "Ìîäóëü íå àêòèâèðîâàí", "<font color='red'>Íåîáõîäèìî àêòèâèðîâàòü ìîäóëü, èíà÷å îí ðàáîòàòü íå áóäåò</font>" ); 
        } 
    } 

    public function router( ) 
    { 
        $this->del_bulletins( ); 
        if ( isset( $_GET['action'] ) ) 
        { 
            if ( $_GET['action'] == "show_cat" ) 
            { 
                $_obfuscate_8Zt3KoS4J9Mÿ = $this->show_cat( ); 
                $this->tag = $_obfuscate_8Zt3KoS4J9Mÿ; 
            } 
            if ( $_GET['action'] == "show_bul" ) 
            { 
                $_obfuscate_Jlk0gaxGTXAÿ = $this->show_bul( ); 
                $this->tag = $_obfuscate_Jlk0gaxGTXAÿ; 
            } 
            if ( $_GET['action'] == "add" ) 
            { 
                $this->add( ); 
                $this->tag = "Äîáàâëåíèå îáúÿâëåíèÿ"; 
            } 
            if ( $_GET['action'] == "save_add" ) 
            { 
                $this->save_add( ); 
            } 
        } 
        else 
        { 
            $this->category( ); 
            if ( $this->con['show_top'] == "yes" ) 
            { 
                $this->top( ); 
            } 
            $this->tag = $this->con['title']; 
        } 
    } 

    public function category( ) 
    { 
        global $config; 
        $i = 0; 
        $_obfuscate_rVsNRAÿÿ = $this->con['rows_cat']; 
        foreach ( $this->sec as $sec ) 
        { 
            foreach ( $this->cat as $cat ) 
            { 
                if ( $cat['cat_sec'] == $sec['sec_id'] ) 
                { 
                    $_obfuscate_DT2Z9E9UhTSy = 0 < $cat['cat_count'] ? $cat['cat_count'] : ""; 
                    $url = $config['allow_alt_url'] == "yes" ? "/board/cat-".$cat['cat_id']."/" : "/index.php?do=board&action=show_cat&id=".$cat['cat_id']; 
                    $this->tpl->load_template( "board/category.tpl" ); 
                    $this->tpl->set( "{url}", $url ); 
                    $this->tpl->set( "{name}", $cat['cat_name'] ); 
                    $this->tpl->set( "{count}", $_obfuscate_DT2Z9E9UhTSy ); 
                    if ( 0 < $cat['cat_count'] ) 
                    { 
                        $this->tpl->set_block( "|\\[bulletin-yes\\](.*?)\\[/bulletin-yes\\]|si", "\\1" ); 
                        $this->tpl->set_block( "|\\[bulletin-no\\](.*?)\\[/bulletin-no\\]|si", "" ); 
                    } 
                    else 
                    { 
                        $this->tpl->set_block( "|\\[bulletin-yes\\](.*?)\\[/bulletin-yes\\]|si", "" ); 
                        $this->tpl->set_block( "|\\[bulletin-no\\](.*?)\\[/bulletin-no\\]|si", "\\1" ); 
                    } 
                    $this->tpl->compile( "category" ); 
                    $_obfuscate_p45BShOKcJYÿ .= $this->tpl->result['category']; 
                    $count += $cat['cat_count']; 
                    $this->tpl->global_clear( ); 
                } 
            } 
            if ( $i == $_obfuscate_rVsNRAÿÿ ) 
            { 
                $_obfuscate_ .= "</tr>\n<tr>\n"; 
                $_obfuscate_rVsNRAÿÿ += $this->con['rows_cat']; 
            } 
            $this->tpl->load_template( "board/section.tpl" ); 
            $this->tpl->set( "{icon}", $sec['sec_icon'] ); 
            $this->tpl->set( "{name}", $sec['sec_name'] ); 
            $this->tpl->set( "{category}", $_obfuscate_p45BShOKcJYÿ ); 
            $this->tpl->compile( "section" ); 
            $_obfuscate_ .= "\n<td valign='top'>\n".$this->tpl->result['section']."\n</td>\n"; 
            $this->tpl->global_clear( ); 
            ++$i; 
            $_obfuscate_p45BShOKcJYÿ = false; 
        } 
        $_obfuscate_ = "<table width='100%'>\n<tr>\n".$_obfuscate_."\n</tr>\n</table>\n"; 
        $this->tpl->load_template( "board/categories.tpl" ); 
        $this->tpl->set( "{section}", $_obfuscate_ ); 
        $this->tpl->set( "{count}", $count ); 
        $this->tpl->compile( "content" ); 
        $this->tpl->clear( ); 
    } 

    public function top( ) 
    { 
        global $config; 
        $_obfuscate_1uJ1csLMWAÿÿ = $this->con( "\r\n      SELECT bul_id, bul_type, bul_theme, bul_start\r\n      FROM ".PREFIX."_board_bulletins\r\n      ORDER BY bul_start DESC\r\n      LIMIT 0, ".$this->con['num_top']."\r\n    " ); 
        while ( $row = $this->db->get_row( $_obfuscate_1uJ1csLMWAÿÿ ) ) 
        { 
            $url = $config['allow_alt_url'] == "yes" ? "/board/bul-".$row['bul_id'].".html" : "/index.php?do=board&action=show_bul&id=".$row['bul_id']; 
            $this->tpl->load_template( "board/top.tpl" ); 
            $this->tpl->set( "{url}", $url ); 
            $this->tpl->set( "{theme}", $row['bul_theme'] ); 
            $this->tpl->set( "{type}", $row['bul_type']( $row['bul_type'] ) ); 
            $this->tpl->set( "{date}", date( "j.n.Y", $row['bul_start'] ) ); 
            $this->tpl->compile( "top" ); 
            $this->tpl->clear( ); 
        } 
        $this->tpl->load_template( "board/show_top.tpl" ); 
        $this->tpl->result( "{top}", $this->tpl->result['top'] ); 
        $this->tpl->compile( "content" ); 
        $this->tpl->clear( ); 
    } 

    public function show_cat( ) 
    { 
        global $config; 
        if ( $_GET['id'] !== "" ) 
        { 
            $_obfuscate_xvYeh9Iÿ = $this->con['bul_page']; 
            $_obfuscate_W7bDo7Tf = $_GET['cstart'] == "" ? 0 : ( $_GET['cstart'] - 1 ) * $_obfuscate_xvYeh9Iÿ; 
            $_obfuscate_BH7wNrHYY4_uxgÿÿ = $_GET( "SELECT COUNT(*) as count FROM ".PREFIX."_board_bulletins WHERE bul_cat = '".$_GET['id']."'" ); 
            $_obfuscate_lnnRdTB1Rwÿÿ = $_obfuscate_BH7wNrHYY4_uxgÿÿ['count']; 
            $_obfuscate_jBJBsjgLAk11PcCm = $config['http_home_url']."/board/cat-".$_GET['id'].""; 
            $_obfuscate_qMG_NyCxl8UZUR8 = $config['http_home_url']."/index.php?do=board&action=show_cat&id=".$_GET['id']; 
            $_obfuscate_C6_bCo2KzAÿÿ = $_GET( "\r\n        SELECT bul_id, bul_type, bul_theme, bul_start, bul_images\r\n        FROM ".PREFIX."_board_bulletins\r\n        WHERE bul_cat = '".$_GET['id']."'\r\n        ORDER BY bul_start ASC\r\n        LIMIT ".$_obfuscate_W7bDo7Tf.", ".$_obfuscate_xvYeh9Iÿ."\r\n      " );
            while ( $row = $this->db->get_row( $_obfuscate_C6_bCo2KzAÿÿ ) ) 
            { 
                if ( $row['bul_images'] == "" ) 
                { 
                    $this->tpl->set_block( "|\\[foto-yes\\](.*?)\\[/foto-yes\\]|si", "" ); 
                    $this->tpl->set_block( "|\\[foto-no\\](.*?)\\[/foto-no\\]|si", "\\1" ); 
                } 
                else 
                { 
                    $this->tpl->set_block( "|\\[foto-yes\\](.*?)\\[/foto-yes\\]|si", "\\1" ); 
                    $this->tpl->set_block( "|\\[foto-no\\](.*?)\\[/foto-no\\]|si", "" ); 
                } 
                $url = $config['allow_alt_url'] == "yes" ? "/board/bul-".$row['bul_id'].".html" : "/index.php?do=board&action=show_bul&id=".$row['bul_id']; 
                $this->tpl->load_template( "board/bulletins.tpl" ); 
                $this->tpl->set( "{url}", $url ); 
                $this->tpl->set( "{theme}", $row['bul_theme'] ); 
                $this->tpl->set( "{type}", $row['bul_type']( $row['bul_type'] ) ); 
                $this->tpl->set( "{date}", date( "j.n.Y", $row['bul_start'] ) ); 
                $this->tpl->compile( "bulletins" ); 
                $this->tpl->clear( ); 
            } 
            $_obfuscate_kAW0rE3gzPYIAÿÿ = $this->navigation( $_obfuscate_xvYeh9Iÿ, $_obfuscate_W7bDo7Tf, $_obfuscate_lnnRdTB1Rwÿÿ, $_obfuscate_jBJBsjgLAk11PcCm, $_obfuscate_qMG_NyCxl8UZUR8 ); 
            $this->tpl->load_template( "board/show_cat.tpl" ); 
            $this->sec[$this->cat[$_GET['id']]['cat_sec']]( "{sec_name}", $this->sec[$this->cat[$_GET['id']]['cat_sec']]['sec_name'] ); 
            $this->cat[$_GET['id']]( "{cat_name}", $this->cat[$_GET['id']]['cat_name'] ); 
            $this->tpl->result( "{bulletins}", $this->tpl->result['bulletins'] ); 
            $this->tpl->set( "{navigation}", $_obfuscate_kAW0rE3gzPYIAÿÿ ); 
            $this->tpl->compile( "content" ); 
            $this->tpl->clear( ); 
            return $this->cat[$_GET['id']]['cat_name']; 
        } 
    } 

    public function show_bul( ) 
    { 
        global $config; 
        if ( $_GET['id'] !== "" ) 
        { 
            $_obfuscate_AsrQ = $_GET( "\r\n        SELECT *\r\n        FROM ".PREFIX."_board_bulletins\r\n        WHERE bul_id = '".$_GET['id']."'\r\n      " ); 
            if ( $_obfuscate_AsrQ['bul_images'] !== "" ) 
            { 
                $_obfuscate_rVsNRAÿÿ = $this->con['rows_thumb']; 
                $_obfuscate_MNh1cC6M = explode( "|", $_obfuscate_AsrQ['bul_images'] ); 
                $_obfuscate_1mNnwucÿ .= "<table><tr>"; 
                foreach ( $_obfuscate_MNh1cC6M as $_obfuscate_3vXM ) 
                { 
                    if ( $i == $_obfuscate_rVsNRAÿÿ ) 
                    { 
                        $_obfuscate_1mNnwucÿ .= "</tr><tr>"; 
                        $_obfuscate_rVsNRAÿÿ += $this->con['rows_thumb']; 
                    } 
                    $this->tpl->load_template( "board/foto.tpl" ); 
                    $this->tpl->set( "{url}", $config['http_home_url']."uploads/board/images/".$_obfuscate_3vXM ); 
                    $this->tpl->set( "{foto}", "/uploads/board/thumbs/".$_obfuscate_3vXM ); 
                    $this->tpl->compile( "fotos" ); 
                    $_obfuscate_1mNnwucÿ .= "<td>".$this->tpl->result['fotos']."</td>"; 
                    $this->tpl->global_clear( ); 
                    ++$i; 
                } 
                $_obfuscate_1mNnwucÿ .= "</tr></table>"; 
            } 
            $this->tpl->load_template( "board/show_bul.tpl" ); 
            $this->sec[$this->cat[$_obfuscate_AsrQ['bul_cat']]['cat_sec']]( "{sec_name}", $this->sec[$this->cat[$_obfuscate_AsrQ['bul_cat']]['cat_sec']]['sec_name'] ); 
            $this->cat[$_obfuscate_AsrQ['bul_cat']]( "{cat_name}", $this->cat[$_obfuscate_AsrQ['bul_cat']]['cat_name'] ); 
            $this->tpl->set( "{theme}", $_obfuscate_AsrQ['bul_theme'] ); 
            $this->tpl->set( "{type}", $_obfuscate_AsrQ['bul_type']( $_obfuscate_AsrQ['bul_type'] ) ); 
            $this->tpl->set( "{start_date}", date( "j.n.Y", $_obfuscate_AsrQ['bul_start'] ) ); 
            $this->tpl->set( "{stop_date}", date( "j.n.Y", $_obfuscate_AsrQ['bul_stop'] ) ); 
            $this->tpl->set( "{days}", round( ( $_obfuscate_AsrQ['bul_stop'] - $_obfuscate_AsrQ['bul_start'] ) / 86400, 0 ) ); 
            $this->tpl->set( "{author}", $_obfuscate_AsrQ['bul_name'] ); 
            $this->tpl->set( "{phone}", $_obfuscate_AsrQ['bul_phone'] ); 
            $this->tpl->set( "{text}", $_obfuscate_AsrQ['bul_text'] ); 
            $this->tpl->set( "{fotos}", $_obfuscate_1mNnwucÿ ); 
            $this->tpl->compile( "content" ); 
            $this->tpl->clear( ); 
            return $_obfuscate_AsrQ['bul_theme']; 
        } 
    } 

    public function add( ) 
    { 
        global $is_logged; 
        $path = parse_url( $_obfuscate_QSpsVAzJ['http_home_url'] ); 
        $_obfuscate_uuejq7KG = $is_logged ? "" : "\\1"; 
        $this->tpl->load_template( "board/add.tpl" ); 
        $this->tpl->set_block( "|\\[not-logged\\](.*?)\\[/not-logged\\]|si", $_obfuscate_uuejq7KG ); 
        $this->tpl->set( "{categories}", $this->cat_list( ) ); 
        $this->tpl->set( "{type}", "<select name='type'><option value=''>Âûáåðèòå òèï:</option><option value='1'>Ïðåäëîæåíèå</option><option value='2'>Ñïðîñ</option><option value='3'>Óñëóãè</option><option value='4'>Îáìåí</option></select>" );
        $this->tpl->set( "{timeout}", "<select name='timeout'><option value='30'>30 äíåé</option><option value='60'>60 äíåé</option><option value='90'>90 äíåé</option></select>" ); 
        $this->tpl->set( "{code}", "<span id='dle-captcha'><img src='".$path['path']."/engine/modules/antibot.php' border='0' /><br /><a onclick='reload(); return false;' href='#'>Îáíîâèòü êîä</a></span>" ); 
        $this->tpl->set( "{files}", "<div id='files'><input type='file' name='file[]'></div>" ); 
        $this->tpl->copy_template = "<form  method='post' action='/index.php?do=board&action=save_add' enctype='multipart/form-data'>".$this->tpl->copy_template."</form>"; 
        $this->tpl .= "copy_template"; 
        $this->tpl->compile( "content" ); 
        $this->tpl->clear( ); 
    } 

    public function save_add( ) 
    { 
        global $is_logged; 
        global $member_id; 
        global $config; 
        require_once( ENGINE_DIR."/classes/parse.class.php" ); 
        $parse = new ParseFilter( ); 
        $error = ""; 
        if ( $is_logged ) 
        { 
            $name = $member_id['name']; 
            $mail = $member_id['email']; 
        } 
        else 
        { 
            if ( $_POST['name'] == "" ) 
            { 
                $error .= "<font color='red'>Íå óêàçàíî âàøå èìÿ</font><br>"; 
            } 
            else 
            { 
                $_POST['name']( "SELECT name FROM ".USERPREFIX."_users WHERE LOWER(name) = '".strtolower( $_POST['name'] )."'" ); 
                if ( 0 < $this->db->num_rows( ) ) 
                { 
                    $error .= "<font color='red'>Èìÿ êîòîðîå âû ââåëè óæå çàíÿòî äðóãèì ïîëüçîâàòåëåì</font><br>"; 
                } 
                else 
                { 
                    $name = $this->db->safesql( trim( $_POST['name'] )( trim( $_POST['name'] ) ) ); 
                } 
                $this->db->free( ); 
            } 
            if ( $_POST['email'] == "" ) 
            { 
                $error .= "<font color='red'>Íå óêàçàí âàø E-mail</font><br>"; 
            } 
            else if ( preg_match( "/^[\\.A-z0-9_\\-]+[@][A-z0-9_\\-]+([.][A-z0-9_\\-]+)+[A-z]{1,4}$/", $_POST['email'] ) ) 
            { 
                $error .= "<font color='red'>Íå ïðàâèëüíî óêàçàí E-mail</font><br>"; 
            } 
            else 
            { 
                $mail = $this->db->safesql( trim( $_POST['email'] )( trim( $_POST['email'] ) ) ); 
            } 
        } 
        if ( $_POST['type'] == "" ) 
        { 
            $error .= "<font color='red'>Íå âûáðàí òèï îáúÿâëåíèÿ</font><br>"; 
        } 
        if ( $_POST['cat'] == "" ) 
        { 
            $error .= "<font color='red'>Íå âûáðàíà êàòåãîðèÿ</font><br>"; 
        } 
        if ( $_POST['theme'] == "" ) 
        { 
            $error .= "<font color='red'>Íå óêàçàíà òåìà îáúÿâëåíèÿ</font><br>"; 
        } 
        if ( $_POST['text'] == "" ) 
        { 
            $error .= "<font color='red'>Íå íàïèñàí òåêñò îáúÿâëåíèÿ</font><br>"; 
        } 
        if ( $_POST['sec_code'] == "" ) 
        { 
            $error .= "<font color='red'>Íå ââåäåí çàùèòíûé êîä</font><br>"; 
        } 
        else if ( $_POST['sec_code'] !== $_SESSION['sec_code_session'] ) 
        { 
            $error .= "<font color='red'>Íå ïðàâèëüíî ââåäåí çàùèòíûé êîä</font><br>"; 
        } 
        if ( $error == "" ) 
        { 
            $type = $this->db->safesql( trim( $_POST['type'] )( trim( $_POST['type'] ) ) ); 
            $cat = $this->db->safesql( trim( $_POST['cat'] )( trim( $_POST['cat'] ) ) ); 
            $theme = $this->db->safesql( trim( $_POST['theme'] )( trim( $_POST['theme'] ) ) ); 
            $text = $this->db->safesql( trim( $_POST['text'] )( trim( $_POST['text'] ) ) ); 
            $city = $this->db->safesql( trim( $_POST['city'] )( trim( $_POST['city'] ) ) ); 
            $phone = $this->db->safesql( trim( $_POST['phone'] )( trim( $_POST['phone'] ) ) ); 
            $_POST( "\r\n        INSERT INTO ".PREFIX."_board_bulletins\r\n          (\r\n           bul_name,\r\n           bul_email,\r\n           bul_type,\r\n           bul_cat,\r\n           bul_theme,\r\n           bul_text,\r\n           bul_city,\r\n           bul_phone,\r\n           bul_start,\r\n           bul_stop,\r\n           bul_images\r\n          )\r\n        VALUES\r\n          (\r\n           '".$name."',\r\n           '".$mail."',\r\n           '".$type."',\r\n           '".$cat."',\r\n           '".$theme."',\r\n           '".$text."',\r\n           '".$city."',\r\n           '".$phone."',\r\n           '".time( )."',\r\n           '".( 86400 * $_POST['timeout'] + time( ) )."',\r\n           ''\r\n          )\r\n      " );
            $in_id = $this->db->insert_id( ); 
            if ( $_FILES['file']['name'][0] !== "" ) 
            { 
                include_once( ENGINE_DIR."/classes/thumb.class.php" ); 
                $i = 0; 
                for ( ; $i < count( $_FILES['file']['name'] ); ++$i ) 
                { 
                    $extensions = array( "gif", "jpg", "png", "jpe", "jpeg" ); 
                    $name_arr = explode( ".", $_FILES['file']['name'][$i] ); 
                    $name = uniqid( ); 
                    $type = end( &$name_arr ); 
                    if ( !in_array( $type, $extensions ) && !in_array( strtolower( $type ), $extensions ) ) 
                    { 
                        @move_uploaded_file( @$_FILES['file']['tmp_name'][$i], @ROOT_DIR."/uploads/board/images/".$name.".".$type ); 
                        $thumb = new thumbnail( ROOT_DIR."/uploads/board/images/".$name.".".$type ); 
                        if ( $this->con['thumb']( $this->con['thumb'], 0 ) ) 
                        { 
                            $config['jpeg_quality']( $config['jpeg_quality'] ); 
                            $thumb->save( ROOT_DIR."/uploads/board/thumbs/".$name.".".$type ); 
                        } 
                        $images[] = $name.".".$type; 
                    } 
                } 
                $this->db->query( "\r\n          UPDATE ".PREFIX."_board_bulletins\r\n          SET bul_images = '".implode( "|", $images )."'\r\n          WHERE bul_id = '".$in_id."'\r\n        " ); 
            } 
            $cattt = $this->db->super_query( "\r\n        SELECT cat_count\r\n        FROM ".PREFIX."_board_category\r\n        WHERE cat_id = '".$cat."'\r\n      " ); 
            $cattt['cat_count']( "\r\n        UPDATE ".PREFIX."_board_category\r\n        SET cat_count = '".( $cattt['cat_count'] + 1 )."'\r\n        WHERE cat_id = '".$cat."'\r\n      " ); 
            $this->del_cache( ); 
            $this->tpl->load_template( "info.tpl" ); 
            $this->tpl->set( "{title}", "Âàøå îáúÿâëåíèå óñïåøíî äîáàâëåíî" ); 
            $this->tpl->set( "{error}", "<font color='green'>Âàøå îáúÿâëåíèå óñïåøíî äîáàâëåíî â áàçó</font><br><br /><a href='#' onclick='javascript:history.go(-1)'>Âåðíóòüñÿ íàçàä</a>" ); 
            $this->tpl->compile( "content" ); 
            $this->tpl->clear( ); 
        } 
        else 
        { 
            $this->box( "Ïðè çàïîëíåíèè ôîðìû îáíàðóæåíû îøèáêè!", $error."<br /><a href='#' onclick='javascript:history.go(-1)'>Âåðíóòüñÿ íàçàä</a>" ); 
        } 
    } 

    public function block( ) 
    { 
        global $config; 
        foreach ( $this->sec as $sec ) 
        { 
            foreach ( $this->cat as $cat ) 
            { 
                if ( $cat['cat_sec'] == $sec['sec_id'] ) 
                { 
                    $url = $config['allow_alt_url'] == "yes" ? "/board/cat-".$cat['cat_id']."/" : "/index.php?do=board&action=show_cat&id=".$cat['cat_id']; 
                    $this->tpl->load_template( "board/block_cat.tpl" ); 
                    $this->tpl->set( "{url}", $url ); 
                    $this->tpl->set( "{name}", $cat['cat_name'] ); 
                    $this->tpl->set( "{count}", $cat['cat_count'] ); 
                    $this->tpl->compile( "categories" ); 
                    $_obfuscate_p45BShOKcJYÿ .= $this->tpl->result['categories']; 
                    $this->tpl->result['categories'] = ""; 
                    $this->tpl->clear( ); 
                } 
            } 
            $this->tpl->load_template( "board/block_sec.tpl" ); 
            $this->tpl->set( "{name}", $sec['sec_name'] ); 
            $this->tpl->set( "{id}", $sec['sec_id'] ); 
            $this->tpl->set( "{categories}", $_obfuscate_p45BShOKcJYÿ ); 
            $this->tpl->compile( "sections" ); 
            $_obfuscate_ .= $this->tpl->result['sections']; 
            $this->tpl->result['sections'] = ""; 
            $this->tpl->clear( ); 
            ++$i; 
            $_obfuscate_p45BShOKcJYÿ = false; 
        } 
        $this->tpl->load_template( "board/block.tpl" ); 
        $this->tpl->set( "{sections}", $_obfuscate_ ); 
        $this->tpl->set( "{categories}", "Êàòåãîðèè" ); 
        $this->tpl->copy_template = "\r\n      <script language='JavaScript' type='text/javascript'>\r\n       function Show_Hide(id){\r\n         if (document.getElementById) { item = document.getElementById(id); }\r\n         if (item.style) {\r\n           if (item.style.display == 'none'){ item.style.display = ''; }\r\n           else { item.style.display = 'none'; }\r\n         }\r\n       }\r\n      </script>\r\n    ".$this->tpl->copy_template; 
        $this->tpl->compile( "block" ); 
        $this->tpl->clear( ); 
        return $this->tpl->result['block']; 
    } 

    public function cat_list( ) 
    { 
        $data .= "<select name='cat'><option value=''>Âûáåðèòå êàòåãîðèþ:</option>"; 
        foreach ( $this->sec as $sec ) 
        { 
            $data .= "<optgroup label='".$sec['sec_name']."'>"; 
            foreach ( $this->cat as $cat ) 
            { 
                if ( $cat['cat_sec'] == $sec['sec_id'] ) 
                { 
                    $data .= "<option value='".$cat['cat_id']."'>".$cat['cat_name']."</option>"; 
                } 
            } 
        } 
        $data .= "</select>"; 
        return $data; 
    } 

    public function type( $_obfuscate_E9QJjgv2_GAÿ ) 
    { 
        if ( $_obfuscate_E9QJjgv2_GAÿ == "1" ) 
        { 
            $type = "Ïðåäëîæåíèå"; 
            return $type; 
        } 
        if ( $_obfuscate_E9QJjgv2_GAÿ == "2" ) 
        { 
            $type = "Ñïðîñ"; 
            return $type; 
        } 
        if ( $_obfuscate_E9QJjgv2_GAÿ == "3" ) 
        { 
            $type = "Óñëóãè"; 
            return $type; 
        } 
        if ( $_obfuscate_E9QJjgv2_GAÿ == "4" ) 
        { 
            $type = "Îáìåí"; 
            return $type; 
        } 
        $type = "-"; 
        return $type; 
    } 

    public function box( $_obfuscate_obqvewÿÿ, $text ) 
    { 
        $this->tpl->load_template( "info.tpl" ); 
        $this->tpl->set( "{title}", $_obfuscate_obqvewÿÿ ); 
        $this->tpl->set( "{error}", $text ); 
        $this->tpl->compile( "content" ); 
        $this->tpl->clear( ); 
    } 

    public function del_bulletins( ) 
    { 
        $_obfuscate_C6_bCo2KzAÿÿ = $this->db->query( "\r\n      SELECT bul_id, bul_cat, bul_images\r\n      FROM ".PREFIX."_board_bulletins\r\n      WHERE bul_stop < '".time( )."'\r\n    " ); 
        $_obfuscate_VBYNJAÿÿ = false; 
        while ( $row = $this->db->get_row( $_obfuscate_C6_bCo2KzAÿÿ ) ) 
        { 
            $row['bul_images']( $row['bul_id'], $row['bul_cat'], $row['bul_images'] ); 
            $_obfuscate_VBYNJAÿÿ = true; 
        } 
        if ( $_obfuscate_VBYNJAÿÿ == true ) 
        { 
            $this->del_cache( ); 
        } 
    } 

    public function del_bul( $id, $cat, $_obfuscate_MNh1cC6M ) 
    { 
        if ( $id !== "" ) 
        { 
            if ( $_obfuscate_MNh1cC6M !== "" ) 
            { 
                $_obfuscate_sI6GO0G6FQÿÿ = explode( "|", $_obfuscate_MNh1cC6M ); 
                foreach ( $_obfuscate_sI6GO0G6FQÿÿ as $_obfuscate_3vXM ) 
                { 
                    @unlink( @ROOT_DIR."/uploads/board/images/".$_obfuscate_3vXM ); 
                    @unlink( @ROOT_DIR."/uploads/board/thumbs/".$_obfuscate_3vXM ); 
                } 
            } 
            $this->db->query( "\r\n        UPDATE ".PREFIX."_board_category\r\n        SET cat_count = cat_count - 1\r\n        WHERE cat_id = '".$cat."'\r\n      " ); 
            $this->db->query( "\r\n        DELETE\r\n        FROM ".PREFIX."_board_bulletins\r\n        WHERE bul_id = '".$id."'\r\n      " ); 
        } 
    } 

    public function get_cache( ) 
    { 
        $this->sec = get_vars( "board_section" ); 
        if ( is_array( $this->sec ) ) 
        { 
            $_obfuscate_Ah6eJtl30Qÿÿ = $this->db->query( "\r\n        SELECT *\r\n        FROM ".PREFIX."_board_sections\r\n        ORDER BY sec_posi ASC\r\n      " ); 
            while ( $row = $this->db->get_row( $_obfuscate_Ah6eJtl30Qÿÿ ) ) 
            { 
                $this->sec[$row['sec_id']] = $row; 
            } 
            set_vars( "board_section", $this->sec ); 
            $this->db->free( ); 
        } 
        $this->cat = get_vars( "board_category" ); 
        if ( is_array( $this->cat ) ) 
        { 
            $_obfuscate_n_YQi_pLvwÿÿ = $this->db->query( "\r\n        SELECT *\r\n        FROM ".PREFIX."_board_category\r\n        ORDER BY cat_posi ASC\r\n      " ); 
            while ( $row = $this->db->get_row( $_obfuscate_n_YQi_pLvwÿÿ ) ) 
            { 
                $this->cat[$row['cat_id']] = $row; 
            } 
            set_vars( "board_category", $this->cat ); 
            $this->db->free( ); 
        } 
    } 

    public function del_cache( ) 
    { 
        if ( file_exists( ENGINE_DIR."/cache/system/board_section.php" ) ) 
        { 
            @unlink( @ENGINE_DIR."/cache/system/board_section.php" ); 
        } 
        if ( file_exists( ENGINE_DIR."/cache/system/board_category.php" ) ) 
        { 
            @unlink( @ENGINE_DIR."/cache/system/board_category.php" ); 
        } 
    } 

    public function guard( $key ) 
    { 
        if ( $key ) 
        { 
            if ( md5( md5( $_SERVER['HTTP_HOST'] ).$this->key ) == $key ) 
            { 
                return true; 
            } 
            return false; 
        } 
        return false; 
    } 

    public function navigation( $_obfuscate_xvYeh9Iÿ, $_obfuscate_W7bDo7Tf, $_obfuscate_lnnRdTB1Rwÿÿ, $_obfuscate_jBJBsjgLAk11PcCm, $_obfuscate_qMG_NyCxl8UZUR8 ) 
    { 
        global $config; 
        $i = $_obfuscate_W7bDo7Tf; 
        $this->tpl->load_template( "navigation.tpl" ); 
        if ( 0 < $_obfuscate_W7bDo7Tf ) 
        { 
            $_obfuscate_jMLuYAÿÿ = $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ; 
            $_obfuscate_TfRCksZzHNRQ = $config['allow_alt_url'] == "yes" ? $_obfuscate_jBJBsjgLAk11PcCm."/page-".$_obfuscate_jMLuYAÿÿ.".html" : $_obfuscate_qMG_NyCxl8UZUR8."&cstart=".$_obfuscate_jMLuYAÿÿ; 
            $this->tpl->set_block( "'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "<a href=\"".$_obfuscate_TfRCksZzHNRQ."\">\\1</a>" ); 
        } 
        else 
        { 
            $this->tpl->set_block( "'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "<span>\\1</span>" ); 
            $_obfuscate_R4vSyHg9gÿÿ = TRUE; 
        } 
        if ( $_obfuscate_xvYeh9Iÿ ) 
        { 
            $pages_count = @ceil( @$_obfuscate_lnnRdTB1Rwÿÿ / $_obfuscate_xvYeh9Iÿ ); 
            $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ = 0; 
            $_obfuscate_w9JNSDEÿ = ""; 
            $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ = 3; 
            if ( 10 < $pages_count ) 
            { 
                $j = 1; 
                for ( ; $j <= $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ; ++$j ) 
                { 
                    if ( $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ !== $_obfuscate_W7bDo7Tf ) 
                    { 
                        $_obfuscate_w9JNSDEÿ .= $config['allow_alt_url'] == "yes" ? "<a href='".$_obfuscate_jBJBsjgLAk11PcCm."/page-".$j.( ".html'>".$j."</a>" ) : "<a href='".$_obfuscate_qMG_NyCxl8UZUR8.( "&cstart=".$j."'>{$j}</a>" ); 
                    } 
                    else 
                    { 
                        $_obfuscate_w9JNSDEÿ .= " <span>".$j."</span>"; 
                    } 
                    $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ += $_obfuscate_xvYeh9Iÿ; 
                } 
                if ( 1 < $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 && $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 < $pages_count ) 
                { 
                    $_obfuscate_w9JNSDEÿ .= $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 2 < $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 ? "<span>...</span>" : " "; 
                    $_obfuscate_V8DxEeoXtS8ÿ = $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 1 < $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 ? $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ : $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 1;
                    $_obfuscate_qHoJKdLznl4ÿ = $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 < $pages_count - ( $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 1 ) ? $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 : $pages_count - ( $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 1 ); 
                    $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ = ( $_obfuscate_V8DxEeoXtS8ÿ - 1 ) * $_obfuscate_xvYeh9Iÿ; 
                    $j = $_obfuscate_V8DxEeoXtS8ÿ; 
                    for ( ; $j < $_obfuscate_qHoJKdLznl4ÿ + ( $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ - 1 ); ++$j ) 
                    { 
                        if ( $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ != $_obfuscate_W7bDo7Tf ) 
                        { 
                            $_obfuscate_w9JNSDEÿ .= $config['allow_alt_url'] == "yes" ? "<a href='".$_obfuscate_jBJBsjgLAk11PcCm."/page-".$j.( ".html'>".$j."</a>" ) : "<a href='".$_obfuscate_qMG_NyCxl8UZUR8.( "&cstart=".$j."'>{$j}</a>" ); 
                        } 
                        else 
                        { 
                            $_obfuscate_w9JNSDEÿ .= " <span>".$j."</span> "; 
                        } 
                        $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ += $_obfuscate_xvYeh9Iÿ; 
                    } 
                    $_obfuscate_w9JNSDEÿ .= $_obfuscate_W7bDo7Tf / $_obfuscate_xvYeh9Iÿ + 1 < $pages_count - ( $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ + 1 ) ? "<span>...</span>" : " "; 
                } 
                else 
                { 
                    $_obfuscate_w9JNSDEÿ .= "<span>...</span>"; 
                } 
                $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ = ( $pages_count - $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ ) * $_obfuscate_xvYeh9Iÿ; 
                $j = $pages_count - ( $_obfuscate__viMkxvkCZ2Wxf5pcFnaOEÿ - 1 ); 
                for ( ; $j <= $pages_count; ++$j ) 
                { 
                    if ( $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ != $_obfuscate_W7bDo7Tf ) 
                    { 
                        $_obfuscate_w9JNSDEÿ .= $config['allow_alt_url'] == "yes" ? "<a href='".$_obfuscate_jBJBsjgLAk11PcCm."/page-".$j.( ".html'>".$j."</a>" ) : "<a href='".$_obfuscate_qMG_NyCxl8UZUR8.( "&cstart=".$j."'>{$j}</a>" ); 
                    } 
                    else 
                    { 
                        $_obfuscate_w9JNSDEÿ .= " <span>".$j."</span> "; 
                    } 
                    $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ += $_obfuscate_xvYeh9Iÿ; 
                } 
            } 
            else 
            { 
                $j = 1; 
                for ( ; $j <= $pages_count; ++$j ) 
                { 
                    if ( $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ != $_obfuscate_W7bDo7Tf ) 
                    { 
                        $_obfuscate_w9JNSDEÿ .= $config['allow_alt_url'] == "yes" ? "<a href='".$_obfuscate_jBJBsjgLAk11PcCm."/page-".$j.( ".html'>".$j."</a>" ) : "<a href='".$_obfuscate_qMG_NyCxl8UZUR8.( "&cstart=".$j."'>{$j}</a>" ); 
                    } 
                    else 
                    { 
                        $_obfuscate_w9JNSDEÿ .= " <span>".$j."</span> "; 
                    } 
                    $_obfuscate_DeuAwwYSRvgrl8YK7QgrAÿÿ += $_obfuscate_xvYeh9Iÿ; 
                } 
            } 
            $this->tpl->set( "{pages}", $_obfuscate_w9JNSDEÿ ); 
        } 
        if ( $_obfuscate_xvYeh9Iÿ < $_obfuscate_lnnRdTB1Rwÿÿ && ( $_obfuscate_W7bDo7Tf + 1 ) * $_obfuscate_xvYeh9Iÿ < $_obfuscate_lnnRdTB1Rwÿÿ ) 
        { 
            $_obfuscate_s87n7sqPKxJi = $_obfuscate_W7bDo7Tf + 2; 
            $_obfuscate_vqBeQÿÿ = $config['allow_alt_url'] == "yes" ? $_obfuscate_jBJBsjgLAk11PcCm."/page-".$_obfuscate_s87n7sqPKxJi.".html" : $_obfuscate_qMG_NyCxl8UZUR8."&cstart=".$_obfuscate_s87n7sqPKxJi; 
            $this->tpl->set_block( "'\\[next-link\\](.*?)\\[/next-link\\]'si", "<a href=\"".$_obfuscate_vqBeQÿÿ."\">\\1</a>" ); 
        } 
        else 
        { 
            $this->tpl->set_block( "'\\[next-link\\](.*?)\\[/next-link\\]'si", "<span>\\1</span>" ); 
            $_obfuscate_wgIZbg8WpAÿÿ = TRUE; 
        } 
        if ( !$_obfuscate_R4vSyHg9gÿÿ || !$_obfuscate_wgIZbg8WpAÿÿ ) 
        { 
            $this->tpl->compile( "navi" ); 
            $this->tpl->clear( ); 
        } 
        return $this->tpl->result['navi']; 
    } 

} 

if ( defined( "DATALIFEENGINE" ) ) 
{ 
    exit( "Hacking attempt!" ); 
} 
$board = new Site_Board( ); 
$mata_board = $board->tag; 
$block_board = $board->block( ); 
?>
 
Пробовал сам дезендить, но не до конца правильно получается -
Обычная обфускация. Практически не обратимый процесс. В данном случае можно просто произвольно переименовать имена переменных, но имена функций НЕ трогать.

в аттаче серверный деобфускатор, просто ставишь на виртуалку:
 

Вложения

  • deobfuscator.rar
    692,9 KB · Просмотры: 62
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху