コード例 #1
0
ファイル: message.php プロジェクト: Yoyoyozo/webDiplomacy
 public static function linkify($message)
 {
     $message = self::splitWords($message);
     $patterns = array('/gameID[:= _]?([0-9]+)/i', '/userID[:= _]?([0-9]+)/i', '/threadID[:= _]?([0-9]+)/i', '/((?:[^a-z0-9])|(?:^))([0-9]+) ?(?:(?:D)|(?:points))((?:[^a-z])|(?:$))/i');
     $replacements = array('<a href="board.php?gameID=\\1" class="light">gameID=\\1</a>', '<a href="profile.php?userID=\\1" class="light">userID=\\1</a>', '<a href="forum.php?threadID=\\1#\\1" class="light">threadID=\\1</a>', '\\1\\2' . libHTML::points() . '\\3');
     return preg_replace($patterns, $replacements, $message);
 }
コード例 #2
0
ファイル: user.php プロジェクト: Yoyoyozo/webDiplomacy
 /**
  * Return a profile link for this user
  * @param bool[optional] $welcome If true this profile link is tweaked to be used as the Welcome link
  * @return string Profile link HTML
  */
 function profile_link($welcome = false)
 {
     $buffer = '';
     if ($this->type['User']) {
         $buffer .= '<a href="./profile.php?userID=' . $this->id . '"';
         $buffer .= '>' . $this->username;
         if (!$welcome and $this->online) {
             $buffer .= libHTML::loggedOn($this->id);
         }
         $buffer .= ' (' . $this->points . libHTML::points() . $this->typeIcon($this->type) . ')</a>';
     } else {
         $buffer .= '<em>' . $this->username . '</em>';
     }
     return $buffer;
 }
コード例 #3
0
ファイル: forum.php プロジェクト: Yoyoyozo/webDiplomacy
            print '<div class="reply replyborder' . $replyswitch . ' replyalternate' . $replyswitch . '
				' . ($replyNumber ? '' : 'reply-top') . ' userID' . $reply['fromUserID'] . '">';
            $replyNumber++;
            print '<a name="' . $reply['id'] . '"></a>';
            if ($new['id'] == $reply['id']) {
                print '<a name="postbox"></a>';
                $messageAnchor = '';
            } elseif ($User->timeLastSessionEnded < $reply['timeSent']) {
                print $messageAnchor;
                $messageAnchor = '';
            } elseif ($reply['id'] == $maxReplyID) {
                print $messageAnchor;
                $messageAnchor = '';
            }
            print '<div class="message-head replyalternate' . $replyswitch . ' leftRule">';
            print '<strong><a href="profile.php?userID=' . $reply['fromUserID'] . '">' . $reply['fromusername'] . ' ' . libHTML::loggedOn($reply['fromUserID']) . ' (' . $reply['points'] . ' ' . libHTML::points() . User::typeIcon($reply['userType']) . ')</a>' . '</strong><br />';
            print libHTML::forumMessage($message['id'], $reply['id']);
            print '<em>' . libTime::text($reply['timeSent']) . '</em>';
            print '<br />' . $User->likeMessageToggleLink($reply['id'], $reply['fromUserID']) . libHTML::likeCount($reply['likeCount']);
            if ($User->type['Admin'] || $User->type['ForumModerator']) {
                if (Silence::isSilenced($reply)) {
                    $silence = new Silence($reply);
                } else {
                    unset($silence);
                }
                print '<br />';
                if (isset($silence) && $silence->isEnabled()) {
                    print '<a class="light likeMessageToggleLink" href="admincp.php?tab=Control%20Panel&amp;silenceID=' . $silence->id . '#disableSilence">' . l_t('Disable silence') . '</a>';
                } else {
                    print '<a class="light likeMessageToggleLink" href="admincp.php?tab=Control%20Panel&amp;postID=' . $reply['id'] . '&amp;userID=' . $reply['fromUserID'] . '#createUserThreadSilence">' . l_t('Silence user') . '</a>';
                }
コード例 #4
0
ファイル: halloffame.php プロジェクト: Yoyoyozo/webDiplomacy
    $players = $Misc->RankingPlayers;
    print '<p>' . l_t('You are ranked %s out of %s ranking players (players with >100%s)', '<a href="#me" class="light">#' . $position . '</a>', $players, libHTML::points()) . l_t('For more stats on your ranking visit <a class="light" href="profile.php?userID=' . $User->id . '">your profile</a>.') . '</p>';
}
print '<table class="credits">';
$alternate = false;
$i = 1;
$crashed = $DB->sql_tabl("SELECT id, username, points FROM wD_Users\r\n\t\t\t\t\t\torder BY points DESC LIMIT 100 ");
while (list($id, $username, $points) = $DB->tabl_row($crashed)) {
    $alternate = !$alternate;
    print '
	<tr class="replyalternate' . ($alternate ? '1' : '2') . '">
		<td class="left time">
			' . $points . ' ' . libHTML::points() . ' - #' . $i . '
		</td>

		<td class="right message"><a href="profile.php?userID=' . $id . '">' . $username . '</a></td>
	</tr>';
    $i++;
}
if ($User->type['User'] && $User->points > 100) {
    print '<tr class="replyalternate' . ($alternate ? '1' : '2') . '">
		<td class="left time">
			' . $User->points . ' ' . libHTML::points() . ' - <a name="me"></a>#' . $position . '
		</td>

		<td class="right message"><strong><em>' . $User->username . '</em></strong></td>
	</tr>';
}
print '</table>';
print '</div>';
libHTML::footer();
コード例 #5
0
ファイル: member.php プロジェクト: Yoyoyozo/webDiplomacy
 /**
  * The amount of points bet, info on current value/amount won. Colored depending on success/failure.
  * @return string
  */
 function memberBetWon()
 {
     $buf = l_t('Bet:') . ' <em>' . $this->bet . libHTML::points() . '</em>, ';
     if ($this->Game->phase == 'Pre-game') {
         return l_t('Bet:') . ' <em>' . $this->bet . libHTML::points() . '</em>';
     }
     if ($this->status == 'Playing' || $this->status == 'Left') {
         $buf .= l_t('worth:') . ' <em';
         $value = $this->Game->Scoring->pointsForDraw($this);
         if ($value > $this->bet) {
             $buf .= ' class="good"';
         } elseif ($value < $this->bet) {
             $buf .= ' class="bad"';
         }
         $buf .= '>' . $value . libHTML::points() . '</em>';
         return $buf;
     } elseif ($this->status == 'Won' || $this->Game->potType == 'Points-per-supply-center' && $this->status == 'Survived' || $this->status == 'Drawn') {
         $buf .= l_t('won:') . ' <em';
         $value = $this->pointsWon;
         if ($value > $this->bet) {
             $buf .= ' class="good"';
         } elseif ($value < $this->bet) {
             $buf .= ' class="bad"';
         }
         $buf .= '>' . $value . libHTML::points() . '</em>';
         return $buf;
     } else {
         return l_t('Bet:') . ' <em class="bad">' . $this->bet . libHTML::points() . '</em>';
     }
 }
