* added featured article to tibiacom template (you can add them with add news button)

* added networks (facebook and twitter) and highscores (top 5) boxes to tibiacom template, configurable in templates/tibiacom/config.php
* fixed polls box in tibiacom template
* (internal) moved tibiacom boxes to separate directory
* (internal) renamed constant TICKET -> TICKER
This commit is contained in:
slawkens 2017-10-26 15:35:22 +02:00
parent 5e414ebda8
commit 583f3394fc
29 changed files with 795 additions and 121 deletions

View File

@ -28,7 +28,7 @@ session_start();
define('MYAAC', true); define('MYAAC', true);
define('MYAAC_VERSION', '0.6.6'); define('MYAAC_VERSION', '0.6.6');
define('DATABASE_VERSION', 17); define('DATABASE_VERSION', 18);
define('TABLE_PREFIX', 'myaac_'); define('TABLE_PREFIX', 'myaac_');
define('START_TIME', microtime(true)); define('START_TIME', microtime(true));
define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX')); define('MYAAC_OS', (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'WINDOWS' : (strtoupper(PHP_OS) == 'DARWIN' ? 'MAC' : 'LINUX'));
@ -50,7 +50,8 @@ define('FLAG_CONTENT_MENUS', 4096);
// news // news
define('NEWS', 1); define('NEWS', 1);
define('TICKET', 2); define('TICKER', 2);
define('ARTICLE', 3);
// directories // directories
define('BASE', dirname(__FILE__) . '/'); define('BASE', dirname(__FILE__) . '/');

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -255,13 +255,15 @@ CREATE TABLE `myaac_news`
`id` INT(11) NOT NULL AUTO_INCREMENT, `id` INT(11) NOT NULL AUTO_INCREMENT,
`title` VARCHAR(100) NOT NULL, `title` VARCHAR(100) NOT NULL,
`body` TEXT NOT NULL, `body` TEXT NOT NULL,
`type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - news, 2 - ticket, 3 - article', `type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '1 - news, 2 - ticker, 3 - article',
`date` INT(11) NOT NULL DEFAULT 0, `date` INT(11) NOT NULL DEFAULT 0,
`category` TINYINT(1) NOT NULL DEFAULT 0, `category` TINYINT(1) NOT NULL DEFAULT 0,
`player_id` INT(11) NOT NULL DEFAULT 0, `player_id` INT(11) NOT NULL DEFAULT 0,
`last_modified_by` INT(11) NOT NULL DEFAULT 0, `last_modified_by` INT(11) NOT NULL DEFAULT 0,
`last_modified_date` INT(11) NOT NULL DEFAULT 0, `last_modified_date` INT(11) NOT NULL DEFAULT 0,
`comments` VARCHAR(50) NOT NULL DEFAULT '', `comments` VARCHAR(50) NOT NULL DEFAULT '',
`article_text` VARCHAR(300) NOT NULL DEFAULT '',
`article_image` VARCHAR(100) NOT NULL DEFAULT '',
`hidden` TINYINT(1) NOT NULL DEFAULT 0, `hidden` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = MyISAM; ) ENGINE = MyISAM;

View File

@ -414,11 +414,11 @@ function short_text($text, $limit)
function tickers() function tickers()
{ {
global $tickers_content; global $tickers_content, $featured_article;
if(PAGE == 'news') { if(PAGE == 'news') {
if(isset($tickers_content)) if(isset($tickers_content))
return $tickers_content; return $tickers_content . $featured_article;
} }
return ''; return '';
@ -949,6 +949,40 @@ function unsetSession($key) {
unset($_SESSION[$config['session_prefix'] . $key]); unset($_SESSION[$config['session_prefix'] . $key]);
} }
function getTopPlayers($limit = 5) {
global $cache, $config, $db;
$fetch_from_db = true;
if($cache->enabled())
{
$tmp = '';
if($cache->fetch('top_' . $limit . '_level', $tmp))
{
$players = unserialize($tmp);
$fetch_from_db = false;
}
}
if($fetch_from_db)
{
$deleted = 'deleted';
if(fieldExist('deletion', 'players'))
$deleted = 'deletion';
$players = $db->query('SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` < ' . $config['highscores_groups_hidden'] . ' AND `' . $deleted . '` = 0 AND account_id != 1 ORDER BY `experience` DESC LIMIT 5')->fetchAll();
$i = 0;
foreach($players as &$player) {
$player['rank'] = ++$i;
}
if($cache->enabled())
$cache->set('top_' . $limit . '_level', serialize($players), 120);
}
return $players;
}
// validator functions // validator functions
require_once(LIBS . 'validator.php'); require_once(LIBS . 'validator.php');
require_once(SYSTEM . 'compat.php'); require_once(SYSTEM . 'compat.php');

View File

@ -108,7 +108,7 @@ class Plugins {
$query = $query->fetch(); $query = $query->fetch();
$db->update(TABLE_PREFIX . 'hooks', array('type' => $hook, 'file' => $info['file']), array('id' => (int)$query['id'])); $db->update(TABLE_PREFIX . 'hooks', array('type' => $hook, 'file' => $info['file']), array('id' => (int)$query['id']));
} else { } else {
$db->insert(TABLE_PREFIX . 'hooks', array('id' => 'NULL', 'name' => $_name, 'type' => $hook, 'file' => $info['file'])); $db->insert(TABLE_PREFIX . 'hooks', array('id' => null, 'name' => $_name, 'type' => $hook, 'file' => $info['file']));
} }
} else } else
self::$warnings[] = 'Unknown event type: ' . $info['type']; self::$warnings[] = 'Unknown event type: ' . $info['type'];

6
system/migrations/18.php Normal file
View File

