1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +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['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['from'] = vartrue($_GET['from'],0);
$this->qry['from'] = varset($_GET['from'],0);
if($this->qry['action'] == 'error')
{
@@ -555,7 +555,7 @@ class download
{
// $dlrow = $sql->fetch();
$catRows = $dlrow;
$sc->setVars($dlrow); // Used below for header / breadcrumb.
$sc->parent = $this->getParent($this->qry['id']);
@@ -728,13 +728,12 @@ class download
</div>";
}
// $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);
unset($nextprevQry['id'],$nextprevQry['name'],$nextprevQry['action']);
$newUrl = e107::url('download','category',$catRows, array('query'=>$nextprevQry));
$nextprev = array(
'tmpl_prefix' =>'default',

View File

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

View File

@@ -76,7 +76,7 @@ if(strstr(e_QUERY, "mirror"))
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);
//header("Location: ".e_BASE."download.php?error.{$download_id}.1");
exit;
@@ -252,7 +252,8 @@ if ($type == "file")
(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);
exit();
}
@@ -389,7 +390,8 @@ function check_download_limits()
if($row['count'] >= $limits['gen_intdata'])
{
// 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(e_BASE."download.php?error.{$cutoff}.2");
/* require_once(HEADERF);
@@ -421,7 +423,8 @@ function check_download_limits()
if($row['total_bw'] / 1024 > $limit['gen_user_id'])
{ //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(e_BASE."download.php?error.{$cutoff}.2");
/* require(HEADERF);