G-Style Posted August 27, 2007 Report Share Posted August 27, 2007 Taatad: Visi lietotaaji ir sadaliiti 2 grupaas : Admin Normal. Kaa pie useru atteeloshanas online vareetu pievienot katrai lietotaaju grupai savu *.gif failu? Piemeeram visi Admin grupas lietotaaji atteelojas ar bilde1.gif pie lietoaaja nickname,bet visi Normal grupas lietotaaji ar bilde2.gif?? Ceru,ka ideja ir skaidra. Thanks :) Link to comment Share on other sites More sharing options...
martins256 Posted August 27, 2007 Report Share Posted August 27, 2007 un kā atšķir adminu no parastā lietotāja ? datubāzē kkur glabā vai kur ? Link to comment Share on other sites More sharing options...
marcis Posted August 27, 2007 Report Share Posted August 27, 2007 tur kur glabājas tev lietotāju dati tak ir norādīts lietotāja statuss? $bilde = "bilde2.gif"; if($statuss=="admin"){$bilde = "bilde1.gif";} echo $bilde; Link to comment Share on other sites More sharing options...
G-Style Posted August 27, 2007 Author Report Share Posted August 27, 2007 Jaa visi dati glabaajas datubaazee Link to comment Share on other sites More sharing options...
Delfins Posted August 27, 2007 Report Share Posted August 27, 2007 Piemērs nākotnei $groupImgs = array('admin' => 'a.gif', 'normal' => 'b.gif'); print $groupImgs[$row['user_group']]; Link to comment Share on other sites More sharing options...
G-Style Posted August 27, 2007 Author Report Share Posted August 27, 2007 Ideja skaidra. Mazs papildinaajums: Vai ir iespeejams katram neregistreetam lietotaajam-viesim pieskirt savu unikaalu id, piem. Viesis112 un tam klaat arii kadu c.gif? Link to comment Share on other sites More sharing options...
martins256 Posted August 27, 2007 Report Share Posted August 27, 2007 (edited) protams, ka ir iespējams! tikai lai tam nereģistrētajam lietotājam tas c.gif paliktu, vajag viņam iesmērēt cepumus (ja viņš cepumus izdzēš, tad viss beidzās...) Edited August 27, 2007 by martins256 Link to comment Share on other sites More sharing options...
Grey_Wolf Posted August 27, 2007 Report Share Posted August 27, 2007 ar tiem unikalajiem ID ir kaa ir :( ir domati daudzi risinaajumi, bet iisti korekti nestraadaa neviens... Ja nu vieniigi to Uzticett areejam skriptam/ programmai kas atceraas kaaddi ID ir pieskjirti --> no taa secinam ka tam ideali izmantot DB tabulu ;) (njemot veraa ka SQL mak smuki genereet Unikalus ID ... ) --- vel risinajums : $aaa=substr(time(), 4); // nogriezjam pirmos simbolus nost , jo vinji taapat ir vienaadi echo $aaa.mt_rand(0, 9999); // pieskaitam klaat random skaitli Bet sim ir varbuutiiba ka var nodubleties ... Link to comment Share on other sites More sharing options...
rpr Posted August 27, 2007 Report Share Posted August 27, 2007 kamdelj vienkaarshi to nenovienkaarshot ar http://lv2.php.net/uniqid ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted August 27, 2007 Report Share Posted August 27, 2007 rpr --> var arii taa ... (tas pats jau vien buus ;) ) katrai metodei savi + un savi - .... Link to comment Share on other sites More sharing options...
Recommended Posts