درود بر گراميان
اين ماژول بر اساس تعداد نظرات ارسالي كاربران براي آنها رتبه اي قرار مي دهد.
عكس از محيط مديريت
ابتدا فايل زير را دانلود و در جاي مشخص شده كپي كنيد.
2.-فايل زير را براي ويرايش باز نماييد
/engine/ajax/addcomments.php
كد زير را پيدا كنيد
include ENGINE_DIR . '/data/config.php';
بعد از كد بالا كد زير را قرار دهيد
include ENGINE_DIR.'/data/rating.php';
3.-فايل زير را براي ويرايش باز كنيد
/engine/classes/comments.class.php
كد زير را پيدا كنيد
$_TIME, $allow_comments_ajax;
بجاي كد بالا كد زير را قرار دهيد
$_TIME, $allow_comments_ajax, $conf;
در همين فايل دنبال كد زير بگرديد
$tpl->set_block( "'\\[signature\\](.*?)\\[/signature\\]'si", "" );
}
}
بعد از آن كد زير را قرار دهيد
$no_rating = " Los invitados no pueden participar en la cafificaciَn";
$arr_ratings = array(
0=> array(
'image_rating'=> "{$conf['img_path']}/00.gif",
'rank_txt'=> "<font color=\"{$conf['color-0']}\">{$conf['text-stat-0']}</font>",
'count_comm'=> "{$conf['comm-num-0']}"
),
1=> array(
'image_rating'=> "{$conf['img_path']}/01.gif",
'rank_txt'=> "<font color=\"{$conf['color-1']}\">{$conf['text-stat-1']}</font>",
'count_comm'=> "{$conf['comm-num-1']}"
),
2=> array(
'image_rating'=> "{$conf['img_path']}/02.gif",
'rank_txt'=> "<font color=\"{$conf['color-2']}\">{$conf['text-stat-2']}</font>",
'count_comm'=> "{$conf['comm-num-2']}"
),
3=> array(
'image_rating'=> "{$conf['img_path']}/03.gif",
'rank_txt'=> "<font color=\"{$conf['color-3']}\">{$conf['text-stat-3']}</font>",
'count_comm'=> "{$conf['comm-num-3']}"
),
4=> array(
'image_rating'=> "{$conf['img_path']}/04.gif",
'rank_txt'=> "<font color=\"{$conf['color-4']}\">{$conf['text-stat-4']}</font>",
'count_comm'=> "{$conf['comm-num-4']}"
),
5=> array(
'image_rating'=> "{$conf['img_path']}/05.gif",
'rank_txt'=> "<font color=\"{$conf['color-5']}\">{$conf['text-stat-5']}</font>",
'count_comm'=> "{$conf['comm-num-5']}"
),
6=> array(
'image_rating'=> "{$conf['img_path']}/06.gif",
'rank_txt'=> "<font color=\"{$conf['color-6']}\">{$conf['text-stat-6']}</font>",
'count_comm'=> "{$conf['comm-num-6']}"
),
7=> array(
'image_rating'=> "{$conf['img_path']}/07.gif",
'rank_txt'=> "<font color=\"{$conf['color-7']}\">{$conf['text-stat-7']}</font>",
'count_comm'=> "{$conf['comm-num-7']}"
),
8=> array(
'image_rating'=> "{$conf['img_path']}/08.gif",
'rank_txt'=> "<font color=\"{$conf['color-8']}\">{$conf['text-stat-8']}</font>",
'count_comm'=> "{$conf['comm-num-8']}"
),
9=> array(
'image_rating'=> "{$conf['img_path']}/09.gif",
'rank_txt'=> "<font color=\"{$conf['color-9']}\">{$conf['text-stat-9']}</font>",
'count_comm'=> "{$conf['comm-num-9']}"
),
10=> array(
'image_rating'=> "{$conf['img_path']}/10.gif",
'rank_txt'=> "<font color=\"{$conf['color-10']}\">{$conf['text-stat-10']}</font>",
'count_comm'=> "{$conf['comm-num-10']}"
),
11=> array(
'image_rating'=> "{$conf['img_path']}/11.gif",
'rank_txt'=>"<font color=\"{$conf['color-11']}\">{$conf['text-stat-11']}</font>",
'count_comm'=> "{$conf['comm-num-11']}"
),
12=> array(
'image_rating'=> "{$conf['img_path']}/12.gif",
'rank_txt'=>"<font color=\"{$conf['color-12']}\">{$conf['text-stat-12']}</font>",
'count_comm'=> "{$conf['comm-num-12']}"
),
13=> array(
'image_rating'=> "{$conf['img_path']}/13.gif",
'rank_txt'=>"<font color=\"{$conf['color-13']}\">{$conf['text-stat-13']}</font>",
'count_comm'=> "{$conf['comm-num-13']}"
),
14=> array(
'image_rating'=> "{$conf['img_path']}/14.gif",
'rank_txt'=> "<font color=\"{$conf['color-14']}\">{$conf['text-stat-14']}</font>",
'count_comm'=> "{$conf['comm-num-14']}"
),
15=> array(
'image_rating'=> "{$conf['img_path']}/15.gif",
'rank_txt'=>"<font color=\"{$conf['color-15']}\">{$conf['text-stat-15']}</font>",
'count_comm'=> "{$conf['comm-num-15']}"
),
16=> array(
'image_rating'=> "{$conf['img_path']}/16.gif",
'rank_txt'=>"<font color=\"{$conf['color-16']}\">{$conf['text-stat-16']}</font>",
'count_comm'=> "{$conf['comm-num-16']}"
),
17=> array(
'image_rating'=> "{$conf['img_path']}/17.gif",
'rank_txt'=>"<font color=\"{$conf['color-17']}\">{$conf['text-stat-17']}</font>",
'count_comm'=> "{$conf['comm-num-17']}"
),
18=> array(
'image_rating'=> "{$conf['img_path']}/18.gif",
'rank_txt' => "<font color=\"{$conf['color-18']}\">{$conf['text-stat-18']}</font>",
'count_comm' => "{$conf['comm-num-18']}"
),
19=> array(
'image_rating'=> "{$conf['img_path']}/19.gif",
'rank_txt'=>"<font color=\"{$conf['color-19']}\">{$conf['text-stat-19']}</font>",
'count_comm'=> "{$conf['comm-num-19']}"
),
20=> array(
'image_rating'=> "{$conf['img_path']}/20.gif",
'rank_txt'=>"<font color=\"{$conf['color-20']}\">{$conf['text-stat-20']}</font>",
'count_comm'=> "{$conf['comm-num-20']}"
),
);
if ($row['comm_num']=="")
$row[comm_num] = 0;
for($j=0; $j<=count($arr_ratings)-1;$j++)
{
if ($row['comm_num']>=$arr_ratings[$j]['count_comm'])
{
$image_rating = $arr_ratings[$j]['image_rating'];
$rank_txt = $arr_ratings[$j]['rank_txt'];
$remain_comm = "Te faltan ".($arr_ratings[$j+1]['count_comm']-$row['comm_num'])." comentario(s) para pasar al siguiente nivel.";
$rank = "<a href=\"#\" title=\"{$remain_comm}\">{$rank_txt}</a>";
if ($row['comm_num'] == 0)
$remain_comm = $no_rating;
}
}
if ($conf['admin-stat'] == 1)
{
if ($row['user_group'] == 1)
{
$rank_txt = "{$conf['text-stat-20']}";
$image_rating = "{$conf['img_path']}/20.gif";
$remain_comm = "";
}
}
$tpl->set('{image_rating}', "<img src=\"".$image_rating."\" alt=\"\" border=0 />");
if ($conf['txt-stat'] == 1)
$tpl->set('{rank_txt}', $rank);
else
$tpl->set('{rank_txt}', '---');
$tpl->set('{img_rating_alt}', $remain_comm);
$arr_ratings = array(
0=> array(
'image_rating'=> "{$conf['img_path']}/00.gif",
'rank_txt'=> "<font color=\"{$conf['color-0']}\">{$conf['text-stat-0']}</font>",
'count_comm'=> "{$conf['comm-num-0']}"
),
1=> array(
'image_rating'=> "{$conf['img_path']}/01.gif",
'rank_txt'=> "<font color=\"{$conf['color-1']}\">{$conf['text-stat-1']}</font>",
'count_comm'=> "{$conf['comm-num-1']}"
),
2=> array(
'image_rating'=> "{$conf['img_path']}/02.gif",
'rank_txt'=> "<font color=\"{$conf['color-2']}\">{$conf['text-stat-2']}</font>",
'count_comm'=> "{$conf['comm-num-2']}"
),
3=> array(
'image_rating'=> "{$conf['img_path']}/03.gif",
'rank_txt'=> "<font color=\"{$conf['color-3']}\">{$conf['text-stat-3']}</font>",
'count_comm'=> "{$conf['comm-num-3']}"
),
4=> array(
'image_rating'=> "{$conf['img_path']}/04.gif",
'rank_txt'=> "<font color=\"{$conf['color-4']}\">{$conf['text-stat-4']}</font>",
'count_comm'=> "{$conf['comm-num-4']}"
),
5=> array(
'image_rating'=> "{$conf['img_path']}/05.gif",
'rank_txt'=> "<font color=\"{$conf['color-5']}\">{$conf['text-stat-5']}</font>",
'count_comm'=> "{$conf['comm-num-5']}"
),
6=> array(
'image_rating'=> "{$conf['img_path']}/06.gif",
'rank_txt'=> "<font color=\"{$conf['color-6']}\">{$conf['text-stat-6']}</font>",
'count_comm'=> "{$conf['comm-num-6']}"
),
7=> array(
'image_rating'=> "{$conf['img_path']}/07.gif",
'rank_txt'=> "<font color=\"{$conf['color-7']}\">{$conf['text-stat-7']}</font>",
'count_comm'=> "{$conf['comm-num-7']}"
),
8=> array(
'image_rating'=> "{$conf['img_path']}/08.gif",
'rank_txt'=> "<font color=\"{$conf['color-8']}\">{$conf['text-stat-8']}</font>",
'count_comm'=> "{$conf['comm-num-8']}"
),
9=> array(
'image_rating'=> "{$conf['img_path']}/09.gif",
'rank_txt'=> "<font color=\"{$conf['color-9']}\">{$conf['text-stat-9']}</font>",
'count_comm'=> "{$conf['comm-num-9']}"
),
10=> array(
'image_rating'=> "{$conf['img_path']}/10.gif",
'rank_txt'=> "<font color=\"{$conf['color-10']}\">{$conf['text-stat-10']}</font>",
'count_comm'=> "{$conf['comm-num-10']}"
),
11=> array(
'image_rating'=> "{$conf['img_path']}/11.gif",
'rank_txt'=>"<font color=\"{$conf['color-11']}\">{$conf['text-stat-11']}</font>",
'count_comm'=> "{$conf['comm-num-11']}"
),
12=> array(
'image_rating'=> "{$conf['img_path']}/12.gif",
'rank_txt'=>"<font color=\"{$conf['color-12']}\">{$conf['text-stat-12']}</font>",
'count_comm'=> "{$conf['comm-num-12']}"
),
13=> array(
'image_rating'=> "{$conf['img_path']}/13.gif",
'rank_txt'=>"<font color=\"{$conf['color-13']}\">{$conf['text-stat-13']}</font>",
'count_comm'=> "{$conf['comm-num-13']}"
),
14=> array(
'image_rating'=> "{$conf['img_path']}/14.gif",
'rank_txt'=> "<font color=\"{$conf['color-14']}\">{$conf['text-stat-14']}</font>",
'count_comm'=> "{$conf['comm-num-14']}"
),
15=> array(
'image_rating'=> "{$conf['img_path']}/15.gif",
'rank_txt'=>"<font color=\"{$conf['color-15']}\">{$conf['text-stat-15']}</font>",
'count_comm'=> "{$conf['comm-num-15']}"
),
16=> array(
'image_rating'=> "{$conf['img_path']}/16.gif",
'rank_txt'=>"<font color=\"{$conf['color-16']}\">{$conf['text-stat-16']}</font>",
'count_comm'=> "{$conf['comm-num-16']}"
),
17=> array(
'image_rating'=> "{$conf['img_path']}/17.gif",
'rank_txt'=>"<font color=\"{$conf['color-17']}\">{$conf['text-stat-17']}</font>",
'count_comm'=> "{$conf['comm-num-17']}"
),
18=> array(
'image_rating'=> "{$conf['img_path']}/18.gif",
'rank_txt' => "<font color=\"{$conf['color-18']}\">{$conf['text-stat-18']}</font>",
'count_comm' => "{$conf['comm-num-18']}"
),
19=> array(
'image_rating'=> "{$conf['img_path']}/19.gif",
'rank_txt'=>"<font color=\"{$conf['color-19']}\">{$conf['text-stat-19']}</font>",
'count_comm'=> "{$conf['comm-num-19']}"
),
20=> array(
'image_rating'=> "{$conf['img_path']}/20.gif",
'rank_txt'=>"<font color=\"{$conf['color-20']}\">{$conf['text-stat-20']}</font>",
'count_comm'=> "{$conf['comm-num-20']}"
),
);
if ($row['comm_num']=="")
$row[comm_num] = 0;
for($j=0; $j<=count($arr_ratings)-1;$j++)
{
if ($row['comm_num']>=$arr_ratings[$j]['count_comm'])
{
$image_rating = $arr_ratings[$j]['image_rating'];
$rank_txt = $arr_ratings[$j]['rank_txt'];
$remain_comm = "Te faltan ".($arr_ratings[$j+1]['count_comm']-$row['comm_num'])." comentario(s) para pasar al siguiente nivel.";
$rank = "<a href=\"#\" title=\"{$remain_comm}\">{$rank_txt}</a>";
if ($row['comm_num'] == 0)
$remain_comm = $no_rating;
}
}
if ($conf['admin-stat'] == 1)
{
if ($row['user_group'] == 1)
{
$rank_txt = "{$conf['text-stat-20']}";
$image_rating = "{$conf['img_path']}/20.gif";
$remain_comm = "";
}
}
$tpl->set('{image_rating}', "<img src=\"".$image_rating."\" alt=\"\" border=0 />");
if ($conf['txt-stat'] == 1)
$tpl->set('{rank_txt}', $rank);
else
$tpl->set('{rank_txt}', '---');
$tpl->set('{img_rating_alt}', $remain_comm);
4.-فايل زير را براي ويرايش باز نماييد
/engine/modules/show.full.php
كد زير را پيدا كنيد
if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
die( "Hacking attempt!" );
}
بعد از كد بالا كد زير را قرار دهيد
include ENGINE_DIR.'/data/rating.php';
5.- فايل زير را براي ويرايش باز كنيد
/engine/modules/lastcomments.php
كد زير را پيدا كنيد:
if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
die( "Hacking attempt!" );
}
بعد از كد بالا كد زير را قرار دهيد
include ENGINE_DIR.'/data/rating.php';
6.-فايل زير را براي ويرايش باز كنيد
/engine/modules/profile.php
كد زير را پيدا كنيد:
include_once ENGINE_DIR . '/classes/parse.class.php';
بعد از كد بالا كد زير را قرار دهيد
include ENGINE_DIR.'/data/rating.php';
در همين فايل دنبال كد زير بگرديد:
$tpl->set_block( "'\\[signature\\](.*?)\\[/signature\\]'si", "" );
}
}
بعد از كد بالا كد زير را قرار دهيد:
$no_rating = " Los invitados no pueden participar en la cafificaciَn";
$arr_ratings = array(
0=> array(
'image_rating'=> "{$conf['img_path']}/00.gif",
'rank_txt'=> "<font color=\"{$conf['color-0']}\">{$conf['text-stat-0']}</font>",
'count_comm'=> "{$conf['comm-num-0']}"
),
1=> array(
'image_rating'=> "{$conf['img_path']}/01.gif",
'rank_txt'=> "<font color=\"{$conf['color-1']}\">{$conf['text-stat-1']}</font>",
'count_comm'=> "{$conf['comm-num-1']}"
),
2=> array(
'image_rating'=> "{$conf['img_path']}/02.gif",
'rank_txt'=> "<font color=\"{$conf['color-2']}\">{$conf['text-stat-2']}</font>",
'count_comm'=> "{$conf['comm-num-2']}"
),
3=> array(
'image_rating'=> "{$conf['img_path']}/03.gif",
'rank_txt'=> "<font color=\"{$conf['color-3']}\">{$conf['text-stat-3']}</font>",
'count_comm'=> "{$conf['comm-num-3']}"
),
4=> array(
'image_rating'=> "{$conf['img_path']}/04.gif",
'rank_txt'=> "<font color=\"{$conf['color-4']}\">{$conf['text-stat-4']}</font>",
'count_comm'=> "{$conf['comm-num-4']}"
),
5=> array(
'image_rating'=> "{$conf['img_path']}/05.gif",
'rank_txt'=> "<font color=\"{$conf['color-5']}\">{$conf['text-stat-5']}</font>",
'count_comm'=> "{$conf['comm-num-5']}"
),
6=> array(
'image_rating'=> "{$conf['img_path']}/06.gif",
'rank_txt'=> "<font color=\"{$conf['color-6']}\">{$conf['text-stat-6']}</font>",
'count_comm'=> "{$conf['comm-num-6']}"
),
7=> array(
'image_rating'=> "{$conf['img_path']}/07.gif",
'rank_txt'=> "<font color=\"{$conf['color-7']}\">{$conf['text-stat-7']}</font>",
'count_comm'=> "{$conf['comm-num-7']}"
),
8=> array(
'image_rating'=> "{$conf['img_path']}/08.gif",
'rank_txt'=> "<font color=\"{$conf['color-8']}\">{$conf['text-stat-8']}</font>",
'count_comm'=> "{$conf['comm-num-8']}"
),
9=> array(
'image_rating'=> "{$conf['img_path']}/09.gif",
'rank_txt'=> "<font color=\"{$conf['color-9']}\">{$conf['text-stat-9']}</font>",
'count_comm'=> "{$conf['comm-num-9']}"
),
10=> array(
'image_rating'=> "{$conf['img_path']}/10.gif",
'rank_txt'=> "<font color=\"{$conf['color-10']}\">{$conf['text-stat-10']}</font>",
'count_comm'=> "{$conf['comm-num-10']}"
),
11=> array(
'image_rating'=> "{$conf['img_path']}/11.gif",
'rank_txt'=>"<font color=\"{$conf['color-11']}\">{$conf['text-stat-11']}</font>",
'count_comm'=> "{$conf['comm-num-11']}"
),
12=> array(
'image_rating'=> "{$conf['img_path']}/12.gif",
'rank_txt'=>"<font color=\"{$conf['color-12']}\">{$conf['text-stat-12']}</font>",
'count_comm'=> "{$conf['comm-num-12']}"
),
13=> array(
'image_rating'=> "{$conf['img_path']}/13.gif",
'rank_txt'=>"<font color=\"{$conf['color-13']}\">{$conf['text-stat-13']}</font>",
'count_comm'=> "{$conf['comm-num-13']}"
),
14=> array(
'image_rating'=> "{$conf['img_path']}/14.gif",
'rank_txt'=> "<font color=\"{$conf['color-14']}\">{$conf['text-stat-14']}</font>",
'count_comm'=> "{$conf['comm-num-14']}"
),
15=> array(
'image_rating'=> "{$conf['img_path']}/15.gif",
'rank_txt'=>"<font color=\"{$conf['color-15']}\">{$conf['text-stat-15']}</font>",
'count_comm'=> "{$conf['comm-num-15']}"
),
16=> array(
'image_rating'=> "{$conf['img_path']}/16.gif",
'rank_txt'=>"<font color=\"{$conf['color-16']}\">{$conf['text-stat-16']}</font>",
'count_comm'=> "{$conf['comm-num-16']}"
),
17=> array(
'image_rating'=> "{$conf['img_path']}/17.gif",
'rank_txt'=>"<font color=\"{$conf['color-17']}\">{$conf['text-stat-17']}</font>",
'count_comm'=> "{$conf['comm-num-17']}"
),
18=> array(
'image_rating'=> "{$conf['img_path']}/18.gif",
'rank_txt' => "<font color=\"{$conf['color-18']}\">{$conf['text-stat-18']}</font>",
'count_comm' => "{$conf['comm-num-18']}"
),
19=> array(
'image_rating'=> "{$conf['img_path']}/19.gif",
'rank_txt'=>"<font color=\"{$conf['color-19']}\">{$conf['text-stat-19']}</font>",
'count_comm'=> "{$conf['comm-num-19']}"
),
20=> array(
'image_rating'=> "{$conf['img_path']}/20.gif",
'rank_txt'=>"<font color=\"{$conf['color-20']}\">{$conf['text-stat-20']}</font>",
'count_comm'=> "{$conf['comm-num-20']}"
),
);
if ($row['comm_num']=="")
$row[comm_num] = 0;
for($j=0; $j<=count($arr_ratings)-1;$j++)
{
if ($row['comm_num']>=$arr_ratings[$j]['count_comm'])
{
$image_rating = $arr_ratings[$j]['image_rating'];
$rank_txt = $arr_ratings[$j]['rank_txt'];
$remain_comm = "Te faltan ".($arr_ratings[$j+1]['count_comm']-$row['comm_num'])." comentario(s) para pasar al siguiente nivel.";
$rank = "<a href=\"#\" title=\"{$remain_comm}\">{$rank_txt}</a>";
if ($row['comm_num'] == 0)
$remain_comm = $no_rating;
}
}
if ($conf['admin-stat'] == 1)
{
if ($row['user_group'] == 1)
{
$rank_txt = "{$conf['text-stat-20']}";
$image_rating = "{$conf['img_path']}/20.gif";
$remain_comm = "";
}
}
$tpl->set('{image_rating}', "<img src=\"".$image_rating."\" alt=\"\" border=0 />");
if ($conf['txt-stat'] == 1)
$tpl->set('{rank_txt}', $rank);
else
$tpl->set('{rank_txt}', '---');
$tpl->set('{img_rating_alt}', $remain_comm);
7.- فايل زير را براي ويرايش باز كنيد
/engine/inc/options.php
كد زير را پيدا كنيد:
array(
'name' => $lang['opt_img'],
'url' => "$PHP_SELF?mod=files",
'descr' => $lang['opt_imgc'],
'image' => "iset.png",
'access' => "2",
),
'name' => $lang['opt_img'],
'url' => "$PHP_SELF?mod=files",
'descr' => $lang['opt_imgc'],
'image' => "iset.png",
'access' => "2",
),
بعد از كد بالا كد زير را قرار دهيد:
array(
'name' => 'امتيازات',
'url' => "$PHP_SELF?mod=rating",
'descr' => 'پيكر بندي ماژول امتيازات',
'image' => "rating/rating.png",
'access' => "1",
),
'name' => 'امتيازات',
'url' => "$PHP_SELF?mod=rating",
'descr' => 'پيكر بندي ماژول امتيازات',
'image' => "rating/rating.png",
'access' => "1",
),
8.-فايل زير را براي ويرايش باز كنيد(يا از مديريت فالب هاي سايت اقدام نماييد)
/templates/Tu_Template/userinfo.tpl
تگ زير را بيابيد:
Grupo: {status}
<br />
<br />
<br />
<br />
بعد از تگ بالا تگ زير را قرار دهيد
<b>{rank_txt}</b><br>
{image_rating}
<br />
<br />
{image_rating}
<br />
<br />
9.-فايل زير را براي ويرايش باز كنيد(يا از مديريت فالب هاي سايت اقدام نماييد)
/templates/Tu_Template/comments.tpl
تگ هاي زير را در محل مناسب قرار دهيد:
{rank_txt} - متن وضيعت كاربر بر اساس تعداد نظرات
{image_rating} - عكس رتبه كاربر