コード例 #6
0
ファイル: gamehome.php プロジェクト: Yoyoyozo/webDiplomacy
 /**
  * Shortened pot data. Finished games aren't displayed via Home
  * @return string
  */
 function pot()
 {
     return $this->pot . ' ' . libHTML::points() . '<span title="' . $this->Scoring->longName() . '"> ' . $this->Scoring->Abbr() . '</span>';
 }
コード例 #7
0
    /**
     * Compares this class' aUser with one of its bUsers, and the data returned from the comparison
     * makes it easy to tell if the two users are being played by the same player.
     *
     * @param User $bUser The user to compare aUser with
     */
    public function compare(User $bUser)
    {
        global $DB;
        print '<ul>';
        print '<li><a href="profile.php?userID=' . $bUser->id . '">' . $bUser->username . '</a> (' . $bUser->points . ' ' . libHTML::points() . ')
				' . ($bUser->type['Banned'] ? '<img src="' . l_s('images/icons/cross.png') . '" alt="X" title="' . l_t('Banned') . '" />' : '') . '
				RR: ' . $bUser->reliabilityRating . '
			(<a href="?aUserID=' . $bUser->id . '#viewMultiFinder" class="light">' . l_t('check userID=%s', $bUser->id) . '</a>)
				<ul><li><strong>email:</strong> ' . $bUser->email . '</li>';
        list($bUserTotal) = $DB->sql_row("SELECT COUNT(ip) FROM wD_AccessLog WHERE userID = " . $bUser->id);
        $this->compareIPData($bUser->id, $bUserTotal);
        $this->compareCookieCodeData($bUser->id, $bUserTotal);
        $this->compareUserAgentData($bUser->id, $bUserTotal);
        if (count($this->aLogsData['fullGameIDs']) > 0) {
            $this->compareGames('All games', $bUser->id, $this->aLogsData['fullGameIDs']);
        }
        if (count($this->aLogsData['activeGameIDs']) > 0) {
            $this->compareGames('Active games', $bUser->id, $this->aLogsData['activeGameIDs']);
        }
        print '</ul></li></ul>';
    }
コード例 #8
0
ファイル: faq.php プロジェクト: Yoyoyozo/webDiplomacy
   (at your option) any later version.

   webDiplomacy is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU Affero General Public License
   along with webDiplomacy.  If not, see <http://www.gnu.org/licenses/>.
*/
defined('IN_CODE') or die('This script can not be run by itself.');
/**
 * @package Base
 * @subpackage Static
 */
