kechums Posted May 31, 2009 Report Share Posted May 31, 2009 ka pielikt katram savu bildi?es liku šādi: echo '<img src='img/f_ico.gif' alt='face' /><font color="red">'.$row->members_display_name.'</font><br />'; //admins pienjemsim bet nestrada ir kadi ieteikumi? Lasi par eskeipošanu Quote Link to comment Share on other sites More sharing options...
alfinsh Posted May 31, 2009 Report Share Posted May 31, 2009 ak tu jezinj , nu kļūda gadījās ... "aizvāc" Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted May 31, 2009 Author Report Share Posted May 31, 2009 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! :) Quote Link to comment Share on other sites More sharing options...
kechums Posted May 31, 2009 Report Share Posted May 31, 2009 if($row->mgroup == "1") { echo '<img src="bildes_urlis" /><font color="Purple">'.$row->members_display_name.'</font><br />'; //ipasnieks pienjemsim } Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted May 31, 2009 Author Report Share Posted May 31, 2009 <? $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! Quote Link to comment Share on other sites More sharing options...
kechums Posted May 31, 2009 Report Share Posted May 31, 2009 <table> <tr> <td><img src="url" /></td> <td>lietotaajs</td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
marcis Posted May 31, 2009 Report Share Posted May 31, 2009 Pastāstiet man tādu lietu - ja pirmais if's nostrādā, tad kāda jēga iet cauri pārējiem if'iem? Un ja mainās tikai krāsa, tad kāda jēga tur vispār if'us lietot? Ir arī tāda lieta kā masīvi. Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted May 31, 2009 Author Report Share Posted May 31, 2009 a tas vis skripts jaliek no if lidz lejai } ?Ja Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted May 31, 2009 Report Share Posted May 31, 2009 (edited) 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 May 31, 2009 by nemakuphp Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted May 31, 2009 Author Report Share Posted May 31, 2009 Liels paldies šis vēl labāks bet ar bildēm man liekās būtu interesantāk, bet šis ir liederīgāks! :) TNX nemakuphp Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted May 31, 2009 Report Share Posted May 31, 2009 pieliec pirms <a ... klāt <img src='img/".$group.".jpg' /> un attēlus saglamā mapē img ar nosaukumiem 1.jpg 2.jpg utt Quote Link to comment Share on other sites More sharing options...
airbus Posted June 1, 2009 Report Share Posted June 1, 2009 Pieliku to <img src='img/grupas/".$group.".jpg' /> , bet man nevis tur 1.jpg bet kaut kadu array.jpg Quote Link to comment Share on other sites More sharing options...
kechums Posted June 1, 2009 Report Share Posted June 1, 2009 airbus, parādi visu rindu, kur ir tas <img ... izvads. Quote Link to comment Share on other sites More sharing options...
airbus Posted June 1, 2009 Report Share Posted June 1, 2009 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 />"; Quote Link to comment Share on other sites More sharing options...
kechums Posted June 1, 2009 Report Share Posted June 1, 2009 Ja tu izmanto #24 nemakuphp ielikto skriptu, tad grūti nosaukt iemeslu, kāpēc neizvadās grupas numurs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.