$sql = "SELECT * FROM " . PRUNE_TABLE . " WHERE forum_id = " . intval($item['id']); $result = $db->sql_query($sql); if ($db->sql_numrows($result) > 0) { $sql = "UPDATE " . PRUNE_TABLE . "\n\t\t\t\t\t\t\t\tSET prune_days = " . intval($item['prune_days']) . ",\n\t\t\t\t\t\t\t\t\tprune_freq = " . intval($item['prune_freq']) . "\n\t\t\t\t\t\t\t\tWHERE forum_id = " . intval($item['id']); } else { $sql = "INSERT INTO " . PRUNE_TABLE . "\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\t\t\t\tprune_days,\n\t\t\t\t\t\t\t\t\tprune_freq\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t" . intval($item['id']) . ",\n\t\t\t\t\t\t\t\t\t" . intval($item['prune_days']) . ",\n\t\t\t\t\t\t\t\t\t" . intval($item['prune_freq']) . "\n\t\t\t\t\t\t\t\t)"; } $db->sql_query($sql); } } // clean previous if new created if ($new_item || $delete_forum) { delete_item($fid, $item['type'] . $item['id'], $item['move']); } // reorder reorder_tree(); // end message $selected_id = $item['main']; $message = $lang['Forums_updated'] . $return_msg; message_die(GENERAL_MESSAGE, $message); exit; } else { // template $template->set_filenames(array('body' => ADM_TPL . 'forum_extend_edit_body.tpl')); // header $template->assign_vars(array('L_TITLE' => $lang['Edit_forum'], 'L_TITLE_EXPLAIN' => $lang['Forum_edit_delete_explain'], 'L_TYPE' => $lang['Forum_type'], 'L_NAME' => $lang['Forum_name'], 'L_NAME_CLEAN' => $lang['CLEAN_NAME'], 'L_DESC' => $lang['Forum_desc'], 'L_MAIN' => $lang['Category_attachment'], 'L_POSITION' => $lang['Position_after'], 'L_STATUS' => $lang['Forum_status'], 'L_MOVE' => $lang['Move_contents'], 'L_ICON' => $lang['icon'], 'L_ICON_EXPLAIN' => $lang['icon_explain'], 'L_PRUNE_ENABLE' => $lang['Forum_pruning'], 'L_ENABLED' => $lang['Enabled'], 'L_PRUNE_DAYS' => $lang['prune_days'], 'L_PRUNE_FREQ' => $lang['prune_freq'], 'L_FORUM_NOTIFY' => $lang['Forum_notify'], 'L_POSTCOUNT' => $lang['Forum_postcount'], 'L_MOD_OS_FORUMRULES' => $lang['MOD_OS_ForumRules'], 'L_FORUM_RULES' => $lang['Forum_rules'], 'L_RULES_DISPLAY_TITLE' => $lang['Rules_display_title'], 'L_RULES_CUSTOM_TITLE' => $lang['Rules_custom_title'], 'L_RULES_APPEAR_IN' => $lang['Rules_appear_in'], 'L_RULES_IN_VIEWFORUM' => $lang['Rules_in_viewforum'], 'L_RULES_IN_VIEWTOPIC' => $lang['Rules_in_viewtopic'], 'L_RULES_IN_POSTING' => $lang['Rules_in_posting'], 'L_LINK' => $lang['Forum_link'], 'L_FORUM_LINK' => $lang['Forum_link_url'], 'L_FORUM_LINK_EXPLAIN' => $lang['Forum_link_url_explain'], 'L_FORUM_LINK_INTERNAL' => $lang['Forum_link_internal'], 'L_FORUM_LINK_INTERNAL_EXPLAIN' => $lang['Forum_link_internal_explain'], 'L_FORUM_LINK_HIT_COUNT' => $lang['Forum_link_hit_count'], 'L_FORUM_LINK_HIT_COUNT_EXPLAIN' => $lang['Forum_link_hit_count_explain'], 'L_AUTH' => $lang['Auth_Control_Forum'], 'L_PRESET' => $lang['Presets'], 'L_SUBMIT' => $delete_forum ? $lang['Delete'] : $lang['Submit'], 'L_CANCEL' => $lang['Cancel'], 'L_REFRESH' => $lang['Refresh'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_DAYS' => $lang['Days'])); // type select list $s_type_opt = ''; @reset($forum_type_list); while (list($key, $value) = @each($forum_type_list)) { $selected = $item['type'] == $key ? ' selected="selected"' : '';
/** * Parse the root tag * * The root tag will grab a list of all root - node elements of the tree * * @access public * @param text to parse * @param optional parameters */ function _parse_root($text, $optional) { // Required Model $this->CI->load->model('tree_model', 'tree'); // Tree Helper $this->CI->load->helper('tree'); // Get the root nodes and direct descendants $subtree = $this->CI->tree->get_tree(); $subtree = reorder_tree($subtree); // Loop through all the trees, parsing everything along the way foreach ($subtree as $current) { $node_type = $current->node_type; $tmp = $this->_parse_node($current, $text, $node_type); if ($current->children) { $restrict_child = $current->restrict_child_type; $tmp = $this->_parse_children($tmp, $optional, $current->children, $restrict_child); } $newt .= $tmp; } return $newt; }