$faq = array("Sono nuovo qui!" => "Sub-section", "Di che cosa parla questo sito?" => "La maniera più semplice per capirlo è di dare un occhio a\r\n\t<a href='http://webdiplomacy.net/doc/0.90-screenshot.png' class='light'>una immagine del gioco</a>. Se il concetto non è ancora ben chiaro guarda <a href='intro.php' class='light'>l'introduzione a webDiplomacy</a>.", "Come faccio a giocare?" => "Le regole sono abbastanza semplici da capire, ma se dovessi essere in dubbio riguardo a qualcosa leggi\r\n\t<a href='intro.php' class='light'>l'introduzione a webDiplomacy</a>, e sentiti libero di chiedere per aiuto o spiegazioni nel <a href='http://forum.webdiplomacy.it/' class='light'>forum pubblico</a>.", "Qual è la licenza del programma?" => "La <a href='AGPL.txt' class='light'>GNU Affero General License</a>\r\n\t(<a href='http://www.opensource.org/licenses/agpl-v3.html' class='light'>Open Source Initiative</a> approved),\r\n\tche in sostanza spiega che puoi scaricare e modificare il codice come piace a te e metterlo nel tuo sito ma che non puoi rivendicare di averlo scritto tu e che devi riferire di ogni modifica alla community.<br /><br />\r\n\tVedi <a href='credits.php' class='light'>riferimenti</a> per informazioni in merito ai dettagli che sono ricadono sotto licenze differenti.", "Questo programma ha qualcosa a che fare con phpDiplomacy?" => "Questo programma era solito essere chiamato phpDiplomacy sino alla versione 0.9.\r\n\tCi spiace per la confusione, anche noi odiamo i cambiamenti di nome, ma per il nostro user-base il vecchio prefisso 'php' non si è rivelato essere l'etichetta immediatamente riconoscibile che doveva essere nelle nostre intenzioni iniziali.", "L'interfaccia" => "Sub-section", "Cosa sono quei cerchi verdi accanto al nome della persona?" => "L'icona verde appare quando un giocatore è on-line sul server. Questo significa che se il giocatore ha avuto accesso al server negli ultimi ~10-15 minuti questi avranni l'icona verde accanto al loro nome.", "E questo cosa sarebbe? (<img src='images/icons/online.png' />, <img src='images/icons/mail.png' />, etc)" => "Se vedi un/una icona/bottone/immagine che non sai cosa significhi prova a passarci sopra il mouse, potrebbe uscire una nota con una breve spiegazione.\r\nSe non dovesse succedere, sentiti libero di chiedere sul <a href='http://forum.webdiplomacy.it/' class='light'>forum</a>.", "Perchè i miei ordini cambiano colore da verde a rosso?" => "Gli ordini in rosso sono ancora da salvare; se vedi molti ordini in rosso dovresti salvare, altrimenti potresti dimenticartene e perderli chiudendo la finstra del browser o chattando con qualcuno.", "Cosa significano 'Salva' e 'Pronto' (Save e Ready)?" => "'Salva' salva i tuoi ordini; i tuoi ordini non ancora salvati, in rosso, diventeranno verdi non appena saranno salvati definitivamente. 'Pronto' significa che hai finito di inserire i tuoi ordini e che sei pronto per continuare con il turno successivo. Se ognuno è 'Pronto' il gioco prosegue proprio in quell'istante, velocizzando la partita.", "Cosa sono i codici che possono aggiungere HTML nei messaggi del forum? (icone, collegamenti a partite, ecc)" => "Spesso nei forum le persone discutono o vogliono aggiungere collegamenti a partite/account di utenti/altre discussioni nel forum. Per rendere questo più semplice alcuni codici sono riconosciuti automaticamente e rimpiazzati con il corretto link/simbolo:\r\n\t<ul><li><strong>'<em>[number]</em> punti'</strong>/<strong>'<em>[number]</em> D'</strong> risulterà in\r\n\t<strong>'punti'</strong> / <strong>'D'</strong> venendo rimpiazzati con il simbolo dei punti (" . libHTML::points() . ").</li>\r\n\t<li><strong>'gameID=<em>[number]</em>'</strong> / <strong>'threadID=<em>[number]</em>'</strong> / <strong>'userID=<em>[number]</em>'</strong> avranno un link appropriato con il/la partita/discussione/profilo sostituiti nel messaggio.</li></ul>", "Perchè alcune cose sembrano cambiare non appena la pagina si è caricata?" => "Dopo che la pagina si è caricata parte JavaScript, andando a fare alcune modifiche\r\n\t(per esempio mettendo l'orario GMT/UTC nel tuo computer, rendendo in grassetto i tuoi interventi, ecc) che implementano la pagina.", "Regole del gioco" => "Sub-section", "Voglio imparare le basi del gioco" => "Vedi la <a href='intro.php' class='light'>pagina introduttiva</a>.", "Voglio imparare le regole avanzate del gioco" => "Vedi <a href='http://www.wizards.com/avalonhill/rules/diplomacy.pdf' class='light'>il regolamento di Avalon Hill</a>.", "Voglio imparare i dettagli sulle regole del gioco" => "Noi usiamo il DATC per risolvere esattamente ogni sorta di situazioni intricate, nei casi in cui c'è ambiguità nel regolamento. (Questo tipo di cose generalmente non capitano spesso in una partita, comunque.)<br />\r\n\tVedi la nostra pagina DATC <a href='datc.php' class='light'>here</a>.", "Se qualcuno deve distruggere una unità ma non ha inserito gli ordini su quale unità distruggere, quale unità è distrutta?" => "Si risolve come raccomanda DATC:\r\n\tL'unità più lontana dai tuoi Centri di rifornimento di partenza.La distanza è definita come il minor numero di mosse necessario per arrivare alla posizione dell'unità partendo dai Centri di partenza. Quando si calcola il minor numero di mosse, le armate si considerano come se si potessero muovere attraversando i mari, le flotte invece si considerano soltanto secondo il loro naturale movimento attraverso i mari e le coste. Se ci dovessero essere due unità con la medesima distanza da un Centro di partenza, si rimuove l'unità che giace sul territorio che viene prima secondo l'ordine alfabetico.", "Se un convoglio è attaccato, il convoglio fallisce?" => "No; perchè un ordine di convoglio non abbia successo è necessario che la flotta che convoglia venga costretta a ritirarsi, e non ci devono essere altri convogli grazie al quale l'armata riesca comunque a essere convogliata.", "Cosa succede se ordino di costruire/distruggere due unità nello stesso territorio?" => "Il primo ordine di costruzione sarà accettato, il secondo no", "Cosa succede se due unità ritirano nello stesso territorio?" => "Entrambe le unità saranno distrutte", "Posso attaccare e costringere a ritirarsi le mie unità?" => "No; non puoi costringere al ritiro le tue stesse unità nè supportare un attacco verso le tue stesse unità.", "Ci sono altre regole che dovrei tenere a mente?" => "C'è una lista completa delle regole sulla pagina delle <a href='rules.php' class='light'>regole</a>,\r\n\tche elenca alcune altre regole che dovrai seguire per aiutarci a mantenere il sito divertente per chiunque.", "Punti" => "Sub-section", "What happens when I run out?" => "You can't run out: Your total number of points include the number of points which you have 'bet' into games you're currently playing in,\r\n\tas well as the points you have in your account. Your total number of points never falls below 100; whenever it does\r\n\tyou're given your points back.<br /><br />\r\n\tTo put it another way; any player who isn't currently playing in any games will always have at least 100 points, so\r\n\tyou won't run out!", "How are the points split in a draw?" => "In a draw the points are split evenly among all the survivors still in the game,\r\n\tregardless of the number of supply centers each player has.<br/>\r\n\tRead <a href='points.php' class='light'>the points guide</a> for more info about the points system.", "I have an idea for a better system" => "We constantly get new ideas for the points system, but usually they're either missing\r\n\tout in some aspect (the points system serves multiple functions), or they improve in one area but are worse in another.<br /><br />\r\n\tThe points system does the job fine, so it's unlikely to be replaced.\r\n\t(See <a href='http://forum.webdiplomacy.net/viewtopic.php?p=288#p288' class='light'>this page</a> for an\r\n\texplanation regarding the role of the existing system, and what a replacement would have to do.)<br /><br />\r\n\tThere's no real way to express how good a player really is in a single number, the points system as it is is\r\n\tprobably good enough for now, and there's definitely no agreement on what would replace it.", "Can you draw the game, but give 2/3rds of the points to this player and ..." => "Draws can only be given one way; an even split to\r\n\tall survivors.", "Bugs" => "Sub-section", "My game has crashed!" => "Sometimes (usually only shortly after code updates) a software bug or server error may occur while a\r\n\tgame is being processed.\r\n\tWhen this happens the problem is detected, all changes are undone, and the game is marked as crashed.<br /><br />\r\n\tAdmins will see a message whenever a game crashes, and information about the crash is saved so that the problem that caused it can be fixed quickly.\r\n\tOnce a mod or admin has marked the game as OK the game will continue where it left off again.<br /><br />\r\n\r\n\tIf your game has been crashed for a long time try asking about it in the forum.", "The phase ends \"Now\"? \"Processing has been paused\"?" => "When the server detects that no games have processed for a while\r\n\t(over 30 minutes or so), or a moderator/admin sees a problem and his the panic button, all game processing is disabled until\r\n\tthe problem is resolved.<br />\r\n\tAfter the all-clear is given games will usually be given time to make up for any during which orders couldn't be entered, and\r\n\tprocessing will resume. Until that point if a game says it will be processed 'Now' that means it would process now, except\r\n\tprocessing is disabled.<br /><br />\r\n\r\n\tYou may also see it if you a games timer counted down to 0 while you were viewing the page, in which\r\n\tcase you should refresh the page to view the newly processed game.", "I didn't enter those orders!" => "Occasionally we get this complaint, but every time we have checked the\r\n\tinput logs to see what order was actually entered it turns out to be the mistaken order.\r\n\tAlso the mistaken orders are often the 'Bulgaria'/'Budapest' sort of mistake which are easier to\r\n\timagine human error than a bug.<br /><br />\r\n\tTry finalizing your orders and then checking them over, so you can be sure of what you entered.", "Someone says their orders messed up, and I'm paying the price!" => "\r\n\tUnfortunately it does seem that sometimes people will claim that their orders came out wrong to cover up the intention of\r\n\ttheir actions. (e.g. \"I was going to stab you, then read your message and changed my orders so I wasn't going to stab you,\r\n\tbut my old orders came out instead of the new ones! Oh so sorry about that!\")<br /><br />\r\n\r\n\tThis is against <a href='rules.php' class='light'>the rules</a>, as it makes work for admins over made up bugs. When someone\r\n\ttells you a bug caused a mistake in their orders you should reserve some skepticism, and remember that the official server alone\r\n\treceives and processes over 20,000 orders per day (as of Feb 2010) without mistake every minute of every day for years on\r\n\tend, so sudden bugs which change whole order-sets around simply don't seem to genuinely happen ever, despite checking every\r\n\tsingle report.\r\n", "My orders gave the wrong results!" => "Before reporting this as a bug double check that you entered your orders correctly and you're\r\n\tnot misunderstanding the rules. 99.999% of the time \"adjudicator bugs\" turn out to be a misunderstanding.<br />\r\n\tIf you're still positive there's a problem let us know in the <a class='light' href='http://forum.webdiplomacy.it/'>forum</a>.", "A part of the site looks wrong in an alternative browser" => "webDiplomacy isn't currently completely web standards compliant,\r\n\tso there may be glitches. We would like to get webDiplomacy working on everything (within reason) but we need users\r\n\tof alternative browsers to let us know what's wrong and tell us how to make it look right in that browser.", "This site seems to slow my computer down" => "See Help > What is Plura? for a likely cause and fix.", "Feature Requests" => "Sub-section", "Better forum" => "A better forum would be good, but getting it to fit in and appear as part of webDiplomacy, rather than just\r\n\ta separate site, is difficult, and would likely use more server resources than our efficient but lightweight built-in forum.<br />\r\n\tAt the moment we are trying to improve our existing forum in small incrememnts.", "A point and click interactive map" => "This is being worked on, but progress is slow. If you know JavaScript and SVG/Canvas why not\r\n\tcarry on the work on the <a href='http://forum.webdiplomacy.net/' class='light'>development forum</a>?", "Translations" => "Eventually translations will be supported, but it is a long process and not a top priority.", "New variants" => "If a variant has lasting appeal, is well balanced, isn't gimmicky, has been tried and tested on another server, and was\r\n\tcreated by a reputable developer, then it's up for consideration to be included in the standard release.<br />\r\n\tYou can discuss this in the variants section of the webDiplomacy\r\n\t<a href='http://forum.webdiplomacy.net/' class='light'>developers forum</a>.<br /><br />\r\n\r\n\tAlso creating your own variants or porting\r\n\texisting variants to the webDiplomacy variants system is easier than ever, from simple map-change variants all the\r\n\tway to strange rule-changing variants, the system is flexible enough to accomadate your varaint ideas.\r\n\t", "Can I suggest a feature?" => "Feature suggestions are best made in the <a class='light' href='http://forum.webdiplomacy.net/'>developer forums</a>,\r\n\telsewhere they're likely to be missed. Remember that unless you can back-up your suggestion with code even good ideas may not get far.", "Helping out" => "Sub-section", "Can I help develop the software?" => "You sure can: if you're an HTML/CSS/JavaScript/PHP 5/MySQL/SVG/Canvas developer,\r\n\tgraphics/icon artist, or want to learn, check out the <a class='light' href='http://webdiplomacy.net/developers.php'>dev info</a>,\r\n\tand if you get lost you can get help/discuss ideas in the <a class='light' href='http://forum.webdiplomacy.net/'>developer forums</a>.", "Can I donate?" => "If you enjoy the site and want to help out, but can't code, you can donate to the project via\r\nPayPal, and this is student-ware so all donations are appreciated. :-)\r\n<div style='text-align:center'>\r\n<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>\r\n<input type='hidden' name='cmd' value='_s-xclick'>\r\n<input type='image' src='https://www.paypal.com/en_US/i/btn/x-click-but21.gif' border='0' name='submit' alt='Make payments with PayPal - it's fast, free and secure!'>\r\n<img alt='' border='0' src='https://www.paypal.com/en_AU/i/scr/pixel.gif' width='1' height='1'>\r\n<input type='hidden' name='encrypted' value='-----BEGIN PKCS7-----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-----END PKCS7-----\r\n'>\r\n</form></div>A big thanks to all the past donors who helped make all '07-'08 server fees community paid!", "How else can I help?" => "Tell your friends about webDiplomacy, put links on your website, help new players out in the forums,\r\n\tand give helpful feedback to developers. Thanks!", "Map" => "Sub-section", "Why are some orders missing from the map?" => "Not all orders are drawn on the small map. Below the small map there is a set of icons;\r\n\tthe one in the middle (<img src='images/historyicons/external.png' alt='example' />) opens up the large map, which contains all orders.<br/>\r\n\tAlso at the bottom of the board page is a link to open up a textual list of all the orders entered in the game, if you can't see\r\n\tsomething in the large map.", "I can't tell the difference between Germany and Austria" => "Color-blind people may have trouble distinguishing Germany and Austria's\r\n\tcolors. We hope to fix this problem in the future.");
if (isset(Config::$faq) && is_array(Config::$faq) && count(Config::$faq)) {
    $faq["Server-specific"] = "Sub-section";
    $faq["What is this section?"] = "webDiplomacy is free, open-source software, and there are several servers running webDiplomacy code.\r\n\t\t\tThis section is for questions which may be specific to this particular installation, whereas the rest of it applies to all\r\n\t\t\tinstallations. (e.g. This section may contain Q&amp;A regarding who runs and pays for this server, or relate to the features\r\n\t\t\twhich set this server apart from the official installation if any.)";
    foreach (Config::$faq as $Q => $A) {
        $faq[$Q] = $A;
    }
}
$i = 1;
print libHTML::pageTitle('Frequently Asked Questions', 'Answers to the questions people often ask in the forums; click on a question to expand the answer.');
$sections = array();
$section = 0;
foreach ($faq as $q => $a) {
    if ($a == "Sub-section") {
        $sections[] = '<a href="#faq_' . $section++ . '" class="light">' . $q . '</a>';
    }
コード例 #9
0
 public function givePoints(array $params)
 {
     global $DB;
     $userID = (int) $params['userID'];
     $points = (int) $params['points'];
     $giveUser = new User($userID);
     if ($points > 0) {
         User::pointsTransfer($giveUser->id, 'Supplement', $points);
     } else {
         $points = -1 * $points;
         $DB->sql_put("UPDATE wD_Users SET points = points - " . $points . " WHERE id=" . $userID);
     }
     return l_t('This user was transferred %s %s.', $points, libHTML::points());
 }
コード例 #10
0
ファイル: gamecreate.php プロジェクト: Yoyoyozo/webDiplomacy
print $User->points . libHTML::points();
?>
)
	</li>
	<li class="formlistfield">
		<input type="text" name="newGame[bet]" size="7" value="<?php 
