$lister = getListerRange($_GET['page'], $TotalPages); if (isset($show_new_link)) { $smarty->assign('show_new_link', 'yes'); if (isset($_POST['LINK'])) { $smarty->assign('pst_LINK', html_spchars($_POST['LINK'])); } } if (isset($error_message)) { $smarty->assign('error_message', $error_message); } if (isset($_GET['safemode'])) { $error_message = ADMIN_SAFEMODE_WARNING; } $_SERVER['REQUEST_URI'] = set_query('safemode=&action='); $le_Categories = le_getCategories(); foreach ($le_Categories as $_ind => $_val) { $le_Categories[$_ind]['links_num'] = le_getLinksNumber("le_lCategoryID = {$_val['le_cID']}"); } $smarty->assign('le_LinksNumInCategories', le_getLinksNumber()); $smarty->assign('REQUEST_URI', $_SERVER['REQUEST_URI']); $smarty->assign('url_allcategories', set_query('categoryID=')); $smarty->assign('le_categories', $le_Categories); $smarty->assign('le_categories_num', count($le_Categories)); $smarty->assign('le_CategoryID', $_GET['categoryID']); $smarty->assign('curr_page', $_GET['page']); $smarty->assign('last_page', $TotalPages); $smarty->assign('le_links', le_getLinks((int) $_GET['page'], (int) $ob_per_list, $_GET['categoryID'] ? array('le_lCategoryID' => (int) $_GET['categoryID']) : '1', 'le_lID, le_lText, le_lDesk, le_lURL, le_lCategoryID, le_lVerified', 'le_lVerified ASC, le_lURL ASC')); $smarty->assign('le_lister_range', range($lister['start'], $lister['end'])); $smarty->assign("admin_sub_dpt", "modules_linkexchange.tpl"); } }
} $_SERVER['REQUEST_URI'] = set_query('added='); $lister = getListerRange($_GET['page'], $TotalPages); $le_Categories = le_getCategories(); if (isset($_GET['show_all']) || isset($_POST['show_all'])) { $ob_per_list = $ob_per_list * $TotalPages; $smarty->assign('showAllLinks', '1'); $_GET['page'] = 1; } $smarty->assign('REQUEST_URI', html_amp($_SERVER['REQUEST_URI'])); $smarty->assign('url_allcategories', set_query('le_categoryID=')); $smarty->assign('le_categories', $le_Categories); $smarty->assign('le_CategoryID', $_GET['le_categoryID']); $smarty->assign('curr_page', $_GET['page']); $smarty->assign('last_page', $TotalPages); if (isset($error)) { if ($error != STRING_ERROR_LE_LINK_ADDED) { $smarty->assign('error', $error); $smarty->assign('pst_LINK', html_spchars($_POST['LINK'])); } else { $smarty->assign('error_ok', $error); } } isset($_GET['le_categoryID']) ? (int) $_GET['le_categoryID'] : 1; $smarty->assign('le_links', le_getLinks((int) $_GET['page'], (int) $ob_per_list, ($_GET['le_categoryID'] ? "le_lCategoryID = {$_GET['le_categoryID']}" : '1') . " AND (le_lVerified IS NOT NULL AND le_lVerified <>'0000-00-00 00:00:00' )", 'le_lID, le_lText, le_lDesk, le_lURL, le_lCategoryID, le_lVerified', 'le_lVerified ASC, le_lURL ASC')); if ($lister['start'] < $lister['end']) { $smarty->assign('le_lister_range', range($lister['start'], $lister['end'])); } $smarty->assign('le_categories_pr', ceil(count($le_Categories) / 2)); $smarty->assign("main_content_template", "links_exchange.tpl"); }
$error_message = STRING_ERROR_LE_LINK_CATEGORY_EXISTS; } break; case 'SAVE_LINK_CATEGORY': if (le_saveCategory($_POST['LINK_CATEGORY'])) { $msg = 'ok'; } else { $error_message = STRING_ERROR_LE_LINK_CATEGORY_EXISTS; } break; case 'DELETE_LINK_CATEGORY': if (!isset($_POST['LINK_CATEGORY']['le_cID'])) { break; } le_deleteCategory((int) $_POST['LINK_CATEGORY']['le_cID']); $_links = le_getLinks(0, le_getLinksNumber('le_lCategoryID = ' . (int) $_POST['LINK_CATEGORY']['le_cID']), (int) $_POST['LINK_CATEGORY']['le_cID'], 'le_lID', 'le_lVerified ASC, le_lURL ASC'); foreach ($_links as $__link) { le_SaveLink(array('le_lID' => (int) $__link['le_lID'], 'le_lCategoryID' => 0)); } $_POST['fREDIRECT'] = set_query('categoryID=', $_POST['fREDIRECT']); $msg = 'ok'; break; case 'NEW_LINK': if (!strlen(str_replace('http://', '', $_POST['LINK']['le_lURL']))) { $error_message = STRING_ERROR_LE_ENTER_LINK; $show_new_link = true; break; } $_POST['LINK']['le_lURL'] = xEscSQL($_POST['LINK']['le_lURL']); if (!strlen($_POST['LINK']['le_lText'])) { $error_message = STRING_ERROR_LE_ENTER_TEXT;