* Plugin Name: GLM ServerStats - Stand Alone
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Server Stats Display.
- * Version: 1.0.8
+ * Version: 1.0.9
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmServerStats
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.8
+ * @version 1.0.9
*/
-define('GLM_SERVERSTATS_PLUGIN_VERSION', '1.0.8');
+define('GLM_SERVERSTATS_PLUGIN_VERSION', '1.0.9');
// Check that we're being called by WordPress.
if (!defined('ABSPATH')) {
public function model()
{
+ $haveStats = false;
+ $thisDate = false;
+ $thisDateTime = false;
+ $thisMonth = false;
+ $thisMonthTime = false;
+ $websiteId = false;
+
// Get current bandwidth configuration
$config = get_option('glmServerStatsConfigData');
- // Connect to the bandwidth database
- $this->bandwidthDataConnect(
- $config['db_host'],
- $config['db_user'],
- $config['db_pass'],
- $config['db_name'],
- $config['website']
- );
+ if ($config != false) {
+
+ // Connect to the bandwidth database
+ $this->bandwidthDataConnect(
+ $config['db_host'],
+ $config['db_user'],
+ $config['db_pass'],
+ $config['db_name'],
+ $config['website']
+ );
+
+ // Get the current bandwidth stats
+ $stats = $this->bandwidthGetStats();
- // Get the current bandwidth stats
- $stats = $this->bandwidthGetStats();
+ if ($stats != false) {
- // Build summary info
- $thisDate = date('m/d/Y');
- $thisDateTime = strtotime($thisDate);
- $thisMonth = date('m/Y');
- $thisMonthTime = strtotime(date('m/01/Y'));
- $websiteId = $this->siteId;
+ // Build summary info
+ $thisDate = date('m/d/Y');
+ $thisDateTime = strtotime($thisDate);
+ $thisMonth = date('m/Y');
+ $thisMonthTime = strtotime(date('m/01/Y'));
+ $websiteId = $this->siteId;
+
+ $haveStats = true;
+
+ }
+
+ }
// Compile template data
$templateData = array(
- 'serverStats' => $stats,
+ 'haveStats' => $haveStats,
'serverStats' => $stats,
'thisDate' => $thisDate,
'thisDateTime' => $thisDateTime,
<h2>
Server Bandwidth
</h2>
+{if $haveStats}
<div style="width: 800px;">
<p>
<b>Server Bandwidth</b> is the amount of data sent and received by this Web site.
});
</script>
-
+{else}
+ <h3 class="glm-error">Server Bandwidth has not been configured. Please ask system administrator to configure this plugin.</h3>
+{/if}
{include file='footer.html'}