Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] hierarchia elementów
Chemiq
post
Post #1





Grupa: Zarejestrowani
Postów: 105
Pomógł: 0
Dołączył: 16.07.2006

Ostrzeżenie: (0%)
-----


mam niewielki problemik. otóż zdefiniowałem takie coś:
  1. <?php
  2. define(GUEST, !$_SESSION['login']);
  3. define(USER, $_SESSION['login']);
  4. define(MOD, $dane_user['status']=="mod");
  5. define(J_ADMIN, $dane_user['status']=="j_admin");
  6. define(ADMIN, $dane_user['status']=="admin");
  7. define(S_ADMIN, $dane_user['status']=="s_admin");
  8. ?>


jak zrobić hierarchię tych elementów, tzn. żeby GUEST < USER < MOD itd.(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
abc667
post
Post #2





Grupa: Zarejestrowani
Postów: 229
Pomógł: 0
Dołączył: 29.05.2007

Ostrzeżenie: (0%)
-----


  1. <?php
  2. define('GUEST', !$_SESSION['login']);
  3. define('USER', $_SESSION['login']);
  4. define('MOD', false);
  5. define('J_ADMIN', false);
  6. define('ADMIN', false);
  7. define('S_ADMIN', false);
  8.  
  9.  
  10. if(in_array($dane_user['status'], array("mod", "j_admin", "admin", "s_admin")))
  11. {
  12. define('MOD', true);
  13. if($dane_user['status'] != "mod")
  14. {
  15. define('J_ADMIN', true);
  16. if($dane_user['status'] != "j_admin")
  17. {
  18. define('ADMIN', true);
  19. if($dane_user['status'] != "admin")
  20. define('S_ADMIN', true);
  21. }
  22. }
  23. }
  24. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 23:34