slawkens 5e414ebda8 * added news ticker for kathrine template
* (internal) moved news tickers to twig template
* (internal) moved Forum class to separate file
* (internal) moved deprecated functions to compat.php
2017-10-25 09:50:12 +02:00

425 lines
21 KiB
PHP

<?php
defined('MYAAC') or die('Direct access not allowed!');
if(isset($config['boxes']))
$config['boxes'] = explode(",", $config['boxes']);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo template_place_holder('head_start'); ?>
<link rel="shortcut icon" href="<?php echo $template_path; ?>/images/favicon.ico" type="image/x-icon" />
<link rel="icon" href="<?php echo $template_path; ?>/images/favicon.ico" type="image/x-icon" />
<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="<?php echo $template_path; ?>/ticker.js"></script>
<script type="text/javascript">
var loginStatus="<?php echo ($logged ? 'true' : 'false'); ?>";
<?php
if(strpos(URI, 'subtopic=') !== false) {
$tmp = $_REQUEST['subtopic'];
}
else {
$tmp = str_replace('/', '', URI);
}
?>
var activeSubmenuItem="<?php echo $tmp; ?>";
var IMAGES="<?php echo $template_path; ?>/images";
var LINK_ACCOUNT="<?php echo BASE_URL; ?>";
function rowOverEffect(object) {
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
function InitializePage() {
LoadLoginBox();
LoadMenu();
}
// initialisation of the loginbox status by the value of the variable 'loginStatus' which is provided to the HTML-document by PHP in the file 'header.inc'
function LoadLoginBox()
{
if(loginStatus == "false") {
document.getElementById('LoginstatusText_1').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-you-are-not-logged-in.gif')";
document.getElementById('ButtonText').style.backgroundImage = "url('" + IMAGES + "/global/buttons/_sbutton_login.gif')";
document.getElementById('LoginstatusText_2').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-create-account.gif')";
document.getElementById('LoginstatusText_2_1').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-create-account.gif')";
document.getElementById('LoginstatusText_2_2').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-create-account-over.gif')";
} else {
document.getElementById('LoginstatusText_1').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-welcome.gif')";
document.getElementById('ButtonText').style.backgroundImage = "url('" + IMAGES + "/global/buttons/_sbutton_myaccount.gif')";
document.getElementById('LoginstatusText_2').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-logout.gif')";
document.getElementById('LoginstatusText_2_1').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-logout.gif')";
document.getElementById('LoginstatusText_2_2').style.backgroundImage = "url('" + IMAGES + "/loginbox/loginbox-font-logout-over.gif')";
}
}
// mouse-over and click events of the loginbox
function MouseOverLoginBoxText(source)
{
source.lastChild.style.visibility = "visible";
source.firstChild.style.visibility = "hidden";
}
function MouseOutLoginBoxText(source)
{
source.firstChild.style.visibility = "visible";
source.lastChild.style.visibility = "hidden";
}
function LoginButtonAction()
{
if(loginStatus == "false") {
window.location = "<?php echo getLink('account/manage'); ?>";
} else {
window.location = "<?php echo getLink('account/manage'); ?>";
}
}
function LoginstatusTextAction(source) {
if(loginStatus == "false") {
window.location = "<?php echo getLink('account/create'); ?>";
} else {
window.location = "<?php echo getLink('account/logout'); ?>";
}
}
var menu = new Array();
menu[0] = new Object();
var unloadhelper = false;
// load the menu and set the active submenu item by using the variable 'activeSubmenuItem'
function LoadMenu()
{
document.getElementById("submenu_"+activeSubmenuItem).style.color = "white";
document.getElementById("ActiveSubmenuItemIcon_"+activeSubmenuItem).style.visibility = "visible";
if(self.name.lastIndexOf("&") == -1) {
self.name = "news=1&account=0&community=0&library=0&forum=0<?php if($config['gifts_system']) echo '&shops=0'; ?>&";
}
FillMenuArray();
InitializeMenu();
}
function SaveMenu()
{
if(unloadhelper == false) {
SaveMenuArray();
unloadhelper = true;
}
}
// store the values of the variable 'self.name' in the array menu
function FillMenuArray()
{
while(self.name.length > 0 ){
var mark1 = self.name.indexOf("=");
var mark2 = self.name.indexOf("&");
var menuItemName = self.name.substr(0, mark1);
menu[0][menuItemName] = self.name.substring(mark1 + 1, mark2);
self.name = self.name.substr(mark2 + 1, self.name.length);
}
}
// hide or show the corresponding submenus
function InitializeMenu()
{
for(menuItemName in menu[0]) {
if(menu[0][menuItemName] == "0") {
document.getElementById(menuItemName+"_Submenu").style.visibility = "hidden";
document.getElementById(menuItemName+"_Submenu").style.display = "none";
document.getElementById(menuItemName+"_Lights").style.visibility = "visible";
document.getElementById(menuItemName+"_Extend").style.backgroundImage = "url(" + IMAGES + "/general/plus.gif)";
}
else {
document.getElementById(menuItemName+"_Submenu").style.visibility = "visible";
document.getElementById(menuItemName+"_Submenu").style.display = "block";
document.getElementById(menuItemName+"_Lights").style.visibility = "hidden";
document.getElementById(menuItemName+"_Extend").style.backgroundImage = "url(" + IMAGES + "/general/minus.gif)";
}
}
}
// reconstruct the variable "self.name" out of the array menu
function SaveMenuArray()
{
var stringSlices = "";
var temp = "";
for(menuItemName in menu[0]) {
stringSlices = menuItemName + "=" + menu[0][menuItemName] + "&";
temp = temp + stringSlices;
}
self.name = temp;
}
// onClick open or close submenus
function MenuItemAction(sourceId)
{
if(menu[0][sourceId] == 1) {
CloseMenuItem(sourceId);
}
else {
OpenMenuItem(sourceId);
}
}
function OpenMenuItem(sourceId)
{
menu[0][sourceId] = 1;
document.getElementById(sourceId+"_Submenu").style.visibility = "visible";
document.getElementById(sourceId+"_Submenu").style.display = "block";
document.getElementById(sourceId+"_Lights").style.visibility = "hidden";
document.getElementById(sourceId+"_Extend").style.backgroundImage = "url(" + IMAGES + "/general/minus.gif)";
}
function CloseMenuItem(sourceId)
{
menu[0][sourceId] = 0;
document.getElementById(sourceId+"_Submenu").style.visibility = "hidden";
document.getElementById(sourceId+"_Submenu").style.display = "none";
document.getElementById(sourceId+"_Lights").style.visibility = "visible";
document.getElementById(sourceId+"_Extend").style.backgroundImage = "url(" + IMAGES + "/general/plus.gif)";
}
// mouse-over effects of menubuttons and submenuitems
function MouseOverMenuItem(source)
{
source.firstChild.style.visibility = "visible";
}
function MouseOutMenuItem(source)
{
source.firstChild.style.visibility = "hidden";
}
function MouseOverSubmenuItem(source)
{
source.style.backgroundColor = "#14433F";
}
function MouseOutSubmenuItem(source)
{
source.style.backgroundColor = "#0D2E2B";
}
</script>
<?php echo template_place_holder('head_end'); ?>
</head>
<body onBeforeUnLoad="SaveMenu();" onUnload="SaveMenu();">
<?php echo template_place_holder('body_start'); ?>
<div id="top"></div>
<div id="ArtworkHelper" style="background-image:url(<?php echo $template_path; ?>/images/header/<?php echo $config['background_image']; ?>);" >
<div id="Bodycontainer">
<div id="ContentRow">
<div id="MenuColumn">
<div id="LeftArtwork">
<img id="Statue_1" src="<?php echo $template_path; ?>/images/header/animated-statue.gif" alt="logoartwork" />
<img id="TibiaLogoArtworkTop" src="<?php echo $template_path; ?>/images/header/<?php echo $config['logo_image']; ?>" onClick="window.location = '<?php echo getLink('news')?>';" alt="logoartwork" />
<img id="TibiaLogoArtworkBottom" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-bottom.gif" alt="logoartwork" />
<img id="Statue_2" src="<?php echo $template_path; ?>/images/header/animated-statue.gif" alt="logoartwork" />
<img id="LogoLink" src="<?php echo $template_path; ?>/images/header/tibia-logo-artwork-string.gif" onClick="window.location = 'mailto:<?php echo $config['lua']['ownerEmail']; ?>';" alt="logoartwork" />
</div>
<div id="Loginbox" >
<div id="LoginTop" style="background-image:url(<?php echo $template_path; ?>/images/general/box-top.gif)" ></div>
<div id="BorderLeft" class="LoginBorder" style="background-image:url(<?php echo $template_path; ?>/images/general/chain.gif)" ></div>
<div class="Loginstatus" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-textfield-background.gif)" >
<div id="LoginstatusText_1" class="LoginstatusText" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-font-you-are-not-logged-in.gif)" ></div>
</div>
<div id="LoginButtonContainer" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-textfield-background.gif)" >
<div id="LoginButton" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton.gif)" >
<div onClick="LoginButtonAction();" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);"><div class="Button" style="background-image:url(<?php echo $template_path; ?>/images/global/buttons/sbutton_over.gif)" ></div>
<?php
echo '<div id="ButtonText" '.($logged ? '' : 'style="background-image:url('.$template_path.'/images/global/buttons/_sbutton_login.gif)"').'>
</div>';
?>
</div>
</div>
</div>
<div style="clear:both" ></div>
<div class="Loginstatus" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-textfield-background.gif)" >
<div id="LoginstatusText_2" onClick="LoginstatusTextAction(this);" onMouseOver="MouseOverLoginBoxText(this);" onMouseOut="MouseOutLoginBoxText(this);" ><div id="LoginstatusText_2_1" class="LoginstatusText" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-font-create-account.gif)" ></div><div id="LoginstatusText_2_2" class="LoginstatusText" style="background-image:url(<?php echo $template_path; ?>/images/loginbox/loginbox-font-create-account-over.gif)" ></div></div>
</div>
<div id="BorderRight" class="LoginBorder" style="background-image:url(<?php echo $template_path; ?>/images/general/chain.gif)" ></div>
<div id="LoginBottom" class="Loginstatus" style="background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif)" ></div>
</div>
<div-- id='Menu'>
<div id='MenuTop' style='background-image:url(<?php echo $template_path; ?>/images/general/box-top.gif);'></div>
<?php
$menus = get_template_menus();
foreach($config['menu_categories'] as $id => $cat) { ?>
<div id='<?php echo $cat['id']; ?>' class='menuitem'>
<span onClick="MenuItemAction('<?php echo $cat['id']; ?>')">
<div class='MenuButton' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background.gif);'>
<div onMouseOver='MouseOverMenuItem(this);' onMouseOut='MouseOutMenuItem(this);'><div class='Button' style='background-image:url(<?php echo $template_path; ?>/images/menu/button-background-over.gif);'></div>
<span id='<?php echo $cat['id']; ?>_Lights' class='Lights'>
<div class='light_lu' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div>
<div class='light_ld' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div>
<div class='light_ru' style='background-image:url(<?php echo $template_path; ?>/images/menu/green-light.gif);'></div>
</span>
<div id='<?php echo $cat['id']; ?>_Icon' class='Icon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-<?php echo $cat['id']; ?>.gif);'></div>
<div id='<?php echo $cat['id']; ?>_Label' class='Label' style='background-image:url(<?php echo $template_path; ?>/images/menu/label-<?php echo $cat['id']; ?>.gif);'></div>
<div id='<?php echo $cat['id']; ?>_Extend' class='Extend' style='background-image:url(<?php echo $template_path; ?>/images/general/plus.gif);'></div>
</div>
</div>
</span>
<div id='<?php echo $cat['id']; ?>_Submenu' class='Submenu'>
<?php
if(isset($menus[$id])) {
foreach($menus[$id] as $category => $menu) {
$is_external = strpos($menu['link'], 'http') !== false;
?>
<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 class='LeftChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
<div id='ActiveSubmenuItemIcon_<?php echo str_replace('/', '', $menu['link']); ?>' class='ActiveSubmenuItemIcon' style='background-image:url(<?php echo $template_path; ?>/images/menu/icon-activesubmenu.gif);'></div>
<div class='SubmenuitemLabel'><?php echo $menu['name']; ?></div>
<div class='RightChain' style='background-image:url(<?php echo $template_path; ?>/images/general/chain.gif);'></div>
</div>
</a>
<?php
}
}
?>
</div>
<?php
if($id == MENU_CATEGORY_SHOP) {
?>
<div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div>
<?php
}
?>
</div>
<?php
}
?>
}
?>
<script type="text/javascript">
InitializePage();
</script>
</div>
<div id="ContentColumn">
<div class="Content">
<div id="ContentHelper">
<?php echo tickers(); ?>
<div id="<?php echo PAGE; ?>" class="Box">
<div class="Corner-tl" style="background-image:url(<?php echo $template_path; ?>/images/content/corner-tl.gif);"></div>
<div class="Corner-tr" style="background-image:url(<?php echo $template_path; ?>/images/content/corner-tr.gif);"></div>
<div class="Border_1" style="background-image:url(<?php echo $template_path; ?>/images/content/border-1.gif);"></div>
<div class="BorderTitleText" style="background-image:url(<?php echo $template_path; ?>/images/content/title-background-green.gif);"></div>
<?php
$headline = $template_path.'/images/header/headline-' . PAGE . '.gif';
if(!file_exists($headline))
$headline = $template_path . '/headline.php?t=' . ucfirst($title);
?>
<img class="Title" src="<?php echo $headline; ?>" alt="Contentbox headline" />
<div class="Border_2">
<div class="Border_3">
<?php $hooks->trigger(HOOK_TIBIACOM_BORDER_3); ?>
<div class="BoxContent" style="background-image:url(<?php echo $template_path; ?>/images/content/scroll.gif);">
<?php echo template_place_holder('center_top') . $content; ?>
</div>
</div>
</div>
<div class="Border_1" style="background-image:url(<?php echo $template_path; ?>/images/content/border-1.gif);"></div>
<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url(<?php echo $template_path; ?>/images/content/corner-bl.gif);"></div></div>
<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url(<?php echo $template_path; ?>/images/content/corner-br.gif);"></div></div>
</div>
</div>
</div>
<div id="Footer"><?php echo template_footer(); ?><br/>Layout by CipSoft GmbH.</div>
</div>
<div id="ThemeboxesColumn">
<div id="RightArtwork">
<?php
//$tmp_link =
//if($config['friendly_urls'])
?>
<img id="Monster" src="images/monsters/<?php echo logo_monster() ?>.gif" onClick="window.location = '?subtopic=creatures&creature=<?php echo $config['logo_monster'] ?>';" alt="Monster of the Week" />
<img id="PedestalAndOnline" src="<?php echo $template_path; ?>/images/header/pedestal-and-online.gif" alt="Monster Pedestal and Players Online Box"/>
<div id="PlayersOnline" onClick="window.location = '<?php echo getLink('online'); ?>'">
<?php
if($status['online'])
echo '<div id="players" style="display: inline;">' . $status['players'] . '</div><br>Players Online';
else
echo '<font color="red"><b>Server<br />OFFLINE</b></font>';
?></div>
</div>
<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
if(PAGE == 'news' && in_array("gallery", $config['boxes'])):
$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>
<?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
}
endif; ?>
<br/><br/>
<?php
if($config['template_allow_change'])
echo '<font color="white">Template:</font><br/>' . template_form();
?>
</div>
</div>
</div>
</div>
</div>
<?php echo template_place_holder('body_end'); ?>
</body>
</html>
<?php
function logo_monster()
{
global $config;
return str_replace(" ", "", trim(mb_strtolower($config['logo_monster'])));
}
?>