Skip to content

Commit ba04c6b

Browse files
committed
+ initial commit into google code repos
0 parents  commit ba04c6b

File tree

784 files changed

+214687
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

784 files changed

+214687
-0
lines changed

.htaccess

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
##
2+
# .htaccess
3+
#
4+
# This file provides mapping from xml to php for all front-end sites of XMLArsenal
5+
#
6+
# @author Amras Taralom <[email protected]>
7+
# @version 1.0, last modified 2009/11/26
8+
# @package XMLArsenal
9+
# @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
10+
#
11+
##
12+
13+
14+
# set index.xml as start document and prevent browsing
15+
DirectoryIndex index.xml index.php index.html index.htm
16+
Options -Indexes
17+
18+
# put rw-engine to action
19+
RewriteEngine On
20+
21+
# catch the language selector and login whereveryou are...
22+
RewriteCond %{QUERY_STRING} ^locale=
23+
RewriteRule /* languageselect.php?query=%{QUERY_STRING}
24+
RewriteCond %{QUERY_STRING} login=1
25+
RewriteRule /* login.php?query=%{QUERY_STRING}
26+
RewriteCond %{QUERY_STRING} logout=1
27+
RewriteRule /* logout.php?query=%{QUERY_STRING}
28+
29+
# rules for the xml/php translation
30+
# but ONLY for main dir, not for other dirs
31+
RewriteCond %{REQUEST_URI} !^(\/strings\/)
32+
RewriteCond %{REQUEST_URI} !^(\/data\/)
33+
RewriteCond %{REQUEST_URI} !^(\/layout\/)
34+
RewriteRule ^(.*).xml \/$1.php?%{QUERY_STRING}
35+
36+
#error handeling
37+
ErrorDocument 401 /error.php
38+
ErrorDocument 403 /error.php
39+
ErrorDocument 404 /error.php

achievement-firsts.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* achievement-firsts.php
5+
*
6+
* The script handles caching and output of the achievement-firsts.xml with respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/09/23
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
echo fgettemplate('./xml-templates/achievement-firsts.xml', array('LANGUAGE'=>$language));
22+
23+
?>

arena-calculator.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/**
4+
* arena-calculator.php
5+
*
6+
* The script handles caching and output of the arena-calculator.xml.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/10-10
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/functions.inc.php';
18+
19+
echo fgettemplate('./xml-templates/arena-calculator.xml', array('LANGUAGE'=>$language));
20+
21+
22+
?>

arena-ladder.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/**
4+
* arena-ladder.php
5+
*
6+
* The script handles caching and output of the arena-ladder.xml with the respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/09/18
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
//try using cache
22+
$cachefile = FILECACHEFOLDER. md5("arena-ladder.xml_".$filterValue."_teamSize_".$teamSize."_lang_".$language) .".cache";
23+
if(USEFILECACHE && file_exists($cachefile) && (filemtime($cachefile) + 60*60*UPDATEINTERVAL > time())){
24+
echo file_get_contents($cachefile)."<!-- cached file. cache valid until ".date('d.m.Y H:i:s',filemtime($cachefile) + 60*60*UPDATEINTERVAL).". -->";
25+
die();
26+
}
27+
28+
$ladder = new Arenaladder();
29+
30+
$xml = fgettemplate('./xml-templates/arena-ladder-basic.xml', $ladder->prepareArenaladderSheet());
31+
$xml = str_replace(array("\n", "\r", "\t", "\o", "\xOB", " "), '', $xml);
32+
33+
$doc = new DOMDocument('1.0');
34+
$doc->preserveWhiteSpace = false;
35+
$doc->loadXML($xml);
36+
$doc->formatOutput = true;
37+
$xml = $doc->saveXML();
38+
39+
if(USEFILECACHE) file_put_contents($cachefile, $xml);
40+
echo $xml;
41+
42+
?>

battlegroups.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* battlegroups.php
5+
*
6+
* The script handles caching and output of the battlegroups.xml with the respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/09/17
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
$vars = array();
22+
$vars['LANGUAGE'] = $language;
23+
$vars['REALMS'] = '';
24+
$vars['REALMPOOL'] = $realmpool;
25+
$vars['REALMPOOLURL'] = urlencode($realmpool);
26+
27+
foreach($realms as $realm){
28+
29+
$realmvars = array();
30+
$realmvars['NAME'] = $realm->realmName;
31+
$realmvars['NAMEURL'] = urlencode($realm->realmName);
32+
33+
$vars['REALMS'] .= fgettemplate('./xml-templates/battlegroups-realm.xml', $realmvars);
34+
35+
}//foreach
36+
37+
echo fgettemplate('./xml-templates/battlegroups.xml', $vars);
38+
39+
?>

bookmarks.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
/**
4+
* character-select.php
5+
*
6+
* The script handles output of the /vault/character-select.xml with respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/12/10
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
22+
//check if logged in
23+
if($_SESSION['loggedIn'] == false){
24+
25+
header("Location: /login.xml");
26+
27+
}//if
28+
29+
$acc = unserialize($_SESSION['account']);
30+
31+
//add bookmark
32+
if($_GET['action'] == 1 && $_GET['n'] && $_GET['r']){
33+
34+
$acc->addBookmark($_GET['n'], $_GET['r']);
35+
36+
}
37+
//remove bookmark
38+
else if($_GET['action'] == 2 && $_GET['n'] && $_GET['r']){
39+
40+
$acc->removeBookmark($_GET['n'], $_GET['r']);
41+
42+
}//if
43+
44+
$xml = fgettemplate('./xml-templates/bookmarks-basic.xml', $acc->prepareCharacterBookmarks());
45+
$xml = str_replace(array("\n", "\r", "\t", "\o", "\xOB", " "), '', $xml);
46+
47+
/*no processing needed
48+
49+
$doc = new DOMDocument('1.0');
50+
$doc->preserveWhiteSpace = false;
51+
$doc->loadXML($xml);
52+
$doc->formatOutput = true;
53+
$xml = $doc->saveXML(); */
54+
55+
echo $xml;
56+
57+
?>

