Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jappix/jappix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'server/stats-svg.php')
-rw-r--r--server/stats-svg.php103
1 files changed, 0 insertions, 103 deletions
diff --git a/server/stats-svg.php b/server/stats-svg.php
deleted file mode 100644
index d57960d7..00000000
--- a/server/stats-svg.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-/*
-
-Jappix - An open social platform
-The SVG loader for Jappix statistics
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// PHP base
-define('JAPPIX_BASE', '..');
-
-// Get the functions
-require_once('./functions.php');
-require_once('./functions-manager.php');
-
-// Get the configuration
-require_once('./read-main.php');
-require_once('./read-hosts.php');
-
-// Get the libs
-require_once('./drawsvgchart.php');
-require_once('./gettext.php');
-
-// Prepare application
-enableErrorSink();
-hideErrors();
-compressThis();
-
-// Start the session
-session_start();
-
-// Check if the user is authorized
-$is_admin = false;
-
-if((isset($_SESSION['jappix_user']) && !empty($_SESSION['jappix_user'])) && (isset($_SESSION['jappix_password']) && !empty($_SESSION['jappix_password']))) {
- // Get the session values
- $user = $_SESSION['jappix_user'];
- $password = $_SESSION['jappix_password'];
-
- // Checks the user is admin
- $is_admin = isAdmin($user, $password);
-}
-
-// Not admin? Stop the script!
-if(!$is_admin) {
- exit;
-}
-
-// Get the graph type
-if((isset($_GET['g']) && !empty($_GET['g']))) {
- $graph = $_GET['g'];
-} else {
- $graph = 'others';
-}
-
-// Get the locale
-if((isset($_GET['l']) && !empty($_GET['l']))) {
- $locale = $_GET['l'];
-} else {
- $locale = 'en';
-}
-
-// Include the translations
-includeTranslation($locale, 'main');
-
-$drawsvgchart = new DrawSVGChart;
-
-// Generation vars
-$link = FALSE;
-$evolution = FALSE;
-
-// Access graph?
-if($graph == 'access') {
- // Access graph
- $elements = getMonthlyVisits();
- $legend = array(array('#5276A9', T_("Visits")));
- $evolution = TRUE;
-} else if($graph == 'share') {
- // Share graph
- $elements = largestShare(shareStats(), 8);
- $legend = array(array('#5276A9', T_("Size")));
-} else if($graph == 'others') {
- // Others graph
- $elements = otherStats();
- $legend = array(array('#5276A9', T_("Size")));
-}
-
-// Generate the chart
-$svgchart = $drawsvgchart->createChart($elements, $legend, $link, $evolution, $graph);
-
-// No error?
-if(!$drawsvgchart->has_errors()) {
- header('Content-Type: image/svg+xml; charset=utf-8');
- echo $drawsvgchart->getXMLOutput();
-}
-
-?>