2 /************************************************************************
3 * MXChange v0.2.1 Start: 09/22/2004 *
4 * ================ Last change: 09/22/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_home.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Set "home" page *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : "Home"-Seite festlegen *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", __FILE__);
44 if (REQUEST_ISSET_GET(('sub'))) $sub = REQUEST_GET('sub');
48 case "": // Output selection table
49 LOAD_TEMPLATE("admin_config_home_main");
52 case "settings": // Settings related to the index page
55 ADMIN_SAVE_SETTINGS_POST();
56 OUTPUT_HTML("<a href=\"{!URL!}/modules.php?module=admin&what=config_home&sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</a>");
58 // Prepare data for the template
59 $content = array_fill(-1, 60, "");
60 $content[getConfig('index_delay')] = " selected=\"selected\"";
62 define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS(getConfig('index_cookie'), "index_cookie", "YMWD"));
63 LOAD_TEMPLATE("admin_config_home_settings", false, $content);
67 case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)
68 if (REQUEST_ISSET_GET(('home'))) {
70 UPDATE_CONFIG("index_home", SQL_ESCAPE(REQUEST_GET('home')));
73 // Load all what menu points
74 $result = SQL_QUERY("SELECT id, what, title
75 FROM `{!_MYSQL_PREFIX!}_guest_menu`
76 WHERE `action`='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N'
77 ORDER BY `sort` ASC", __FILE__, __LINE__);
79 $SW = 2; $OUT = ""; $atitle = "";
80 while (list($id, $wht, $wtitle) = SQL_FETCHROW($result)) {
81 $LINK = "<a href=\"{!URL!}/modules.php?module=admin&what=config_home&sub=target&home=".$wht."\">"._IS_NEW_HOME."</a>";
82 if ($wht == getConfig('index_home')) {
84 $LINK = "<div class=\"admin_note\">{!_IS_CURRENT_HOME!}</div>";
85 $atitle = "<div class=\"admin_note\">".$atitle."</div>";
86 $wtitle = "<div class=\"admin_note\">".$wtitle."</div>";
91 <td class=\"switch_sw".$SW." bottom right\"> ".$id."</td>
92 <td class=\"switch_sw".$SW." bottom right\"> ".$wtitle."</td>
93 <td class=\"switch_sw".$SW." bottom\" align=\"center\">
103 SQL_FREERESULT($result);
104 define('__HOME_ROWS', $OUT);
107 LOAD_TEMPLATE("admin_config_home");