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

Помощь Счетчик комментариев и Ранг пользователей v.2.0

Статус
В этой теме нельзя размещать новые ответы.
а ты пробовал как я написал? на 5.5 пошлно. а 5.7 не пробовал еще
 
на 5.7 должно работать..

структура вроде не менялась
 
Даже не пытался делать так как обновляется ДЛешка часто и запарился мечится с восстановлением модулей :(
 
Я переделывал этот модуль под 5.7. все работало нормально. Если кому надо пишите в ПМ
 
вот я для 57, пробывал работает, а вот кто может на 6.0 сделать?

PHP:
Файл engine/modules/lastcomments.php

Заменить

	if ($userid) {
	$sql_comm = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, reg_date, signature, foto, fullname, land, icq, " . PREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE {$stop_list}" . PREFIX . "_comments.is_register = '1' AND " . PREFIX . "_comments.user_id='$userid' ORDER BY date desc LIMIT ".$cstart.",".$number;
    $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id WHERE {$stop_list}" . PREFIX . "_comments.is_register = '1' AND " . PREFIX . "_comments.user_id='$userid'";
	}
	else {
	$sql_comm = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, reg_date, signature, foto, fullname, land, icq, " . PREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id {$stop_list}ORDER BY date desc LIMIT ".$cstart.",".$number;
    $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id {$stop_list}";
	}

на

	if ($userid) {
        $sql_comm = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, news_num, " . PREFIX . "_users.comm_num, reg_date, signature, foto, fullname, land, icq, " . PREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE {$stop_list}" . PREFIX . "_comments.is_register = '1' AND " . PREFIX . "_comments.user_id='$userid' ORDER BY date desc LIMIT ".$cstart.",".$number;
    $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id WHERE {$stop_list}" . PREFIX . "_comments.is_register = '1' AND " . PREFIX . "_comments.user_id='$userid'";
    }
    else {
        $sql_comm = "SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.date, " . PREFIX . "_comments.autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, news_num, " . PREFIX . "_users.comm_num, reg_date, signature, foto, fullname, land, icq, " . PREFIX . "_users.xfields as xprofile, " . PREFIX . "_post.title, " . PREFIX . "_post.date as newsdate, " . PREFIX . "_post.alt_name FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id {$stop_list}ORDER BY date desc LIMIT ".$cstart.",".$number;
        $sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_post ON " . PREFIX . "_comments.post_id=" . PREFIX . "_post.id {$stop_list}";
    }



==============



после:

	if ($row['is_register']) $tpl->set('{registration}', langdate($config['timestamp_active'], $row['reg_date']));
	else $tpl->set('{registration}', '--');

вставить:

	$tpl->set('{comm_num}', intval($row['comm_num']));




==============




После

	$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
	}

Вставить

$no_rating = " Гости не учавствуют в рейтинге";
$arr_ratings = array(
0=> array(
'image_rating'=>'{THEME}/images/rank_00.png',
'rank_txt'=>'Гость',
'count_comm'=>'0'
),

1=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Новичок',
'count_comm'=>'5'
),
2=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Пользователь',
'count_comm'=>'10'
),
3=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Продвинутый пользователь',
'count_comm'=>'25'
),
4=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Общительный',
'count_comm'=>'50'
),
5=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Комментатор',
'count_comm'=>'75'
),
6=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Активист',
'count_comm'=>'100'
),
7=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Супер-Активист',
'count_comm'=>'200'
),
8=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Лучший собеседник',
'count_comm'=>'300'
),
9=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Мудрец',
'count_comm'=>'400'
),
10=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Хранитель сайта',
'count_comm'=>'500'
),
11=> array(
'image_rating'=>'{THEME}/images/rank_06.png',
'rank_txt'=>'Бог',
'count_comm'=>'1000'
),
);
if ($row['comm_num']==""){$row[comm_num]=0;}
for($i=0;$i<=count($arr_ratings)-1;$i++)
{
if ($row['comm_num']>=$arr_ratings[$i]['count_comm'])
{
$image_rating = $arr_ratings[$i]['image_rating'];
$rank_txt = $arr_ratings[$i]['rank_txt'];
$remain_comm = "До следующего звания Вам ".($arr_ratings[$i+1]['count_comm']-$row['comm_num'])." комментариев";
if ($row['comm_num']==0){$remain_comm = $no_rating;}
}
}
$tpl->set('{image_rating}',$image_rating);
$tpl->set('{rank_txt}',$rank_txt);
$rank_txt = "";
$image_rating = "";

if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
$tpl->set('{img_rating_alt}',$remain_comm);



================================================================



Файл ajax/addcomments.php


Найти:

$row = $db->super_query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$post_id' order by id DESC LIMIT 0,1");

Заменить на:

	$row = $db->super_query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, news_num, " . PREFIX . "_users.comm_num, " . PREFIX . "_users.user_group, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$post_id' order by id DESC LIMIT 0,1");



==============



после:

if ($row['is_register']) $tpl->set('{registration}', langdate($config['timestamp_active'], $row['reg_date']));
else $tpl->set('{registration}', '--');

вставить:

$tpl->set('{comm_num}', intval($row['comm_num']));



==============



после:

$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
}

вставить:

$no_rating = " Гости не учавствуют в рейтинге";
$arr_ratings = array(
0=> array(
'image_rating'=>'{THEME}/images/rank_00.png',
'rank_txt'=>'Гость',
'count_comm'=>'0'
),

1=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Новичок',
'count_comm'=>'5'
),
2=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Пользователь',
'count_comm'=>'10'
),
3=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Продвинутый пользователь',
'count_comm'=>'25'
),
4=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Общительный',
'count_comm'=>'50'
),
5=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Комментатор',
'count_comm'=>'75'
),
6=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Активист',
'count_comm'=>'100'
),
7=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Супер-Активист',
'count_comm'=>'200'
),
8=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Лучший собеседник',
'count_comm'=>'300'
),
9=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Мудрец',
'count_comm'=>'400'
),
10=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Хранитель сайта',
'count_comm'=>'500'
),
11=> array(
'image_rating'=>'{THEME}/images/rank_06.png',
'rank_txt'=>'Бог',
'count_comm'=>'1000'
),
);
if ($row['comm_num']==""){$row[comm_num]=0;}
for($i=0;$i<=count($arr_ratings)-1;$i++)
{
if ($row['comm_num']>=$arr_ratings[$i]['count_comm'])
{
$image_rating = $arr_ratings[$i]['image_rating'];
$rank_txt = $arr_ratings[$i]['rank_txt'];
$remain_comm = "До следующего звания Вам ".($arr_ratings[$i+1]['count_comm']-$row['comm_num'])." комментариев";
if ($row['comm_num']==0){$remain_comm = $no_rating;}
}
}
$tpl->set('{image_rating}',$image_rating);
$tpl->set('{rank_txt}',$rank_txt);
$rank_txt = "";
$image_rating = "";

if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
$tpl->set('{img_rating_alt}',$remain_comm);



================================================================



Файл engine/modules/show.full.php

найти:

	$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id' order by date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);

заменить на:

	$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . PREFIX . "_users.email, reg_date, signature, foto, fullname, land, icq,comm_num, xfields FROM " . PREFIX . "_comments LEFT JOIN " . PREFIX . "_users ON " . PREFIX . "_comments.user_id=" . PREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id' order by date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);



==============



после:

	$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
	}

вставить:


$no_rating = " Гости не учавствуют в рейтинге";
$arr_ratings = array(
0=> array(
'image_rating'=>'{THEME}/images/rank_00.png',
'rank_txt'=>'Гость',
'count_comm'=>'0'
),

1=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Новичок',
'count_comm'=>'5'
),
2=> array(
'image_rating'=>'{THEME}/images/rank_01.png',
'rank_txt'=>'Пользователь',
'count_comm'=>'10'
),
3=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Продвинутый пользователь',
'count_comm'=>'25'
),
4=> array(
'image_rating'=>'{THEME}/images/rank_02.png',
'rank_txt'=>'Общительный',
'count_comm'=>'50'
),
5=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Комментатор',
'count_comm'=>'75'
),
6=> array(
'image_rating'=>'{THEME}/images/rank_03.png',
'rank_txt'=>'Активист',
'count_comm'=>'100'
),
7=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Супер-Активист',
'count_comm'=>'200'
),
8=> array(
'image_rating'=>'{THEME}/images/rank_04.png',
'rank_txt'=>'Лучший собеседник',
'count_comm'=>'300'
),
9=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Мудрец',
'count_comm'=>'400'
),
10=> array(
'image_rating'=>'{THEME}/images/rank_05.png',
'rank_txt'=>'Хранитель сайта',
'count_comm'=>'500'
),
11=> array(
'image_rating'=>'{THEME}/images/rank_06.png',
'rank_txt'=>'Бог',
'count_comm'=>'1000'
),
);
if ($row['comm_num']==""){$row[comm_num]=0;}
for($i=0;$i<=count($arr_ratings)-1;$i++)
{
if ($row['comm_num']>=$arr_ratings[$i]['count_comm'])
{
$image_rating = $arr_ratings[$i]['image_rating'];
$rank_txt = $arr_ratings[$i]['rank_txt'];
$remain_comm = "До следующего звания Вам ".($arr_ratings[$i+1]['count_comm']-$row['comm_num'])." комментариев";
if ($row['comm_num']==0){$remain_comm = $no_rating;}
}
}
$tpl->set('{image_rating}',$image_rating);
$tpl->set('{rank_txt}',$rank_txt);
$rank_txt = "";
$image_rating = "";

if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
$tpl->set('{img_rating_alt}',$remain_comm);



================================================================



Файл templates/default/comments.tpl

заменить:

<tr>
        <td width="110" valign="top"><img src="{foto}" border="0"></td>
        <td class="news" valign="top">{comment}[signature]<br /><br />--------------------<br /><div class="slink">{signature}</div>[/signature]</td>
    </tr>

на:

<tr>
        <td width="110" class="ctitle" valign="top" align="center"><img src="{foto}" border="0" /><br />
{rank_txt}<br />
<img src={THEME}/images/comments.gif border="0" alt="Комментариев" />{comm_num}<br />
<img src="{image_rating}" border="0" alt="Рейтинг" />
	</td>
        <td class="news" valign="top">{comment}[signature]<br /><br />--------------------<br /><div class="slink">{signature}</div>[/signature]</td>
    </tr>
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху