لأظهار رتب النجوم في الرسائل الخاصة ل
ملحق اختيار نجوم مختلفة لكل مجموعة للإصدار 3.0.1 فقط
افتح ملف : modules/pm_show.module.php
وابحث ابتداء من
السطر 309 إلى السطر 341 عن الكود :
CODE
//get user rating
$ratings = $PowerBB->userrating->GetCachedRatings();
$y = sizeof($ratings);
for ($b = 0; $b <= $y; $b++)
{
if($ratings[$y-1]['posts'] < $PowerBB->_CONF['template']['ReplierInfo']['posts'])
{
$user_ratings = $ratings[$y-1]['rating'];
$user_posts = $ratings[$y-1]['posts'];
break;
}
if($ratings[$b]['posts'] > $PowerBB->_CONF['template']['ReplierInfo']['posts'])
{
$user_ratings = $ratings[$b]['rating'];
$user_posts = $ratings[$b]['posts'];
break;
}
if($PowerBB->_CONF['template']['ReplierInfo']['posts'] < $ratings[1]['posts'])
{
$user_ratings = $ratings[1]['rating'];
$user_posts = $ratings[1]['posts'];
break;
}
}
$PowerBB->_CONF['template']['RatingInfo']['rating'] = $user_ratings;
$PowerBB->_CONF['template']['RatingInfo']['posts'] = $user_posts;
$GrpArr = array();
$GrpArr['where'] = array('id',$PowerBB->_CONF['template']['Info']['usergroup']);
$GroupInfo = $PowerBB->core->GetInfo($GrpArr,'group');
$PowerBB->template->assign('GroupInfo',$GroupInfo);
واستبدله كاملاً بهذا الكود :
CODE
$GrpArr = array();
$GrpArr['where'] = array('id',$PowerBB->_CONF['template']['ReplierInfo']['usergroup']);
$GroupInfo = $PowerBB->core->GetInfo($GrpArr,'group');
$PowerBB->template->assign('GroupInfo',$GroupInfo);
if (!empty($GroupInfo['stars_color']))
{
$Stars=array(
"blue" => "look/images/stars/star_blue.gif",
"bronze" => "look/images/stars/star_bronze.gif",
"cyan" => "look/images/stars/star_cyan.gif",
"gold" => "look/images/stars/star_gold.gif",
"green" => "look/images/stars/star_green.gif",
"orange" => "look/images/stars/star_orange.gif",
"purple" => "look/images/stars/star_purple.gif",
"red" => "look/images/stars/star_red.gif",
"silver" => "look/images/stars/star_silver.gif"
);
$Star_Color=$GroupInfo['stars_color'];
$star_color= $Stars[$Star_Color];
//get user rating
$ratings = $PowerBB->userrating->GetCachedRatings();
$y = sizeof($ratings);
if($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[0]['posts']&&$ratings[0]['rating']== 0){$M_Stars="";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[0]['posts']&&$ratings[0]['rating']== 1){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[1]['posts']&&$ratings[1]['rating']== 2){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[2]['posts']&&$ratings[2]['rating']== 3){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[3]['posts']&&$ratings[3]['rating']== 4){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[4]['posts']&&$ratings[4]['rating']== 5){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[5]['posts']&&$ratings[5]['rating']== 6){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[6]['posts']&&$ratings[6]['rating']== 7){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[7]['posts']&&$ratings[7]['rating']== 8){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']<=$ratings[8]['posts']&&$ratings[8]['rating']== 9){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
elseif($PowerBB->_CONF['template']['ReplierInfo']['posts']>=$ratings[9]['posts']){$M_Stars="<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>"."<img border='0' src='".$star_color."' alt='".$title."'>";
}
$PowerBB->_CONF['template']['RatingInfo']['rating'] = $M_Stars;
$PowerBB->_CONF['template']['RatingInfo']['posts'] = $PowerBB->_CONF['template']['ReplierInfo']['posts'];
}
أنتهى ..