monitor_buttons.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2018 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. $query_groups = "";
  25. if($_SESSION['users_role'] != "admin")
  26. {
  27. $groups = $db->getUsersGroups($_SESSION['user_id']);
  28. $query_groups .= " AND (";
  29. foreach($groups as $group)
  30. $query_groups .= "group_id=".$group['group_id']." OR ";
  31. $query_groups .= "group_id=0 OR group_id IS NULL)";
  32. }
  33. $addons = $db->resultQuery("SELECT addon_id FROM OGP_DB_PREFIXaddons WHERE home_cfg_id=".$server_home['home_cfg_id'].$query_groups);
  34. $addons_qty = $addons ? count($addons) : 0;
  35. if($addons && $addons_qty >= 1){
  36. $module_buttons = array(
  37. "<a class='monitorbutton' href='?m=addonsmanager&amp;p=user_addons&amp;home_id=".
  38. $server_home['home_id']."&amp;mod_id=".$server_home['mod_id'].
  39. "&amp;ip=".$server_home['ip']."&amp;port=".$server_home['port']."'>
  40. <img src='" . check_theme_image("modules/administration/images/addons_manager.png") . "' title='". get_lang("addons") ."'>
  41. <span>". get_lang("addons") ." (".$addons_qty.")</span>
  42. </a>"
  43. );
  44. }
  45. else
  46. $module_buttons = array();
  47. ?>