]> git.mxchange.org Git - mailer.git/blobdiff - inc/stats-functions.php
Fixes for installation
[mailer.git] / inc / stats-functions.php
index baa0b130b1f0f24714685c12fa1bc650fba7308a..44256ff3dbb444876695c733154cf16ad56e0cfc 100644 (file)
@@ -99,6 +99,9 @@ function setStatsEntry ($entry, $value) {
 
 // Loads stats table
 function loadStatsTable () {
 
 // Loads stats table
 function loadStatsTable () {
+       // Check if the link is up
+       if (!SQL_IS_LINK_UP()) return false;
+
        // Do we have it there for today?
        if (!isStatsTableCreated()) {
                // Then create a default one
        // Do we have it there for today?
        if (!isStatsTableCreated()) {
                // Then create a default one
@@ -120,6 +123,9 @@ function loadStatsTable () {
 
 // Checks if the the statistics table is created
 function isStatsTableCreated () {
 
 // Checks if the the statistics table is created
 function isStatsTableCreated () {
+       // Check if the link is up
+       if (!SQL_IS_LINK_UP()) return false;
+
        // Ask for it
        $result = SQL_QUERY_ESC("SHOW TABLES LIKE '{?_MYSQL_PREFIX?}_stats_%s'",
                array(date('Ymd', time())), __FUNCTION__, __LINE__);
        // Ask for it
        $result = SQL_QUERY_ESC("SHOW TABLES LIKE '{?_MYSQL_PREFIX?}_stats_%s'",
                array(date('Ymd', time())), __FUNCTION__, __LINE__);
@@ -130,6 +136,9 @@ function isStatsTableCreated () {
 
 // Create the dummy table
 function createStatsTable () {
 
 // Create the dummy table
 function createStatsTable () {
+       // Check if the link is up
+       if (!SQL_IS_LINK_UP()) return false;
+
        // Create it here
        $result = SQL_QUERY_ESC("CREATE TABLE IF NOT EXISTS `{?_MYSQL_PREFIX?}_stats_%s` (
 `stats_entry` VARCHAR(100) NOT NULL DEFAULT '',
        // Create it here
        $result = SQL_QUERY_ESC("CREATE TABLE IF NOT EXISTS `{?_MYSQL_PREFIX?}_stats_%s` (
 `stats_entry` VARCHAR(100) NOT NULL DEFAULT '',
@@ -141,6 +150,9 @@ PRIMARY KEY (`stats_entry`)
 
 // Write all entries to the table
 function writeStatsTable () {
 
 // Write all entries to the table
 function writeStatsTable () {
+       // Check if the link is up
+       if (!SQL_IS_LINK_UP()) return false;
+
        // Empty the table first
        SQL_QUERY_ESC("TRUNCATE `{?_MYSQL_PREFIX?}_stats_%s`",
                array(date('Ymd', time())), __FUNCTION__, __LINE__);
        // Empty the table first
        SQL_QUERY_ESC("TRUNCATE `{?_MYSQL_PREFIX?}_stats_%s`",
                array(date('Ymd', time())), __FUNCTION__, __LINE__);