mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Lexica Botania Online MMORPG Free To Play!
This commit is contained in:
1 parent
a5f3964620
commit
f488be6595
4 files changed
+90
-1
No files matched your search
+55
-1
@@ -3,4 +3,58 @@
|
||||
Lexica Botania Online
|
||||
</div>
|
||||
|
||||
Lorem ipsum dolor sit...
|
||||
<div class='warning-txt'>
|
||||
<ul>
|
||||
<li>This page is a verbatim copy of the Lexica Botania you can craft ingame by combining a Book with any type of Sapling. It, however, does not contain any recipes or images. Usage of the ingame guide is encouraged.</li>
|
||||
<li>The contents of this page are fed from the <a href="https://github.com/Vazkii/Botania/blob/master/src/main/resources/assets/botania/lang/en_US.lang"> bleeding-edge lang file</a> and may be ahead of the Botania version currently out.</li>
|
||||
<li>This page contains spoilers for unlockables!</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$file = file('https://raw.githubusercontent.com/Vazkii/Botania/master/src/main/resources/assets/botania/lang/en_US.lang');
|
||||
|
||||
$started_docs = false;
|
||||
$opened_div = false;
|
||||
|
||||
$current_entry = '';
|
||||
foreach($file as $line) {
|
||||
if($started_docs || trim($line) == '# LEXICON ENTRIES') {
|
||||
$started_docs = true;
|
||||
$entry_match = match_entry($line);
|
||||
$page_match = match_page($line, $current_entry);
|
||||
|
||||
if(sizeof($entry_match) > 0) {
|
||||
$current_entry = $entry_match[1];
|
||||
if($opened_div)
|
||||
echo('</div>');
|
||||
|
||||
echo("<br><a href='#$current_entry' class='entry-bookmark glyphicon glyphicon-bookmark' title='Permalink'></a> <b id='$current_entry-fake'>$entry_match[2]</b><div class='entry-text'>");
|
||||
$opened_div = true;
|
||||
}
|
||||
|
||||
if(sizeof($page_match) > 0) {
|
||||
$page = preg_replace('/&(.)((?:[^&])+)(?:(?:&(?:0|r))|$)/', "<span class='mc-color-$1'>$2</span>", $page_match[1]) . '<br>';
|
||||
$no_control = preg_replace('/&./', '', $page_match[1]);
|
||||
if(strlen($no_control) > 50)
|
||||
echo($page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo('</div>');
|
||||
|
||||
function match($regex, $line) {
|
||||
$matches = array();
|
||||
preg_match("/$regex/", $line, $matches);
|
||||
return $matches;
|
||||
}
|
||||
|
||||
function match_entry($line) {
|
||||
return match('botania\.entry\.(\w+)=(.+)', $line);
|
||||
}
|
||||
|
||||
function match_page($line, $entry_name) {
|
||||
return match("botania\.page\.$entry_name\d+=(.+)", $line);
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user