mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Changes in some of the content pages.
(cherry picked from commit 8734ea0)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class Content
|
||||
{
|
||||
public $id = '';
|
||||
public $title = '';
|
||||
public $url = '';
|
||||
public $body = '';
|
||||
public $metadescription = '';
|
||||
public $metakeywords = '';
|
||||
public $contenttype = '';
|
||||
public $showinmenu = '';
|
||||
public $status = '';
|
||||
public $ordinal = '';
|
||||
public $createddate = '';
|
||||
public $role = '';
|
||||
|
||||
}
|
||||
@@ -2,15 +2,17 @@
|
||||
|
||||
use newznab\db\Settings;
|
||||
|
||||
/**
|
||||
* This class looks up site content.
|
||||
*/
|
||||
class Contents
|
||||
{
|
||||
const TYPEUSEFUL = 1;
|
||||
const TYPEARTICLE = 2;
|
||||
const TYPEINDEX = 3;
|
||||
|
||||
/**
|
||||
* @var \newznab\db\Settings
|
||||
*/
|
||||
public $pdo;
|
||||
|
||||
/**
|
||||
* @param array $options Class instances.
|
||||
*/
|
||||
@@ -24,87 +26,69 @@ class Contents
|
||||
$this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings());
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a content row before insert/update.
|
||||
*/
|
||||
public function validate($content)
|
||||
{
|
||||
if (substr($content["url"],0,1) != '/')
|
||||
{
|
||||
$content["url"] = "/".$content["url"];
|
||||
}
|
||||
|
||||
if (substr($content["url"], strlen($content["url"]) - 1) != '/')
|
||||
{
|
||||
$content["url"] = $content["url"]."/";
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a content row.
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
return $this->pdo->queryExec(sprintf("DELETE from content where id=%d", $id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a content row.
|
||||
*/
|
||||
public function update($content)
|
||||
{
|
||||
$content = $this->validate($content);
|
||||
$this->pdo->queryExec(sprintf("update content set role=%d, title = %s , url = %s , body = %s , metadescription = %s , metakeywords = %s , contenttype = %d , showinmenu = %d , status = %d , ordinal = %d where id = %d ", $content["role"], $this->pdo->escapeString($content["title"]), $this->pdo->escapeString($content["url"]), $this->pdo->escapeString($content["body"]), $this->pdo->escapeString($content["metadescription"]), $this->pdo->escapeString($content["metakeywords"]), $content["contenttype"], $content["showinmenu"], $content["status"], $content["ordinal"], $content["id"] ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a content row.
|
||||
*/
|
||||
public function add($content)
|
||||
{
|
||||
|
||||
$content = $this->validate($content);
|
||||
|
||||
return $this->pdo->queryInsert(sprintf("insert into content (role, title, url, body, metadescription, metakeywords, contenttype, showinmenu, status, ordinal ) values (%d, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $content["role"], $this->pdo->escapeString($content["title"]), $this->pdo->escapeString($content["url"]), $this->pdo->escapeString($content["body"]), $this->pdo->escapeString($content["metadescription"]), $this->pdo->escapeString($content["metakeywords"]), $content["contenttype"], $content["showinmenu"], $content["status"], $content["ordinal"] ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all active content rows.
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return $this->pdo->query(sprintf("select * from content where status = 1 order by contenttype, coalesce(ordinal, 1000000)"));
|
||||
$arr = [];
|
||||
$rows = $this->data_get();
|
||||
if ($rows === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$arr[] = $this->row2Object($row);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all content rows.
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
return $this->pdo->query(sprintf("select * from content order by contenttype, coalesce(ordinal, 1000000)"));
|
||||
$arr = [];
|
||||
$rows = $this->data_getAll();
|
||||
if ($rows === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$arr[] = $this->row2Object($row);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a content row by its id.
|
||||
* Convert get all but from to object.
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public function getByID($id, $role)
|
||||
public function getAllButFront()
|
||||
{
|
||||
if ($role == Users::ROLE_ADMIN)
|
||||
$role = "";
|
||||
else
|
||||
$role = sprintf("and (role=%d or role=0)", $role);
|
||||
$arr = [];
|
||||
$rows = $this->data_getAllButFront();
|
||||
if ($rows === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->pdo->queryOneRow(sprintf("select * from content where id = %d %s", $id, $role));
|
||||
foreach ($rows as $row) {
|
||||
$arr[] = $this->row2Object($row);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index page.
|
||||
*/
|
||||
public function getIndex()
|
||||
public function getFrontPage()
|
||||
{
|
||||
return $this->pdo->queryOneRow(sprintf("select * from content where status=1 and contenttype = %d ", Contents::TYPEINDEX), true);
|
||||
$arr = [];
|
||||
$rows = $this->data_getFrontPage();
|
||||
if ($rows === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$arr[] = $this->row2Object($row);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public function getForMenuByTypeAndRole($id, $role)
|
||||
@@ -123,14 +107,61 @@ class Contents
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public function data_getForMenuByTypeAndRole($id, $role)
|
||||
public function getIndex()
|
||||
{
|
||||
if ($role == Users::ROLE_ADMIN) {
|
||||
$role = "";
|
||||
} else {
|
||||
$role = sprintf("AND (role = %d OR role = 0)", $role);
|
||||
$row = $this->data_getIndex();
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content WHERE showinmenu = 1 AND status = 1 AND contenttype = %d %s ", $id, $role));
|
||||
|
||||
return $this->row2Object($row);
|
||||
}
|
||||
|
||||
public function getByID($id, $role)
|
||||
{
|
||||
$row = $this->data_getByID($id, $role);
|
||||
if ($row === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->row2Object($row);
|
||||
}
|
||||
|
||||
public function validate($content)
|
||||
{
|
||||
if (substr($content->url, 0, 1) != '/') {
|
||||
$content->url = "/" . $content->url;
|
||||
}
|
||||
|
||||
if (substr($content->url, strlen($content->url) - 1) != '/') {
|
||||
$content->url = $content->url . "/";
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function add($form)
|
||||
{
|
||||
$content = $this->row2Object($form);
|
||||
$content = $this->validate($content);
|
||||
if ($content->ordinal == 1) {
|
||||
$this->pdo->queryDirect("UPDATE content SET ordinal = ordinal + 1 WHERE ordinal > 0");
|
||||
}
|
||||
return $this->data_add($content);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
return $this->pdo->queryExec(sprintf("DELETE FROM content WHERE id = %d", $id));
|
||||
}
|
||||
|
||||
public function update($form)
|
||||
{
|
||||
$content = $this->row2Object($form);
|
||||
$content = $this->validate($content);
|
||||
$this->data_update($content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function row2Object($row, $prefix = "")
|
||||
@@ -154,4 +185,65 @@ class Contents
|
||||
$obj->role = $row[$prefix . "role"];
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function data_update($content)
|
||||
{
|
||||
return $this->pdo->queryExec(sprintf("UPDATE content SET role = %d, title = %s, url = %s, body = %s, metadescription = %s, metakeywords = %s, contenttype = %d, showinmenu = %d, status = %d, ordinal = %d WHERE id = %d", $content->role, $this->pdo->escapeString($content->title), $this->pdo->escapeString($content->url), $this->pdo->escapeString($content->body), $this->pdo->escapeString($content->metadescription), $this->pdo->escapeString($content->metakeywords), $content->contenttype, $content->showinmenu, $content->status, $content->ordinal, $content->id));
|
||||
}
|
||||
|
||||
public function data_add($content)
|
||||
{
|
||||
return $this->pdo->queryInsert(sprintf("INSERT INTO content (role, title, url, body, metadescription, metakeywords, contenttype, showinmenu, status, ordinal) values (%d, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $content->role, $this->pdo->escapeString($content->title), $this->pdo->escapeString($content->url), $this->pdo->escapeString($content->body), $this->pdo->escapeString($content->metadescription), $this->pdo->escapeString($content->metakeywords), $content->contenttype, $content->showinmenu, $content->status, $content->ordinal));
|
||||
}
|
||||
|
||||
public function data_get()
|
||||
{
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content WHERE status = 1 ORDER BY contenttype, COALESCE(ordinal, 1000000)"));
|
||||
}
|
||||
|
||||
public function data_getAll()
|
||||
{
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content ORDER BY contenttype, COALESCE(ordinal, 1000000)"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all but front page.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function data_getAllButFront()
|
||||
{
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content WHERE id != 1 ORDER BY contenttype, COALESCE(ordinal, 1000000)"));
|
||||
}
|
||||
|
||||
public function data_getByID($id, $role)
|
||||
{
|
||||
if ($role == Users::ROLE_ADMIN) {
|
||||
$role = "";
|
||||
} else {
|
||||
$role = sprintf("AND (role = %d OR role = 0)", $role);
|
||||
}
|
||||
|
||||
return $this->pdo->queryOneRow(sprintf("SELECT * FROM content WHERE id = %d %s", $id, $role));
|
||||
}
|
||||
|
||||
public function data_getFrontPage()
|
||||
{
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content WHERE status = 1 AND contenttype = %d ORDER BY ordinal ASC, COALESCE(ordinal, 1000000), id", Contents::TYPEINDEX));
|
||||
}
|
||||
|
||||
public function data_getIndex()
|
||||
{
|
||||
return $this->pdo->queryOneRow(sprintf("SELECT * FROM content WHERE status = 1 AND contenttype = %d", Contents::TYPEINDEX));
|
||||
}
|
||||
|
||||
public function data_getForMenuByTypeAndRole($id, $role)
|
||||
{
|
||||
if ($role == Users::ROLE_ADMIN) {
|
||||
$role = "";
|
||||
} else {
|
||||
$role = sprintf("AND (role = %d OR role = 0)", $role);
|
||||
}
|
||||
return $this->pdo->query(sprintf("SELECT * FROM content WHERE showinmenu = 1 AND status = 1 AND contenttype = %d %s ", $id, $role));
|
||||
}
|
||||
}
|
||||
@@ -8,82 +8,65 @@ use newznab\db\Settings;
|
||||
class Menu
|
||||
{
|
||||
/**
|
||||
* Get all menu rows for a role.
|
||||
* @var \newznab\db\Settings
|
||||
*/
|
||||
public $pdo;
|
||||
|
||||
/**
|
||||
* @param \newznab\db\Settings $settings
|
||||
*/
|
||||
public function __construct($settings = null)
|
||||
{
|
||||
$this->pdo = ($settings instanceof Settings ? $settings : new Settings());
|
||||
}
|
||||
|
||||
public function get($role, $serverurl)
|
||||
{
|
||||
$db = new Settings();
|
||||
|
||||
$guest = "";
|
||||
if ($role != Users::ROLE_GUEST)
|
||||
$guest = sprintf(" and role != %d ", Users::ROLE_GUEST);
|
||||
if ($role != Users::ROLE_GUEST) {
|
||||
$guest = sprintf(" AND role != %d ", Users::ROLE_GUEST);
|
||||
}
|
||||
|
||||
if ($role != Users::ROLE_ADMIN)
|
||||
$guest .= sprintf(" and role != %d ", Users::ROLE_ADMIN);
|
||||
if ($role != Users::ROLE_ADMIN) {
|
||||
$guest .= sprintf(" AND role != %d ", Users::ROLE_ADMIN);
|
||||
}
|
||||
|
||||
$sql = sprintf("select * from menu where role <= %d %s order by ordinal", $role, $guest);
|
||||
$data = $this->pdo->query(sprintf("SELECT * FROM menu WHERE role <= %d %s ORDER BY ordinal", $role, $guest));
|
||||
|
||||
$data = $db->query($sql);
|
||||
|
||||
$ret = array();
|
||||
foreach ($data as $d)
|
||||
{
|
||||
if (!preg_match("/http/i", $d["href"]))
|
||||
{
|
||||
$d["href"] = $serverurl.$d["href"];
|
||||
$ret = [];
|
||||
foreach ($data as $d) {
|
||||
if (!preg_match("/http/i", $d["href"])) {
|
||||
$d["href"] = $serverurl . $d["href"];
|
||||
$ret[] = $d;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$ret[] = $d;
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all menu rows.
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$db = new newznab\db\Settings();
|
||||
return $db->query(sprintf("select * from menu order by role, ordinal"));
|
||||
return $this->pdo->query("SELECT * FROM menu ORDER BY role, ordinal");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a menu row by its id.
|
||||
*/
|
||||
public function getById($id)
|
||||
{
|
||||
$db = new newznab\db\Settings();
|
||||
return $db->queryOneRow(sprintf("select * from menu where id = %d", $id));
|
||||
return $this->pdo->queryOneRow(sprintf("SELECT * FROM menu WHERE id = %d", $id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a menu row.
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$db = new newznab\db\Settings();
|
||||
return $db->queryExec(sprintf("DELETE from menu where id = %d", $id));
|
||||
return $this->pdo->queryExec(sprintf("DELETE FROM menu WHERE id = %d", $id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a menu row.
|
||||
*/
|
||||
public function add($menu)
|
||||
{
|
||||
$db = new newznab\db\Settings();
|
||||
return $db->queryInsert(sprintf("INSERT INTO menu (href, title, tooltip, role, ordinal, menueval, newwindow )
|
||||
VALUES (%s, %s, %s, %d, %d, %s, %d) ", $db->escapeString($menu["href"]), $db->escapeString($menu["title"]), $db->escapeString($menu["tooltip"]), $menu["role"] , $menu["ordinal"], $db->escapeString($menu["menueval"]), $menu["newwindow"] ));
|
||||
return $this->pdo->queryInsert(sprintf("INSERT INTO menu (href, title, tooltip, role, ordinal, menueval, newwindow ) VALUES (%s, %s, %s, %d, %d, %s, %d)", $this->pdo->escapeString($menu["href"]), $this->pdo->escapeString($menu["title"]), $this->pdo->escapeString($menu["tooltip"]), $menu["role"], $menu["ordinal"], $this->pdo->escapeString($menu["menueval"]), $menu["newwindow"]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a menu row.
|
||||
*/
|
||||
public function update($menu)
|
||||
{
|
||||
$db = new newznab\db\Settings();
|
||||
return $db->queryExec(sprintf("update menu set href = %s, title = %s, tooltip = %s, role = %d, ordinal = %d, menueval = %s, newwindow=%d where id = %d ", $db->escapeString($menu["href"]), $db->escapeString($menu["title"]), $db->escapeString($menu["tooltip"]), $menu["role"] , $menu["ordinal"], $db->escapeString($menu["menueval"]), $menu["newwindow"], $menu["id"] ));
|
||||
return $this->pdo->queryExec(sprintf("UPDATE menu SET href = %s, title = %s, tooltip = %s, role = %d, ordinal = %d, menueval = %s, newwindow = %d WHERE id = %d", $this->pdo->escapeString($menu["href"]), $this->pdo->escapeString($menu["title"]), $this->pdo->escapeString($menu["tooltip"]), $menu["role"], $menu["ordinal"], $this->pdo->escapeString($menu["menueval"]), $menu["newwindow"], $menu["id"]));
|
||||
}
|
||||
}
|
||||
@@ -18,17 +18,16 @@ class Page extends BasePage
|
||||
|
||||
$content = new Contents();
|
||||
$f = new Forum();
|
||||
$menu = new Menu();
|
||||
$menu = new Menu($this->settings);
|
||||
$this->smarty->assign('menulist',$menu->get($role, $this->serverurl));
|
||||
$this->smarty->assign('usefulcontentlist',$content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role));
|
||||
$this->smarty->assign('articlecontentlist',$content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role));
|
||||
$this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role));
|
||||
$this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role));
|
||||
if ($this->userdata != null)
|
||||
$this->smarty->assign('recentforumpostslist',$f->getRecentPosts($this->pdo->getSetting('showrecentforumposts')));
|
||||
|
||||
$this->smarty->assign('main_menu',$this->smarty->fetch('mainmenu.tpl'));
|
||||
$this->smarty->assign('useful_menu',$this->smarty->fetch('usefullinksmenu.tpl'));
|
||||
$this->smarty->assign('article_menu',$this->smarty->fetch('articlesmenu.tpl'));
|
||||
$this->smarty->assign('recentposts_menu',$this->smarty->fetch('recentforumposts.tpl'));
|
||||
|
||||
$category = new Category();
|
||||
if ($this->userdata != null)
|
||||
|
||||
+51
-14
@@ -1,28 +1,65 @@
|
||||
<?php
|
||||
|
||||
$contents = new Contents();
|
||||
$contents = new Contents(['Settings' => $page->settings]);
|
||||
|
||||
$role=0;
|
||||
if ($page->userdata != null)
|
||||
$role = 0;
|
||||
if ($page->userdata != null) {
|
||||
$role = $page->userdata["role"];
|
||||
}
|
||||
|
||||
/* The role column in the content table values are :
|
||||
* 0 = everyone
|
||||
* 1 = logged in users
|
||||
* 2 = admins
|
||||
*
|
||||
* The user role values are:
|
||||
* 0 = guest
|
||||
* 1 = user
|
||||
* 2 = admin
|
||||
* 3 = disabled
|
||||
* 4 = moderator
|
||||
*
|
||||
* Admins and mods should be the only ones to see admin content.
|
||||
*/
|
||||
$page->smarty->assign('admin', (($role == 2 || $role == 4) ? 'true' : 'false'));
|
||||
|
||||
$contentid = 0;
|
||||
if (isset($_GET["id"]))
|
||||
if (isset($_GET["id"])) {
|
||||
$contentid = $_GET["id"];
|
||||
}
|
||||
|
||||
if ($contentid == 0)
|
||||
$content = $contents->getIndex();
|
||||
else
|
||||
$content = $contents->getByID($contentid, $role);
|
||||
$request = false;
|
||||
if (isset($_REQUEST['page'])) {
|
||||
$request = $_REQUEST['page'];
|
||||
}
|
||||
|
||||
if ($content == null)
|
||||
if ($contentid == 0 && $request == 'content') {
|
||||
$content = $contents->getAllButFront();
|
||||
$page->smarty->assign('front', false);
|
||||
$page->meta_title = 'Contents page';
|
||||
$page->meta_keywords = 'contents';
|
||||
$page->meta_description = 'This is the contents page.';
|
||||
} else if ($contentid != 0 && $request !== false) {
|
||||
$content = array($contents->getByID($contentid, $role));
|
||||
$page->smarty->assign('front', false);
|
||||
$page->meta_title = 'Contents page';
|
||||
$page->meta_keywords = 'contents';
|
||||
$page->meta_description = 'This is the contents page.';
|
||||
} else {
|
||||
$content = $contents->getFrontPage();
|
||||
$index = $contents->getIndex();
|
||||
$page->smarty->assign('front', true);
|
||||
$page->meta_title = $index->title;
|
||||
$page->meta_keywords = $index->metakeywords;
|
||||
$page->meta_description = $index->metadescription;
|
||||
}
|
||||
|
||||
if ($content == null) {
|
||||
$page->show404();
|
||||
}
|
||||
|
||||
$page->smarty->assign('content', $content);
|
||||
|
||||
$page->smarty->assign('content',$content);
|
||||
$page->meta_title = $content["title"];
|
||||
$page->meta_keywords = $content["metakeywords"];
|
||||
$page->meta_description = $content["metadescription"];
|
||||
|
||||
$page->content = $page->smarty->fetch('content.tpl');
|
||||
$page->render();
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{if $articlecontentlist|@count > 0}
|
||||
<li class="menu_articles">
|
||||
<h2>Articles</h2>
|
||||
<ul>
|
||||
{foreach from=$articlecontentlist item=content}
|
||||
<li class="mmenu{if $menu.newwindow =="1"}_new{/if}"><a {if $menu.newwindow =="1"}class="external" target="null"{/if} title="{$content.title}" href="{$smarty.const.WWW_TOP}/content/{$content.id}{$content.url}">{$content.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<li class="menu_articles">
|
||||
<h2>Articles</h2>
|
||||
<ul>
|
||||
{foreach from=$articlecontentlist item=content}
|
||||
<li class="mmenu{if $menu.newwindow =="1"}_new{/if}">
|
||||
<a {if $menu.newwindow =="1"}class="external" target="null"{/if} title="{$content->title}" href="{$smarty.const.WWW_TOP}/content/{$content->id}{$content->url}">{$content->title}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
@@ -1,4 +1,19 @@
|
||||
|
||||
<h1>{$content.title}</h1>
|
||||
|
||||
{$content.body}
|
||||
{if $loggedin=="false"}
|
||||
{foreach from=$content item=c}
|
||||
{if $c->role == 0}{$c->body}{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{foreach from=$content item=c}
|
||||
{if $c->role == 0 || $c->role == 1 || ($c->role == 2 && $admin == 'true')}
|
||||
{if $front == false}
|
||||
<h3>
|
||||
<a style="color:#0082E1" href="{$smarty.const.WWW_TOP}content?id={$c->id}">{$c->title}</a>
|
||||
</h3>
|
||||
{/if}
|
||||
{$c->body}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $front == true}
|
||||
<a style="color:#0082E1" href="{$smarty.const.WWW_TOP}content">See more...</a>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -1,126 +1,4 @@
|
||||
<div id="menucontainer">
|
||||
<div id="menulink">
|
||||
<ul>
|
||||
{foreach from=$parentcatlist item=parentcat}
|
||||
{if $parentcat.id == 1000 && $userdata.consoleview=="1"}
|
||||
<li><a title="Browse {$parentcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/console">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/console?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif $parentcat.id == 2000 && $userdata.movieview=="1"}
|
||||
<li><a title="Browse {$parentcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/movies">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/movies?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 3000 && $userdata.musicview=="1")}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/music">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 3030}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/music?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 4000 && $userdata.gameview=="1")}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/games">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 4050}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/games">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")}
|
||||
<li class="dropdown">
|
||||
<a id="cat3"
|
||||
class="dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
data-hover="dropdown"
|
||||
href="{$smarty.const.WWW_TOP}/xxx">{$parentcat.title}
|
||||
<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="cat3">
|
||||
<li><a href="{$smarty.const.WWW_TOP}/xxx">All {$parentcat.title}</a></li>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 6010 OR 6020 OR 6030 OR 6040}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")}
|
||||
<li class="dropdown">
|
||||
<a id="cat3"
|
||||
class="dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
data-hover="dropdown"
|
||||
href="{$smarty.const.WWW_TOP}/xxx">{$parentcat.title}
|
||||
<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="cat3">
|
||||
<li><a href="{$smarty.const.WWW_TOP}/xxx">All {$parentcat.title}</a></li>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 6010 OR 6020 OR 6030 OR 6040}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$parentcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$parentcat.id}">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if ($subcat.id == 7020 && $userdata.bookview=="1")}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/books">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
<li><a title="Browse All" href="{$smarty.const.WWW_TOP}/browse">All</a>
|
||||
<ul>
|
||||
<li><a title="Browse Groups" href="{$smarty.const.WWW_TOP}/browsegroup">Groups</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="menusearchlink">
|
||||
<form id="headsearch_form" action="{$smarty.const.WWW_TOP}/search/" method="get">
|
||||
|
||||
@@ -142,4 +20,124 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menulink">
|
||||
<ul>
|
||||
{if isset($userdata)}
|
||||
{foreach from=$parentcatlist item=parentcat}
|
||||
{if $parentcat.id == 1000 && $userdata.consoleview=="1" && $site->lookupgames=="1"}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/console">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/console?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif $parentcat.id == 2000 && $userdata.movieview=="1" && $site->lookupimdb > "0"}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/movies">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/movies?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 3000 && $userdata.musicview=="1") && $site->lookupmusic=="1"}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/music">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 3030}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/music?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 4000 && $userdata.gameview=="1")}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/games">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 4050}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/games">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")}
|
||||
<li class="dropdown">
|
||||
<a id="cat3"
|
||||
class="dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
data-hover="dropdown"
|
||||
href="{$smarty.const.WWW_TOP}/xxx">{$parentcat.title}
|
||||
<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="cat3">
|
||||
<li><a href="{$smarty.const.WWW_TOP}/xxx">All {$parentcat.title}</a></li>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 6010 OR 6020 OR 6030 OR 6040}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 6000 && $userdata.xxxview=="1" && $site->lookupxxx=="1")}
|
||||
<li class="dropdown">
|
||||
<a id="cat3"
|
||||
class="dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
data-hover="dropdown"
|
||||
href="{$smarty.const.WWW_TOP}/xxx">{$parentcat.title}
|
||||
<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="cat3">
|
||||
<li><a href="{$smarty.const.WWW_TOP}/xxx">All {$parentcat.title}</a></li>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 6010 OR 6020 OR 6030 OR 6040}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/xxx?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}"
|
||||
href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{elseif ($parentcat.id == 8000 && $userdata.bookview=="1") && $site->lookupbooks=="1"}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/books">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
{if $subcat.id == 8010}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/books">{$subcat.title}</a></li>
|
||||
{else}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{else}
|
||||
<li><a title="Browse {$parentcat.title}" href="{$smarty.const.WWW_TOP}/browse?t={$parentcat.id}">{$parentcat.title}</a>
|
||||
<ul>
|
||||
{foreach from=$parentcat.subcatlist item=subcat}
|
||||
<li><a title="Browse {$subcat.title}" href="{$smarty.const.WWW_TOP}/browse?t={$subcat.id}">{$subcat.title}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
<li><a title="Browse All" href="{$smarty.const.WWW_TOP}/browse">All</a>
|
||||
<ul>
|
||||
<li><a title="Browse Groups" href="{$smarty.const.WWW_TOP}/browsegroup">Groups</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user