Changeset 47


Ignore:
Timestamp:
Aug 19, 2007, 4:58:14 PM (17 years ago)
Author:
george
Message:

Listování stránek u aktualit.
Zjednodušení generování hlavního menu do funkcí.
Doplnění položek konfigurace.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • config.sample.php

    r45 r47  
    1919  ),
    2020  'Web' => array(
    21     'Charset' => 'windows-1250',
    22     'BaseURL' => '/',
    23     'WoWServerAddr' => 'localhost',
    24     'ServerName' => 'Heroes of Fantasy',
    25     'ServerAdmin' => 'Chronos', 
     21    'Charset' => 'iso-8859-2',
     22    'BaseURL' => 'http://localhost/dev/wow/wow-web/',
     23    'Description' => 'Neoficiální herní server hry World of Warcraft',
     24    'WoWServerAddr' => 'wow.zdechov.net',
     25    'Title' => 'Heroes of Fantasy',
     26    'Admin' => 'Chronos',
     27    'AdminEmail' => 'wow@zdechov.net',
    2628  ),
    2729);
  • css/global_js.php

    r18 r47  
    11<?php
    2 include('../config.php');
     2include('../global.php');
    33?>
    44
     
    2222
    2323<?php
    24 echo('imgsrc = new Array();
    25 imgsrc[1] = "'.$BaseUrl.'images/home.jpg";
    26 imgsrc[2] = "'.$BaseUrl.'images/home2.jpg";
    27 imgsrc[3] = "'.$BaseUrl.'images/donate.jpg";
    28 imgsrc[4] = "'.$BaseUrl.'images/donate2.jpg";
    29 imgsrc[5] = "'.$BaseUrl.'images/download.jpg";
    30 imgsrc[6] = "'.$BaseUrl.'images/download2.jpg";
    31 imgsrc[7] = "'.$BaseUrl.'images/forum.jpg";
    32 imgsrc[8] = "'.$BaseUrl.'images/forum2.jpg";
    33 imgsrc[9] = "'.$BaseUrl.'images/guilds.jpg";
    34 imgsrc[10] = "'.$BaseUrl.'images/guilds2.jpg";
    35 imgsrc[11] = "'.$BaseUrl.'images/honor.jpg";
    36 imgsrc[12] = "'.$BaseUrl.'images/honor2.jpg";
    37 imgsrc[13] = "'.$BaseUrl.'images/how.jpg";
    38 imgsrc[14] = "'.$BaseUrl.'images/how2.jpg";
    39 imgsrc[15] = "'.$BaseUrl.'images/link.jpg";
    40 imgsrc[16] = "'.$BaseUrl.'images/link2.jpg";
    41 imgsrc[17] = "'.$BaseUrl.'images/mapa.jpg";
    42 imgsrc[18] = "'.$BaseUrl.'images/mapa2.jpg";
    43 imgsrc[19] = "'.$BaseUrl.'images/online_player.jpg";
    44 imgsrc[20] = "'.$BaseUrl.'images/online_player2.jpg";
    45 imgsrc[21] = "'.$BaseUrl.'images/povolani.jpg";
    46 imgsrc[22] = "'.$BaseUrl.'images/povolani2.jpg";
    47 imgsrc[23] = "'.$BaseUrl.'images/profese.jpg";
    48 imgsrc[24] = "'.$BaseUrl.'images/profese2.jpg";
    49 imgsrc[25] = "'.$BaseUrl.'images/rasy.jpg";
    50 imgsrc[26] = "'.$BaseUrl.'images/rasy2.jpg";
    51 imgsrc[27] = "'.$BaseUrl.'images/registrace.jpg";
    52 imgsrc[28] = "'.$BaseUrl.'images/registrace2.jpg";
    53 imgsrc[29] = "'.$BaseUrl.'images/server.jpg";
    54 imgsrc[30] = "'.$BaseUrl.'images/server2.jpg";
    55 ');
     24echo('imgsrc = new Array();');
     25foreach($Menu as $Index => $MenuItem)
     26{
     27  echo('imgsrc['.($Index*2+1).'] = "'.$Config['Web']['BaseURL'].'images/'.$MenuItem[2].'.jpg";');
     28  echo('imgsrc['.($Index*2+2).'] = "'.$Config['Web']['BaseURL'].'images/'.$MenuItem[2].'2.jpg";'); 
     29}
     30
    5631?>
    5732
  • global.php

    r27 r47  
    88$Database->Prefix = $Config['Database']['Prefix'];
    99$Database->charset($Config['Database']['Charset']);
     10
     11$Menu = array(
     12  array('index.php', 'Home', 'home'),
     13  array('server.php', 'Server', 'server'),
     14  array('finance/', 'Finance', 'donate'),
     15  array('download_soubory/', 'Stahování', 'download'),
     16  array('jak_zacit.php', 'Jak zaèít', 'how'),
     17  array('link.php', 'Odkazy', 'link'),
     18  array('mapa.php', 'Mapa', 'mapa'),
     19  array('guild.php', 'Seznam guild', 'guilds'),
     20  array('forum/', 'Diskusní fórum', 'forum'),
     21  array('minimanager/register.php', 'Registrace', 'registrace'),
     22  array('online_player.php', 'Online hráèi', 'online_player'),
     23  array('honor.php', 'Tabulka cti', 'honor'),
     24  array('Death%20Dealers%20Hratelne%20Rasy.php', 'Rasy', 'rasy'),
     25  array('Death%20Dealers%20Povolani.php', 'Povolání', 'povolani'),
     26  array('Death%20Dealers%20Profese.php', 'Profese', 'profese'),
     27);
    1028
    1129function HumanDate($DateTime)
     
    91109}
    92110
     111function GenerateMenu()
     112{
     113  global $Config, $Menu;
     114  $Result = '';
     115  foreach($Menu as $Index => $MenuItem)
     116  {
     117    $Result .= '<a href="'.$Config['Web']['BaseURL'].$MenuItem[0].'" onMouseOver="swtch(&quot;'.($Index*2+2).'&quot;,&quot;'.$MenuItem[2].'&quot;)" onMouseOut="swtch(&quot;'.($Index*2+1).'&quot;,&quot;'.$MenuItem[2].'&quot;)"><IMG SRC="'.$Config['Web']['BaseURL'].'images/'.$MenuItem[2].'.jpg" name="'.$MenuItem[2].'" alt="'.$MenuItem[1].'" border="0"></A>';
     118  }
     119  return($Result);
     120}
     121
    93122function ShowHeader()
    94123{
    95   global $Charset, $BaseUrl;
     124  global $Config;
    96125  echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    97126<HTML>
    98127<HEAD>
    99128  <META http-equiv="Content-Language" content="cs">
    100   <META http-equiv="Content-Type" content="text/html; charset='.$Charset.'">
     129  <META http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'">
    101130  <META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
    102131  <link rel="SHORTCUT ICON" href="images/favicon.ico">
     132  <link rel="alternate" title="RSS aktuality" href="rss.php" type="application/rss+xml">
    103133  <TITLE>WoW server Heroes of Fantasy</TITLE>
    104   <style type="text/css" media="screen">@import url('.$BaseUrl.'css/style.css);</style>
    105   <script language="JavaScript" type="text/javascript" src="'.$BaseUrl.'css/global_js.php"></script>
     134  <style type="text/css" media="screen">@import url('.$Config['Web']['BaseURL'].'css/style.css);</style>
     135  <script language="JavaScript" type="text/javascript" src="'.$Config['Web']['BaseURL'].'css/global_js.php"></script>
    106136</HEAD> 
    107137<BODY text="#cccccc">
     
    117147  ShowOnlinePlayerCount();
    118148 
    119 echo('</div>
    120 <a href="'.$BaseUrl.'index.php" onMouseOver="swtch(&quot;2&quot;,&quot;home&quot;)" onMouseOut="swtch(&quot;1&quot;,&quot;home&quot;)"><IMG SRC="'.$BaseUrl.'images/home.jpg" name="home" alt="Home" border="0"></A>
    121 <a href="'.$BaseUrl.'server.php" onMouseOver="swtch(&quot;30&quot;,&quot;Server&quot;)" onMouseOut="swtch(&quot;29&quot;,&quot;Server&quot;)"><IMG SRC="'.$BaseUrl.'images/server.jpg" name="Server" alt="Server" border="0"></A>
    122 <a href="'.$BaseUrl.'finance/" onMouseOver="swtch(&quot;4&quot;,&quot;donate&quot;)" onMouseOut="swtch(&quot;3&quot;,&quot;donate&quot;)"><IMG SRC="'.$BaseUrl.'images/donate.jpg" alt="donate" name="donate" border="0"></A>
    123 <a href="'.$BaseUrl.'download_soubory/" onMouseOver="swtch(&quot;6&quot;,&quot;download&quot;)" onMouseOut="swtch(&quot;5&quot;,&quot;download&quot;)"><IMG SRC="'.$BaseUrl.'images/download.jpg" alt="download" name="download" border="0"></A>
    124 <a href="'.$BaseUrl.'jak_zacit.php" onMouseOver="swtch(&quot;14&quot;,&quot;how&quot;)" onMouseOut="swtch(&quot;13&quot;,&quot;how&quot;)"><IMG SRC="'.$BaseUrl.'images/how.jpg" alt="how" name="how" border="0"></A>
    125 <a href="'.$BaseUrl.'link.php" onMouseOver="swtch(&quot;16&quot;,&quot;link&quot;)" onMouseOut="swtch(&quot;15&quot;,&quot;link&quot;)"><IMG SRC="'.$BaseUrl.'images/link.jpg" alt="link" name="link" border="0"></A>
    126 <a href="'.$BaseUrl.'mapa.php" onMouseOver="swtch(&quot;18&quot;,&quot;mapa&quot;)" onMouseOut="swtch(&quot;17&quot;,&quot;mapa&quot;)"><IMG SRC="'.$BaseUrl.'images/mapa.jpg" alt="mapa" name="mapa" border="0"></A>
    127 <a href="'.$BaseUrl.'guildy.php" onMouseOver="swtch(&quot;10&quot;,&quot;guildy&quot;)" onMouseOut="swtch(&quot;9&quot;,&quot;guildy&quot;)"><IMG SRC="'.$BaseUrl.'images/guilds.jpg" alt="guildy" name="guildy" border="0"></A>
    128 <a href="'.$BaseUrl.'forum/" onMouseOver="swtch(&quot;8&quot;,&quot;Forum&quot;)" onMouseOut="swtch(&quot;7&quot;,&quot;Forum&quot;)"><IMG SRC="'.$BaseUrl.'images/forum.jpg" alt="Forum" name="Forum" border="0"></A>
    129 <a href="'.$BaseUrl.'minimanager/register.php" onMouseOver="swtch(&quot;28&quot;,&quot;registrace&quot;)" onMouseOut="swtch(&quot;27&quot;,&quot;registrace&quot;)"><IMG SRC="'.$BaseUrl.'images/registrace.jpg" alt="registrace" name="registrace" border="0"></A>
    130 <a href="'.$BaseUrl.'online_player.php" onMouseOver="swtch(&quot;20&quot;,&quot;online_player&quot;)" onMouseOut="swtch(&quot;19&quot;,&quot;online_player&quot;)"><IMG SRC="'.$BaseUrl.'images/online_player.jpg" alt="online player" name="online_player" border="0"></A>
    131 <a href="'.$BaseUrl.'honor.php" onMouseOver="swtch(&quot;12&quot;,&quot;honor&quot;)" onMouseOut="swtch(&quot;11&quot;,&quot;honor&quot;)"><IMG SRC="'.$BaseUrl.'images/honor.jpg" alt="honor" name="honor" border="0"></A>
    132 <a href="'.$BaseUrl.'Death%20Dealers%20Hratelne%20Rasy.php" onMouseOver="swtch(&quot;26&quot;,&quot;Rasy&quot;)" onMouseOut="swtch(&quot;25&quot;,&quot;Rasy&quot;)"><IMG SRC="'.$BaseUrl.'images/rasy.jpg" alt="Rasy" name="Rasy" border="0"></A>
    133 <a href="'.$BaseUrl.'Death%20Dealers%20Povolani.php" onMouseOver="swtch(&quot;22&quot;,&quot;Povolani&quot;)" onMouseOut="swtch(&quot;21&quot;,&quot;Povolani&quot;)"><IMG SRC="'.$BaseUrl.'images/povolani.jpg" alt="Povolani" name="Povolani" border="0"></A>
    134 <a href="'.$BaseUrl.'Death%20Dealers%20Profese.php" onMouseOver="swtch(&quot;24&quot;,&quot;profese&quot;)" onMouseOut="swtch(&quot;23&quot;,&quot;profese&quot;)"><IMG SRC="'.$BaseUrl.'images/profese.jpg" alt="profese" name="profese" border="0"></A>');
    135 
    136 
    137 /*
    138 echo('<TABLE width="220" border="1" align="center">
    139 <TR><TD width="15%" valign="top">
    140 <P class="pAktuality">
    141 <A class="aAktuality" href="/VsechnyA.php"><i>Aktuality:</i></a>
    142 ');
    143 
    144 include('aktuality.php');
    145 */
     149
     150echo('</div>');
     151
     152echo(GenerateMenu());
    146153
    147154echo('<A HREF="http://www.toplist.cz/" target="_blank"><IMG alt="pocitadlo"
     
    156163function ShowFooter()
    157164{
    158   global $BaseUrl;
     165  global $Config;
    159166  echo('</div>
    160167    </td>
     
    165172       <I class="Paticka">
    166173   <A href="administrace/" class="Paticka">#</A>
    167       | Správce serveru: Chronos | Email: wow@zdechov.net | Poèet pøístupù: <A HREF="http://counter.cnw.cz/" TARGET=_parent>
     174      | Správce serveru: '.$Config['Web']['Admin'].' | Email: '.$Config['Web']['AdminEmail'].' | Poèet pøístupù: <A HREF="http://counter.cnw.cz/" TARGET=_parent>
    168175      <IMG SRC="http://counter.cnw.cz/monika.cgi?wowzdechov&amp;5&amp;000000&amp;FFFFFF&amp;on" BORDER=0 ALT="CNW:Counter"></A><SCRIPT type="JavaScript">
    169176      <!--
  • index.php

    r28 r47  
    1919
    2020<?php
    21 ShowNews();
     21echo(ShowNews());
    2222?>
    2323</td><td id="EmuInfo" valign="top">
  • news.php

    r16 r47  
    66{
    77  global $Database;
    8   echo('<strong>Aktuality:</strong>');
    9   echo('<div style="NewsTable">');
     8  $ItemPerPage = 6;
     9  if(array_key_exists('Page', $_GET)) $Page = $Database->real_escape_string($_GET['Page']); else $Page = 0;
    1010  $Database->select_db('wow');
    11   $Result = $Database->query('SELECT news.*, user.User as username FROM news JOIN user ON user.ID=news.user WHERE 1 ORDER BY time DESC LIMIT 6');
    12   while($Row = $Result->fetch_array())
     11  $DbResult = $Database->query('SELECT COUNT(*) FROM news');
     12  $Total = $DbResult->fetch_array();
     13  $Total = $Total[0];
     14 
     15  $Result = '<strong>Aktuality:</strong>';
     16  $Result .= '<div style="NewsTable">';
     17  $DbResult = $Database->query('SELECT news.*, user.User as username FROM news JOIN user ON user.ID=news.user WHERE 1 ORDER BY time DESC LIMIT '.($Page * $ItemPerPage).','.$ItemPerPage);
     18  while($Row = $DbResult->fetch_array())
    1319  {
    14     echo('<div class="NewsItem">');
     20    $Result .= '<div class="NewsItem">';
    1521    if($Row['long_text'] != '') $Row['title'] = '<a href="?new_id='.$Row['id'].'">'.$Row['title'].'</a>';
    16     echo('<div class="NewsItemTitle"><strong>'.$Row['title'].'</strong> ('.HumanDate($Row['time']).')</div>')
    17     echo($Row['short_text'].' ('.$Row['username'].')</div>');
     22    $Result .= '<div class="NewsItemTitle"><strong>'.$Row['title'].'</strong> ('.HumanDate($Row['time']).')</div>'
     23    $Result .= $Row['short_text'].' ('.$Row['username'].')</div>';
    1824  }
    19   echo('</div>');
     25  $Result .= '</div>';
     26  $Result .= PagesList('?Page=', $Page, $Total, $ItemPerPage);
     27  return($Result);
    2028}
    2129
  • stat/stat.php

    r44 r47  
    1111$RealmDatabase = 'realmd';  // must contains zone_coordinates and accounts table
    1212$EmuVersion = $Config['Mangos']['Version'];
    13 $Owner = $Config['Web']['ServerAdmin'];
    14 $ServerName = $Config['Web']['ServerName'];
     13$Owner = $Config['Web']['Admin'];
     14$ServerName = $Config['Web']['Title'];
    1515$DatabaseEncoding = 'utf8';
    1616
Note: See TracChangeset for help on using the changeset viewer.