themes.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. function exec_ogp_module()
  25. {
  26. require_once('modules/settings/functions.php');
  27. require_once('includes/form_table_class.php');
  28. global $db,$view,$settings;
  29. if ( isset($_REQUEST['update_settings']) )
  30. {
  31. $settings = array("theme" => $_REQUEST['theme'],
  32. "welcome_title" => $_REQUEST['welcome_title'],
  33. "welcome_title_message" => $_REQUEST['welcome_title_message'],
  34. "logo_link" => $_REQUEST['logo_link'],
  35. "bg_wrapper" => @$_REQUEST['bg_wrapper'],
  36. "custom_tab" => $_REQUEST['custom_tab'],
  37. "custom_tab_name" => @$_REQUEST['custom_tab_name'],
  38. "custom_tab_link" => @$_REQUEST['custom_tab_link'],
  39. "custom_tab_sub" => @$_REQUEST['custom_tab_sub'],
  40. "custom_tab_sub_name" => @$_REQUEST['custom_tab_sub_name'],
  41. "custom_tab_sub_link" => @$_REQUEST['custom_tab_sub_link'],
  42. "custom_tab_sub_name2" => @$_REQUEST['custom_tab_sub_name2'],
  43. "custom_tab_sub_link2" => @$_REQUEST['custom_tab_sub_link2'],
  44. "custom_tab_sub_name3" => @$_REQUEST['custom_tab_sub_name3'],
  45. "custom_tab_sub_link3" => @$_REQUEST['custom_tab_sub_link3'],
  46. "custom_tab_sub_name4" => @$_REQUEST['custom_tab_sub_name4'],
  47. "custom_tab_sub_link4" => @$_REQUEST['custom_tab_sub_link4'],
  48. "custom_tab_target_blank" => @$_REQUEST['custom_tab_target_blank']);
  49. $db->setSettings($settings);
  50. print_success(get_lang('settings_updated'));
  51. $view->refresh("?m=settings&p=themes");
  52. return;
  53. }
  54. echo "<h2>".get_lang('theme_settings')."</h2>";
  55. $bg_wrapper = array("" => "Default",
  56. "url(images/bg/connect.png);" => "Connect",
  57. "url(images/bg/foggy_birds.png);" => "Foggy Birds",
  58. "url(images/bg/handmadepaper.png);" => "Handmade Paper",
  59. "url(images/bg/tvlines.png);" => "TV Lines",
  60. "url(images/bg/graycells.png);" => "Gray Cells",
  61. "url(images/bg/coated.png);" => "Coated");
  62. $tab_targets = array("_self" => "Self Page",
  63. "_blank" => "New Page");
  64. $row = $db->getSettings();
  65. $ft = new FormTable();
  66. $ft->start_form("?m=settings&p=themes");
  67. $ft->start_table();
  68. $ft->add_custom_field('theme',get_theme_html_str(@$row['theme']));
  69. $ft->add_field('on_off','welcome_title',@$row['welcome_title']);
  70. $ft->add_field('text','welcome_title_message',@$row['welcome_title_message'], 38);
  71. $ft->add_field('string','logo_link',@$row['logo_link']);
  72. $ft->add_custom_field('bg_wrapper',
  73. create_drop_box_from_array($bg_wrapper,"bg_wrapper",@$row['bg_wrapper'],false));
  74. $ft->add_field('on_off','custom_tab',@$row['custom_tab']);
  75. if( isset($settings['custom_tab']) && $settings['custom_tab'] == "1" )
  76. {
  77. $ft->add_field('string','custom_tab_name',@$row['custom_tab_name']);
  78. $ft->add_field('string','custom_tab_link',@$row['custom_tab_link']);
  79. $ft->add_field('on_off','custom_tab_sub',@$row['custom_tab_sub']);
  80. if( isset($settings['custom_tab_sub']) && $settings['custom_tab_sub'] == "1" )
  81. {
  82. $ft->add_field('string','custom_tab_sub_name',@$row['custom_tab_sub_name']);
  83. $ft->add_field('string','custom_tab_sub_link',@$row['custom_tab_sub_link']);
  84. $ft->add_field('string','custom_tab_sub_name2',@$row['custom_tab_sub_name2']);
  85. $ft->add_field('string','custom_tab_sub_link2',@$row['custom_tab_sub_link2']);
  86. $ft->add_field('string','custom_tab_sub_name3',@$row['custom_tab_sub_name3']);
  87. $ft->add_field('string','custom_tab_sub_link3',@$row['custom_tab_sub_link3']);
  88. $ft->add_field('string','custom_tab_sub_name4',@$row['custom_tab_sub_name4']);
  89. $ft->add_field('string','custom_tab_sub_link4',@$row['custom_tab_sub_link4']);
  90. }
  91. $ft->add_custom_field('custom_tab_target_blank',
  92. create_drop_box_from_array($tab_targets,"custom_tab_target_blank",@$row['custom_tab_target_blank'],false));
  93. }
  94. $ft->end_table();
  95. $ft->add_button("submit","update_settings",get_lang('update_settings'));
  96. $ft->end_form();
  97. }
  98. ?>