Просмотр файла vavok-1.5.3/adminpanel/settings.php

Размер файла: 32.89Kb
  1. <?php
  2. // (c) vavok.net
  3. require_once"../include/startup.php";
  4.  
  5. if (!$users->is_reg() || !$users->is_administrator(101)) {
  6. redirect_to("../pages/error.php?error=401");
  7. }
  8.  
  9. $action = isset($_GET['action']) ? check($_GET['action']) : '';
  10.  
  11. // main settings update
  12. if ($action == "editone") {
  13.  
  14. // Check fields
  15. if (empty($_POST['conf_set0']) || empty($_POST['conf_set1']) || empty($_POST['conf_set2']) || empty($_POST['conf_set3']) || empty($_POST['conf_set8']) || empty($_POST['conf_set9']) || empty($_POST['conf_set10']) || empty($_POST['conf_set11']) || empty($_POST['conf_set14']) || empty($_POST['conf_set21']) || empty($_POST['conf_set29']) || empty($_POST['conf_set61']) || empty($_POST['conf_set62']) || empty($_POST['conf_set63'])) {
  16. redirect_to("settings.php?action=setone&isset=mp_nosset");
  17. }
  18.  
  19. $ufile = file_get_contents(BASEDIR . "used/config.dat");
  20. $udata = explode("|", $ufile);
  21.  
  22. $udata[0] = check($_POST['conf_set0']);
  23. $udata[1] = check($_POST['conf_set1']);
  24. $udata[2] = check($_POST['conf_set2']);
  25. $udata[3] = check($_POST['conf_set3']);
  26. $udata[8] = check($_POST['conf_set8']);
  27. $udata[9] = htmlspecialchars(stripslashes(trim($_POST['conf_set9'])));
  28. $udata[10] = check($_POST['conf_set10']);
  29. $udata[11] = check($_POST['conf_set11']);
  30. $udata[14] = check($_POST['conf_set14']);
  31. $udata[21] = check($_POST['conf_set21']); // transfer protocol
  32. $udata[29] = (int)$_POST['conf_set29'];
  33. $udata[47] = check($_POST['conf_set47']);
  34. $udata[61] = (int)$_POST['conf_set61'];
  35. $udata[62] = (int)$_POST['conf_set62'];
  36. $udata[63] = (int)$_POST['conf_set63'];
  37.  
  38. $utext = '';
  39.  
  40. for ($u = 0; $u < $config["configKeys"]; $u++) {
  41. $utext .= $udata[$u] . '|';
  42. }
  43.  
  44. // update configuration file
  45. if (!empty($udata[8]) && !empty($udata[9])) {
  46. file_put_contents(BASEDIR . "used/config.dat", $utext);
  47. }
  48.  
  49. // update .htaccess file
  50. // dont force https
  51. $htaccess_tp_nos = '# force https protocol
  52. #RewriteCond %{HTTPS} !=on
  53. #RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]';
  54.  
  55. // force https
  56. $htaccess_tp_s = '# force https protocol
  57. RewriteCond %{HTTPS} !=on
  58. RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]';
  59.  
  60. if (get_configuration('transferProtocol') == 'HTTPS' && ($udata[21] == 'auto' || $udata[21] == 'HTTP')) {
  61.  
  62. // Disable forcing HTTPS in .htaccess
  63.  
  64. $file = file_get_contents('../.htaccess');
  65.  
  66. $start = strpos($file, '# force https protocol');
  67. $strlen = mb_strlen($htaccess_tp_s); // find string length
  68.  
  69.  
  70. $file = substr_replace($file, $htaccess_tp_nos, $start, $strlen);
  71.  
  72. file_put_contents('../.htaccess', $file);
  73.  
  74. } elseif ($udata[21] == 'HTTPS' && (get_configuration('transferProtocol') == 'HTTP' || get_configuration('transferProtocol') == 'auto')) {
  75. // Enable forcing HTTPS in .htaccess
  76.  
  77. $file = file_get_contents('../.htaccess');
  78.  
  79. $start = strpos($file, '# force https protocol');
  80. $strlen = mb_strlen($htaccess_tp_nos); // find string length
  81.  
  82.  
  83. $file = substr_replace($file, $htaccess_tp_s, $start, $strlen);
  84.  
  85. file_put_contents('../.htaccess', $file);
  86. }
  87.  
  88. redirect_to("settings.php?isset=mp_yesset");
  89.  
  90. }
  91.  
  92.  
  93. if ($action == "edittwo") {
  94.  
  95. if ($_POST['conf_set4'] != "" && $_POST['conf_set5'] != "" && $_POST['conf_set7'] != "" && isset($_POST['conf_set32']) && $_POST['conf_set74'] != "") {
  96. $ufile = file(BASEDIR . "used/config.dat");
  97. $udata = explode("|", $ufile[0]);
  98.  
  99. $udata[4] = (int)$_POST['conf_set4'];
  100. $udata[5] = (int)$_POST['conf_set5'];
  101. $udata[7] = (int)$_POST['conf_set7'];
  102. $udata[32] = (int)$_POST['conf_set32']; // cookie consent
  103. $udata[74] = (int)$_POST['conf_set74'];
  104.  
  105. for ($u = 0; $u < $config["configKeys"]; $u++) {
  106. $utext .= $udata[$u] . '|';
  107. }
  108.  
  109. if (!empty($udata[8]) && !empty($udata[9])) {
  110. // Save data
  111. file_put_contents(BASEDIR . "used/config.dat", $utext);
  112. }
  113.  
  114. redirect_to ("settings.php?isset=mp_yesset");
  115.  
  116. } else {
  117. header ("Location: settings.php?action=settwo&isset=mp_nosset");
  118. exit;
  119. }
  120. }
  121.  
  122. if ($action == "editthree") {
  123.  
  124. if ($_POST['conf_set20'] != "" && $_POST['conf_set22'] != "" && $_POST['conf_set24'] != "" && $_POST['conf_set25'] != "" && $_POST['conf_set56'] != "") {
  125.  
  126. $ufile = file(BASEDIR . "used/config.dat");
  127. $udata = explode("|", $ufile[0]);
  128.  
  129. $udata[20] = (int)$_POST['conf_set20'];
  130. $udata[22] = (int)$_POST['conf_set22'];
  131. $udata[24] = (int)$_POST['conf_set24'];
  132. $udata[25] = (int)$_POST['conf_set25'];
  133. $udata[56] = (int)$_POST['conf_set56'];
  134. $udata[63] = (int)$_POST['conf_set63'];
  135. $udata[64] = (int)$_POST['conf_set64'];
  136. $udata[65] = (int)$_POST['conf_set65'];
  137.  
  138. for ($u = 0; $u < $config["configKeys"]; $u++) {
  139. $utext .= $udata[$u] . '|';
  140. }
  141.  
  142. file_put_contents(BASEDIR . "used/config.dat", $utext);
  143.  
  144. header ("Location: settings.php?isset=mp_yesset");
  145. exit;
  146. } else {
  147. header ("Location: settings.php?action=setthree&isset=mp_nosset");
  148. exit;
  149. }
  150. }
  151.  
  152. if ($action == "editfour") {
  153.  
  154. if ($_POST['conf_set38'] != "" && $_POST['conf_set39'] != "" && $_POST['conf_set49'] != "") {
  155.  
  156. // update main config
  157. $ufile = file(BASEDIR . "used/config.dat");
  158. $udata = explode("|", $ufile[0]);
  159.  
  160. if (!empty($_POST['conf_set28'])) {
  161. $udata[28] = (int)$_POST['conf_set28'];
  162. }
  163. $udata[37] = (int)$_POST['conf_set37'];
  164. $udata[38] = (int)$_POST['conf_set38'];
  165. $udata[38] = $udata[38] * 1024;
  166. $udata[38] = (int)$udata[38];
  167. $udata[39] = (int)$_POST['conf_set39'];
  168. $udata[49] = (int)$_POST['conf_set49'];
  169. $udata[68] = (int)$_POST['conf_set68'];
  170.  
  171. for ($u = 0; $u < $config["configKeys"]; $u++) {
  172. $utext .= $udata[$u] . '|';
  173. }
  174.  
  175. file_put_contents(BASEDIR . "used/config.dat", $utext);
  176.  
  177. // update gallery settings
  178. $gallery_file = file(BASEDIR . "used/dataconfig/gallery.dat");
  179. if ($gallery_file) {
  180. $gallery_data = explode("|", $gallery_file[0]);
  181.  
  182. $gallery_data[0] = (int)$_POST['gallery_set0'];
  183. $gallery_data[8] = (int)$_POST['gallery_set8']; // photos per page
  184. $gallery_data[5] = (int)$_POST['screen_width'];
  185. $gallery_data[6] = (int)$_POST['screen_height'];
  186. $gallery_data[7] = (int)$_POST['media_buttons'];
  187.  
  188.  
  189. for ($u = 0; $u < $config["configKeys"]; $u++) {
  190. $gallery_text .= $gallery_data[$u] . '|';
  191. }
  192.  
  193. if (isset($gallery_data[0])) {
  194. file_put_contents(BASEDIR . "used/dataconfig/gallery.dat", $gallery_text);
  195. }
  196. }
  197.  
  198. redirect_to("settings.php?isset=mp_yesset");
  199.  
  200. } else { redirect_to("settings.php?action=setfour&isset=mp_nosset"); }
  201.  
  202. }
  203.  
  204. if ($action == "editfive") {
  205.  
  206. if (!empty($_POST['conf_set30'])) {
  207. $ufile = file(BASEDIR . "used/config.dat");
  208. $udata = explode("|", $ufile[0]);
  209.  
  210. $udata[30] = (int)$_POST['conf_set30'];
  211.  
  212. for ($u = 0; $u < $config["configKeys"]; $u++) {
  213. $utext .= $udata[$u] . '|';
  214. }
  215.  
  216. if (!empty($udata[8]) && !empty($udata[9])) {
  217. file_put_contents(BASEDIR . "used/config.dat", $utext);
  218. }
  219.  
  220. redirect_to("settings.php?isset=mp_yesset");
  221.  
  222. } else { redirect_to("settings.php?action=setfive&isset=mp_nosset"); }
  223.  
  224. }
  225.  
  226. if ($action == "editseven") {
  227.  
  228. if (!empty($_POST['conf_set6']) || !empty($_POST['conf_set51']) || !empty($_POST['conf_set70'])) {
  229.  
  230. // url of custom pages
  231. $htaccess = file_get_contents('../.htaccess'); // load .htaccess file
  232.  
  233. // replace custom link
  234. $chars = strlen('# website custom pages');
  235. $start = strpos($htaccess, '# website custom pages') + $chars;
  236. $end = strpos($htaccess, '# end of website custom pages');
  237.  
  238. $replace = '';
  239. for ($i=$start; $i < $end; $i++) {
  240. $replace .= $htaccess[$i];
  241. }
  242.  
  243. // do replacement
  244. if (!empty($_POST['conf_set28'])) {
  245. $_POST['conf_set28'] = str_replace(' ', '', $_POST['conf_set28']);
  246.  
  247. $replacement = "\r\n" . 'RewriteRule ^' . $_POST['conf_set28'] . '\/([^\/]+)\/?$ pages/pages.php?pg=$1 [NC,L]' . "\r\n";
  248. } else { $replacement = "\r\n# custom_link - don't remove\r\n"; }
  249.  
  250. $new_htaccess = str_replace($replace, $replacement, $htaccess);
  251.  
  252. // save changes
  253. file_put_contents('../.htaccess', $new_htaccess);
  254.  
  255. $data = array(
  256. 6 => $_POST['conf_set6'],
  257. 28 => $_POST['conf_set28'],
  258. 51 => $_POST['conf_set51'],
  259. 70 => $_POST['conf_set70']
  260. );
  261.  
  262. $config_update = new Config();
  263. $config_update->update($data);
  264.  
  265. redirect_to("settings.php?isset=mp_yesset");
  266.  
  267. } else {
  268. redirect_to("settings.php?action=setseven&isset=mp_nosset");
  269. }
  270. }
  271.  
  272. if ($action == "editeight") {
  273.  
  274. if ($_POST['conf_set58'] != "" && $_POST['conf_set76'] != "") {
  275. $ufile = file(BASEDIR . "used/config.dat");
  276. $udata = explode("|", $ufile[0]);
  277.  
  278. $udata[58] = (int)$_POST['conf_set58'];
  279. $udata[76] = round($_POST['conf_set76'] * 1440);
  280.  
  281. for ($u = 0; $u < $config["configKeys"]; $u++) {
  282. $utext .= $udata[$u] . '|';
  283. }
  284.  
  285. if (!empty($udata[8]) && !empty($udata[9])) {
  286. file_put_contents(BASEDIR . "used/config.dat", $utext);
  287. }
  288.  
  289. redirect_to("settings.php?isset=mp_yesset");
  290.  
  291. } else {
  292. redirect_to("settings.php?action=seteight&isset=mp_nosset");
  293. }
  294.  
  295. }
  296. // edit database settings
  297. if ($action == "editnine") {
  298.  
  299. if ($_POST['conf_set77'] != "" && $_POST['conf_set78'] != "" && $_POST['conf_set79'] != "" && $_POST['conf_set80'] != "") {
  300.  
  301. // check for tables
  302. if (!$db->table_exists($_POST['conf_set71'] . 'pages')) { $db->copy_table('pages', $_POST['conf_set71']); } // pages for this site
  303. if (!$db->table_exists($_POST['conf_set71'] . 'online')) { $db->copy_table('online', $_POST['conf_set71']); } // visitor counter for this site
  304. if (!$db->table_exists($_POST['conf_set71'] . 'specperm')) { $db->copy_table('specperm', $_POST['conf_set71']); } // permittions for this site
  305.  
  306. if (!$db->table_exists($_POST['conf_set71'] . 'counter')) {
  307.  
  308. $db->copy_table('counter', $_POST['conf_set71']);
  309.  
  310. // set default values
  311. $db->query("INSERT INTO " . $_POST['conf_set71'] . "counter (`day`, `month`, `visits_today`, `visits_total`, `clicks_today`, `clicks_total`) VALUES (0, 0, 0, 0, 0, 0)");
  312.  
  313. } // visitor counter for this site
  314.  
  315.  
  316.  
  317. $data = array(
  318. 71 => $_POST['conf_set71'], // crossdomain table prefix 'tablePrefix'
  319. 77 => $_POST['conf_set77'],
  320. 78 => $_POST['conf_set78'],
  321. 79 => $_POST['conf_set79'],
  322. 80 => $_POST['conf_set80']
  323. );
  324.  
  325. $config_update = new Config();
  326. $config_update->update($data);
  327.  
  328. redirect_to("settings.php?isset=mp_yesset");
  329.  
  330. } else {
  331.  
  332. redirect_to("settings.php?action=setnine&isset=mp_nosset");
  333.  
  334. }
  335.  
  336. }
  337.  
  338. $my_title = "Settings";
  339.  
  340. require_once BASEDIR . "themes/" . MY_THEME . "/index.php";
  341.  
  342. if (empty($action)) {
  343. echo '<a href="settings.php?action=setone" class="btn btn-outline-primary sitelink">' . $lang_apsetting['mainset'] . '</a>';
  344. echo '<a href="settings.php?action=setnine" class="btn btn-outline-primary sitelink">' . $lang_apsetting['mainset'] . ' -> ' . $lang_apsetting['database'] . '</a>';
  345. echo '<a href="settings.php?action=settwo" class="btn btn-outline-primary sitelink">' . $lang_apsetting['shwinfo'] . '</a>';
  346. echo '<a href="settings.php?action=setthree" class="btn btn-outline-primary sitelink">' . $lang_apsetting['bookchatnews'] . '</a>';
  347. echo '<a href="settings.php?action=setfour" class="btn btn-outline-primary sitelink">' . $lang_apsetting['forumgallery'] . '</a>';
  348. echo '<a href="settings.php?action=setfive" class="btn btn-outline-primary sitelink">' . $lang_home['inbox'] . '</a>';
  349. // echo '<a href="settings.php?action=setsix" class="btn btn-outline-primary sitelink">' . $lang_apsetting['advert'] . '</a><br />';
  350. echo '<a href="settings.php?action=setseven" class="btn btn-outline-primary sitelink">' . $lang_apsetting['pagemanage'] . '</a>';
  351. echo '<a href="settings.php?action=seteight" class="btn btn-outline-primary sitelink">' . $lang_apsetting['other'] . '</a>';
  352. }
  353.  
  354. if ($_SESSION['permissions'] == 101 && $users->is_administrator()) {
  355. // main settings
  356. if ($action == "setone") {
  357. echo '<h1>' . $lang_apsetting['mainset'] . '</h1>';
  358.  
  359. echo '<form method="post" action="settings.php?action=editone">';
  360.  
  361. echo '<p>' . $lang_apsetting['language'] . ':<br /><select name="conf_set47"><option value="' . $config['siteDefaultLang'] . '">' . $config['siteDefaultLang'] . '</option>';
  362.  
  363. $dir = opendir ("../lang");
  364. while ($file = readdir($dir)) {
  365. if (!preg_match('/[^0-9A-Za-z.\_\-]/', $file) && $file != $config['siteDefaultLang'] && $file != '..' && $file != '.' && $file != "index.php" && $file != ".htaccess" && strlen($file) > 2) {
  366. echo '<option value="' . $file . '">' . $file . '</option>';
  367. }
  368. }
  369. echo '</select></p>';
  370. closedir($dir);
  371.  
  372. $config_themes_show = str_replace("web_", "", $config['webtheme']);
  373. $config_themes_show = str_replace("wap_", "", $config_themes_show);
  374. $config_themes_show = ucfirst($config_themes_show);
  375. echo '<p>' . $lang_apsetting['webskin'] . ':<br /><select name="conf_set2"><option value="' . $config['webtheme'] . '">' . $config_themes_show . '</option>';
  376.  
  377. $dir = opendir ("../themes");
  378. while ($file = readdir ($dir)) {
  379. if (!preg_match('/[^0-9A-Za-z.\_\-]/', $file) && $file != $config['webtheme'] && $file != '..' && $file != '.' && $file != "index.php" && $file != ".htaccess" && $file != "templates") {
  380. $nfile = str_replace("web_", "", $file);
  381. $nfile = str_replace("wap_", "", $nfile);
  382. $nfile = ucfirst($nfile);
  383. echo '<option value="' . $file . '">' . $nfile . '</option>';
  384. }
  385. }
  386. echo '</select></p>';
  387. closedir ($dir);
  388.  
  389. // this will be admin username or system username
  390. echo '<p>' . $lang_apsetting['adminusername'] . ':<br /><input name="conf_set8" maxlength="20" value="' . $config['adminNick'] . '" /></p>';
  391.  
  392. echo '<p>' . $lang_apsetting['adminemail'] . ':<br /><input name="conf_set9" maxlength="50" value="' . $config['adminEmail'] . '" /></p>';
  393. echo '<p>' . $lang_apsetting['timezone'] . ':<br /><input name="conf_set10" maxlength="3" value="' . $config['timeZone'] . '" /></p>';
  394. echo '<p>' . $lang_apsetting['pagetitle'] . ':<br /><input name="conf_set11" maxlength="100" value="' . $config['title'] . '" /></p>';
  395. echo '<p>' . $lang_apsetting['siteurl'] . ':<br /><input name="conf_set14" maxlength="50" value="' . $config['homeUrl'] . '" /></p>';
  396. echo '<p>' . $lang_apsetting['floodtime'] . ':<br /><input name="conf_set29" maxlength="3" value="' . $config['floodTime'] . '" /></p>';
  397. echo '<p>' . $lang_apsetting['passkey'] . ':<br /><input name="conf_set1" maxlength="25" value="' . $config['keypass'] . '" /></p>';
  398.  
  399. // quarantine time
  400. echo '<p>' . $lang_apsetting['quarantinetime'] . ':<br /><select name="conf_set3">';
  401.  
  402. $quarantine = array(0 => "" . $lang_apsetting['disabled'] . "", 21600 => "6 " . $lang_apsetting['hours'] . "", 43200 => "12 " . $lang_apsetting['hours'] . "", 86400 => "24 " . $lang_apsetting['hours'] . "", 129600 => "36 " . $lang_apsetting['hours'] . "", 172800 => "48 " . $lang_apsetting['hours'] . "");
  403.  
  404. echo '<option value="' . $config['quarantine'] . '">' . $quarantine[$config['quarantine']] . '</option>';
  405.  
  406. foreach($quarantine as $k => $v) {
  407. if ($k != $config['quarantine']) {
  408. echo '<option value="' . $k . '">' . $v . '</option>';
  409. }
  410. }
  411. echo '</select></p>';
  412.  
  413.  
  414. // transfer protocol
  415. echo '<p>Transfer protocol:<br /><select name="conf_set21">';
  416.  
  417. $tProtocol = array('HTTPS' => 'HTTPS', 'HTTP' => 'HTTP', 'auto' => 'auto');
  418.  
  419. if (empty($config['transferProtocol'])) $config['transferProtocol'] = 'auto';
  420. echo '<option value="' . $config['transferProtocol'] . '">' . $tProtocol[$config['transferProtocol']] . '</option>';
  421.  
  422. foreach($tProtocol as $k => $v) {
  423. if ($k != $config['transferProtocol']) {
  424. echo '<option value="' . $k . '">' . $v . '</option>';
  425. }
  426. }
  427. echo '</select></p>';
  428.  
  429.  
  430. // is registration opened
  431. echo '<p>' . $lang_apsetting['openreg'] . ': <br />' . $lang_apsetting['yes'] . '';
  432. if ($config['openReg'] == "1") {
  433. echo '<input name="conf_set61" type="radio" value="1" checked>';
  434. } else {
  435. echo '<input name="conf_set61" type="radio" value="1" />';
  436. }
  437. echo ' &nbsp; &nbsp; ';
  438. if ($config['openReg'] == "0") {
  439. echo '<input name="conf_set61" type="radio" value="0" checked>';
  440. } else {
  441. echo '<input name="conf_set61" type="radio" value="0" />';
  442. }
  443. echo $lang_apsetting['no'] . '</p>';
  444.  
  445. // does user need to confirm registration
  446. echo '<p>' . $lang_apsetting['confregs'] . ': <br />' . $lang_apsetting['yes'] . '';
  447. if ($config['regConfirm'] == "1") {
  448. echo '<input name="conf_set62" type="radio" value="1" checked>';
  449. } else {
  450. echo '<input name="conf_set62" type="radio" value="1" />';
  451. }
  452. echo ' &nbsp; &nbsp; ';
  453. if ($config['regConfirm'] == "0") {
  454. echo '<input name="conf_set62" type="radio" value="0" checked>';
  455. } else {
  456. echo '<input name="conf_set62" type="radio" value="0" />';
  457. }
  458. echo $lang_apsetting['no'] . '</p>';
  459.  
  460. // redirect browser to mobile or desktop theme
  461. echo '<p>Browser redirection: <br />' . $lang_apsetting['yes'] . '';
  462. if ($config['redbrow'] == "1") {
  463. echo '<input name="conf_set0" type="radio" value="1" checked>';
  464. } else {
  465. echo '<input name="conf_set0" type="radio" value="1" />';
  466. }
  467. echo ' &nbsp; &nbsp; ';
  468. if ($config['redbrow'] == "0") {
  469. echo '<input name="conf_set0" type="radio" value="0" checked>';
  470. } else {
  471. echo '<input name="conf_set0" type="radio" value="0" />';
  472. }
  473. echo $lang_apsetting['no'] . '</p>';
  474.  
  475. // maintenance mode
  476. echo '<p>Maintenance: <br />' . $lang_apsetting['yes'] . ''; // update lang
  477. if ($config['siteOff'] == 1) {
  478. echo '<input name="conf_set63" type="radio" value="1" checked>';
  479. } else {
  480. echo '<input name="conf_set63" type="radio" value="1" />';
  481. }
  482. echo ' &nbsp; &nbsp; ';
  483. if ($config['siteOff'] == 0) {
  484. echo '<input name="conf_set63" type="radio" value="0" checked>';
  485. } else {
  486. echo '<input name="conf_set63" type="radio" value="0" />';
  487. }
  488. echo $lang_apsetting['no'] . '</p>';
  489.  
  490. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  491. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  492. }
  493. }
  494. if ($action == "settwo") {
  495. echo '<h1>' . $lang_apsetting['shwinfo'] . '</h1>';
  496.  
  497. echo '<form method="post" action="settings.php?action=edittwo">';
  498.  
  499. echo '<p>' . $lang_apsetting['showclock'] . ': <br />' . $lang_apsetting['yes'] . '';
  500. if ($config['showtime'] == "1") {
  501. echo '<input name="conf_set4" type="radio" value="1" checked>';
  502. } else {
  503. echo '<input name="conf_set4" type="radio" value="1" />';
  504. }
  505. echo ' &nbsp; &nbsp; ';
  506. if ($config['showtime'] == "0") {
  507. echo '<input name="conf_set4" type="radio" value="0" checked>';
  508. } else {
  509. echo '<input name="conf_set4" type="radio" value="0" />';
  510. }
  511. echo $lang_apsetting['no'] . '</p>';
  512.  
  513. echo '<p>' . $lang_apsetting['pagegen'] . ': <br />' . $lang_apsetting['yes'] . '';
  514. if ($config['pageGenTime'] == "1") {
  515. echo '<input name="conf_set5" type="radio" value="1" checked>';
  516. } else {
  517. echo '<input name="conf_set5" type="radio" value="1" />';
  518. }
  519. echo ' &nbsp; &nbsp; ';
  520. if ($config['pageGenTime'] == "0") {
  521. echo '<input name="conf_set5" type="radio" value="0" checked>';
  522. } else {
  523. echo '<input name="conf_set5" type="radio" value="0" />';
  524. }
  525. echo $lang_apsetting['no'] . '</p>';
  526.  
  527.  
  528. echo '<p>' . $lang_apsetting['showonline'] . ': <br />' . $lang_apsetting['yes'] . '';
  529. if ($config['showOnline'] == "1") {
  530. echo '<input name="conf_set7" type="radio" value="1" checked>';
  531. } else {
  532. echo '<input name="conf_set7" type="radio" value="1" />';
  533. }
  534. echo ' &nbsp; &nbsp; ';
  535. if ($config['showOnline'] == "0") {
  536. echo '<input name="conf_set7" type="radio" value="0" checked>';
  537. } else {
  538. echo '<input name="conf_set7" type="radio" value="0" />';
  539. }
  540. echo $lang_apsetting['no'] . '</p>';
  541.  
  542. // cookie consent
  543. echo '<p>Cookie consent: <br />' . $lang_apsetting['yes'] . '';
  544. if ($config['cookieConsent'] == "1") {
  545. echo '<input name="conf_set32" type="radio" value="1" checked>';
  546. } else {
  547. echo '<input name="conf_set32" type="radio" value="1" />';
  548. }
  549. echo ' &nbsp; &nbsp; ';
  550. if ($config['cookieConsent'] == "0") {
  551. echo '<input name="conf_set32" type="radio" value="0" checked>';
  552. } else {
  553. echo '<input name="conf_set32" type="radio" value="0" />';
  554. }
  555. echo $lang_apsetting['no'] . '</p>';
  556.  
  557.  
  558. echo '<p>' . $lang_apsetting['countlook'] . ':<br /><select name="conf_set74">';
  559.  
  560. $incounters = array(6 => "" . $lang_apsetting['dontshow'] . "", 1 => "" . $lang_apsetting['vsttotalvst'] . "", 2 => "" . $lang_apsetting['clicktotalclick'] . "", 3 => "" . $lang_apsetting['clickvisits'] . "", 4 => "" . $lang_apsetting['totclicktotvst']);
  561.  
  562. echo '<option value="' . $config['showCounter'] . '">' . $incounters[$config['showCounter']] . '</option>';
  563.  
  564. foreach($incounters as $k => $v) {
  565. if ($k != $config['showCounter']) {
  566. echo '<option value="' . $k . '">' . $v . '</option>';
  567. }
  568. }
  569. echo '</select></p>';
  570.  
  571. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  572. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  573. }
  574.  
  575. if ($action == "setthree") {
  576. echo '<h1>' . $lang_apsetting['gbnewschatset'] . '</h1>';
  577.  
  578. echo '<form method="post" action="settings.php?action=editthree">';
  579.  
  580. echo '<p>' . $lang_apsetting['allowguestingb'] . ': <br />' . $lang_apsetting['yes'];
  581. if ($config['bookGuestAdd'] == "1") {
  582. echo '<input name="conf_set20" type="radio" value="1" checked>';
  583. } else {
  584. echo '<input name="conf_set20" type="radio" value="1" />';
  585. }
  586. echo ' &nbsp; &nbsp; ';
  587. if ($config['bookGuestAdd'] == "0") {
  588. echo '<input name="conf_set20" type="radio" value="0" checked>';
  589. } else {
  590. echo '<input name="conf_set20" type="radio" value="0" />';
  591. }
  592. echo $lang_apsetting['no'] . '</p>';
  593.  
  594. echo '<p>' . $lang_apsetting['maxinchat'] . ':<br /><input name="conf_set22" maxlength="4" value="' . $config['maxPostChat'] . '" /></p>';
  595. echo '<p>' . $lang_apsetting['maxnews'] . ':<br /><input name="conf_set24" maxlength="5" value="' . $config['maxPostNews'] . '" /></p>';
  596. echo '<p>' . $lang_apsetting['maxgbmsgs'] . ':<br /><input name="conf_set25" maxlength="5" value="' . $config['maxPostBook'] . '" /></p>';
  597. echo '<p>' . $lang_apsetting['onepassmail'] . ':<br /><input name="conf_set56" maxlength="3" value="' . $config['subMailPacket'] . '" /></p>';
  598.  
  599. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  600. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  601. }
  602.  
  603. if ($action == "setfour") {
  604.  
  605. $kbs = $config['photoFileSize'] / 1024;
  606.  
  607. // forum settings
  608. echo '<h1>' . $lang_apsetting['forumandgalset'] . '</h1>';
  609.  
  610. echo '<form method="post" action="settings.php?action=editfour">';
  611.  
  612. echo '<br /><img src="../images/img/forums.gif" alt=""/> Forum settings<br /><br />';
  613. echo '<p>' . $lang_apsetting['forumon'] . ': <br />' . $lang_apsetting['yes'] . '';
  614. if ($config['forumAccess'] == "1") {
  615. echo '<input name="conf_set49" type="radio" value="1" checked>';
  616. } else {
  617. echo '<input name="conf_set49" type="radio" value="1" />';
  618. }
  619. echo ' &nbsp; &nbsp; ';
  620. if ($config['forumAccess'] == "0") {
  621. echo '<input name="conf_set49" type="radio" value="0" checked>';
  622. } else {
  623. echo '<input name="conf_set49" type="radio" value="0" />';
  624. }
  625. echo $lang_apsetting['no'] . '</p>';
  626. echo '<p>Show language dropdown: <br />' . $lang_apsetting['yes'];
  627. if ($config['forumChLang'] == "1") {
  628. echo '<input name="conf_set68" type="radio" value="1" checked>';
  629. } else {
  630. echo '<input name="conf_set68" type="radio" value="1" />';
  631. }
  632. echo ' &nbsp; &nbsp; ';
  633. if ($config['forumChLang'] == "0") {
  634. echo '<input name="conf_set68" type="radio" value="0" checked>';
  635. } else {
  636. echo '<input name="conf_set68" type="radio" value="0" />';
  637. }
  638. echo $lang_apsetting['no'] . '</p>';
  639.  
  640.  
  641. // gallery settings
  642. $gallery_config = file(BASEDIR . "used/dataconfig/gallery.dat");
  643. if ($gallery_config) {
  644. $gallery_data = explode("|", $gallery_config[0]);
  645. } else {
  646. $gallery_data = explode("|", '|||||||||||||');
  647. }
  648. echo '<br /><img src="../images/img/forums.gif" alt=""/> Gallery settings<br /><br />';
  649. echo '<p>' . $lang_apsetting['photosperpg'] . ':<br /><input name="gallery_set8" maxlength="2" value="' . $gallery_data[8] . '" /></p>';
  650. echo '<p>Maximum width in gallery:<br /><input name="screen_width" maxlength="5" value="' . $gallery_data[5] . '" /></p>';
  651. echo '<p>Maximum height in gallery:<br /><input name="screen_height" maxlength="5" value="' . $gallery_data[6] . '" /></p>';
  652. echo '<p>Social media like buttons in gallery <br />' . $lang_apsetting['yes']; // update lang
  653. if ($gallery_data[7] == "1") {
  654. echo '<input name="media_buttons" type="radio" value="1" checked>';
  655. } else {
  656. echo '<input name="media_buttons" type="radio" value="1" />';
  657. }
  658. echo ' &nbsp; &nbsp; ';
  659. if ($gallery_data[7] == "0") {
  660. echo '<input name="media_buttons" type="radio" value="0" checked>';
  661. } else {
  662. echo '<input name="media_buttons" type="radio" value="0" />';
  663. }
  664. echo $lang_apsetting['no'] . '</p>';
  665.  
  666.  
  667. echo '<br /><img src="../images/img/forums.gif" alt=""/> Uploading in gallery<br /><br />';
  668.  
  669. echo '<p>' . $lang_apsetting['photomaxkb'] . ':<br /><input name="conf_set38" maxlength="8" value="' . (int)$kbs . '" /></p>';
  670. echo '<p>' . $lang_apsetting['photopx'] . ':<br /><input name="conf_set39" maxlength="4" value="' . $config['maxPhotoPixels'] . '" /></p>';
  671. echo '<p>Users can upload? <br />' . $lang_apsetting['yes'] . '';
  672. if ($gallery_data[0] == "1") {
  673. echo '<input name="gallery_set0" type="radio" value="1" checked>';
  674. } else {
  675. echo '<input name="gallery_set0" type="radio" value="1" />';
  676. }
  677. echo ' &nbsp; &nbsp; ';
  678. if ($gallery_data[0] == "0") {
  679. echo '<input name="gallery_set0" type="radio" value="0" checked>';
  680. } else {
  681. echo '<input name="gallery_set0" type="radio" value="0" />';
  682. }
  683. echo $lang_apsetting['no'] . '</p>';
  684.  
  685. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  686. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  687. }
  688.  
  689. if ($action == "setfive") {
  690. echo '<h1>' . $lang_apsetting['downandinbxsets'] . '</h1>';
  691.  
  692. echo '<form method="post" action="settings.php?action=editfive">';
  693.  
  694. echo '<p>' . $lang_apsetting['maxinbxmsgs'] . ':<br /><input name="conf_set30" maxlength="5" value="' . $config['pvtLimit'] . '" /></p>';
  695. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  696. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  697. }
  698.  
  699. if ($action == "setseven") {
  700. echo '<h1>' . $lang_apsetting['pagessets'] . '</h1>';
  701.  
  702. echo '<form method="post" action="settings.php?action=editseven">';
  703.  
  704. echo '<div class="form-group">';
  705. echo '<label for="custom-pages">' . $lang_home['customPageUrl'] . '</label>';
  706. echo '<input class="form-control" name="conf_set28" id="custom-pages" value="' . $config['customPages'] . '" />';
  707. echo '</div>';
  708.  
  709. echo '<div class="form-group">';
  710. echo '<label for="referals">' . $lang_apsetting['maxrefererdata'] . '</label>';
  711. echo '<input class="form-control" name="conf_set51" id="referals" maxlength="3" value="' . $config['refererLog'] . '" />';
  712. echo '</div>';
  713.  
  714. echo '<p>' . $lang_apsetting['showrefpage'] . ': </p>';
  715. echo '<div class="form-group form-check form-check-inline">';
  716.  
  717. if ($config['showRefPage'] == "1") {
  718. echo '<input class="form-check-input" id="referal-yes" name="conf_set70" type="radio" value="1" checked>';
  719. } else {
  720. echo '<input class="form-check-input" id="referal-yes" name="conf_set70" type="radio" value="1" />';
  721. }
  722. echo '<label class="form-check-label" for="referal-yes">' . $lang_apsetting['yes'] . '</label>';
  723.  
  724. echo '</div>';
  725.  
  726. echo '<div class="form-check form-check-inline">';
  727. if ($config['showRefPage'] == "0") {
  728. echo '<input class="form-check-input" id="referal-no" name="conf_set70" type="radio" value="0" checked>';
  729. } else {
  730. echo '<input class="form-check-input" id="referal-no" name="conf_set70" type="radio" value="0" />';
  731. }
  732. echo '<label class="form-check-label" for="referal-no">' . $lang_apsetting['no'] . '</label>';
  733. echo '</div>';
  734.  
  735. echo '<p>Facebook comments on pages:</p>'; // update lang
  736. echo '<div class="form-group form-check form-check-inline">';
  737.  
  738. if ($config['pgFbComm'] == "1") {
  739. echo '<input class="form-check-input" id="referal-yes" name="conf_set6" type="radio" value="1" checked>';
  740. } else {
  741. echo '<input class="form-check-input" id="referal-yes" name="conf_set6" type="radio" value="1" />';
  742. }
  743. echo '<label class="form-check-label" for="referal-yes">' . $lang_apsetting['yes'] . '</label>';
  744. echo '</div>';
  745.  
  746. echo '<div class="form-check form-check-inline">';
  747. if ($config['pgFbComm'] == "0") {
  748. echo '<input class="form-check-input" id="referal-no" name="conf_set6" type="radio" value="0" checked>';
  749. } else {
  750. echo '<input class="form-check-input" id="referal-no" name="conf_set6" type="radio" value="0" />';
  751. }
  752. echo '<label class="form-check-label" for="referal-no">' . $lang_apsetting['no'] . '</label>';
  753. echo '</div>';
  754.  
  755. echo '<div class="col-sm-10">';
  756. echo '<button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></div>
  757. </form>';
  758. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  759. }
  760.  
  761. if ($action == "seteight") {
  762. echo '<h1>' . $lang_apsetting['other'] . '</h1>';
  763.  
  764. echo '<form method="post" action="settings.php?action=editeight">';
  765.  
  766. echo '<p>' . $lang_apsetting['maxlogfile'] . ':<br /><input name="conf_set58" maxlength="3" value="' . $config['maxLogData'] . '" /></p>';
  767. echo '<p>' . $lang_apsetting['maxbantime'] . ':<br /><input name="conf_set76" maxlength="3" value="' . round($config['maxBanTime'] / 1440) . '" /></p>';
  768.  
  769. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  770. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  771. }
  772.  
  773. // database settings
  774. if ($action == "setnine") {
  775. echo '<h1>Database settings</h1>';
  776.  
  777. echo '<form method="post" action="settings.php?action=editnine">';
  778.  
  779. echo '<p>Database host:<br /><input name="conf_set77" maxlength="40" value="' . $config['dbhost'] . '" /></p>';
  780. echo '<p>' . $lang_apsetting['username'] . ':<br /><input name="conf_set78" maxlength="40" value="' . $config['dbuser'] . '" /></p>';
  781. echo '<p>' . $lang_apsetting['password'] . ':<br /><input name="conf_set79" maxlength="40" value="' . $config['dbpass'] . '" /></p>';
  782. echo '<p>' . $lang_apsetting['dbname'] . ':<br /><input name="conf_set80" maxlength="40" value="' . $config['dbname'] . '" /></p>';
  783. echo '<p>Crossdomain table prefix:<br /><input name="conf_set71" maxlength="12" value="' . $config['tablePrefix'] . '" /></p>';
  784.  
  785. echo '<br /><button class="btn btn-primary" type="submit" />' . $lang_home['save'] . '</button></form><hr>';
  786. echo '<br /><a href="settings.php" class="btn btn-outline-primary sitelink">' . $lang_home['back'] . '</a>';
  787. }
  788.  
  789. echo '<p><a href="index.php" class="btn btn-outline-primary sitelink">' . $lang_home['admpanel'] . '</a><br />';
  790. echo '<a href="../" class="btn btn-primary homepage">' . $lang_home['home'] . '</a></p>';
  791.  
  792. require_once BASEDIR . "themes/" . MY_THEME . "/foot.php";
  793.  
  794. ?>