print $formPoints;
?>
" />
	</li>
	<li class="formlistdesc">
		The bet required to join this game. This is the amount of points that all players, including you,
		must put into the game's "pot" (<a href="points.php" class="light">read more</a>).<br /><br />

		<strong>Default:</strong> <?php 
print $defaultPoints . libHTML::points();
?>
	</li>
</ul>

<div class="hr"></div>

<div id="AdvancedSettingsButton">
<ul class="formlist">
	<li class="formlisttitle">
		<a href="#" onclick="$('AdvancedSettings').show(); $('AdvancedSettingsButton').hide(); return false;">
		Open Advanced Settings
		</a>
	</li>
	<li class="formlistdesc">
		Advanced settings allowing extra customization of games for seasoned players, allowing
コード例 #11
0
ファイル: gamecreate.php プロジェクト: Yoyoyozo/webDiplomacy
        require_once l_r('gamemaster/game.php');
        $Game = processGame::create($input['variantID'], $input['name'], $input['password'], $input['bet'], $input['potType'], $input['phaseMinutes'], $input['joinPeriod'], $input['anon'], $input['pressType'], $input['missingPlayerPolicy'], $input['drawType'], $input['minimumReliabilityRating']);
        // Create first Member record & object
        processMember::create($User->id, $input['bet']);
        $Game->Members->joinedRedirect();
    } catch (Exception $e) {
        print '<div class="content">';
        print '<p class="notice">' . $e->getMessage() . '</p>';
        print '</div>';
    }
}
if ($User->points >= 5) {
    $roundedDefault = round($User->points / 7 / 10) * 10;
    if ($roundedDefault > 5) {
        $defaultPoints = $roundedDefault;
    } else {
        $defaultPoints = 5;
    }
} else {
    print l_t("You can't create a new game; you have fewer than 5%s, you only have %s%s. " . "You will always have at least 100 points, including the points that you have bet into active games, so if you want " . "to start a new game just wait until your other games have finished (<a href='points.php#minpoints' class='light'>read more</a>).", libHTML::points(), $User->points, libHTML::points());
    print '</div>';
    libHTML::footer();
}
if (isset($input) && isset($input['points'])) {
    $formPoints = $input['points'];
} else {
    $formPoints = $defaultPoints;
}
require_once l_r('locales/English/gamecreate.php');
print '</div>';
libHTML::footer();
コード例 #12
0
ファイル: game.php プロジェクト: Yoyoyozo/webDiplomacy
    /**
     * A bar with form buttons letting you join/leave a game
     * @return string
     */
    function joinBar()
    {
        global $User;
        if ($this->Members->isJoined()) {
            if ($this->phase == 'Pre-game') {
                $reason = $this->Members->cantLeaveReason();
                if ($reason) {
                    return l_t("(Can't leave game; %s.)", $reason);
                } else {
                    return '<form onsubmit="return confirm(\'' . l_t('Are you sure you want to leave this game?') . '\');" method="post" action="board.php?gameID=' . $this->id . '"><div>
					<input type="hidden" name="formTicket" value="' . libHTML::formTicket() . '" />
					<input type="submit" name="leave" value="' . l_t('Leave game') . '" class="form-submit" />
					</div></form>';
                }
            } else {
                return '';
            }
        } else {
            $buf = '';
            if ($this->isJoinable()) {
                if ($this->minimumBet <= 100 && !$User->type['User'] && !$this->private) {
                    return l_t('A newly registered account can join this game; ' . '<a href="register.php" class="light">register now</a> to join.');
                }
                $question = l_t('Are you sure you want to join this game?') . '\\n\\n';
                if ($this->isLiveGame()) {
                    $question .= l_t('The game will start at the scheduled time even if all %s players have joined.', count($this->Variant->countries));
                } else {
                    $question .= l_t('The game will start when all %s players have joined.', count($this->Variant->countries));
                }
                if ($this->minimumReliabilityRating > 0) {
                    $buf .= l_t('Minimum Reliability Rating: <span class="%s">%s%%</span>.', $User->reliabilityRating < $this->minimumReliabilityRating ? 'Austria' : 'Italy', $this->minimumReliabilityRating);
                }
                if ($User->reliabilityRating >= $this->minimumReliabilityRating) {
                    $buf .= '<form onsubmit="return confirm(\'' . $question . '\');" method="post" action="board.php?gameID=' . $this->id . '"><div>
						<input type="hidden" name="formTicket" value="' . libHTML::formTicket() . '" />';
                    if ($this->phase == 'Pre-game') {
                        $buf .= l_t('Bet to join: %s: ', '<em>' . $this->minimumBet . libHTML::points() . '</em>');
                    } else {
                        $buf .= $this->Members->selectCivilDisorder();
                    }
                    if ($this->private) {
                        $buf .= '<br />' . self::passwordBox();
                    }
                    $buf .= ' <input type="submit" name="join" value="' . l_t('Join') . '" class="form-submit" />';
                    $buf .= '</div></form>';
                }
            }
            if ($User->type['User'] && $this->phase != 'Finished') {
                $buf .= '<form method="post" action="redirect.php">' . '<input type="hidden" name="gameID" value="' . $this->id . '">';
                if (!$this->watched()) {
                    $buf .= '<input style="margin-top: 0.5em;" type="submit" title="' . l_t('Adds this game to the watched games list on your home page, and subscribes you to game notifications') . '" ' . 'class="form-submit" name="watch" value="' . l_t('Spectate game') . '">';
                } else {
                    $buf .= '<input type="submit" title="' . l_t('Removes this game from the watch list on your home page, and unsubscribes you from game notifications') . '" ' . 'class="form-submit" name="unwatch" value="' . l_t('Stop spectating game') . '">';
                }
                $buf .= '</form>';
            }
        }
        return $buf;
    }
