function get_menu_item($item) { global $db, $template; $m_id = $item; $sql = 'SELECT * FROM ' . K_MENUS_TABLE . ' WHERE m_id=' . (int) $item; if ($result = $db->sql_query($sql)) { $row = $db->sql_fetchrow($result); } $template->assign_vars(array('S_MENUID' => $row['m_id'], 'S_MENU_NDX' => $row['ndx'], 'S_MENU_TYPE' => $row['menu_type'], 'S_MENU_ICON' => $row['menu_icon'], 'S_MENU_ITEM_NAME' => $row['name'], 'S_MENU_LINK' => $row['link_to'], 'S_MENU_VIEW' => which_group($row['view_by']), 'S_VIEW_ALL' => $row['view_all'], 'S_VIEW_GROUPS' => $row['view_groups'], 'S_MENU_APPEND_SID' => $row['append_sid'], 'S_MENU_APPEND_UID' => $row['append_uid'], 'S_MENU_EXTERN' => $row['extern'], 'S_SOFT_HR' => $row['soft_hr'], 'S_SUB_HEADING' => $row['sub_heading'])); $db->sql_freeresult($result); }
function main($id, $mode) { global $db, $user, $auth, $template, $cache; global $config, $k_config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID; include $phpbb_root_path . 'includes/sgp_functions_admin.' . $phpEx; // Define Switches for html file // $user->add_lang('acp/k_blocks'); $this->tpl_name = 'acp_k_blocks'; $this->page_title = 'ACP_BLOCKS'; $form_key = 'acp_k_blocks'; add_form_key($form_key); $action = request_var('action', ''); $submit = isset($_POST['submit']) ? true : false; if ($submit && !check_form_key($form_key)) { $submit = false; $mode = ''; trigger_error($user->lang['FORM_INVALID']); } // Can not use append_sid here, the $block_id is assigned to the html but unknow to this code // // Would require I add a form element and use request_var to retrieve it // // The global $SID is available so I make use of it...? $template->assign_vars(array('U_BACK' => $this->u_action, 'U_EDIT2' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_blocks&mode=edit&block=", 'U_UP' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_blocks&mode=up&block=", 'U_DOWN' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_blocks&mode=down&block=", 'U_DELETE' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_blocks&mode=delete&block=", 'U_SET_VARS_W' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_modules&mode=welcome&block=", 'U_SET_VARS' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_vars&mode=config&block=", 'U_LINK_MINIMOD' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_modules&mode=edit&module=", 'U_MANAGE_PAGES' => "{$phpbb_admin_path}index.{$phpEx}{$SID}&i=k_pages&mode=manage")); // Set up general vars $mode = request_var('mode', ''); $block = request_var('block', ''); // bold current row text so things are easier to follow when moving/editing etc... // if ($block ? $block : 0) { $sql = 'UPDATE ' . K_BLOCKS_CONFIG_VAR_TABLE . ' SET config_value = ' . (int) $block . ' WHERE config_name = "adm_block"'; $db->sql_query($sql); } else { $wheresql = ' WHERE config_name = "adm_block"'; $sql = 'SELECT config_name, config_value FROM ' . K_BLOCKS_CONFIG_VAR_TABLE . $wheresql; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $k_config[$row['config_name']] = $row['config_value']; } $template->assign_var('ADM_BLOCK', $k_config['adm_block']); //$u_action = append_sid("{$phpbb_admin_path}index.$phpEx" , "i=$id&mode=" . strtolower($mode)); $u_action = append_sid("{$phpbb_admin_path}index.{$phpEx}", "i={$id}&mode=" . $mode); switch ($mode) { case 'up': case 'down': $to_move = $move_to = array(); // get current block data// $sql = "SELECT id, ndx, position FROM " . K_BLOCKS_TABLE . "\n\t\t\t\t\tWHERE id = " . (int) $block . " LIMIT 1"; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['ERROR_PORTAL_BLOCKS'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } // Added function to reindex blocks after a block deletion Dicky if (isset($current_position) && $current_position != $position) { $index_start = get_lowest_ndx($current_position); reindex_column($current_position, $index_start); } $row = $db->sql_fetchrow($result); $to_move['id'] = $row['id']; $to_move['ndx'] = $temp = $row['ndx']; // position is char 'L', 'R', 'C' (char) // $position = $row['position']; if ($mode == 'up') { $temp = $temp - 1; } if ($mode == 'down') { $temp = $temp + 1; } // get move_to block data// $sql = "SELECT id, ndx, position FROM " . K_BLOCKS_TABLE . "\n\t\t\t\t\tWHERE ndx = '" . (int) $temp . "' AND position = '" . $db->sql_escape($position) . "' LIMIT 1"; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } $row = $db->sql_fetchrow($result); $move_to['id'] = $row['id']; $move_to['ndx'] = $row['ndx']; if ($move_to['ndx'] != $temp || $move_to['id'] == '') { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } if ($mode == 'up') { // sql is not duplicated $sql = "UPDATE " . K_BLOCKS_TABLE . " SET ndx = " . $to_move['ndx'] . " WHERE id = " . $move_to['id']; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } $sql = "UPDATE " . K_BLOCKS_TABLE . " SET ndx = " . $move_to['ndx'] . " WHERE id = " . $to_move['id']; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } } if ($mode == 'down') { // sql is not duplicated $sql = "UPDATE " . K_BLOCKS_TABLE . " SET ndx = " . $move_to['ndx'] . " WHERE id = " . $to_move['id']; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } $sql = "UPDATE " . K_BLOCKS_TABLE . " SET ndx = " . $to_move['ndx'] . " WHERE id = " . $move_to['id']; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['BLOCK_MOVE_ERROR'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } } $template->assign_var('BLOCK_REPORT', $user->lang['BLOCK_UPDATING']); if ($position) { $mode = $position; } else { $mode = 'manage'; } $cache->destroy('sql', K_BLOCKS_TABLE); meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=' . $mode)); break; case 'add': case 'ADD': if ($submit) { if (request_var('html_file_name', '') == "" or request_var('title', '') == "") { $message = $user->lang['MISSING_BLOCK_DATA']; $template->assign_var('BLOCK_REPORT', $message . '<br />'); meta_refresh(2, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=add')); return; } //$id = request_var('m_id']; // auto assigned //$ndx = request_var('ndx']; // we calculate this $title = utf8_normalize_nfc(request_var('title', '', true)); $position = request_var('position', ''); $active = request_var('active', 1); $type = request_var('type', ''); $scroll = request_var('scroll', 0); $view_by = request_var('view_by', 1); $view_groups = request_var('view_groups', ''); $view_all = request_var('view_all', 1); $view_pages = request_var('view_pages', ''); $html_file_name = request_var('html_file_name', ''); $var_file_name = request_var('var_file_name', ''); $img_file_name = request_var('img_file_name', ''); $has_vars = request_var('has_vars', 0); $minimod_based = request_var('minimod_based', 0); $mod_block_id = request_var('mod_block_id', 0); $block_cache_time = request_var('block_cache_time', 300); if ($view_all) { $view_by = 1; } if ($img_file_name == '') { $img_file_name = 'default.gif'; } if ($has_vars == 0) { $var_file_name = ''; } if ($minimod_based == 0) { $mod_block_id = '0'; } $view_page_id = request_var('view_page_id', array(0)); for ($i = 0; $i < count($view_page_id); $i++) { $view_pages .= $view_page_id[$i]; if ($i < count($view_page_id) - 1) { $view_pages .= ','; } } $ndx = get_next_ndx($position); // get the next ndx to use for this position // $sql_array = array('ndx' => $ndx, 'title' => $title, 'active' => $active, 'html_file_name' => $html_file_name, 'var_file_name' => $var_file_name, 'img_file_name' => $img_file_name, 'position' => $position, 'view_by' => $view_by, 'view_groups' => $view_groups, 'view_all' => $view_all, 'view_pages' => $view_pages, 'scroll' => $scroll, 'has_vars' => $has_vars, 'minimod_based' => $minimod_based, 'mod_block_id' => $mod_block_id, 'block_cache_time' => $block_cache_time); if (!$db->sql_query('INSERT INTO ' . K_BLOCKS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_array))) { trigger_error($user->lang['COULD_NOT_ADD_BLOCK'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } else { $message = $user->lang['BLOCK_ADDED']; $template->assign_var('BLOCK_REPORT', $title . $message . '</font><br />'); } $cache->destroy('sql', K_BLOCKS_TABLE); meta_refresh(2, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=manage')); return; } else { // get all groups and fill array // get_all_groups(); get_all_pages(0); get_all_minimods(); get_all_vars_files($block); //Get all installed blocks// $data = ''; $c = 0; $sql = 'SELECT * FROM ' . K_BLOCKS_TABLE; if ($result = $db->sql_query($sql)) { while ($row = $db->sql_fetchrow($result)) { $data .= $row['id']; $data .= ' '; $c++; } } $dirslist = ''; $dirs = dir($phpbb_root_path . 'styles/_portal_common/template/blocks'); while ($file = $dirs->read()) { if (!stripos($file, ".bak")) { $dirslist .= "{$file} "; } } closedir($dirs->handle); $dirslist = explode(" ", $dirslist); sort($dirslist); for ($i = 0; $i < sizeof($dirslist); $i++) { if ($dirslist[$i] != '') { $template->assign_block_vars('html_file_name', array('S_BLOCK_FILE_HTML' => $dirslist[$i])); } } $dirslist = '.. '; $dirs = dir($phpbb_root_path . 'images/block_images/block'); while ($file = $dirs->read()) { if (stripos($file, ".gif") || stripos($file, ".png")) { $dirslist .= "{$file} "; } } closedir($dirs->handle); $dirslist = explode(" ", $dirslist); sort($dirslist); for ($i = 0; $i < sizeof($dirslist); $i++) { if ($dirslist[$i] != '') { $template->assign_block_vars('img_file_name', array('S_BLOCK_FILE_I' => $dirslist[$i])); } } $dirslist = ''; $template->assign_var('S_OPTIONS', strtoupper($mode)); } break; case 'edit': case 'EDIT': if ($submit) { $id = request_var('id', 0); $ndx = request_var('ndx', 0); $title = utf8_normalize_nfc(request_var('title', '', true)); $position = request_var('position', ''); $type = request_var('type', ''); $active = request_var('active', 1); $view_by = request_var('view_by', 1); $view_groups = request_var('view_groups', ''); $view_all = request_var('view_all', 1); $view_pages = request_var('view_pages', ''); $scroll = request_var('scroll', 0); $has_vars = request_var('has_vars', 0); $minimod_based = request_var('minimod_based', 0); $mod_block_id = request_var('mod_block_id', 0); $html_file_name = request_var('html_file_name', ''); $var_file_name = request_var('var_file_name', ''); $img_file_name = request_var('img_file_name', ''); $block_cache_time = request_var('block_cache_time', 300); $view_page_id = request_var('view_page_id', array(0)); for ($i = 0; $i < count($view_page_id); $i++) { $view_pages .= $view_page_id[$i]; if ($i < count($view_page_id) - 1) { $view_pages .= ','; } } // this shoud not happen but just in case // if (!$id) { $template->assign_var('BLOCK_REPORT', $user->lang['UNKNOWN_ERROR']); $submit = false; return; } if ($type == 1) { $type = 'H'; } else { $type = 'B'; } if ($view_by == '' && !$view_all) { $view_by = 0; } else { if ($view_all) { $view_by = 1; } } if ($img_file_name == '') { $img_file_name = 'default.gif'; } if ($has_vars == 0) { $var_file_name = ''; } if ($minimod_based == 0) { $mod_block_id = '0'; } // get the current block position // $current_position = get_current_position($id); // if moving block position (column) // if ($current_position != $position) { $ndx = get_next_ndx($position); } // change to build array later $sql = "UPDATE " . K_BLOCKS_TABLE . "\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tndx\t\t\t\t\t= '" . (int) $ndx . "',\n\t\t\t\t\t\t\tactive\t\t\t\t= '" . (int) $active . "',\n\t\t\t\t\t\t\ttitle\t\t\t\t= '" . $db->sql_escape($title) . "',\n\t\t\t\t\t\t\tposition\t\t\t= '" . $db->sql_escape($position) . "',\n\t\t\t\t\t\t\ttype\t\t\t\t= '" . $db->sql_escape($type) . "',\n\t\t\t\t\t\t\thtml_file_name\t\t= '" . $db->sql_escape($html_file_name) . "',\n\t\t\t\t\t\t\tvar_file_name\t\t= '" . $db->sql_escape($var_file_name) . "',\n\t\t\t\t\t\t\timg_file_name\t\t= '" . $db->sql_escape($img_file_name) . "',\n\t\t\t\t\t\t\tview_groups\t\t\t= '" . $db->sql_escape($view_groups) . "',\n\t\t\t\t\t\t\tview_pages\t\t\t= '" . $db->sql_escape($view_pages) . "',\n\t\t\t\t\t\t\tview_by\t\t\t\t= '" . $db->sql_escape($view_by) . "',\n\t\t\t\t\t\t\tview_all\t\t\t= '" . (int) $view_all . "',\n\t\t\t\t\t\t\tscroll\t\t\t\t= '" . (int) $scroll . "',\n\t\t\t\t\t\t\thas_vars\t\t\t= '" . (int) $has_vars . "',\n\t\t\t\t\t\t\tminimod_based\t\t= '" . (int) $minimod_based . "',\n\t\t\t\t\t\t\tmod_block_id\t\t= '" . (int) $mod_block_id . "',\n\t\t\t\t\t\t\tblock_cache_time\t= '" . (int) $block_cache_time . "'\n\t\t\t\t\t\t\tWHERE id = '{$id}'"; if (!($result = $db->sql_query($sql))) { trigger_error($user->lang['COULD_NOT_EDIT_BLOCK'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } $template->assign_var('BLOCK_REPORT', $user->lang['SAVING']); $cache->destroy('sql', K_BLOCKS_TABLE); delete_this_block_cached_file($html_file_name); if ($position) { $mode = $position; } else { $mode = 'manage'; } meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=' . $mode)); return; } // get all available html files, note.. we search the admin styles folder // $dirslist = '.. '; $dirs = dir($phpbb_root_path . 'styles/_portal_common/template/blocks'); while ($file = $dirs->read()) { if (!stripos($file, ".bak")) { $dirslist .= "{$file} "; } } closedir($dirs->handle); $dirslist = explode(" ", $dirslist); sort($dirslist); for ($i = 0; $i < sizeof($dirslist); $i++) { if ($dirslist[$i] != '') { $template->assign_block_vars('html_file_name', array('S_BLOCK_FILE_HTML' => $dirslist[$i])); } } // get all available block images // $dirslist = '.. '; $dirs = dir($phpbb_root_path . 'images/block_images/block'); while ($file = $dirs->read()) { if (stripos($file, ".gif") || stripos($file, ".png")) { $dirslist .= "{$file} "; } } closedir($dirs->handle); $dirslist = explode(" ", $dirslist); sort($dirslist); for ($i = 0; $i < sizeof($dirslist); $i++) { if ($dirslist[$i] != '') { $template->assign_block_vars('img_file_name', array('S_BLOCK_FILE_I' => $dirslist[$i])); } } $dirslist = ''; $template->assign_var('S_OPTIONS', 'ADD'); // not a language var // if ($block == '' || $block == 0) { trigger_error($user->lang['NO_BLOCK_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * FROM ' . K_BLOCKS_TABLE . ' WHERE id=' . (int) $block; if ($result = $db->sql_query($sql)) { $row = $db->sql_fetchrow($result); } if ($row['img_file_name'] == '') { $row['img_file_name'] = 'default.gif'; } $template->assign_vars(array('S_ID' => $row['id'], 'S_NDX' => $row['ndx'], 'S_TITLE' => $row['title'], 'S_POSITION' => $row['position'], 'S_ACTIVE' => $row['active'], 'S_TYPE' => $row['type'], 'S_FNAME_H' => $row['html_file_name'], 'S_FNAME_V' => $row['var_file_name'], 'S_FNAME_I' => $row['img_file_name'], 'S_VIEW_BY' => $row['view_by'], 'S_VIEW_GROUPS' => $row['view_groups'], 'S_VIEW_ALL' => $row['view_all'], 'S_VIEW_PAGES' => $row['view_pages'], 'S_SCROLL' => $row['scroll'], 'S_HAS_VARS' => $row['has_vars'], 'S_MINIMOD_BASED' => $row['minimod_based'], 'S_MOD_BLOCK_ID' => $row['mod_block_id'], 'BLOCK_CACHE_TIME' => $row['block_cache_time'])); // get all groups and fill array // get_all_pages($block); get_all_groups(); get_all_minimods(); get_all_vars_files($block); $db->sql_freeresult($result); $template->assign_var('S_OPTIONS', strtoupper($mode)); break; case 'delete': if (!$block) { trigger_error($user->lang['MUST_SELECT_VALID_BLOCK_DATA'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) { $sql = 'SELECT title, id, position FROM ' . K_BLOCKS_TABLE . ' WHERE id = ' . (int) $block; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $title = $row['title']; $id = $row['id']; $position = $row['position']; $db->sql_freeresult($result); // Get lowest ndx for current position block Dicky $index_start = get_lowest_ndx($position); $sql = "DELETE FROM " . K_BLOCKS_TABLE . "\n\t\t\t\t\t\tWHERE id = " . (int) $block; $db->sql_query($sql); // Added function to reindex blocks after a block deletion reindex_column($position, $index_start); $template->assign_var('BLOCK_REPORT', $title . $user->lang['BLOCK_DELETED'] . '</font><br />'); $cache->destroy('sql', K_BLOCKS_TABLE); meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=manage')); break; } else { confirm_box(false, $user->lang['CONFIRM_OPERATION_BLOCKS'], build_hidden_fields(array('i' => $id, 'mode' => $mode, 'action' => 'delete'))); } $template->assign_var('BLOCK_REPORT', $user->lang['ACTION_CANCELLED']); meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=manage')); break; case 'reindex': $index_no = 1; if (confirm_box(true)) { $thispos = $newpos = ''; $list = array(); $sql = 'SELECT * FROM ' . K_BLOCKS_TABLE . ' ORDER by position, ndx'; if ($result = $db->sql_query($sql)) { while ($row = $db->sql_fetchrow($result)) { $thispos = $row['position']; if ($thispos == $newpos) { $index_no++; } else { $index_no = 1; } $sql = "UPDATE " . K_BLOCKS_TABLE . " SET ndx = '" . (int) $index_no . "' WHERE id = " . (int) $row['id']; //reset ndx to 1 when position changes $newpos = $row['position']; $results = $db->sql_query($sql); if (!$results) { trigger_error($user->lang['RE-INDEXING BLOCKS'] . basename(dirname(__FILE__)) . '/' . basename(__FILE__) . ', line ' . __LINE__); } } } $db->sql_freeresult($result); $template->assign_vars(array('S_BUTTON_HIDE' => true, 'BLOCK_REPORT' => $user->lang['BLOCKS_REINDEXED'])); $cache->destroy('sql', K_BLOCKS_TABLE); meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=manage')); break; } else { confirm_box(false, $user->lang['CONFIRM_OPERATION_BLOCKS_REINDEX'], build_hidden_fields(array('i' => $id, 'mode' => $mode, 'action' => 'reindex'))); } $template->assign_var('BLOCK_REPORT', $user->lang['ACTION_CANCELLED']); meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=k_blocks&mode=manage')); break; case 'tools': $template->assign_var('S_OPTIONS', 'TOOLS'); // not language var // break; case 'L': case 'C': case 'R': case '1': case '2': case '3': $template->assign_var('S_TYPE', $mode); case 'manage': if ($mode != 'manage') { $sql = "SELECT * FROM " . K_BLOCKS_TABLE . " WHERE position = '" . $db->sql_escape($mode) . "' ORDER by ndx, type"; } else { $sql = 'SELECT * FROM ' . K_BLOCKS_TABLE . ' ORDER by position, ndx'; } $l_b_first = $r_b_first = $c_b_first = $l_b_last = $r_b_last = $c_b_last = 1; if ($result = $db->sql_query($sql)) { while ($row = $db->sql_fetchrow($result)) { if ($row['img_file_name'] == '') { $row['img_file_name'] = 'default.gif'; } if ($mode == 'manage') { if ($row['position'] == 'L') { $l_b_last = $l_b_last + 1; } else { if ($row['position'] == 'R') { $r_b_last = $r_b_last + 1; } else { if ($row['position'] == 'C') { $c_b_last = $c_b_last + 1; } } } } $template->assign_block_vars('bdata', array('S_ID' => $row['id'], 'S_NDX' => $row['ndx'], 'S_TITLE' => $row['title'], 'S_POSITION' => $row['position'], 'S_ACTIVE' => $row['active'], 'S_TYPE' => $row['type'], 'S_FNAME_H' => $row['html_file_name'], 'S_FNAME_V' => $row['var_file_name'], 'S_FNAME_I' => $row['img_file_name'], 'S_VIEW_BY' => which_group($row['view_by']), 'S_VIEW_GROUPS' => $row['view_groups'], 'S_VIEW_ALL' => $row['view_all'], 'S_VIEW_PAGES' => $row['view_pages'], 'S_SCROLL' => $row['scroll'], 'S_HAS_VARS' => $row['has_vars'], 'S_MINIMOD_BASED' => $row['minimod_based'], 'S_MOD_BLOCK_ID' => $row['mod_block_id'], 'S_BLOCK_CACHE_TIME' => $row['block_cache_time'], 'S_BLOCK' => $row['id'] == $block ? $block : '.....')); } $db->sql_freeresult($result); } $template->assign_vars(array('S_OPTIONS' => strtoupper($mode), 'S_LBL' => $l_b_last - 1, 'S_RBL' => $r_b_last - 1, 'S_CBL' => $c_b_last - 1, 'S_LRC' => '1')); break; case 'default': break; } $template->assign_var('U_ACTION', $u_action); }