Jump to content
php.lv forumi

[palīdzat] IPB online lietotaju grupas


Snaip3Rs

Recommended Posts

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Nu tad kāds var pateikt to kodu kā pareizi bilde jaliek klāt lai stūrītī rādās!

if($row->mgroup == "1") {

echo '<font color="Purple">'.$row->members_display_name.'</font><br />'; //ipasnieks pienjemsim

}

un kurā vietā tad ir jaliek tas kods priekš bildes būtu ļoti pateicīgs ja jūs iesācējam palīdzētu! :)

Link to comment
Share on other sites

<?
 $db=(object)array(
'host'=>'localhost', // Datubazes hosts
'user'=>'jzvac_admin', // Datubazes lietotajs
'pass'=>'1991jz9969470', // Datubazes lietotaja parole
'name'=>'jzvac_db', // Datubazes nosaukums
'prefix'=>'ibf_members', // Bla, bla
  );

 $cfg=(object)array(
'offset'=>5, // Minutes kops pedejas aktivitates
 );

 @mysql_connect($db->host,$db->user,$db->pass)or die('Konekcija nospraga!');
 @mysql_select_db($db->name)or die('Datubazi ieselektet neizdevas!');

 $now=time();
 $offset=$cfg->offset*200;
 $activity=$now-$offset;
$sql="SELECT members_display_name, mgroup FROM `".mysql_real_escape_string($db->prefix)."` WHERE last_activity>='".intval($activity)."' ORDER BY last_activity DESC";
 $res=mysql_query($sql);
 if(mysql_num_rows($res)>0){
  while($row=mysql_fetch_object($res)){
if($row->mgroup == "1") {
 echo '<font color="Purple">'.$row->members_display_name.'</font><br />'; //ipasnieks pienjemsim
}
if($row->mgroup == "2") {
 echo '<img src="img/user/admin.jpg" /><font color="red">'.$row->members_display_name.'</font><br />'; //admins pienjemsim
}
if($row->mgroup == "3") {
 echo '<img src="img/user/user.jpg" /><font color="black">'.$row->members_display_name.'</font><br />'; //VIP pienjemsim
}
if($row->mgroup == "4") {
 echo '<img src="img/user/moderator.jpg" /><font color="blue">'.$row->members_display_name.'</font><br />'; //moderators pienjemsim
}
if($row->mgroup == "5") {
 echo '<img src="img/user/admin.jpg" /><font color="red">'.$row->members_display_name.'</font><br />'; //admins pienjemsim
}
if($row->mgroup == "6") {
 echo '<img src="img/user/admin.jpg" /><font color="red">'.$row->members_display_name.'</font><br />'; //admins pienjemsim
}
if($row->mgroup == "7") {
 echo '<img src="img/user/ipasnieks.jpg" /><font color="purple">'.$row->members_display_name.'</font><br />'; //Ipasnieks pienjemsim
}
if($row->mgroup == "8") {
 echo '<img src="img/user/admin.jpg" /><font color="red">'.$row->members_display_name.'</font><br />'; //admins pienjemsim
}
if($row->mgroup == "9") {
 echo '<img src="img/user/vip.jpg" /><font color="orange">'.$row->members_display_name.'</font><br />'; //admins pienjemsim
}
if($row->mgroup == "lietotaaju_grupas_nr") {
 echo $row->members_display_name.'<br />'; //parasts mirstiigais
}
  }
 }
 else {
  echo 'Ku ku Neviens nav fourma!';
 }
?>

Gatavs kods ar bildem un pat grupu krāsām der tikai krāsas priekš mana ipb jums jamaina krāsas bus. Online User.

Bet pēdējais lūgums kechumam viņš ir tik daudz palīdzējis ka ir japaaugstina :) vai tu vari iedot kodu kā salikt tadulā jo savadāk man rādās šādi! Es tik zinu kā ir html bet php man jaunalieta!

7fqbx29c3qgkyqm1rjog.jpg

Link to comment
Share on other sites

Vieglāk nebūtu izmantot datus no ibf_groups tabulas? Tur ir divas ailes. Viena sākumam (tas ko forumā settingos esi norādījis) un otra beigām (aizver span vai ko nu tu tur esi licis).

 

Šo rakstīju kaut kad sen. Vajadzētu strādāt. Tikai bez bildes.

 

$reg = mysql_query("SELECT * FROM ibf_members");
$reg = mysql_num_rows($reg);
$delay = "900";
$delay = time() - $delay;
$useri = mysql_query("SELECT * FROM ibf_sessions WHERE member_id != '0' and running_time >= ".$delay."");
$regon = mysql_num_rows($useri);
$viesi = mysql_query("SELECT * FROM ibf_sessions WHERE member_id = '0' and running_time >= ".$delay."");
$viesi = mysql_num_rows($viesi);
$kopa = $regon + $viesi;
echo '
Reģistrējušies: '.$reg.'<br />
Online: '.$kopa.'<br />
Viesi: '.$viesi.'<br />
Lietotāji: '.$regon.'<br />
<hr style="margin:2px 0;"/>
';
while ($users = mysql_fetch_array($useri)){
$group = $users['member_group'];
$q = mysql_query("SELECT * FROM ibf_groups WHERE g_id = '$group'");
while($group = mysql_fetch_array($q)){
if(empty($group['prefix'])){
$prefix = "<span style=\"color:black\">";
$suffix = "</span>";
}
else{
$prefix = $group['prefix'];
$suffix = $group['suffix'];
}
echo "<a href='f/index.php?showuser=".$users['member_id']."' title='".$users['member_name']."'>".$prefix."".$users['member_name']."".$suffix."</a><br />";
}
}

 

Un priekš bildes izmanto grupas id.

Edited by nemakuphp
Link to comment
Share on other sites

echo " <img src='/images/grupas/".$group.".jpg' /> <a href='f/index.php?showuser=".$users['member_id']."' title='".$users['member_name']."'>".$prefix."".$users['member_name']."".$suffix."</a><br />";

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...