allow_php = true; if( !$action ) $action = "list"; if( $action == "list" ) { $_SESSION['admin_referrer'] = $_SERVER['REQUEST_URI']; echoheader( "static", "static" ); $search_field = $db->safesql( trim( htmlspecialchars( stripslashes( urldecode( $_GET['search_field'] ) ), ENT_QUOTES ) ) ); if ($_GET['fromnewsdate']) $fromnewsdate = strtotime( $_GET['fromnewsdate'] ); else $fromnewsdate = ""; if ($_GET['tonewsdate']) $tonewsdate = strtotime( $_GET['tonewsdate'] ); else $tonewsdate = ""; if ($fromnewsdate === -1 OR !$fromnewsdate) $fromnewsdate = ""; if ($tonewsdate === -1 OR !$tonewsdate) $tonewsdate = ""; $start_from = intval( $_GET['start_from'] ); $news_per_page = intval( $_GET['news_per_page'] ); $gopage = intval( $_REQUEST['gopage'] ); if( ! $news_per_page or $news_per_page < 1 ) { $news_per_page = 50; } if( $gopage ) $start_from = ($gopage - 1) * $news_per_page; if( $start_from < 0 ) $start_from = 0; $where = array (); if( $search_field != "" ) { $where[] = "(template like '%$search_field%' OR descr like '%$search_field%')"; } if( $fromnewsdate != "" ) { $where[] = "date >= '$fromnewsdate'"; } if( $tonewsdate != "" ) { $where[] = "date <= '$tonewsdate'"; } if( count( $where ) ) { $where = implode( " AND ", $where ); $where = " WHERE " . $where; } else { $where = ""; } $order_by = array (); if( $_REQUEST['search_order_t'] == "asc" or $_REQUEST['search_order_t'] == "desc" ) $search_order_t = $_REQUEST['search_order_t']; else $search_order_t = ""; if( $_REQUEST['search_order_d'] == "asc" or $_REQUEST['search_order_d'] == "desc" ) $search_order_d = $_REQUEST['search_order_d']; else $search_order_d = ""; if( ! empty( $search_order_t ) ) {$order_by[] = "name $search_order_t";} if( ! empty( $search_order_d ) ) {$order_by[] = "date $search_order_d";} $order_by = implode( ", ", $order_by ); if( ! $order_by ) $order_by = "date desc"; $search_order_date = array ('----' => '', 'asc' => '', 'desc' => '' ); if( isset( $_REQUEST['search_order_d'] ) ) { $search_order_date[$search_order_d] = 'selected'; } else { $search_order_date['desc'] = 'selected'; } $search_order_title = array ('----' => '', 'asc' => '', 'desc' => '' ); if( ! empty( $search_order_t ) ) { $search_order_title[$search_order_t] = 'selected'; } else { $search_order_title['----'] = 'selected'; } $db->query( "SELECT id, name, descr, template, views, date FROM " . PREFIX . "_static" . $where . " ORDER BY " . $order_by . " LIMIT $start_from,$news_per_page" ); // Prelist Entries if( $start_from == "0" ) { $start_from = ""; } $i = $start_from; $entries_showed = 0; $entries = ""; while ( $row = $db->get_array() ) { $i ++; $itemdate = @date( "d.m.Y H:i", $row['date'] ); $title = htmlspecialchars( stripslashes( $row['name'] ), ENT_QUOTES ); $descr = stripslashes($row['descr']); $vlink = $config['http_home_url'] . $row['name'] . ".html"; $entries .= "
|
|||||
| |||||||||||||||
{$npp_nav} | {$lang['edit_go_page']} | HTML; } } echo <<