'news.php', 'title' => ADLAN_0); $front_page['download'] = array('page' => 'download.php', 'title' => ADLAN_24); $front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28); if ($sql -> db_Select("page", "*", "page_theme=''")) { $front_page['custom']['title'] = 'Custom Page'; while ($row = $sql -> db_Fetch()) { $front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']); } } foreach($pref['e_frontpage_list'] as $val) { if (is_readable(e_PLUGIN.$val."/e_frontpage.php")) { require_once(e_PLUGIN.$val."/e_frontpage.php"); } } if (isset($_POST['edit'])) { $_POST['type'] = (isset($_POST['edit']['all'])) ? 'all_users' : 'user_class'; $_POST['class'] = key($_POST['edit']); } if (isset($_POST['updatesettings'])) { if ($_POST['frontpage'] == 'other') { $_POST['other_page'] = $tp -> toForm($_POST['other_page']); $frontpage_value = $_POST['other_page'] ? $_POST['other_page'] : 'news.php'; } else { if (is_array($front_page[$_POST['frontpage']]['page'])) { $frontpage_value = $front_page[$_POST['frontpage']]['page'][$_POST['multipage'][$_POST['frontpage']]]['page']; } else { $frontpage_value = $front_page[$_POST['frontpage']]['page']; } } if ($_POST['type'] == 'all_users') { unset($pref['frontpage']); $pref['frontpage']['all'] = $frontpage_value; } else { if (isset($pref['frontpage']['all'])) { $pref['frontpage']['252'] = ($_POST['class'] == '252') ? $frontpage_value : $pref['frontpage']['all']; $pref['frontpage']['253'] = ($_POST['class'] == '253') ? $frontpage_value : $pref['frontpage']['all']; $pref['frontpage']['254'] = ($_POST['class'] == '254') ? $frontpage_value : $pref['frontpage']['all']; $class_list = get_userclass_list(); foreach ($class_list as $fp_class) { $pref['frontpage'][$fp_class['userclass_id']] = ($_POST['class'] == $fp_class['userclass_id']) ? $frontpage_value : $pref['frontpage']['all']; } unset($pref['frontpage']['all']); } $pref['frontpage'][$_POST['class']] = $frontpage_value; } save_prefs(); $ns -> tablerender(LAN_UPDATED, "
".FRTLAN_1."
"); } $fp = new frontpage; if (isset($_POST['select']) || isset($_POST['edit'])) { $fp -> select_page(); } else { $fp -> select_class(); } class frontpage { function select_class() { global $rs, $pref, $ns, $front_page; $text = "
"; $text .= ""; $text .= "
".FRTLAN_2.": ".$rs -> form_radio('type', 'all_users', (isset($pref['frontpage']['all']) ? TRUE : FALSE))." ".FRTLAN_31."  ".$rs -> form_radio('type', 'user_class', (isset($pref['frontpage']['all']) ? FALSE : TRUE))." ".FRTLAN_32.": ".r_userclass('class', '', 'off', 'guest,member,admin,classes')."
".$rs -> form_button('submit', 'select', LAN_SELECT)."
"; $ns -> tablerender(FRTLAN_13, $text); $text = "
"; if (isset($pref['frontpage']['all'])) { $text .= ""; } else { foreach ($pref['frontpage'] as $current_key => $current_value) { if ($current_key == 252) { $title = FRTLAN_27; } else if ($current_key == 253) { $title = FRTLAN_28; } else if ($current_key == 254) { $title = FRTLAN_29; } else { $class_list = get_userclass_list(); foreach ($class_list as $fp_class) { if ($current_key == $fp_class['userclass_id']) { $title = $fp_class['userclass_name']; } } } $text .= ""; } } $text .= "
".FRTLAN_32." ".FRTLAN_34." ".LAN_EDIT."
".FRTLAN_31." ".$pref['frontpage']['all']."
".$title." ".$current_value."
"; $ns -> tablerender(FRTLAN_33, $text); } function select_page() { global $rs, $pref, $ns, $front_page; if ($_POST['type'] == 'all_users') { $title = FRTLAN_26; } else { if ($_POST['class'] == 252) { $title = FRTLAN_27; } else if ($_POST['class'] == 253) { $title = FRTLAN_28; } else if ($_POST['class'] == 254) { $title = FRTLAN_29; } else { $class_list = get_userclass_list(); foreach ($class_list as $fp_class) { if ($_POST['class'] == $fp_class['userclass_id']) { $title = $fp_class['userclass_name']; } } } } $text = "
"; foreach ($front_page as $front_key => $front_value) { $type_selected = FALSE; $current_setting = (isset($pref['frontpage']['all'])) ? $pref['frontpage']['all'] : $pref['frontpage'][$_POST['class']]; if (is_array($front_value['page'])) { foreach ($front_value['page'] as $multipage) { if ($current_setting == $multipage['page']) { $type_selected = TRUE; $not_other = TRUE; } } } else { if ($current_setting == $front_value['page']) { $type_selected = TRUE; $not_other = TRUE; } } $text .= ""; if (is_array($front_value['page'])) { $text .= ""; $text .= ""; } else { $text .= ""; } $text .= ""; } $text .= ""; $text .= "
".FRTLAN_2." ".$title.":
"; $text .= $rs -> form_radio('frontpage', $front_key, $type_selected); $text .= "".$front_value['title'].""; $text .= $rs -> form_select_open('multipage['.$front_key.']'); $type = isset($pref['frontpage']['all']) ? 'all' : $_POST['class']; foreach ($front_value['page'] as $multipage_key => $multipage_value) { $sub_selected = ($pref['frontpage'][$type] == $multipage_value['page']) ? TRUE : FALSE; $text .= $rs -> form_option($multipage_value['title'], $sub_selected, $multipage_key); } $text .= $rs -> form_select_close(); $text .= "".$front_value['title']."
".$rs -> form_radio('frontpage', 'other', (!$not_other ? TRUE : FALSE))." ".FRTLAN_15." ".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''))."
"; $text .= $rs -> form_hidden('type', $_POST['type']); $text .= $rs -> form_hidden('class', $_POST['class']); $text .= $rs -> form_button('submit', 'updatesettings', FRTLAN_12); $text .= "
"; $ns -> tablerender(FRTLAN_13, $text); } } require_once('footer.php'); ?>