function hfp_tool_action_showall() { global $t, $db_pages, $cfg, $usr; $page = sed_import('page', 'G', 'INT', 2); $sortby = strtoupper(sed_import('sortby', 'G', 'ALP', 4)); $orderby = sed_import('orderby', 'G', 'ALP', 4); $state = sed_import('state', 'G', 'INT', 1); $d = 0; $itemcount = 0; $page = (int) $page; $page = $page != 0 ? $page - 1 : 0; $state_options = array(3, 4); $sortby_options = array('DESC', 'ASC'); $orderby_options = array('id', 'begin', 'expire', 'title'); $sortby = empty($sortby) || !in_array($sortby, $sortby_options) ? "DESC" : $sortby; $orderby = empty($orderby) || !in_array($orderby, $orderby_options) ? "id" : $orderby; $orderby = "page_" . $orderby; $realpage = $page + 1; $state = empty($state) || !in_array($state, $state_options) ? 3 : $state; $limit = HFP_TOOL_ITEMS_PER_PAGE; $offset = ceil($page * $limit); $sql_total = sed_sql_query("SELECT COUNT(*) FROM {$db_pages} WHERE page_state='{$state}'"); $total_count = (int) sed_sql_result($sql_total, 0, "COUNT(*)"); $sql = sed_sql_query("SELECT page_state, page_title, page_begin, page_expire, page_id FROM {$db_pages} " . "WHERE page_state='{$state}' ORDER BY " . sed_sql_prep($orderby) . " " . sed_sql_prep($sortby) . " LIMIT " . (int) $offset . ", " . (int) $limit); while ($result = sed_sql_fetchassoc($sql)) { $t->assign(array("ITEM_PAGE_ID" => (int) $result['page_id'], "ITEM_PAGE_TITLE" => htmlspecialchars($result['page_title']), "ITEM_PAGE_BEGIN" => @date($cfg['dateformat'], (int) $result['page_begin'] + $usr['timezone'] * 3600), "ITEM_PAGE_EXPIRE" => @date($cfg['dateformat'], (int) $result['page_expire'] + $usr['timezone'] * 3600), "ITEM_PAGE_EDIT_URL" => sed_url('page', "m=edit&id=" . (int) $result['page_id'] . "&r=adm"), "ITEM_SORT_TITLE_ASC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=title&sortby=asc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_TITLE_DESC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=title&sortby=desc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_ID_ASC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=id&sortby=asc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_ID_DESC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=id&sortby=desc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_BEGIN_ASC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=begin&sortby=asc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_BEGIN_DESC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=begin&sortby=desc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_EXPIRE_ASC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=expire&sortby=asc&state=' . $state . '&page=' . $realpage), "ITEM_SORT_EXPIRE_DESC" => sed_url('admin', 'm=tools&p=hidefuturepages&orderby=expire&sortby=desc&state=' . $state . '&page=' . $realpage), "ITEM_PAGE_ADD_TO_QUEUE_URL" => sed_url('admin', 'm=tools&p=hidefuturepages&action=add_to_queue&state=' . $state . '&id=' . (int) $result['page_id']) . "&" . sed_xg(), "ITEM_PAGE_SET_TO_DISPLAY_URL" => sed_url('admin', 'm=tools&p=hidefuturepages&action=set_to_display&state=' . $state . '&id=' . (int) $result['page_id']) . "&" . sed_xg(), "ITEM_PAGE_PAGINATION" => hfp_create_pagination($total_count, $realpage, $state))); $itemcount++; $t->parse("MAIN.ACTION_SHOWALL.NONEMPTY_LIST.ITEM_LIST"); } switch ($state) { case 3: $tooltitle = "Future pages"; break; case 4: $tooltitle = "Hidden pages"; break; } $t->assign(array("TOOL_SHOW_TITLE" => $tooltitle, "TOOL_SHOW_OPTIONS" => hfp_tool_show_options($state), "TOOL_SHOW_COUNT" => $total_count, "TOOL_SHOW_PAGELIMIT" => $itemcount, "TOOL_STATE_SELECTED_URL_FUTURE" => sed_url('admin', 'm=tools&p=hidefuturepages&state=3', NULL, TRUE), "TOOL_STATE_SELECTED_URL_HIDDEN" => sed_url('admin', 'm=tools&p=hidefuturepages&state=4', NULL, TRUE))); if ($total_count == 0) { $t->parse("MAIN.ACTION_SHOWALL.EMPTY_LIST"); } else { $t->parse("MAIN.ACTION_SHOWALL.NONEMPTY_LIST"); } $t->parse("MAIN.ACTION_SHOWALL"); }
<?php /* ==================== Seditio - Website engine Copyright Neocrome http://www.neocrome.net [BEGIN_SED] File=plugins/eyoop/eyoop.php Version=100 Updated=2006-jul-25 Type=Plugin Author=riptide Description= [END_SED] [BEGIN_SED_EXTPLUGIN] Code=eyoop Part=page File=eyoop.page.tags Hooks=page.tags Tags= Order=10 [END_SED_EXTPLUGIN] ==================== */ if (!$usr['isadmin'] && $pag['page_ownerid'] == $usr['id']) { $t->assign(array("PAGE_ADMIN_COUNT" => $pag['page_count'], "PAGE_ADMIN_UNVALIDATE" => "<a href=\"plug.php?e=eyoop&a=unvalidate&id=" . $pag['page_id'] . "&" . sed_xg() . "\">" . $L['Putinvalidationqueue'] . "</a>", "PAGE_ADMIN_EDIT" => "<a href=\"plug.php?e=eyoop&id=" . $pag['page_id'] . "&r=list\">" . $L['Edit'] . "</a>")); $t->parse("MAIN.PAGE_ADMIN"); }