コード例 #1
0
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
 * 
 */
ob_start("ob_gzhandler");
//HTTP compression
include 'php/includes/class_userManager.php';
include 'php/includes/class_localization.php';
include 'php/includes/class_schematicRetrieval.php';
include 'php/includes/googleAnalyticsScriptTagGenerator.php';
include 'php/socialButtons.php';
$runningOnLive = !(strpos($_SERVER['HTTP_HOST'], 'mordritch.com') === false);
$language = "en_US";
//TODO: Have this autodetected from cookie or otherwise the request headers
$sessionData = json_encode(userManager::switchTask_standalone('process_getCurrentSessionData'));
$schematicIdToOpen = isset($_GET["id"]) ? json_encode(intval($_GET["id"])) : "null";
$schematicMetadata = schematicRetrieval::getMetadata($schematicIdToOpen);
$schematicMetadataEncoded = json_encode($schematicMetadata);
function generateScriptTags($prependedWhitespace = '')
{
    global $runningOnLive;
    global $language;
    $returnString = '';
    if ($runningOnLive) {
        $buildNumber = intval(file_get_contents('release/mc_rss-min.js_build#'));
        $returnString = $prependedWhitespace . '<script type="text/javascript" src="release/mc_rss-min.js?b=' . $buildNumber . '"></script>' . PHP_EOL;
        $languageBuildNumber = intval(file_get_contents('release/locals/' . $language . '.js_build#'));
        $returnString .= $prependedWhitespace . '<script type="text/javascript" src="release/locals/' . $language . '.js?b=' . $languageBuildNumber . '"></script>' . PHP_EOL;
    } else {
        $returnString .= $prependedWhitespace . '<!-- BEGIN GENERATED SCRIPT TAGS -->' . PHP_EOL;