1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Fixes #470 Download pagination template and SEF Urls.

This commit is contained in:
Cameron 2014-01-04 10:14:10 -08:00
parent dd140d8e69
commit 7f1a946562
3 changed files with 28 additions and 8 deletions

View File

@ -3583,6 +3583,16 @@ class eRequest
define("e_SELF", e_REQUEST_SELF);
define("e_QUERY", $qstring);
$_SERVER['QUERY_STRING'] = e_QUERY;
if(strpos(e_QUERY,"=")!==false ) // Fix for legacyQuery using $_GET ie. ?x=y&z=1 etc.
{
parse_str(e_QUERY,$tmp);
foreach($tmp as $key=>$value)
{
$_GET[$key] = $value;
}
}
return $this;
}

View File

@ -625,19 +625,28 @@ class download
</div>";
}
global $nextprev_parms;
// $newUrl = e_SELF . "?action=list&id={$this->qry['id']}&from=[FROM]&view={$this->qry['view']}&order={$this->qry['order']}&sort={$this->qry['sort']}.";
$nextprevQry = $this->qry;
$nextprevQry['from'] = '[FROM]';
$newUrl = e107::getUrl()->create('download/list/category',$nextprevQry);
$nextprev_parms = $total_downloads . "," . $this->qry['view'] . "," . $this->qry['from'] . "," . $newUrl;
$nextprev = array(
'tmpl_prefix' =>'default',
'total' => $total_downloads,
'amount' => intval($this->qry['view']),
'current' => $this->qry['from'],
'url' => urldecode($newUrl)
);
global $nextprev_parms;
$nextprev_parms = http_build_query($nextprev,false,'&'); // 'tmpl_prefix='.deftrue('NEWS_NEXTPREV_TMPL', 'default').'&total='. $total_downloads.'&amount='.$amount.'&current='.$newsfrom.$nitems.'&url='.$url;
$text .= $tp->parseTemplate($DOWNLOAD_LIST_NEXTPREV, TRUE, $sc);
return $text;
}

View File

@ -31,10 +31,11 @@ class plugin_download_sef_url extends eUrlConfig
),
'rules' => array(
'/' => array('list/index', 'legacyQuery' => '', ),
'Category/<id:{number}>/<name:{sefsecure}>' => array('list/category', 'allowVars'=> array('order','view','sort'), 'legacyQuery' => 'list.{id}.{view}.{order}.{sort}', ),
'Category/<id:{number}>/<name:{sefsecure}>' => array('list/category', 'allowVars'=> array('order','from','view','sort'), 'legacyQuery' => 'action=list&id={id}2&from={from}&view={view}&order={order}&sort={sort}'), // list.{id}.{view}.{order}.{sort}', ),
'<id:{number}>/<name:{sefsecure}>' => array('view/item', 'legacyQuery' => 'view.{id}' ),
'Get/<id:{number}>/<name:{sefsecure}>' => array('request/item', 'legacy'=> '{e_PLUGIN}download/request.php', 'legacyQuery' => 'view.{id}' ),
'/' => array('list/index', 'legacyQuery' => '', ),
) // rule set array
);
}