コード例 #13
0
ファイル: profile.php プロジェクト: Yoyoyozo/webDiplomacy
    }
    print '</div>';
    libHTML::footer();
}
print '<div><div class="rightHalf">
		';
$rankingDetails = $UserProfile->rankingDetails();
$showAnon = $UserProfile->id == $User->id || $User->type['Moderator'];
print '<ul class="formlist">';
print '<li><strong>' . l_t('Rank:') . '</strong> ' . $rankingDetails['rank'] . '</li>';
if ($rankingDetails['position'] < $rankingDetails['rankingPlayers']) {
    print '<li><strong>' . l_t('Position:') . '</strong> ' . $rankingDetails['position'] . ' / ' . $rankingDetails['rankingPlayers'] . ' ' . l_t('(top %s%%)', $rankingDetails['percentile']) . '</li>';
}
print '<li><strong>' . l_t('Available points:') . '</strong> ' . $UserProfile->points . ' ' . libHTML::points() . '</li>';
print '<li><strong>' . l_t('Points in play:') . '</strong> ' . ($rankingDetails['worth'] - $UserProfile->points - ($showAnon ? 0 : $rankingDetails['anon']['points'])) . ' ' . libHTML::points() . '</li>';
print '<li><strong>' . l_t('Total points:') . '</strong> ' . $rankingDetails['worth'] . ' ' . libHTML::points() . '</li>';
if ($UserProfile->type['DonatorPlatinum']) {
    $donatorMarker = libHTML::platinum() . ' - <strong>' . l_t('Platinum') . '</strong>';
} elseif ($UserProfile->type['DonatorGold']) {
    $donatorMarker = libHTML::gold() . ' - <strong>' . l_t('Gold') . '</strong>';
} elseif ($UserProfile->type['DonatorSilver']) {
    $donatorMarker = libHTML::silver() . ' - ' . l_t('Silver');
} elseif ($UserProfile->type['DonatorBronze']) {
    $donatorMarker = libHTML::bronze() . ' - ' . l_t('Bronze');
} else {
    $donatorMarker = false;
}
if ($donatorMarker) {
    print '<li>&nbsp;</li><li><strong>' . l_t('Donator:') . '</strong> ' . $donatorMarker . '</li>';
}
print '<li>&nbsp;</li>';
コード例 #14
0
ファイル: members.php プロジェクト: Yoyoyozo/webDiplomacy
    /**
     * A form showing a selection of civil-disorder countries which can be taken over from
     * @return string
     */
    public function selectCivilDisorder()
    {
        global $User;
        $buf = "";
        if (1 == count($this->ByStatus['Left'])) {
            foreach ($this->ByStatus['Left'] as $Member) {
            }
            $buf .= '<input type="hidden" name="countryID" value="' . $Member->countryID . '" />
				' . l_t('<label>Take over:</label> %s, for %s.', $Member->countryColored(), '<em>' . $Member->pointsValueInTakeover() . libHTML::points() . '</em>');
        } else {
            $buf .= '<label>' . l_t('Take over:') . '</label> <select name="countryID">';
            foreach ($this->ByStatus['Left'] as $Member) {
                $pointsValue = $Member->pointsValueInTakeover();
                if ($User->points >= $pointsValue) {
                    $buf .= '<option value="' . $Member->countryID . '" />
						' . l_t('%s, for %s', $Member->country, $pointsValue) . '
						</option>';
                }
            }
            $buf .= '</select>';
        }
        return $buf;
    }
