• DONATE to NULLED!
    Форуму и его команде можно помочь, мотивировать модераторов разделов.
    Помогите модератору этого раздела killoff лично.

Хак Hide by Day [DLE 9.x - 10.x]

Gameer

Постоялец
Регистрация
25 Апр 2014
Сообщения
187
Реакции
118
1438474646_hidebyday[1].png
С помощью этого хака вы сможете скрывать текст внутри тегов если пользователь зарегистрирован меньше указанного времени.

Открыть /engine/classes/templates.class.php найти :
PHP:
if (strpos ( $this->template, "[aviable=" ) !== false) {
Выше вставить:
PHP:
if (strpos ( $this->template, "[show_user=" ) !== false) {
$this->template = preg_replace_callback ( "#\\[(show_user)=(.+?)\\](.*?)\\[/show_user\\]#is", array( &$this, 'show_user'), $this->template );
}
Далее найти :
PHP:
if (strpos ( $template, "[aviable=" ) !== false) {
Выше вставить :
PHP:
if (strpos ( $template, "[show_user=" ) !== false) {
$template = preg_replace_callback ( "#\\[(show_user)=(.+?)\\](.*?)\\[/show_user\\]#is", array( &$this, 'show_user'), $template );
}
Далее найти :
PHP:
function check_module( $matches=array() ) {
Выше вставить :
PHP:
function show_user( $matches=array() ) {
    global $member_id;

    $show_user = $matches[2]; $block = $matches[3];
    if(count(explode('|', $show_user)) > 1)
    {
        $show_user = explode('|', $show_user);
        $show_user[0] = (int)$show_user[0];
        $show_user[1] = trim(strip_tags(stripslashes($show_user[1])));
    }
    else
        $show_user = (int)$show_user;
 
    if ($matches[1] == "show_user") $action = true; else $action = false;
    $date = langdate("Y-m-d", $member_id['reg_date']);

    if( $action AND (int)$member_id['user_group'] != 5) {
        if((floor((strtotime(date('Y-m-d'))-strtotime($date))/(3600*24))) <= (!empty($show_user[0]) ? $show_user[0] : $show_user)) return !empty($show_user[1]) ? $show_user[1] : '';
        else return $block;
    }
    else
        return !empty($show_user[1]) ? $show_user[1] : '';
}

Открыть /engine/classes/templates.class.php найти :
PHP:
if (strpos ( $this->template, "[aviable=" ) !== false) {
Выше вставить:
PHP:
if (strpos ( $this->template, "[show_user=" ) !== false) {
$this->template = preg_replace ( "#\\[show_user=(.+?)\\](.*?)\\[/show_user\\]#ies", "\$this->show_user('\\1', '\\2')", $this->template );
}
Далее найти :
PHP:
if (strpos ( $template, "[aviable=" ) !== false) {
Выше вставить :
PHP:
if (strpos ( $template, "[show_user=" ) !== false) {
$template = preg_replace ( "#\\[show_user=(.+?)\\](.*?)\\[/show_user\\]#ies", "\$this->show_user('\\1', '\\2')", $template );
}
Далее найти :
PHP:
function check_module($aviable, $block, $action = true) {
Выше вставить :
PHP:
function show_user( $show_user, $block, $action = true ) {
    global $member_id;

    if(count(explode('|', $show_user)) > 1)
    {
        $show_user = explode('|', $show_user);
        $show_user[0] = (int)$show_user[0];
        $show_user[1] = trim(strip_tags(stripslashes($show_user[1])));
    }
    else
        $show_user = (int)$show_user;
 
    $date = langdate("Y-m-d", $member_id['reg_date']);

    if( $action AND (int)$member_id['user_group'] != 5) {
        if((floor((strtotime(date('Y-m-d'))-strtotime($date))/(3600*24))) <= (!empty($show_user[0]) ? $show_user[0] : $show_user)) return !empty($show_user[1]) ? $show_user[1] : '';
        else return $block;
    }
    else
        return !empty($show_user[1]) ? $show_user[1] : '';
}
В любом tpl файле использовать тег [show_user=1] - где 1 сколько нужно быть зарегистрированным на сайте в днях. Так же можно сделать вывод почему нельзя видеть, просто прописав [show_user=25|Вы еще мало дней на сайте]текст[/show_user]

Автор : Для просмотра ссылки Войди или Зарегистрируйся
 
Последнее редактирование:
Назад
Сверху