1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

DownloadsL Pagination (next/prev) fix. SEF Url methods updated.

This commit is contained in:
Cameron
2017-04-12 15:38:09 -07:00
parent 9e91201103
commit 8d077da40e
3 changed files with 21 additions and 16 deletions

View File

@@ -112,7 +112,7 @@ class download
$this->qry['id'] = intval($_GET['id']); $this->qry['id'] = intval($_GET['id']);
$this->qry['order'] = vartrue($_GET['order']) && in_array("download_".$_GET['order'],$this->orderOptions) ? $_GET['order'] : $this->qry['order']; $this->qry['order'] = vartrue($_GET['order']) && in_array("download_".$_GET['order'],$this->orderOptions) ? $_GET['order'] : $this->qry['order'];
$this->qry['sort'] = (varset($_GET['sort']) == 'asc') ? "asc" : 'desc'; $this->qry['sort'] = (varset($_GET['sort']) == 'asc') ? "asc" : 'desc';
$this->qry['from'] = vartrue($_GET['from'],0); $this->qry['from'] = varset($_GET['from'],0);
if($this->qry['action'] == 'error') if($this->qry['action'] == 'error')
{ {
@@ -555,7 +555,7 @@ class download
{ {
// $dlrow = $sql->fetch(); // $dlrow = $sql->fetch();
$catRows = $dlrow;
$sc->setVars($dlrow); // Used below for header / breadcrumb. $sc->setVars($dlrow); // Used below for header / breadcrumb.
$sc->parent = $this->getParent($this->qry['id']); $sc->parent = $this->getParent($this->qry['id']);
@@ -729,12 +729,11 @@ class download
} }
// $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]';
unset($nextprevQry['id'],$nextprevQry['name'],$nextprevQry['action']);
$newUrl = e107::getUrl()->create('download/list/category',$nextprevQry); $newUrl = e107::url('download','category',$catRows, array('query'=>$nextprevQry));
$nextprev = array( $nextprev = array(
'tmpl_prefix' =>'default', 'tmpl_prefix' =>'default',

View File

@@ -419,13 +419,16 @@ $columnInfo = array(
// optional // optional
public function init() public function init()
{ {
$this->action = vartrue($_GET['mode']);
$this->subAction = vartrue($_GET['action']); $this->action = $this->getMode(); // vartrue($_GET['mode']);
$this->id = vartrue($_GET['id']); $this->subAction = $this->getAction(); // vartrue($_GET['action']);
$this->id = $this->getId(); // vartrue($_GET['id']);
$this->observe(); $this->observe();

View File

@@ -76,7 +76,7 @@ if(strstr(e_QUERY, "mirror"))
exit(); exit();
} }
$goUrl = e107::getUrl()->create('download/index')."?action=error&id=1"; $goUrl = e107::url('download', 'index', null, array('query'=>array('action'=>'error','id'=>1))); // ."?action=error&id=1";
e107::redirect($goUrl); e107::redirect($goUrl);
//header("Location: ".e_BASE."download.php?error.{$download_id}.1"); //header("Location: ".e_BASE."download.php?error.{$download_id}.1");
exit; exit;
@@ -252,7 +252,8 @@ if ($type == "file")
(strpos($pref['download_denied'],"signup.php") && USER == TRUE) (strpos($pref['download_denied'],"signup.php") && USER == TRUE)
)) ))
{ {
$goUrl = e107::getUrl()->create('download/index')."?action=error&id=1"; // $goUrl = e107::getUrl()->create('download/index')."?action=error&id=1";
$goUrl = e107::url('download', 'index', null, array('query'=>array('action'=>'error','id'=>1)));
e107::redirect($goUrl); e107::redirect($goUrl);
exit(); exit();
} }
@@ -389,7 +390,8 @@ function check_download_limits()
if($row['count'] >= $limits['gen_intdata']) if($row['count'] >= $limits['gen_intdata'])
{ {
// Exceeded download count limit // Exceeded download count limit
$goUrl = e107::getUrl()->create('download/index')."?action=error&id=2"; // $goUrl = e107::getUrl()->create('download/index')."?action=error&id=2";
$goUrl = e107::url('download', 'index', null, array('query'=>array('action'=>'error','id'=>2)));
e107::redirect($goUrl); e107::redirect($goUrl);
// e107::redirect(e_BASE."download.php?error.{$cutoff}.2"); // e107::redirect(e_BASE."download.php?error.{$cutoff}.2");
/* require_once(HEADERF); /* require_once(HEADERF);
@@ -421,7 +423,8 @@ function check_download_limits()
if($row['total_bw'] / 1024 > $limit['gen_user_id']) if($row['total_bw'] / 1024 > $limit['gen_user_id'])
{ //Exceed bandwith limit { //Exceed bandwith limit
$goUrl = e107::getUrl()->create('download/index')."?action=error&id=2"; // $goUrl = e107::getUrl()->create('download/index')."?action=error&id=2";
$goUrl = e107::url('download', 'index', null, array('query'=>array('action'=>'error','id'=>2)));
e107::redirect($goUrl); e107::redirect($goUrl);
// e107::redirect(e_BASE."download.php?error.{$cutoff}.2"); // e107::redirect(e_BASE."download.php?error.{$cutoff}.2");
/* require(HEADERF); /* require(HEADERF);