コード例 #15
0
ファイル: index.php プロジェクト: Yoyoyozo/webDiplomacy
    static function forumNew()
    {
        // Select by id, prints replies and new threads
        global $DB, $Misc;
        $tabl = $DB->sql_tabl("\r\n\t\t\tSELECT m.id as postID, t.id as threadID, m.type, m.timeSent, IF(t.replies IS NULL,m.replies,t.replies) as replies,\r\n\t\t\t\tIF(t.subject IS NULL,m.subject,t.subject) as subject,\r\n\t\t\t\tu.id as userID, u.username, u.points, IF(s.userID IS NULL,0,1) as online, u.type as userType,\r\n\t\t\t\tSUBSTRING(m.message,1,100) as message, m.latestReplySent, t.fromUserID as threadStarterUserID\r\n\t\t\tFROM wD_ForumMessages m\r\n\t\t\tINNER JOIN wD_Users u ON ( m.fromUserID = u.id )\r\n\t\t\tLEFT JOIN wD_Sessions s ON ( m.fromUserID = s.userID )\r\n\t\t\tLEFT JOIN wD_ForumMessages t ON ( m.toID = t.id AND t.type = 'ThreadStart' AND m.type = 'ThreadReply' )\r\n\t\t\tORDER BY m.timeSent DESC\r\n\t\t\tLIMIT 50");
        $oldThreads = 0;
        $threadCount = 0;
        $threadIDs = array();
        $threads = array();
        while (list($postID, $threadID, $type, $timeSent, $replies, $subject, $userID, $username, $points, $online, $userType, $message, $latestReplySent, $threadStarterUserID) = $DB->tabl_row($tabl)) {
            $threadCount++;
            if ($threadID) {
                $iconMessage = libHTML::forumMessage($threadID, $postID);
            } else {
                $iconMessage = libHTML::forumMessage($postID, $postID);
            }
            if ($type == 'ThreadStart') {
                $threadID = $postID;
            }
            if (!isset($threads[$threadID])) {
                if (strlen($subject) > 30) {
                    $subject = substr($subject, 0, 40) . '...';
                }
                $threadIDs[] = $threadID;
                $threads[$threadID] = array('subject' => $subject, 'replies' => $replies, 'posts' => array(), 'threadStarterUserID' => $threadStarterUserID);
            }
            $message = Message::refilterHTML($message);
            if (strlen($message) >= 50) {
                $message = substr($message, 0, 50) . '...';
            }
            $message = '<div class="message-contents threadID' . $threadID . '" fromUserID="' . $userID . '">' . $message . '</div>';
            $threads[$threadID]['posts'][] = array('iconMessage' => $iconMessage, 'userID' => $userID, 'username' => $username, 'message' => $message, 'points' => $points, 'online' => $online, 'userType' => $userType, 'timeSent' => $timeSent);
        }
        $buf = '';
        $threadCount = 0;
        foreach ($threadIDs as $threadID) {
            $data = $threads[$threadID];
            $buf .= '<div class="hr userID' . $threads[$threadID]['threadStarterUserID'] . ' threadID' . $threadID . '"></div>';
            $buf .= '<div class="homeForumGroup homeForumAlt' . ($threadCount % 2 + 1) . ' userID' . $threads[$threadID]['threadStarterUserID'] . ' threadID' . $threadID . '">
				<div class="homeForumSubject homeForumTopBorder">' . libHTML::forumParticipated($threadID) . ' ' . $data['subject'] . '</div> ';
            if (count($data['posts']) < $data['replies']) {
                $buf .= '<div class="homeForumPost homeForumMessage homeForumPostAlt' . libHTML::alternate() . ' ">

				...</div>';
            }
            $data['posts'] = array_reverse($data['posts']);
            foreach ($data['posts'] as $post) {
                $buf .= '<div class="homeForumPost homeForumPostAlt' . libHTML::alternate() . ' userID' . $post['userID'] . '">


					<div class="homeForumPostTime">' . libTime::text($post['timeSent']) . ' ' . $post['iconMessage'] . '</div>
					<a href="profile.php?userID=' . $post['userID'] . '" class="light">' . $post['username'] . '</a>
						' . libHTML::loggedOn($post['userID']) . ' (' . $post['points'] . libHTML::points() . User::typeIcon($post['userType']) . ')

					<div style="clear:both"></div>
					<div class="homeForumMessage">' . $post['message'] . '</div>
					</div>';
            }
            $buf .= '<div class="homeForumLink">
					<div class="homeForumReplies">' . l_t('%s replies', '<strong>' . $data['replies'] . '</strong>') . '</div>
					<a href="forum.php?threadID=' . $threadID . '#' . $threadID . '">' . l_t('Open') . '</a>
					</div>
					</div>';
        }
        if ($buf) {
            return $buf;
        } else {
            return '<div class="homeNoActivity">' . l_t('No forum posts found, why not ' . '<a href="forum.php?postboxopen=1#postbox" class="light">start one</a>?');
        }
    }
コード例 #16
0
ファイル: faq.php プロジェクト: Yoyoyozo/webDiplomacy
   You should have received a copy of the GNU Affero General Public License
   along with webDiplomacy.  If not, see <http://www.gnu.org/licenses/>.
*/
defined('IN_CODE') or die('This script can not be run by itself.');
/**
 * @package Base
 * @subpackage Static
 */