@ -0,0 +1,6 @@
<?php
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` ADD `article_text` VARCHAR(300) NOT NULL DEFAULT '' AFTER `comments`;");
$db->query("ALTER TABLE `" . TABLE_PREFIX . "news` ADD `article_image` VARCHAR(100) NOT NULL DEFAULT '' AFTER `article_text`;");
?>

View File

@ -89,8 +89,8 @@ function clearCache()
if($cache->fetch('news' . $template_name . '_' . NEWS, $tmp)) if($cache->fetch('news' . $template_name . '_' . NEWS, $tmp))
$cache->delete('news' . $template_name . '_' . NEWS); $cache->delete('news' . $template_name . '_' . NEWS);
if($cache->fetch('news' . $template_name . '_' . TICKET, $tmp)) if($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
$cache->delete('news' . $template_name . '_' . TICKET); $cache->delete('news' . $template_name . '_' . TICKER);
if($cache->fetch('template_ini' . $template_name, $tmp)) if($cache->fetch('template_ini' . $template_name, $tmp))
$cache->delete('template_ini' . $template_name); $cache->delete('template_ini' . $template_name);

View File

@ -34,7 +34,7 @@ if(isset($_GET['archive']))
if($_REQUEST['id'] < 100000) if($_REQUEST['id'] < 100000)
$field_name = 'id'; $field_name = 'id';
$news = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'news').' WHERE `type` = 1 AND `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . ''); $news = $db->query('SELECT * FROM `'.TABLE_PREFIX . 'news` WHERE `hidden` != 1 AND `' . $field_name . '` = ' . (int)$_REQUEST['id'] . '');
if($news->rowCount() == 1) if($news->rowCount() == 1)
{ {
$news = $news->fetch(); $news = $news->fetch();
@ -102,21 +102,24 @@ $news_cached = false;
// some constants, used mainly by database (cannot by modified without schema changes) // some constants, used mainly by database (cannot by modified without schema changes)
define('TITLE_LIMIT', 100); define('TITLE_LIMIT', 100);
define('BODY_LIMIT', 65535); // maximum news body length define('BODY_LIMIT', 65535); // maximum news body length
define('ARTICLE_TEXT_LIMIT', 300);
define('ARTICLE_IMAGE_LIMIT', 100);
$canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin(); $canEdit = hasFlag(FLAG_CONTENT_NEWS) || superAdmin();
if($canEdit) if($canEdit)
{ {
if(!empty($action)) if(!empty($action))
{ {
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : NULL; $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$p_title = isset($_REQUEST['title']) ? $_REQUEST['title'] : NULL; $p_title = isset($_REQUEST['title']) ? $_REQUEST['title'] : null;
$body = isset($_REQUEST['body']) ? stripslashes($_REQUEST['body']) : NULL; $body = isset($_REQUEST['body']) ? stripslashes($_REQUEST['body']) : null;
$comments = isset($_REQUEST['comments']) ? $_REQUEST['comments'] : NULL; $comments = isset($_REQUEST['comments']) ? $_REQUEST['comments'] : null;
$type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : NULL; $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : null;
$category = isset($_REQUEST['category']) ? (int)$_REQUEST['category'] : NULL; $category = isset($_REQUEST['category']) ? (int)$_REQUEST['category'] : null;
$player_id = isset($_REQUEST['player_id']) ? (int)$_REQUEST['player_id'] : NULL; $player_id = isset($_REQUEST['player_id']) ? (int)$_REQUEST['player_id'] : null;
$article_text = isset($_REQUEST['article_text']) ? $_REQUEST['article_text'] : null;
$forum_section = isset($_REQUEST['forum_section']) ? $_REQUEST['forum_section'] : NULL; $article_image = isset($_REQUEST['article_image']) ? $_REQUEST['article_image'] : null;
$forum_section = isset($_REQUEST['forum_section']) ? $_REQUEST['forum_section'] : null;
$errors = array(); $errors = array();
if($action == 'add') { if($action == 'add') {
@ -124,8 +127,8 @@ if($canEdit)
$forum_add = Forum::add_thread($p_title, $body, $forum_section, $player_id, $account_logged->getId(), $errors); $forum_add = Forum::add_thread($p_title, $body, $forum_section, $player_id, $account_logged->getId(), $errors);
} }
if(News::add($p_title, $body, $type, $category, $player_id, isset($forum_add) && $forum_add != 0 ? $forum_add : 0, $errors)) { if(News::add($p_title, $body, $type, $category, $player_id, isset($forum_add) && $forum_add != 0 ? $forum_add : 0, $article_text, $article_image, $errors)) {
$p_title = $body = $comments = ''; $p_title = $body = $comments = $article_text = $article_image = '';
$type = $category = $player_id = 0; $type = $category = $player_id = 0;
} }
} }
@ -142,15 +145,17 @@ if($canEdit)
$type = $news['type']; $type = $news['type'];
$category = $news['category']; $category = $news['category'];
$player_id = $news['player_id']; $player_id = $news['player_id'];
$article_text = $news['article_text'];
$article_image = $news['article_image'];
} }
else { else {
if(News::update($id, $p_title, $body, $type, $category, $player_id, $forum_section, $errors)) { if(News::update($id, $p_title, $body, $type, $category, $player_id, $forum_section, $article_text, $article_image, $errors)) {
// update forum thread if exists // update forum thread if exists
if(isset($forum_section) && Validator::number($forum_section)) { if(isset($forum_section) && Validator::number($forum_section)) {
$db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `author_guid` = ".(int) $player_id.", `post_text` = ".$db->quote($body).", `post_topic` = ".$db->quote($p_title).", `edit_date` = " . time() . " WHERE `id` = " . $db->quote($forum_section)); $db->query("UPDATE `" . TABLE_PREFIX . "forum` SET `author_guid` = ".(int) $player_id.", `post_text` = ".$db->quote($body).", `post_topic` = ".$db->quote($p_title).", `edit_date` = " . time() . " WHERE `id` = " . $db->quote($forum_section));
} }
$action = $p_title = $body = $comments = ''; $action = $p_title = $body = $comments = $article_text = $article_image = '';
$type = $category = $player_id = 0; $type = $category = $player_id = 0;
} }
} }
@ -165,7 +170,7 @@ if($canEdit)
if($cache->enabled()) if($cache->enabled())
{ {
$cache->set('news_' . $template_name . '_' . NEWS, '', 120); $cache->set('news_' . $template_name . '_' . NEWS, '', 120);
$cache->set('news_' . $template_name . '_' . TICKET, '', 120); $cache->set('news_' . $template_name . '_' . TICKER, '', 120);
} }
} }
} }
@ -176,7 +181,7 @@ if(!$news_cached)
{ {
$categories = array(); $categories = array();
foreach($db->query( foreach($db->query(
'SELECT id, name, icon_id FROM ' . TABLE_PREFIX . 'news_categories WHERE hidden != 1') as $cat) 'SELECT `id`, `name`, `icon_id` FROM `' . TABLE_PREFIX . 'news_categories` WHERE `hidden` != 1') as $cat)
{ {
$categories[$cat['id']] = array( $categories[$cat['id']] = array(
'name' => $cat['name'], 'name' => $cat['name'],
@ -186,11 +191,11 @@ if(!$news_cached)
$tickers_db = $tickers_db =
$db->query( $db->query(
'SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE ' . $db->fieldName('type') . ' = ' . TICKET . 'SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .
($canEdit ? '' : ' AND ' . $db->fieldName('hidden') . ' != 1') . ($canEdit ? '' : ' AND `hidden` != 1') .
' ORDER BY ' . $db->fieldName('date') . ' DESC' . ' ORDER BY `date` DESC LIMIT ' . $config['news_ticker_limit']);
' LIMIT ' . $config['news_ticker_limit']);
$tickers_content = '';
if($tickers_db->rowCount() > 0) if($tickers_db->rowCount() > 0)
{ {
$tickers = $tickers_db->fetchAll(); $tickers = $tickers_db->fetchAll();
@ -199,20 +204,47 @@ if(!$news_cached)
$ticker['body_short'] = short_text(strip_tags($ticker['body']), 100); $ticker['body_short'] = short_text(strip_tags($ticker['body']), 100);
} }
$tickers_to_add = $twig->render('news.tickers.html.twig', array( $tickers_content = $twig->render('news.tickers.html.twig', array(
'tickers' => $tickers, 'tickers' => $tickers,
'canEdit' => $canEdit 'canEdit' => $canEdit
)); ));
} }
}
else
$tickers_to_add = News::getCached(TICKET);
if(isset($tickers_to_add[0])) if($cache->enabled() && !$canEdit)
{ $cache->set('news_' . $template_name . '_' . TICKER, $tickers_content, 120);
$tickers_content = $tickers_to_add;
if($cache->enabled() && !$news_cached && !$canEdit) $featured_article_db =
$cache->set('news_' . $template_name . '_' . TICKET, $tickers_to_add, 120); $db->query(
'SELECT `id`, `title`, `article_text`, `article_image`, `hidden` FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . ARTICLE .
($canEdit ? '' : ' AND `hidden` != 1') .
' ORDER BY `date` DESC LIMIT 1');
$article = '';
if($featured_article_db->rowCount() > 0) {
$article = $featured_article_db->fetch();
$featured_article = '';
if($twig->getLoader()->exists('news.featured_article.html.twig')) {
$featured_article = $twig->render('news.featured_article.html.twig', array(
'article' => array(
'id' => $article['id'],
'title' => $article['title'],
'text' => $article['article_text'],
'image' => $article['article_image'],
'hidden' => $article['hidden'],
'read_more'=> getLink('news/archive/') . $article['id']
),
'canEdit' => $canEdit
));
}
if($cache->enabled() && !$canEdit)
$cache->set('news_' . $template_name . '_' . ARTICLE, $featured_article, 120);
}
}
else {
$tickers_content = News::getCached(TICKER);
$featured_article = News::getCached(ARTICLE);
} }
if(!$news_cached) if(!$news_cached)
@ -243,7 +275,9 @@ if(!$news_cached)
'categories' => $categories, 'categories' => $categories,
'forum_boards' => getForumBoards(), 'forum_boards' => getForumBoards(),
'forum_section' => isset($forum_section) ? $forum_section : null, 'forum_section' => isset($forum_section) ? $forum_section : null,
'comments' => isset($comments) ? $comments : null 'comments' => isset($comments) ? $comments : null,
'article_text' => isset($article_text) ? $article_text : null,
'article_image' => isset($article_image) ? $article_image : null
)); ));
} }
@ -271,7 +305,7 @@ if(!$news_cached)
$admin_options = '<br/><br/><a href="?subtopic=news&action=edit&id=' . $news['id'] . '" title="Edit"> $admin_options = '<br/><br/><a href="?subtopic=news&action=edit&id=' . $news['id'] . '" title="Edit">
<img src="images/edit.png"/>Edit <img src="images/edit.png"/>Edit
</a> </a>
<a id="delete" href="' . BASE_URL . '?subtopic=news&action=delete&id=' . $news['id'] . '" onclick="return confirm(\'Are you sure?\');" title="Delete"> <a id="delete" href="?subtopic=news&action=delete&id=' . $news['id'] . '" onclick="return confirm(\'Are you sure?\');" title="Delete">
<img src="images/del.png"/>Delete <img src="images/del.png"/>Delete
</a> </a>
<a href="?subtopic=news&action=hide&id=' . $news['id'] . '" title="' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '"> <a href="?subtopic=news&action=hide&id=' . $news['id'] . '" title="' . ($news['hidden'] != 1 ? 'Hide' : 'Show') . '">
@ -292,13 +326,15 @@ if(!$news_cached)
} }
echo $twig->render('news.html.twig', array( echo $twig->render('news.html.twig', array(
'id' => $news['id'],
'title' => stripslashes($news['title']), 'title' => stripslashes($news['title']),
'content' => $content_ . $admin_options, 'content' => $content_ . $admin_options,
'date' => $news['date'], 'date' => $news['date'],
'icon' => $categories[$news['category']]['icon_id'], 'icon' => $categories[$news['category']]['icon_id'],
'author' => $config['news_author'] ? $author : '', 'author' => $config['news_author'] ? $author : '',
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null, 'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
'news_date_format' => $config['news_date_format'] 'news_date_format' => $config['news_date_format'],
'hidden'=> $news['hidden']
)); ));
} }
} }
@ -316,7 +352,7 @@ else
class News class News
{ {
static public function verify($title, $body, &$errors) static public function verify($title, $body, $article_text, $article_image, &$errors)
{ {
if(!isset($title[0]) || !isset($body[0])) { if(!isset($title[0]) || !isset($body[0])) {
$errors[] = 'Please fill all inputs.'; $errors[] = 'Please fill all inputs.';
@ -333,16 +369,26 @@ class News
return false; return false;
} }
if(strlen($article_text) > ARTICLE_TEXT_LIMIT) {
$errors[] = 'Article text cannot be longer than ' . ARTICLE_TEXT_LIMIT . ' characters.';
return false;
}
if(strlen($article_image) > ARTICLE_IMAGE_LIMIT) {
$errors[] = 'Article image cannot be longer than ' . ARTICLE_IMAGE_LIMIT . ' characters.';
return false;
}
return true; return true;
} }
static public function add($title, $body, $type, $category, $player_id, $comments, &$errors) static public function add($title, $body, $type, $category, $player_id, $comments, $article_text, $article_image, &$errors)
{ {
global $db; global $db;
if(!News::verify($title, $body, $errors)) if(!self::verify($title, $body, $article_text, $article_image, $errors))
return false; return false;
$db->insert(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'date' => time(), 'category' => $category, 'player_id' => isset($player_id) ? $player_id : 0, 'comments' => $comments)); $db->insert(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'date' => time(), 'category' => $category, 'player_id' => isset($player_id) ? $player_id : 0, 'comments' => $comments, 'article_text' => $article_text, 'article_image' => $article_image));
return true; return true;
} }
@ -351,13 +397,13 @@ class News
return $db->select(TABLE_PREFIX . 'news', array('id' => $id)); return $db->select(TABLE_PREFIX . 'news', array('id' => $id));
} }
static public function update($id, $title, $body, $type, $category, $player_id, $comments, &$errors) static public function update($id, $title, $body, $type, $category, $player_id, $comments, $article_text, $article_image, &$errors)
{ {
global $db; global $db;
if(!News::verify($title, $body, $errors)) if(!self::verify($title, $body, $article_text, $article_image, $errors))
return false; return false;
$db->update(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'category' => $category, 'last_modified_by' => isset($player_id) ? $player_id : 0, 'last_modified_date' => time(), 'comments' => $comments), array('id' => $id)); $db->update(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'category' => $category, 'last_modified_by' => isset($player_id) ? $player_id : 0, 'last_modified_date' => time(), 'comments' => $comments, 'article_text' => $article_text, 'article_image' => $article_image), array('id' => $id));
return true; return true;
} }
@ -396,7 +442,7 @@ class News
static public function getCached($type) static public function getCached($type)
{ {
global $cache, $config, $template_name; global $cache, $template_name;
if($cache->enabled()) if($cache->enabled())
{ {
$tmp = ''; $tmp = '';

View File

@ -20,10 +20,10 @@ CREATE TABLE `z_polls` (
`id` int(11) NOT NULL auto_increment, `id` int(11) NOT NULL auto_increment,
`question` varchar(255) NOT NULL, `question` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL, `description` varchar(255) NOT NULL,
`end` int(11) NOT NULL, `end` int(11) NOT NULL DEFAULT 0,
`start` int(11) NOT NULL, `start` int(11) NOT NULL DEFAULT 0,
`answers` int(11) NOT NULL, `answers` int(11) NOT NULL DEFAULT 0,
`votes_all` int(11) NOT NULL, `votes_all` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;'); ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;');
@ -33,7 +33,7 @@ $db->query('
`poll_id` int(11) NOT NULL, `poll_id` int(11) NOT NULL,
`answer_id` int(11) NOT NULL, `answer_id` int(11) NOT NULL,
`answer` varchar(255) NOT NULL, `answer` varchar(255) NOT NULL,
`votes` int(11) NOT NULL `votes` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1;'); ) ENGINE=MyISAM DEFAULT CHARSET=latin1;');
if(!fieldExist('vote', 'accounts')) if(!fieldExist('vote', 'accounts'))
@ -346,10 +346,23 @@ function getColorByPercent($percent)
for( $x = 1; $x <= getSession('answers'); $x++ ) for( $x = 1; $x <= getSession('answers'); $x++ )
{ {
$INSERT_answer = $db->query('INSERT INTO `z_polls_answers` (`poll_id`,`answer_id`,`answer`) VALUES ('.$db->quote($id_next).','.$db->quote($x).','.$db->quote($_POST[$x]).')'); $db->insert('z_polls_answers', array(
'poll_id' => $id_next,
'answer_id' => $x,
'answer' => $_POST[$x],
'votes' => 0
));
} }
$end = $time+24*60*60*$_POST['end']; $end = $time+24*60*60*$_POST['end'];
$INSERT_poll = $db->query('INSERT INTO `z_polls` (`id`,`question`, `description`,`end`,`answers`,`start`) VALUES ('.$db->quote($id_next).','.$db->quote($_POST['question']).','.$db->quote($_POST['description']).','.$db->quote($end).','.$db->quote(getSession('answers')).','.$db->quote($time).')'); $db->insert('z_polls', array(
'id' => $id_next,
'question' => $_POST['question'],
'description' => $_POST['description'],
'end' => $end,
'answers' => getSession('answers'),
'start' => $time,
'votes_all' => 0
));
} }
$POLLS_check = $db->query('SELECT MAX(end) FROM '.$db->tableName('z_polls').''); $POLLS_check = $db->query('SELECT MAX(end) FROM '.$db->tableName('z_polls').'');

View File

@ -1,7 +1,7 @@
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script> <script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
tinymce.init({ tinymce.init({
selector : "textarea", selector : "#body",
theme : "modern", theme : "modern",
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code', plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code', toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
@ -31,21 +31,37 @@
{% set rows = rows + 1 %} {% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}"> <tr bgcolor="{{ getStyle(rows) }}">
<!--td>Description:</td--> <!--td>Description:</td-->
<td colspan="2"><textarea name="body" maxlength="{{ constant('BODY_LIMIT') }}" class="tinymce">{{ body }}</textarea></td> <td colspan="2"><textarea name="body" id="body" maxlength="{{ constant('BODY_LIMIT') }}" class="tinymce">{{ body }}</textarea></td>
<tr/> <tr/>
{% set rows = rows + 1 %} {% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}"> <tr bgcolor="{{ getStyle(rows) }}">
<td><b>Type:</b></td> <td><b>Type:</b></td>
<td> <td>
<select name="type"> <select name="type" id="select-type"{% if action == 'edit' %} disabled{% endif %}>
<option value="{{ constant('NEWS') }}" {% if type is defined and type == constant('NEWS') %}selected="yes"{% endif %}>News</option> <option value="{{ constant('NEWS') }}" {% if type is defined and type == constant('NEWS') %}selected="yes"{% endif %}>News</option>
<option value="{{ constant('TICKET') }}" {% if type is defined and type == constant('TICKET') %}selected="yes"{% endif %}>Ticket</option> <option value="{{ constant('TICKER') }}" {% if type is defined and type == constant('TICKER') %}selected="yes"{% endif %}>Ticket</option>
<!--option value="{{ constant('ARTICLE') }}">Article</option--> <option value="{{ constant('ARTICLE') }}" {% if type is defined and type == constant('ARTICLE') %}selected="yes"{% endif %}>Article</option>
</select> </select>
</td> </td>
</tr> </tr>
{% set rows = rows + 1 %}
<tr id="article-text" bgcolor="{{ getStyle(rows) }}"{% if article_text is empty %} style="display: none;"{% endif %}>
<td><b>Article short text:<br/>This will be displayed on news page.<br/>Rest will be available on "read more" page.</b></td>
<td>
<textarea name="article_text">{% if article_text is not empty %}{{ article_text }}{% endif %}</textarea>
</td>
</tr>
{% set rows = rows + 1 %}
<tr id="article-image" bgcolor="{{ getStyle(rows) }}"{% if article_image is empty %} style="display: none;"{% endif %}>
<td><b>Article image:</b></td>
<td>
<input type="text" name="article_image" value="{% if article_image is not empty %}{{ article_image }}{% else %}images/news/announcement.jpg{% endif %}" />
</td>
</tr>
{% if action == 'edit' %} {% if action == 'edit' %}
{% set rows = rows + 1 %} {% set rows = rows + 1 %}
{% if player is defined %} {% if player is defined %}
@ -115,11 +131,23 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#news-edit").hide(); $("#news-edit").hide();
});
$("#news-button").click(function() { $("#news-button").click(function() {
$("#news-edit").toggle(); $("#news-edit").toggle();
return false; return false;
}); });
$('#select-type').change(function() {
var value = $('#select-type').val();
if(value == {{ constant('ARTICLE') }}) {
$('#article-text').show();
$('#article-image').show();
}
else {
$('#article-text').hide();
$('#article-image').hide();
}
});
});
</script> </script>
{% endif %} {% endif %}

View File

@ -84,7 +84,7 @@ defined('MYAAC') or die('Direct access not allowed!');
$i = 0; $i = 0;
foreach($menus[$category] as $menu) { foreach($menus[$category] as $menu) {
if(strpos($menu['link'], 'http') !== false) { if(strpos(trim($menu['link']), 'http') === 0) {
echo '<a href="' . $menu['link'] . '" target="_blank">' . $menu['name'] . '</a>'; echo '<a href="' . $menu['link'] . '" target="_blank">' . $menu['name'] . '</a>';
} }
else { else {

View File

@ -106,7 +106,7 @@
<td > <td >
<div style="float: right; margin-top: 20px;" > <div style="float: right; margin-top: 20px;" >
<form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" > <form class="MediumButtonForm" action="{{ getLink('account/create') }}" method="post" >
<div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ><div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ></div> <div class="MediumButtonBackground" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="MediumButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ></div>
<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" /> <input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="{{ template_path }}/images/global/buttons/mediumbutton_createaccount.png" />
</div> </div>
</form> </form>

View File

@ -740,6 +740,52 @@ img {
border: 0; border: 0;
} }
#Themeboxes #NetworksBox {
position: relative;
height: 204px;
}
#Themeboxes #NetworksBox #FacebookBlock {
position: relative;
top: 32px;
height: 113px;
}
#Themeboxes #NetworksBox #FacebookLikeBox {
position: relative;
left: 27px;
top: 3px;
height: 60px;
width: 115px;
overflow: hidden;
}
#Themeboxes #NetworksBox #FacebookLikeBox div {
position: relative;
left: -1px;
top: -1px;
}
#Themeboxes #NetworksBox #FacebookSendBox {
position: absolute;
left: 92px;
top: 14px;
width: 50px;
}
#Themeboxes #NetworksBox #FacebookLikes {
position: relative;
left: 14px;
top: 10px;
width: 155px;
left: 13px;
overflow: hidden;
}
#Themeboxes #NetworksBox #FacebookLikes div {
position: relative;
left: -69px;
}
#Themeboxes #NetworksBox #TwitterBlock {
position: relative;
top: 42px;
text-align: center;
}
/** ------------------------------- /** -------------------------------
* OLD Stylesheet declarations for * OLD Stylesheet declarations for
* the CONTENT AREA * the CONTENT AREA

View File

@ -0,0 +1,18 @@
<?php
if(PAGE != 'news') {
return;
}
$query = $db->query('SELECT `thumb` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($config['gallery_image']));
if($query->rowCount() == 1):
$image = $query->fetch();
?>
<div id="GalleryBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/gallery/gallerybox.gif);">
<a href="?subtopic=gallery&image=<?php echo $config['gallery_image']; ?>" >
<img id="GalleryContent" class="ThemeboxContent" src="<?php echo $image['thumb']; ?>" alt="Screenshot of the Day" />
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<br/><br/><br/>
<?php endif; ?>

View File

@ -0,0 +1,63 @@
<style type="text/css" media="all">
.Toplevelbox {
top: -4px;
position: relative;
margin-bottom: 10px;
width: 180px;
height: 200px;
}
.top_level {
position: absolute;
top: 29px;
left: 6px;
height: 160px;
width: 168px;
z-index: 20;
text-align: center;
padding-top: 6px;
font-family: Tahoma, Geneva, sans-serif;
font-size: 9.2pt;
color: #FFF;
font-weight: bold;
text-align: right;
text-decoration: inherit;
text-shadow: 0.1em 0.1em #333
}
#Topbar a {
text-decoration: none;
cursor: auto;
}
a.topfont {
font-family: Verdana, Arial, Helvetica;
font-size: 11px;
color: #FF0000;
text-decoration: none
}
a:hover.topfont {
font-family: Verdana, Arial, Helvetica;
font-size: 11px;
color: #CCC;
text-decoration:none
}
</style>
<div id="Topbar" class="Themebox" style="background-image:url(<?PHP echo $template_path; ?>/images/themeboxes/highscores/highscores.png);">
<div class="top_level" style="background:url(<?PHP echo $template_path; ?>/images/themeboxes/bg_top.png)" align=" ">
<?php
foreach(getTopPlayers(5) as $player) {
echo '<div align="left"><a href="'.getPlayerLink($player['name'], false).'" class="topfont">
<font color="#CCC">&nbsp;&nbsp;&nbsp;&nbsp;'.$player['rank'].' - </font>'.$player['name'].'
<br>
<small><font color="white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level: ('.$player['level'].')</font></small>
<br>
</a>
</div>';
}
?>
<div class="Bottom" style="background-image:url(<?PHP echo $template_path; ?>/images/general/box-bottom.gif); top: 159px;; left:-5px;">
</div>
</div>
</div>
<br/><br/><br/>

View File

@ -0,0 +1,31 @@
<div id="NetworksBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/networks/networksbox.png);">
<?php if(!empty($config['network_facebook'])) {?>
<div id="FacebookBlock">
<div id="FacebookLikeBox">
<div class="fb-like-box fb_iframe_widget" data-href="https://www.facebook.com/<?php echo $config['network_facebook']; ?>" data-width="175" data-height="180" data-show-faces="true" data-stream="false" data-border-color="none" data-header="false" fb-xfbml-state="rendered">
<span style="vertical-align: bottom; width: 181px; height: 180px;">
</span>
</div>
</div>
<div id="FacebookSendBox">
<div class="fb-send fb_iframe_widget" data-href="https://www.facebook.com/<?php echo $config['network_facebook']; ?>" data-width="50" data-height="20" fb-xfbml-state="rendered">
<span style="vertical-align: bottom; width: 50px; height: 20px;">
</span>
</div>
</div>
<div id="FacebookLikes">
<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" data-href="https://www.facebook.com/<?php echo $config['network_facebook']; ?>" data-send="false" data-width="225" data-show-faces="false" fb-xfbml-state="rendered">
<span style="height: 28px; width: 225px;">
</span>
</div>
</div>
</div>
<?php } ?>
<?php if(!empty($config['network_twitter'])){ ?>
<div id="TwitterBlock">
<a href="https://twitter.com/<?php echo $config['network_twitter']; ?>" class="twitter-follow-button" data-show-count="false">Follow @<?php echo $config['network_twitter']; ?></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<?php } ?>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>

View File

@ -0,0 +1,5 @@
<div id="NewcomerBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/newcomer/newcomerbox.gif);">
<a class="ThemeboxButton" href="<?php echo getLink('account/create'); ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_jointibia.gif);"></div>
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>

View File

@ -0,0 +1,21 @@
<?php
if(PAGE != 'news') {
return;
}
$poll = $db->query('SELECT `id`, `question` FROM `z_polls` WHERE end > ' . time() . ' ORDER BY `end` LIMIT 1');
if($poll->rowCount() > 0) {
$poll = $poll->fetch();
?>
<div id="CurrentPollBox" class="Themebox"
style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText"><?php echo $poll['question']; ?></div>
<a class="ThemeboxButton" href="<?php echo getLink('polls') . '/' . $poll['id']; ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_votenow.gif);"></div>
</a>
<div class="Bottom"
style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<?php
}
?>

View File

@ -0,0 +1,7 @@
<div id="PremiumBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/premium/premiumbox.gif);">
<a class="ThemeboxButton" href="<?php echo getLink('premium'); ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);">
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div>
<div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_getpremium.gif);"></div>
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>

View File

@ -5,8 +5,12 @@ $config['vdarkborder'] = "#505050";
$config['news_title_color'] = "white"; $config['news_title_color'] = "white";
$config['logo_monster'] = "Elder Beholder"; $config['logo_monster'] = "Elder Beholder";
// separated by comma // separated by comma
// List: newcomer,gallery,premium,poll // sequence is important! they will be shown in same order that you add them to the list
$config['boxes'] = "newcomer,gallery"; // List: newcomer,gallery,premium,poll,highscores,networks
$config['boxes'] = "highscores,newcomer,gallery,networks,poll";
$config['network_facebook'] = 'tibia'; // leave empty to disable
$config['network_twitter'] = 'tibia'; // leave empty to disable
$config['background_image'] = "background-artwork-860.jpg"; $config['background_image'] = "background-artwork-860.jpg";
$config['logo_image'] = "tibia-logo-artwork-top.gif"; $config['logo_image'] = "tibia-logo-artwork-top.gif";
$config['gallery_image'] = 1; $config['gallery_image'] = 1;

View File

@ -0,0 +1,98 @@
.fb_hidden{position:absolute;top:-10000px;z-index:10001}
.fb_invisible{display:none}
.fb_reset{background:none;border:0;border-spacing:0;color:#000;cursor:auto;direction:ltr;font-family:"lucida grande", tahoma, verdana, arial, sans-serif;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:1;margin:0;overflow:visible;padding:0;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;visibility:visible;white-space:normal;word-spacing:normal}
.fb_reset > div{overflow:hidden}
.fb_link img{border:none}
.fb_dialog{background:rgba(82, 82, 82, .7);position:absolute;top:-10000px;z-index:10001}
.fb_dialog_advanced{padding:10px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}
.fb_dialog_content{background:#fff;color:#333}
.fb_dialog_close_icon{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 0 transparent;_background-image:url(http://static.ak.fbcdn.net/rsrc.php/v2/yL/r/s816eWC-2sl.gif);cursor:pointer;display:block;height:15px;position:absolute;right:18px;top:17px;width:15px;top:8px\9;right:7px\9}
.fb_dialog_mobile .fb_dialog_close_icon{top:5px;left:5px;right:auto}
.fb_dialog_padding{background-color:transparent;position:absolute;width:1px;z-index:-1}
.fb_dialog_close_icon:hover{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -15px transparent;_background-image:url(http://static.ak.fbcdn.net/rsrc.php/v2/yL/r/s816eWC-2sl.gif)}
.fb_dialog_close_icon:active{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -30px transparent;_background-image:url(http://static.ak.fbcdn.net/rsrc.php/v2/yL/r/s816eWC-2sl.gif)}
.fb_dialog_loader{background-color:#f2f2f2;border:1px solid #606060;font-size:24px;padding:20px}
.fb_dialog_top_left,
.fb_dialog_top_right,
.fb_dialog_bottom_left,
.fb_dialog_bottom_right{height:10px;width:10px;overflow:hidden;position:absolute}
.fb_dialog_top_left{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/ye/r/8YeTNIlTZjm.png) no-repeat 0 0;left:-10px;top:-10px}
.fb_dialog_top_right{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/ye/r/8YeTNIlTZjm.png) no-repeat 0 -10px;right:-10px;top:-10px}
.fb_dialog_bottom_left{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/ye/r/8YeTNIlTZjm.png) no-repeat 0 -20px;bottom:-10px;left:-10px}
.fb_dialog_bottom_right{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/ye/r/8YeTNIlTZjm.png) no-repeat 0 -30px;right:-10px;bottom:-10px}
.fb_dialog_vert_left,
.fb_dialog_vert_right,
.fb_dialog_horiz_top,
.fb_dialog_horiz_bottom{position:absolute;background:#525252;filter:alpha(opacity=70);opacity:.7}
.fb_dialog_vert_left,
.fb_dialog_vert_right{width:10px;height:100%}
.fb_dialog_vert_left{margin-left:-10px}
.fb_dialog_vert_right{right:0;margin-right:-10px}
.fb_dialog_horiz_top,
.fb_dialog_horiz_bottom{width:100%;height:10px}
.fb_dialog_horiz_top{margin-top:-10px}
.fb_dialog_horiz_bottom{bottom:0;margin-bottom:-10px}
.fb_dialog_iframe{line-height:0}
.fb_dialog_content .dialog_title{background:#6d84b4;border:1px solid #3b5998;color:#fff;font-size:14px;font-weight:bold;margin:0}
.fb_dialog_content .dialog_title > span{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/yd/r/Cou7n-nqK52.gif)
no-repeat 5px 50%;float:left;padding:5px 0 7px 26px}
body.fb_hidden{-webkit-transform:none;height:100%;margin:0;left:-10000px;overflow:visible;position:absolute;top:-10000px;width:100%
}
.fb_dialog.fb_dialog_mobile.loading{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/ya/r/3rhSv5V8j3o.gif)
white no-repeat 50% 50%;min-height:100%;min-width:100%;overflow:hidden;position:absolute;top:0;z-index:10001}
.fb_dialog.fb_dialog_mobile.loading.centered{max-height:590px;min-height:590px;max-width:500px;min-width:500px}
#fb-root #fb_dialog_ipad_overlay{background:rgba(0, 0, 0, .45);position:absolute;left:0;top:0;width:100%;min-height:100%;z-index:10000}
#fb-root #fb_dialog_ipad_overlay.hidden{display:none}
.fb_dialog.fb_dialog_mobile.loading iframe{visibility:hidden}
.fb_dialog_content .dialog_header{-webkit-box-shadow:white 0 1px 1px -1px inset;background:-webkit-gradient(linear, 0 0, 0 100%, from(#738ABA), to(#2C4987));border-bottom:1px solid;border-color:#1d4088;color:#fff;font:14px Helvetica, sans-serif;font-weight:bold;text-overflow:ellipsis;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0;vertical-align:middle;white-space:nowrap}
.fb_dialog_content .dialog_header table{-webkit-font-smoothing:subpixel-antialiased;height:43px;width:100%
}
.fb_dialog_content .dialog_header td.header_left{font-size:12px;padding-left:5px;vertical-align:middle;width:60px
}
.fb_dialog_content .dialog_header td.header_right{font-size:12px;padding-right:5px;vertical-align:middle;width:60px
}
.fb_dialog_content .touchable_button{background:-webkit-gradient(linear, 0 0, 0 100%, from(#4966A6),
color-stop(0.5, #355492), to(#2A4887));border:1px solid #29447e;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-webkit-box-shadow:rgba(0, 0, 0, .117188) 0 1px 1px inset,
rgba(255, 255, 255, .167969) 0 1px 0;display:inline-block;margin-top:3px;max-width:85px;line-height:18px;padding:4px 12px;position:relative}
.fb_dialog_content .dialog_header .touchable_button input{border:none;background:none;color:#fff;font:12px Helvetica, sans-serif;font-weight:bold;margin:2px -12px;padding:2px 6px 3px 6px;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0}
.fb_dialog_content .dialog_header .header_center{color:#fff;font-size:16px;font-weight:bold;line-height:18px;text-align:center;vertical-align:middle}
.fb_dialog_content .dialog_content{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/y9/r/jKEcVPZFk-2.gif) no-repeat 50% 50%;border:1px solid #555;border-bottom:0;border-top:0;height:150px}
.fb_dialog_content .dialog_footer{background:#f2f2f2;border:1px solid #555;border-top-color:#ccc;height:40px}
#fb_dialog_loader_close{float:left}
.fb_dialog.fb_dialog_mobile .fb_dialog_close_button{text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0}
.fb_dialog.fb_dialog_mobile .fb_dialog_close_icon{visibility:hidden}
.fb_iframe_widget{display:inline-block;position:relative}
.fb_iframe_widget span{display:inline-block;position:relative;text-align:justify}
.fb_iframe_widget iframe{position:absolute}
.fb_iframe_widget_lift{z-index:1}
.fb_hide_iframes iframe{position:relative;left:-10000px}
.fb_iframe_widget_loader{position:relative;display:inline-block}
.fb_iframe_widget_fluid{display:inline}
.fb_iframe_widget_fluid span{width:100%}
.fb_iframe_widget_loader iframe{min-height:32px;z-index:2;zoom:1}
.fb_iframe_widget_loader .FB_Loader{background:url(http://static.ak.fbcdn.net/rsrc.php/v2/y9/r/jKEcVPZFk-2.gif) no-repeat;height:32px;width:32px;margin-left:-16px;position:absolute;left:50%;z-index:4}
.fb_connect_bar_container div,
.fb_connect_bar_container span,
.fb_connect_bar_container a,
.fb_connect_bar_container img,
.fb_connect_bar_container strong{background:none;border-spacing:0;border:0;direction:ltr;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:1;margin:0;overflow:visible;padding:0;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;visibility:visible;white-space:normal;word-spacing:normal;vertical-align:baseline}
.fb_connect_bar_container{position:fixed;left:0 !important;right:0 !important;height:42px !important;padding:0 25px !important;margin:0 !important;vertical-align:middle !important;border-bottom:1px solid #333 !important;background:#3b5998 !important;z-index:99999999 !important;overflow:hidden !important}
.fb_connect_bar_container_ie6{position:absolute;top:expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px":body.scrollTop+"px")}
.fb_connect_bar{position:relative;margin:auto;height:100%;width:100%;padding:6px 0 0 0 !important;background:none;color:#fff !important;font-family:"lucida grande", tahoma, verdana, arial, sans-serif !important;font-size:13px !important;font-style:normal !important;font-variant:normal !important;font-weight:normal !important;letter-spacing:normal !important;line-height:1 !important;text-decoration:none !important;text-indent:0 !important;text-shadow:none !important;text-transform:none !important;white-space:normal !important;word-spacing:normal !important}
.fb_connect_bar a:hover{color:#fff}
.fb_connect_bar .fb_profile img{height:30px;width:30px;vertical-align:middle;margin:0 6px 5px 0}
.fb_connect_bar div a,
.fb_connect_bar span,
.fb_connect_bar span a{color:#bac6da;font-size:11px;text-decoration:none}
.fb_connect_bar .fb_buttons{float:right;margin-top:7px}
.fb_edge_widget_with_comment{position:relative;*z-index:1000}
.fb_edge_widget_with_comment span.fb_edge_comment_widget{position:absolute}
.fb_edge_widget_with_comment span.fb_send_button_form_widget{z-index:1}
.fb_edge_widget_with_comment span.fb_send_button_form_widget .FB_Loader{left:0;top:1px;margin-top:6px;margin-left:0;background-position:50% 50%;background-color:#fff;height:150px;width:394px;border:1px #666 solid;border-bottom:2px solid #283e6c;z-index:1}
.fb_edge_widget_with_comment span.fb_send_button_form_widget.dark .FB_Loader{background-color:#000;border-bottom:2px solid #ccc}
.fb_edge_widget_with_comment span.fb_send_button_form_widget.siderender
.FB_Loader{margin-top:0}
.fbpluginrecommendationsbarleft,
.fbpluginrecommendationsbarright{position:fixed !important;bottom:0;z-index:999}
.fbpluginrecommendationsbarleft{left:10px}
.fbpluginrecommendationsbarright{right:10px}

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -12,15 +12,23 @@ if(isset($config['boxes']))
<link href="<?php echo $template_path; ?>/basic.css" rel="stylesheet" type="text/css" /> <link href="<?php echo $template_path; ?>/basic.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="tools/basic.js"></script> <script type="text/javascript" src="tools/basic.js"></script>
<script type="text/javascript" src="<?php echo $template_path; ?>/ticker.js"></script> <script type="text/javascript" src="<?php echo $template_path; ?>/ticker.js"></script>
<script id="twitter-wjs" src="<?php echo $template_path; ?>/js/twitter.js"></script>
<script id="facebook-jssdk" async src="<?php echo $template_path; ?>/js/facebook.js"></script>
<link href="<?php echo $template_path; ?>/css/facebook.css" rel="stylesheet" type="text/css">
<script type="text/javascript"> <script type="text/javascript">
var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>"; var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>";
<?php <?php
if(PAGE != 'news') {
if(strpos(URI, 'subtopic=') !== false) { if(strpos(URI, 'subtopic=') !== false) {
$tmp = $_REQUEST['subtopic']; $tmp = $_REQUEST['subtopic'];
} }
else { else {
$tmp = str_replace('/', '', URI); $tmp = str_replace('/', '', URI);
} }
}
else {
$tmp = 'news';
}
?> ?>
var activeSubmenuItem="<?php echo $tmp; ?>"; var activeSubmenuItem="<?php echo $tmp; ?>";
var IMAGES="<?php echo $template_path; ?>/images"; var IMAGES="<?php echo $template_path; ?>/images";
@ -200,6 +208,54 @@ if(isset($config['boxes']))
</head> </head>
<body onBeforeUnLoad="SaveMenu();" onUnload="SaveMenu();"> <body onBeforeUnLoad="SaveMenu();" onUnload="SaveMenu();">
<?php echo template_place_holder('body_start'); ?> <?php echo template_place_holder('body_start'); ?>
<?php if(!empty($config['network_facebook'])) {?>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : 497232093667125, // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Event.subscribe('auth.login', function() {
var URLHelper = "?";
if (window.location.search.replace("?", "").length > 0) {
URLHelper = "&";
}
if (FB_TryLogin == 1) {
window.location = window.location + URLHelper + "step=facebooktrylogin&wasreloaded=1";
} else if (FB_TryLogin == 2) {
window.location = window.location + URLHelper + "page=facebooktrylogin&wasreloaded=1";
} else {
window.location = window.location + URLHelper + "wasreloaded=1";
}
});
FB.Event.subscribe('auth.logout', function(a_Response) {
if (a_Response.status !== 'connected') {
window.location.href=window.location.href;
} else {
/* nothing to do here*/
}
});
FB.Event.subscribe('auth.statusChange', function(response) {
if (FB_ForceReload == 1 && response.status == "connected") {
var URLHelper = "?";
if (window.location.search.replace("?", "").length > 0) {
URLHelper = "&";
}
window.location = window.location + URLHelper + "step=facebooktrylogin&wasreloaded=1";
}
});
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<?php } ?>
<div id="top"></div> <div id="top"></div>
<div id="ArtworkHelper" style="background-image:url(<?php echo $template_path; ?>/images/header/<?php echo $config['background_image']; ?>);" > <div id="ArtworkHelper" style="background-image:url(<?php echo $template_path; ?>/images/header/<?php echo $config['background_image']; ?>);" >
<div id="Bodycontainer"> <div id="Bodycontainer">
@ -269,7 +325,7 @@ foreach($config['menu_categories'] as $id => $cat) { ?>
<?php <?php
if(isset($menus[$id])) { if(isset($menus[$id])) {
foreach($menus[$id] as $category => $menu) { foreach($menus[$id] as $category => $menu) {
$is_external = strpos($menu['link'], 'http') !== false; $is_external = strpos(trim($menu['link']), 'http') === 0;
?> ?>
<a href='<?php echo $is_external ? $menu['link'] : getLink($menu['link']); ?>'<?php echo $is_external ? ' target="_blank"' : ''?>> <a href='<?php echo $is_external ? $menu['link'] : getLink($menu['link']); ?>'<?php echo $is_external ? ' target="_blank"' : ''?>>
<div id='submenu_<?php echo str_replace('/', '', $menu['link']); ?>' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'> <div id='submenu_<?php echo str_replace('/', '', $menu['link']); ?>' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
@ -353,56 +409,15 @@ foreach($config['menu_categories'] as $id => $cat) { ?>
</div> </div>
<div id="Themeboxes"> <div id="Themeboxes">
<?php if(in_array("newcomer", $config['boxes'])): ?>
<div id="NewcomerBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/newcomer/newcomerbox.gif);">
<a class="ThemeboxButton" href="<?php echo getLink('account/create'); ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);">
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div>
<div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_jointibia.gif);"></div>
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<?php endif; ?>
<?php if(in_array("premium", $config['boxes'])): ?>
<div id="PremiumBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/premium/premiumbox.gif);">
<a class="ThemeboxButton" href="<?php echo getLink('premium'); ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);">
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div>
<div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_getpremium.gif);"></div>
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<?php endif; ?>
<?php <?php
if(PAGE == 'news' && in_array("gallery", $config['boxes'])): foreach($config['boxes'] as $box) {
$query = $db->query('SELECT `thumb` FROM `' . TABLE_PREFIX . 'gallery` WHERE `id` = ' . $db->quote($config['gallery_image'])); $file = TEMPLATES . $template_name . '/boxes/' . $box . '.php';
if($query->rowCount() == 1): if(file_exists($file)) {
$image = $query->fetch(); include($file); ?>
?>
<div id="GalleryBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/gallery/gallerybox.gif);">
<a href="?subtopic=gallery&image=<?php echo $config['gallery_image']; ?>" >
<img id="GalleryContent" class="ThemeboxContent" src="<?php echo $image['thumb']; ?>" alt="Screenshot of the Day" />
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if(PAGE == 'news' && in_array("poll", $config['boxes'])):
$poll = $db->query('SELECT id, question FROM '.$db->tableName(TABLE_PREFIX . 'polls') . ' WHERE end > ' . time() . ' ORDER BY end LIMIT 1');
if($poll->rowCount() > 0)
{
$poll = $poll->fetch();
?>
<div id="CurrentPollBox" class="Themebox" style="background-image:url(<?php echo $template_path; ?>/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText"><?php echo $poll['question']; ?></div>
<a class="ThemeboxButton" href="<?php echo getLink('polls') . '&id=' . $poll['id']; ?>" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif);">
<div class="BigButtonOver" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif);"></div>
<div class="ButtonText" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/_sbutton_votenow.gif);"></div>
</a>
<div class="Bottom" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);"></div>
</div>
<?php <?php
} }
endif; ?> }
<br/><br/> ?>
<?php <?php
if($config['template_allow_change']) if($config['template_allow_change'])
echo '<font color="white">Template:</font><br/>' . template_form(); echo '<font color="white">Template:</font><br/>' . template_form();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,45 @@
<div id="FeaturedArticle" class="Box">
<div class="Corner-tl" style="background-image:url({{ template_path }}/images/content/corner-tl.gif);"></div>
<div class="Corner-tr" style="background-image:url({{ template_path }}/images/content/corner-tr.gif);"></div>
<div class="Border_1" style="background-image:url({{ template_path }}/images/content/border-1.gif);"></div>
<div class="BorderTitleText" style="background-image:url({{ template_path }}/images/content/title-background-green.gif);"></div>
<img id="ContentBoxHeadline" class="Title" src="{{ template_path }}/images/header/headline-featuredarticle.gif" alt="Contentbox headline" />
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent" style="background-image:url({{ template_path }}/images/content/scroll.gif);">
<div id="TeaserThumbnail">
{% if article.read_more is not empty %}<a href="{{ article.read_more }}">{% endif %}
<img src="{{ article.image }}" width="150" height="100" border=0 alt="" />
{% if article.read_more is not empty %}</a>{% endif %}
</div>
{% if article.read_more is not empty %}
<a id="Link" href="{{ article.read_more }}">&raquo; read more</a>
{% endif %}
<div id="TeaserText">
<div style="position: relative; top: -2px; margin-bottom: 2px;">
<b>
<p>{{ article.title|raw }}
{% if canEdit %}
<a href="?subtopic=news&action=edit&id={{ article.id }}" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="?subtopic=news&action=delete&id={{ article.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a href="?subtopic=news&action=hide&id={{ article.id }}" title="{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if article.hidden != 1 %}success{% else %}error{% endif %}.png"/>
{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
{% endif %}
</p>
</b>
</div>
{{ article.text|raw }}
</div>
</div>
</div>
</div>
<div class="Border_1" style="background-image:url({{ template_path }}/images/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url({{ template_path }}/images/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url({{ template_path }}/images/content/corner-br.gif);"></div></div>
</div>