Changeset 136 for trunk/wassup.php

Show
Ignore:
Timestamp:
04/22/08 11:25:27 (7 months ago)
Author:
root
Message:

1.5.1 almost ready

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wassup.php

    r133 r136  
    44Plugin URI: http://www.wpwp.org 
    55Description: Wordpress plugin to analyze your visitors traffic with real time stats, chart and a lot of chronological informations. It has sidebar Widget support to show current online visitors and other statistics. 
    6 Version: 1.5 
     6Version: 1.5.1 
    77Author: Michele Marcucci 
    88Author URI: http://www.michelem.org/ 
     
    1717        die('Permission Denied! You are not allowed to call this page directly.'); 
    1818} 
    19 $version = "1.5"; 
     19$version = "1.5.1"; 
    2020define('WASSUPFOLDER', dirname(plugin_basename(__FILE__)), TRUE); 
    2121require_once(dirname(__FILE__).'/lib/wassup.class.php'); 
     
    399399 
    400400function WassUp() { 
    401         global $wpdb, $version, $wpurl, $wassup_options, $whash; 
     401        global $wpdb, $wp_version, $version, $wpurl, $wassup_options, $whash; 
    402402 
    403403        //#debug... 
     
    443443                $wassup_options->wassup_refresh = $_POST['wassup_refresh']; 
    444444                $wassup_options->wassup_userlevel = $_POST['wassup_userlevel']; 
     445                $wassup_options->wassup_dashboard_chart = $_POST['wassup_dashboard_chart']; 
    445446                $wassup_options->wassup_default_type = $_POST['wassup_default_type']; 
    446447                $wassup_options->wassup_default_limit = $_POST['wassup_default_limit']; 
     
    13921393 
    13931394           //### Extract useful visit information from http header... 
    1394            $language = @explode("-", $language); 
    1395            $language = @explode(",", $language[1]); 
    1396            $language = @explode(";", $language[0]); 
     1395           // 
     1396           //#use country code for language, if it exists in hostname 
     1397           if (!empty($hostname) && preg_match("/\.[a-zA-Z]{2}$/", $hostname) > 0) { 
     1398                $country = strtoupper(substr($hostname,-2)); 
     1399                if ($country == "UK") { $country = "GB"; } //change UK to GB for consistent language codes 
     1400                $language = array("$country"); 
     1401           } else { 
     1402                $language = @explode("-", $language); 
     1403                $language = @explode(",", $language[1]); 
     1404                $language = @explode(";", $language[0]); 
     1405           } 
    13971406 
    13981407           list($searchengine,$search_phrase)=explode("|",wGetSE($referrer)); 
     
    16511660// This is the function to print out a chart's preview in the dashboard 
    16521661function wassupDashChart() { 
    1653         global $wpdb; 
     1662        global $wpdb, $wassup_options; 
     1663        if ($wassup_options->wassup_dashboard_chart == 1) { 
    16541664        $table_name = $wpdb->prefix . "wassup"; 
    16551665        $to_date = wassup_get_time(); 
     
    16581668        $Chart->to_date = $to_date; 
    16591669 
    1660         $itemstot = $Chart->calc_tot("count", $search, null, "DISTINCT"); 
    1661         print $itemstot; 
    1662  
    16631670        echo '<h3>WassUp Stats <cite><a href="admin.php?page=wassup">More &raquo;</a></cite></h3>'; 
    16641671        echo $Chart->TheChart(1, "400", "125", "", $wassup_options->wassup_chart_type, "bg,s,00000000", "dashboard", "left"); 
     1672        } 
    16651673} //end function wassupDashChart 
    16661674