$faq = array();
if (isset(Config::$faq) && is_array(Config::$faq) && count(Config::$faq)) {
    $faq["Server-specific"] = "Sub-section";
    foreach (Config::$faq as $Q => $A) {
        $faq[$Q] = $A;
    }
}
$globalFaq = array("I'm new here" => "Sub-section", "What is this site about?" => "The easiest way to understand is to look at\r\n\t<a href='http://webdiplomacy.net/doc/0.90-screenshot.png' class='light'>an in-game screenshot</a>. If the concept is still strange\r\n\tread <a href='intro.php' class='light'>the intro to webDiplomacy</a>.", "How do I play?" => "The gameplay is quite self explanatory, but if you're unsure about something read\r\n\t<a href='intro.php' class='light'>the intro to webDiplomacy</a>, and feel free\r\n\tto ask for help or clarification in <a href='forum.php' class='light'>the public forum</a>.", "What's the software license?" => "The <a href='AGPL.txt' class='light'>GNU Affero General License</a>\r\n\t(<a href='http://www.opensource.org/licenses/agpl-v3.html' class='light'>Open Source Initiative</a> approved),\r\n\twhich basically says you can download and change the code as you like, and put it up on your\r\n\town website, but you can't claim you wrote it, and you have to give any changes\r\n\tyou make back to the community.<br /><br />\r\n\tSee <a href='credits.php' class='light'>the credits</a> for information about the\r\n\tsmall elements which are under different licenses.", "Is this software related to phpDiplomacy?" => "This software used to be called phpDiplomacy until version 0.9.\r\n\tSorry for the confusion, we hate name changes too, but for our user-base the old 'php' prefix wasn't\r\n\tthe immediately recognizable label that it was intended to be.", "The interface" => "Sub-section", "What are those green circles next to peoples names?" => "The green icon appears when a player is logged into the server. This\r\n\tmeans that if the player has accessed the server in the last ~10-15 minutes they will have the green icon next to their name.", "What the hell is that thing? (<img src='images/icons/online.png' />, <img src='images/icons/mail.png' />, etc)" => "If you see an icon/button/image and don't understand what it means try hovering your mouse over it,\r\n\tit may give you a tool-tip helping explain it. If it doesn't feel free to ask on the <a href='forum.php' class='light'>forum</a>.", "Why do my order choices turn from green to red?" => "Red order choices are unsaved; if you see a lot of red in your orders you should\r\n\tsave, or you might forget and lose them by closing the browser window or chatting to someone.", "What do 'Save' and 'Ready' mean?" => "'Save' saves your order; your red, unsaved order choices will turn green once they're successfully\r\n\tsaved. 'Ready' means you have finished entering your orders, and are ready to continue to the next turn. If everyone is 'Ready' the\r\n\tgame continues right away, speeding up the game.", "What are the codes which can add HTML into forum messages? (icons, game links, etc)" => "Often in the forum people discuss points, or\r\n\twant to link others to games/user accounts/other forum threads. To make this easier certain forum-codes are recognized and replaced\r\n\twith proper links/icons:\r\n\t<ul><li><strong>'<em>[number]</em> points'</strong>/<strong>'<em>[number]</em> D'</strong> will result in\r\n\t<strong>'points'</strong> / <strong>'D'</strong> being replaced with the points icon (" . libHTML::points() . ").</li>\r\n\t<li><strong>'gameID=<em>[number]</em>'</strong> / <strong>'threadID=<em>[number]</em>'</strong> / <strong>'userID=<em>[number]</em>'</strong> will have\r\n\ta link to the appropriate game/thread/profile substituted into the message.</li></ul>", "Why do some things appear to change just after the page has loaded?" => "After a page is loaded JavaScript runs, making a few changes\r\n\t(e.g. putting GMT/UTC times into your computer's time zone, making your posts bold, etc) which enhance the page.", "Game rules" => "Sub-section", "I want to learn the basic rules" => "See the <a href='intro.php' class='light'>intro page</a>.", "I want to learn the complete rules" => "See Avalon Hill's <a href='http://www.wizards.com/avalonhill/rules/diplomacy.pdf' class='light'>rulebook</a>.", "I want to learn the exact specifics of the rules" => "We use the DATC to lay out exactly how all sorts of tricky\r\n\tsituations are processed, in the cases where there is ambiguity in the rules. (This sort of stuff doesn't come up\r\n\tin usual play though.)<br />\r\n\tSee our DATC page <a href='datc.php' class='light'>here</a>.", "If someone has to destroy a unit, but doesn't enter destroy orders, what unit is destroyed?" => "It's done as the DATC recommends:\r\n\tIt's the furthest from your home supply centers. Distance is defined as the smallest number of moves to get from the unit's position\r\n\tto a home supply center. When calculating the smallest number of moves armies can move across seas, but fleets can only move across\r\n\tseas and coasts. If there are two units both the same distance from a home supply center then fleets disband before armies. If there's still a tie, \r\n\tthe territory which is first alphabetically is removed first.", "If a convoy is attacked does the convoy fail?" => "No; for a convoy to fail it has to be dislodged, and there must be no other convoys\r\n\tthe the army being convoyed can go through instead.", "What happens if I order to build/destroy two units in the same territory?" => "The first build order will be accepted, the second won't", "What happens if two units retreat to the same place?" => "They will both be disbanded", "Can I dislodge my own units?" => "No; you cannot dislodge your own units, or support the dislodgement of your own units", "Any other rules I should bear in mind?" => "There is a full list of rules on the <a href='rules.php' class='light'>rules</a> page,\r\n\tlisting a few extra non-game rules you have to follow to help keep the site fun for everyone.", "Points" => "Sub-section", "What happens when I run out?" => "You can't run out: Your total number of points include the number of points which you have 'bet' into games you're currently playing in,\r\n\tas well as the points you have in your account. Your total number of points never falls below 100; whenever it does\r\n\tyou're given your points back.<br /><br />\r\n\tTo put it another way; any player who isn't currently playing in any games will always have at least 100 points, so\r\n\tyou won't run out!", "How are the points split in a draw?" => "In a draw the points are split evenly among all the survivors still in the game,\r\n\tregardless of the number of supply centers each player has.<br/>\r\n\tRead <a href='points.php' class='light'>the points guide</a> for more info about the points system.", "I have an idea for a better system" => "We constantly get new ideas for the points system, but usually they're either missing\r\n\tout in some aspect (the points system serves multiple functions), or they improve in one area but are worse in another.<br /><br />\r\n\tThe points system does the job fine, so it's unlikely to be replaced.\r\n\t(See <a href='http://forum.webdiplomacy.net/viewtopic.php?p=288#p288' class='light'>this page</a> for an\r\n\texplanation regarding the role of the existing system, and what a replacement would have to do.)<br /><br />\r\n\tThere's no real way to express how good a player really is in a single number, the points system as it is is\r\n\tprobably good enough for now, and there's definitely no agreement on what would replace it.", "Can you draw the game, but give 2/3rds of the points to this player and ..." => "Draws can only be given one way; an even split to\r\n\tall survivors.", "Bugs" => "Sub-section", "My game has crashed!" => "Sometimes (usually only shortly after code updates) a software bug or server error may occur while a\r\n\tgame is being processed.\r\n\tWhen this happens the problem is detected, all changes are undone, and the game is marked as crashed.<br /><br />\r\n\tAdmins will see a message whenever a game crashes, and information about the crash is saved so that the problem that caused it can be fixed quickly.\r\n\tOnce a mod or admin has marked the game as OK the game will continue where it left off again.<br /><br />\r\n\r\n\tIf your game has been crashed for a long time try asking about it in the forum.", "The phase ends \"Now\"? \"Processing has been paused\"?" => "When the server detects that no games have processed for a while\r\n\t(over 30 minutes or so), or a moderator/admin sees a problem and hits the panic button, all game processing is disabled until\r\n\tthe problem is resolved.<br />\r\n\tAfter the all-clear is given games will usually be given time to make up for any during which orders couldn't be entered, and\r\n\tprocessing will resume. Until that point if a game says it will be processed 'Now' that means it would process now, except\r\n\tprocessing is disabled.<br /><br />\r\n\r\n\tYou may also see it if you a games timer counted down to 0 while you were viewing the page, in which\r\n\tcase you should refresh the page to view the newly processed game.", "I didn't enter those orders!" => "Occasionally we get this complaint, but every time we have checked the\r\n\tinput logs to see what order was actually entered it turns out to be the mistaken order.\r\n\tAlso the mistaken orders are often the 'Bulgaria'/'Budapest' sort of mistake which are easier to\r\n\timagine human error than a bug.<br /><br />\r\n\tTry finalizing your orders and then checking them over, so you can be sure of what you entered.", "Someone says their orders messed up, and I'm paying the price!" => "\r\n\tUnfortunately it does seem that sometimes people will claim that their orders came out wrong to cover up the intention of\r\n\ttheir actions. (e.g. \"I was going to stab you, then read your message and changed my orders so I wasn't going to stab you,\r\n\tbut my old orders came out instead of the new ones! Oh so sorry about that!\")<br /><br />\r\n\r\n\tThis is against <a href='rules.php' class='light'>the rules</a>, as it makes work for admins over made up bugs. When someone\r\n\ttells you a bug caused a mistake in their orders you should reserve some skepticism, and remember that the official server alone\r\n\treceives and processes over 20,000 orders per day (as of Feb 2010) without mistake every minute of every day for years on\r\n\tend, so sudden bugs which change whole order-sets around simply don't seem to genuinely happen ever, despite checking every\r\n\tsingle report.\r\n", "My orders gave the wrong results!" => "Before reporting this as a bug double check that you entered your orders correctly and you're\r\n\tnot misunderstanding the rules. 99.999% of the time \"adjudicator bugs\" turn out to be a misunderstanding.<br />\r\n\tIf you're still positive there's a problem let us know in the <a class='light' href='forum.php'>forum</a>.", "A part of the site looks wrong in an alternative browser" => "webDiplomacy isn't currently completely web standards compliant,\r\n\tso there may be glitches. We would like to get webDiplomacy working on everything (within reason) but we need users\r\n\tof alternative browsers to let us know what's wrong and tell us how to make it look right in that browser.", "This site seems to slow my computer down" => "See Help > What is Plura? for a likely cause and fix.", "Feature Requests" => "Sub-section", "Better forum" => "A better forum would be good, but getting it to fit in and appear as part of webDiplomacy, rather than just\r\n\ta separate site, is difficult, and would likely use more server resources than our efficient but lightweight built-in forum.<br />\r\n\tAt the moment we are trying to improve our existing forum in small increments.", "A point and click interactive map" => "This is being worked on, but progress is slow. If you know JavaScript and SVG/Canvas why not\r\n\tcarry on the work on the <a href='http://forum.webdiplomacy.net/' class='light'>development forum</a>?", "Translations" => "Eventually translations will be supported, but it is a long process and not a top priority.", "New variants" => "If a variant has lasting appeal, is well balanced, isn't gimmicky, has been tried and tested on another server, and was\r\n\tcreated by a reputable developer, then it's up for consideration to be included in the standard release.<br />\r\n\tYou can discuss this in the variants section of the webDiplomacy\r\n\t<a href='http://forum.webdiplomacy.net/' class='light'>developers forum</a>.<br /><br />\r\n\r\n\tAlso creating your own variants or porting\r\n\texisting variants to the webDiplomacy variants system is easier than ever, from simple map-change variants all the\r\n\tway to strange rule-changing variants, the system is flexible enough to accommodate your variant ideas.\r\n\t", "Can I suggest a feature?" => "Feature suggestions are best made in the <a class='light' href='http://forum.webdiplomacy.net/'>developer forums</a>,\r\n\telsewhere they're likely to be missed. Remember that unless you can back-up your suggestion with code even good ideas may not get far.", "Helping out" => "Sub-section", "Can I help develop the software?" => "You sure can: if you're an HTML/CSS/JavaScript/PHP 5/MySQL/SVG/Canvas developer,\r\n\tgraphics/icon artist, or want to learn, check out the <a class='light' href='http://webdiplomacy.net/developers.php'>dev info</a>,\r\n\tand if you get lost you can get help/discuss ideas in the <a class='light' href='http://forum.webdiplomacy.net/'>developer forums</a>.", "Can I donate?" => "See the server-specific section for a donate link, thanks!", "Do I get anything for being a donator?" => "Markers are given for donators based on total donated to date; this lets everyone\r\nsee who is helping keep the site online and who has put value in their webDiplomacy account, but no extra\r\nfunctionality is available to donators.", "How else can I help?" => "Tell your friends about webDiplomacy, put links on your website, help new players out in the forums,\r\n\tand give helpful feedback to developers. Thanks!", "Map" => "Sub-section", "Why are some orders missing from the map?" => "Not all orders are drawn on the small map. Below the small map there is a set of icons;\r\n\tthe one in the middle (<img src='images/historyicons/external.png' alt='example' />) opens up the large map, which contains all orders.<br/>\r\n\tAlso at the bottom of the board page is a link to open up a textual list of all the orders entered in the game, if you can't see\r\n\tsomething in the large map.", "I can't tell the difference between Germany and Austria" => "Color-blind people may have trouble distinguishing Germany and Austria's\r\n\tcolors. We hope to fix this problem in the future.");
foreach ($globalFaq as $Q => $A) {
    $faq[$Q] = $A;
}
$i = 1;
print libHTML::pageTitle('Frequently Asked Questions', 'Answers to the questions people often ask in the forums; click on a question to expand the answer.');
$sections = array();
$section = 0;
foreach ($faq as $q => $a) {
    if ($a == "Sub-section") {
        $sections[] = '<a href="#faq_' . $section++ . '" class="light">' . $q . '</a>';
    }
}
print '<div style="text-align:center; font-weight:bold"><strong>Sections:</strong> ' . implode(' - ', $sections) . '</div>
	<div class="hr"></div>';
$section = 0;