cache/.htaccess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Order deny,allow
2+
Deny from all
3+
Allow from 127.0.0.1

character-achievements.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/**
4+
* character-achievements.php
5+
*
6+
* The script handles caching and output of the character-achievements.xml with respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/09/23
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
//try using cache
22+
$cachefile = FILECACHEFOLDER. md5("character-achievements.xml_category_".$category."_for_".$charname."_on_".$realmName."_lang_".$language) .".cache";
23+
if(USEFILECACHE && file_exists($cachefile) && (filemtime($cachefile) + 60*60*UPDATEINTERVAL > time())){
24+
echo file_get_contents($cachefile)."<!-- cached file. cache valid until ".date('d.m.Y H:i:s',filemtime($cachefile) + 60*60*UPDATEINTERVAL).". -->";
25+
die();
26+
}
27+
28+
$char = new Character($charname, $usedRealm);
29+
30+
if($char->getId()){
31+
32+
if($category === null) $xml = fgettemplate('./xml-templates/character-achievements-basic.xml', $char->prepareCharacterAchievementSheet());
33+
else $xml = fgettemplate('./xml-templates/character-achievements-category.xml', $char->prepareCharacterAchievementSheet($category));
34+
$xml = str_replace(array("\n", "\r", "\t", "\o", "\xOB", " "), '', $xml);
35+
36+
$doc = new DOMDocument('1.0');
37+
$doc->preserveWhiteSpace = false;
38+
$doc->loadXML($xml);
39+
$doc->formatOutput = true;
40+
$xml = $doc->saveXML();
41+
42+
if(USEFILECACHE) file_put_contents($cachefile, $xml);
43+
echo $xml;
44+
45+
}else{
46+
echo fgettemplate('./xml-templates/error404.xml', array('LANGUAGE'=>$language));
47+
}
48+
49+
50+
?>

character-arenateams.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/**
4+
* character-arenateams.php
5+
*
6+
* The script handles caching and output of the character-repuatation.xml with respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/12/10
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
//try using cache
22+
$cachefile = FILECACHEFOLDER. md5("character-arenateams.xml_".$charname."_on_".$realmName."_lang_".$language) .".cache";
23+
if(USEFILECACHE && file_exists($cachefile) && (filemtime($cachefile) + 60*60*UPDATEINTERVAL > time())){
24+
echo file_get_contents($cachefile)."<!-- cached file. cache valid until ".date('d.m.Y H:i:s',filemtime($cachefile) + 60*60*UPDATEINTERVAL).". -->";
25+
die();
26+
}
27+
28+
$char = new Character($charname, $usedRealm);
29+
30+
if($char->getId()){
31+
32+
$xml = fgettemplate("./xml-templates/character-arenateams.xml", $char->prepareCharacterArenaSheet());
33+
$xml = str_replace(array("\n", "\r", "\t", "\o", "\xOB", " "), '', $xml);
34+
35+
$doc = new DOMDocument('1.0');
36+
$doc->preserveWhiteSpace = false;
37+
$doc->loadXML($xml);
38+
$doc->formatOutput = true;
39+
$xml = $doc->saveXML();
40+
41+
if(USEFILECACHE) file_put_contents($cachefile, $xml);
42+
43+
echo $xml;
44+
45+
}else{
46+
echo fgettemplate('./xml-templates/character-sheet-no-such-char.xml');
47+
}
48+
49+
50+
?>

character-reputation.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/**
4+
* character-reputation.php
5+
*
6+
* The script handles caching and output of the character-repuatation.xml with respective values.
7+
*
8+
* @author Amras Taralom <[email protected]>
9+
* @version 1.0, last modified 2009/09/22
10+
* @package XMLArsenal
11+
* @license http://opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
12+
*
13+
*/
14+
15+
require_once './includes/autoload.inc.php';
16+
require_once './includes/config.inc.php';
17+
require_once './includes/db.inc.php';
18+
require_once './includes/data.inc.php';
19+
require_once './includes/functions.inc.php';
20+
21+
//try using cache
22+
$cachefile = FILECACHEFOLDER. md5("character-reputation.xml_".$charname."_on_".$realmName."_lang_".$language) .".cache";
23+
if(USEFILECACHE && file_exists($cachefile) && (filemtime($cachefile) + 60*60*UPDATEINTERVAL > time())){
24+
echo file_get_contents($cachefile)."<!-- cached file. cache valid until ".date('d.m.Y H:i:s',filemtime($cachefile) + 60*60*UPDATEINTERVAL).". -->";
25+
die();
26+
}
27+
28+
$char = new Character($charname, $usedRealm);
29+
30+
if($char->getId()){
31+
32+
if($DATA["factions"][$char->getRace()] == 0) $xmltmpl = "alliance";
33+
else if($DATA["factions"][$char->getRace()] == 1) $xmltmpl = "horde";
34+
35+
$xml = fgettemplate("./xml-templates/character-sheet-reputation_$xmltmpl.xml", $char->prepareCharacterReputationSheet());
36+
$xml = str_replace(array("\n", "\r", "\t", "\o", "\xOB", " "), '', $xml);
37+
38+
$doc = new DOMDocument('1.0');
39+
$doc->preserveWhiteSpace = false;
40+
$doc->loadXML($xml);
41+
$doc->formatOutput = true;
42+
$xml = $doc->saveXML();
43+
44+
if(USEFILECACHE) file_put_contents($cachefile, $xml);
45+
46+
echo $xml;
47+
48+
}else{
49+
echo fgettemplate('./xml-templates/character-sheet-no-such-char.xml');
50+
}
51+
52+
53+
?>

0 commit comments

Comments
 (0)