mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Page template corrections in bootstrap.
This commit is contained in:
@@ -26,6 +26,14 @@ class page_shortcodes extends e_shortcode
|
|||||||
$this->var = e107::getDb()->retrieve('page_chapters','chapter_name, chapter_meta_description','chapter_id = '.intval($this->request['id']).' LIMIT 1');
|
$this->var = e107::getDb()->retrieve('page_chapters','chapter_name, chapter_meta_description','chapter_id = '.intval($this->request['id']).' LIMIT 1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($action == 'showPage' && vartrue($this->request['id'])) // get chapter and description from current.
|
||||||
|
{
|
||||||
|
$query = "SELECT p.page_id,c.chapter_name,c.chapter_meta_description FROM #page AS p LEFT JOIN #page_chapters AS c ON p.page_chapter = c.chapter_id WHERE p.page_id = ".intval($this->request['id'])." LIMIT 1 ";
|
||||||
|
$rows = e107::getDb()->retrieve($query,true);
|
||||||
|
$this->var = $rows[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,6 +9,59 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['page'] = '
|
||||||
|
{PAGE}
|
||||||
|
{PAGECOMMENTS}
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['start'] = '<div class="cpage_body">';
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['body'] = '
|
||||||
|
{CPAGEMESSAGE|default}
|
||||||
|
<section id="{CPAGEANCHOR}">
|
||||||
|
|
||||||
|
{CPAGEBODY}
|
||||||
|
<br />
|
||||||
|
<div class="muted text-right">
|
||||||
|
<small>
|
||||||
|
{CPAGERATING|default}
|
||||||
|
{CPAGEDATE|default}
|
||||||
|
{CPAGEAUTHOR|default}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['authorize'] = '
|
||||||
|
<div class="cpage-restrict">
|
||||||
|
{message}
|
||||||
|
{form_open}
|
||||||
|
<h2>{caption}</h2>
|
||||||
|
<div clas="center">{label} {password} {submit}</div>
|
||||||
|
{form_close}
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['restricted'] = '
|
||||||
|
{text}
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['notfound'] = '
|
||||||
|
{text}
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['end'] = '</div>';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['docs']['tableRender'] = 'cpage';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
18
page.php
18
page.php
@@ -349,7 +349,7 @@ class pageClass
|
|||||||
LEFT JOIN #user AS u ON p.page_author = u.user_id
|
LEFT JOIN #user AS u ON p.page_author = u.user_id
|
||||||
WHERE p.page_id=".intval($this->pageID); // REMOVED AND p.page_class IN (".USERCLASS_LIST.") - permission check is done later
|
WHERE p.page_id=".intval($this->pageID); // REMOVED AND p.page_class IN (".USERCLASS_LIST.") - permission check is done later
|
||||||
|
|
||||||
if(!$sql->db_Select_gen($query))
|
if(!$sql->gen($query))
|
||||||
{
|
{
|
||||||
$ret['title'] = LAN_PAGE_12; // ***** CHANGED
|
$ret['title'] = LAN_PAGE_12; // ***** CHANGED
|
||||||
$ret['sub_title'] = '';
|
$ret['sub_title'] = '';
|
||||||
@@ -364,13 +364,19 @@ class pageClass
|
|||||||
$this->batch = e107::getScBatch('page',null,'cpage')->setVars(new e_vars($ret))->setScVar('page', array());
|
$this->batch = e107::getScBatch('page',null,'cpage')->setVars(new e_vars($ret))->setScVar('page', array());
|
||||||
|
|
||||||
define("e_PAGETITLE", $ret['title']);
|
define("e_PAGETITLE", $ret['title']);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->page = $sql->db_Fetch();
|
$this->page = $sql->fetch();
|
||||||
|
|
||||||
$this->template = e107::getCoreTemplate('page', vartrue($this->page['page_template'], 'default'));
|
$this->template = e107::getCoreTemplate('page', vartrue($this->page['page_template'], 'default'), true, true);
|
||||||
if(empty($this->template)) $this->template = e107::getCoreTemplate('page', 'default');
|
// $this->template = e107::getCoreTemplate('page', 'default',true,true);
|
||||||
|
// print_a($this->template);
|
||||||
|
if(empty($this->template))
|
||||||
|
{
|
||||||
|
$this->template = e107::getCoreTemplate('page', 'default');
|
||||||
|
}
|
||||||
|
|
||||||
$this->batch = e107::getScBatch('page',null,'cpage');
|
$this->batch = e107::getScBatch('page',null,'cpage');
|
||||||
|
|
||||||
@@ -454,12 +460,16 @@ class pageClass
|
|||||||
|
|
||||||
public function showPage()
|
public function showPage()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if(null !== $this->cacheData)
|
if(null !== $this->cacheData)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->renderCache();
|
return $this->renderCache();
|
||||||
}
|
}
|
||||||
if(true === $this->authorized)
|
if(true === $this->authorized)
|
||||||
{
|
{
|
||||||
|
|
||||||
$vars = $this->batch->getParserVars();
|
$vars = $this->batch->getParserVars();
|
||||||
|
|
||||||
$template = str_replace('{PAGECOMMENTS}', '[[PAGECOMMENTS]]', $this->template['start'].$this->template['body'].$this->template['end']);
|
$template = str_replace('{PAGECOMMENTS}', '[[PAGECOMMENTS]]', $this->template['start'].$this->template['body'].$this->template['end']);
|
||||||
|
Reference in New Issue
Block a user