mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- made simple template almost feature complete by implementing view modes and more
- other general fixes to things a bit all over the place git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@12 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -15,11 +15,68 @@ Author: Jim Myhrberg
|
||||
*/
|
||||
//_SCRIPT;
|
||||
|
||||
//==========================
|
||||
//>STAGE> functions
|
||||
//==========================
|
||||
|
||||
|
||||
//>Section> sort_class.start
|
||||
class Sort {
|
||||
|
||||
//>Section> get_url
|
||||
function get_url ($sortby) {
|
||||
global $config;
|
||||
$return = array();
|
||||
$current_sort = ( empty($_REQUEST['sort']) ) ? $config->default_sort : $_REQUEST['sort'] ;
|
||||
|
||||
if ( $sortby == $current_sort ) {
|
||||
if ($sortby != $config->default_sort) $return[] = 'sort='.$sortby;
|
||||
if ( empty($_REQUEST['order']) || $_REQUEST['order'] != 'desc' ) {
|
||||
$return[] = 'order=desc';
|
||||
}
|
||||
} else {
|
||||
if ($sortby != $config->default_sort) {
|
||||
$return[] = 'sort='.$sortby;
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty($return) ) {
|
||||
return DIR_URL;
|
||||
} else {
|
||||
$return = implode('&', $return);
|
||||
return '?'.$return;
|
||||
}
|
||||
}
|
||||
|
||||
//Section sort_class.end
|
||||
}
|
||||
|
||||
|
||||
//==========================
|
||||
//>STAGE> init
|
||||
//==========================
|
||||
|
||||
|
||||
//>After> core.define_constants:30
|
||||
define('TEMPLATE', $config->template);
|
||||
define('TPL_PATH', 'templates/'.TEMPLATE.'/');
|
||||
define('TPL_URL', DLIST_URL.TPL_PATH);
|
||||
define('SERVER_INFO', strip_tags($_SERVER['SERVER_SIGNATURE']));
|
||||
|
||||
//>After> core.dynamic_vars
|
||||
if ( !empty($_REQUEST['order']) && $_REQUEST['order'] == 'desc' ) $do_sort_reverse = true;
|
||||
if ( !empty($_REQUEST['sort']) ) $do_sort_by = $_REQUEST['sort'];
|
||||
$is_root = ( DIR_URL != '' && DIR_URL != '/' ) ? false : true;
|
||||
|
||||
|
||||
//==========================
|
||||
//>STAGE> main
|
||||
//==========================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//==========================
|
||||
//>STAGE> render
|
||||
//==========================
|
||||
|
||||
Reference in New Issue
Block a user