ابتدا فایل زیر را دانلود کنید و محتوای آن را به Templates/Default/Images بریزید.
Download
فایل Engine/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}', '--');
else $tpl->set('{registration}', '--');
بعد از این دو خط، کد زیر رو اضافه کنید:
$tpl->set('{comm_num}', intval($row['comm_num']));
دوباره در همین فایل به کد زیر بگردید:
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
}
}
بعد از این خط، کدهای زیر رو اضافه کنید:
$arr_ratings = array(
'/templates/00023/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
'/templates/00023/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
فایل 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}";
}
$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}";
}
$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}', '--');
else $tpl->set('{registration}', '--');
در زیر این خط، کد زیر رو اضافه کنید:
$tpl->set('{comm_num}', intval($row['comm_num']));
حالا به دنبال کد زیر بگردید:
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
}
}
بعد از این کد، کد زیر رو اضافه کنید:
$arr_ratings = array(
'/templates/00023/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
'/templates/00023/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
حالا فایل Engine/Module/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']);
در همین فایل به دنبال کد زیر بگردید:
if ($row['is_register']) $tpl->set('{registration}', langdate($config['timestamp_active'], $row['reg_date']));
else $tpl->set('{registration}', '--');
else $tpl->set('{registration}', '--');
کد زیر رو در زیر کد بالا اضافه کنید:
$tpl->set('{comm_num}', intval($row['comm_num']));
حالا به دنبال کد زیر بگردید:
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
}
}
کد زیر رو در زیر کدی که پیدا کردید وارد کنید:
$arr_ratings = array(
'/templates/dle/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
'/templates/dle/images/rank_00.png'=>'0',
'/templates/dle/images/rank_01.png'=>'10',
'/templates/dle/images/rank_02.png'=>'20',
'/templates/dle/images/rank_03.png'=>'30',
'/templates/dle/images/rank_04.png'=>'40',
'/templates/dle/images/rank_05.png'=>'50',
);
$image_rating = $arr_rating[0];
foreach($arr_ratings as $key=>$value)
{
if ($row['comm_num']>=$value){$image_rating = $key;}
}
if (!isset($image_rating)){$image_rating = $arr_ratings[0];}
if ($row['is_register'])
$tpl->set('{image_rating}',$image_rating);
else
$tpl->set('{image_rating}','{THEME }/images/rank_00.png');
if ($row['comm_num']>0){
$tpl->set('{comm_num}',$row['comm_num']);
}
else
$tpl->set('{comm_num}','-');
فایل 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>
<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 />
<img src=/templates/dle/images/comments.gif border="0" alt="Comments" align="absmiddle" />{comm_num}<br />
<img src="{image_rating}" border="0" alt="Rating" />
</td>
<td class="news" valign="top">{comment}[signature]<br /><br />--------------------<br /><div class="slink">{signature}</div>[/signature]</td>
</tr>
<td width="110" class="ctitle" valign="top" align="center"><img src="{foto}" border="0"><br />
<img src=/templates/dle/images/comments.gif border="0" alt="Comments" align="absmiddle" />{comm_num}<br />
<img src="{image_rating}" border="0" alt="Rating" />
</td>
<td class="news" valign="top">{comment}[signature]<br /><br />--------------------<br /><div class="slink">{signature}</div>[/signature]</td>
</tr>
تمام شد.