mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fixes #470 Download pagination template and SEF Urls.
This commit is contained in:
@@ -3583,6 +3583,16 @@ class eRequest
|
|||||||
define("e_SELF", e_REQUEST_SELF);
|
define("e_SELF", e_REQUEST_SELF);
|
||||||
define("e_QUERY", $qstring);
|
define("e_QUERY", $qstring);
|
||||||
$_SERVER['QUERY_STRING'] = e_QUERY;
|
$_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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -625,19 +625,28 @@ class download
|
|||||||
</div>";
|
</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']}.";
|
// $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 = $this->qry;
|
||||||
$nextprevQry['from'] = '[FROM]';
|
$nextprevQry['from'] = '[FROM]';
|
||||||
|
|
||||||
$newUrl = e107::getUrl()->create('download/list/category',$nextprevQry);
|
$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.'¤t='.$newsfrom.$nitems.'&url='.$url;
|
||||||
|
|
||||||
$text .= $tp->parseTemplate($DOWNLOAD_LIST_NEXTPREV, TRUE, $sc);
|
$text .= $tp->parseTemplate($DOWNLOAD_LIST_NEXTPREV, TRUE, $sc);
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -31,10 +31,11 @@ class plugin_download_sef_url extends eUrlConfig
|
|||||||
),
|
),
|
||||||
|
|
||||||
'rules' => array(
|
'rules' => array(
|
||||||
'/' => array('list/index', 'legacyQuery' => '', ),
|
'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}', ),
|
||||||
'Category/<id:{number}>/<name:{sefsecure}>' => array('list/category', 'allowVars'=> array('order','view','sort'), 'legacyQuery' => 'list.{id}.{view}.{order}.{sort}', ),
|
|
||||||
'<id:{number}>/<name:{sefsecure}>' => array('view/item', 'legacyQuery' => 'view.{id}' ),
|
'<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}' ),
|
'Get/<id:{number}>/<name:{sefsecure}>' => array('request/item', 'legacy'=> '{e_PLUGIN}download/request.php', 'legacyQuery' => 'view.{id}' ),
|
||||||
|
'/' => array('list/index', 'legacyQuery' => '', ),
|
||||||
|
|
||||||
) // rule set array
|
) // rule set array
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user