Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Vip grupe
Parašė JaWa· 2010 Bir. 20 15:06:51
#1
Sveiki. Bandau daryti toki dalyka, jei narys priklauso vip grupei, prie jo niko zenkliukas yra.
$result5 = dbrows(dbquery("SELECT * FROM ".$db_prefix."users WHERE user_groups='2'"));
if($result5 = 2) {
$gr=explode('.',$data['user_groups']);
if(in_array('2',$gr)) {
$vipas = "<img src='".IMAGES."vip.gif' alt='VIP Narys' title='VIP Narys'>";
}
}
Taciau kaikuriuose failuose susiduriu su tokia problema : pavyzdziui
news.php
kodo iskirpa:
$result5 = dbrows(dbquery("SELECT * FROM ".$db_prefix."users WHERE user_groups='2'"));
if($result5 = 2) {
$gr=explode('.',$data['user_groups']);
if(in_array('2',$gr)) {
$vipas = "<img src='".IMAGES."vip.gif' alt='VIP Narys' title='VIP Narys'>";
} else {
$vipas = "";
}
}
if ($settings['news_style'] == "1") {
if ($rows <= 2 || $ncount == 1) {
$news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> $vipas<a href='".BASEDIR.'profile.php?lookup='.$news_info['user_id']."'><span style='color:#".$news_info['user_color']."'>".$news_info['user_prefix'].$news_info['user_name']."</span></a> ".$locale['041'].showdate("longdate", $news_info['news_date'])." ·\n";
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?readmore=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[0] .= $news_info['news_reads'].$locale['044']." ·\n";
}
Man ta vip zenkliuka rodo ant visu nariu (nors jis ne vip). gal del sito kad cia taip :.
..$vipas <a href='".BASEDIR.'profile.php?lookup='.$news_info['user_id']."'>
galite paaiskinti kaip istaisyti ?
Parašė edis2· 2010 Bir. 20 17:06:25
#2
O kodėl negali taip paprastai?:
if (checkgroup(2, $data['user_id'])){
echo "<img src='".IMAGES."vip.gif' alt='VIP Narys' title='VIP Narys'>";
}
Parašė JaWa· 2010 Bir. 20 20:06:45
#3
edis2, o taip velgi man rodo vip zenkliuka ant visu :)
Parašė AgS· 2010 Bir. 20 20:06:58
#4
Na, gal pas tave ten saugiau padaryta ar kas nors tokio, aš tai paprasčiau daryčiau ;d
$result5 = dbquery("SELECT user_groups FROM ".$db_prefix."users WHERE user_id='".$data['user_id']."' AND user_groups='2'");
if(dbrows($result5) != 0) {
$vipas = "<img src='".IMAGES."vip.gif' alt='VIP Narys' title='VIP Narys'>";
}
Ten tik
$data['user_id']
pasikoreguok ;D
Redagavo AgS· 2010 Bir. 20 20:06:55
Parašė JaWa· 2010 Bir. 20 22:06:55
#5
na vistiek ... :D nors zmogus ne vip , taciau rodo zenkliuka :)
Parašė AgS· 2010 Bir. 21 11:06:39
#6
tai gal pas visus yra ta user_groups 2 nustatyta?
Parašė edis2· 2010 Bir. 21 11:06:04
#7
JaWa parašė:
edis2, o taip velgi man rodo vip zenkliuka ant visu :)
Gal tu vietoj $data['user_id'] naudoji $
userdata['user_id']? Nes pats naudoju savo ir viskas veikia :)