Changeset 100 for trunk/wassup.php

Show
Ignore:
Timestamp:
02/28/08 16:18:47 (10 months ago)
Author:
root
Message:

road to 1.5

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wassup.php

    r99 r100  
    187187                echo '<link rel="stylesheet" href="'.$wpurl.'/wp-content/plugins/'.WASSUPFOLDER.'/ui.tabs.css'.'" type="text/css" />'; 
    188188 
     189// Add some javascripts 
    189190if ($_GET['page'] != "wassup-options" AND $_GET['page'] != "wassup-spy") { ?> 
    190191<script type='text/javascript'> 
     
    235236 
    236237<script type="text/javascript"> 
     238  // Main script for Ajax functions 
    237239  //<![CDATA[ 
    238240  jQuery(document).ready(function($){ 
     
    397399                $save_settings = FALSE; 
    398400        } 
     401        // Save the settings 
    399402        if ($save_settings) { 
    400403                if ($_POST['wassup_remind_flag'] == 1 AND $_POST['wassup_remind_mb'] == "") { 
     
    430433                } 
    431434                update_option('wassup_settings', $wassup_settings); 
     435        // Save spam options from visitor details 
    432436        } elseif (isset($_POST['submit-spam'])) { 
    433437                $wassup_settings['wassup_spamcheck'] = $_POST['wassup_spamcheck']; 
     
    435439                $wassup_settings['wassup_refspam'] = $_POST['wassup_refspam']; 
    436440                update_option('wassup_settings', $wassup_settings); 
     441        // Reset options to defaults 
    437442        } elseif (isset($_POST['reset-to-default'])) { 
    438443                delete_option('wassup_settings'); 
     
    470475        $siteurl =  get_bloginfo('siteurl'); 
    471476 
     477        // This is the ONLINE view 
    472478        if ($_GET['page'] == "wassup-online") { 
    473479                $to_date = wassup_get_time(); 
     
    581587 
    582588                $search = attribute_escape($_GET['search']); 
     589                // Get resolution for main view and chart 
    583590                $res = (int) $wassup_settings['wassup_screen_res']; 
    584591                if (empty($res)) $res=620; 
     
    588595                else $res=1000; 
    589596                 
     597        // Detect IP marked 
    590598        if (isset($_GET['wmark'])) { 
    591599                if ($_GET['wmark'] == 0) { 
     
    598606                update_option('wassup_settings', $wassup_settings); 
    599607        } 
     608        // Detect if chart id enabled/disabled 
    600609        if (isset($_GET['wchart'])) { 
    601610                if ($_GET['wchart'] == 0) { 
     
    607616        } 
    608617                 
     618                // Set default page items limit 
    609619                if ($wassup_settings['wassup_default_limit'] != '' AND !isset($_GET['limit'])) { 
    610620                        $items = $wassup_settings['wassup_default_limit']; 
     
    615625                } 
    616626 
     627                // Detect default items typology 
    617628                if ($wassup_settings['wassup_default_type'] != '' AND !isset($_GET['type'])) { 
    618629                        $type = $wassup_settings['wassup_default_type']; 
     
    621632                } 
    622633 
     634                // Get items typology 
    623635                if ($type == 'spider') { 
    624636                        $whereis = " AND spider!=''"; 
     
    642654 
    643655                $pages = 1; 
     656                // For pagination 
    644657                if(isset($_GET['pages']) and is_numeric($_GET['pages']) and $pages = $_GET['pages']) { 
    645658                        $limit = " LIMIT ".(($pages-1)*$items).",$items"; 
     
    648661                } 
    649662 
     663                // Start print out the results 
    650664                print "<h2>".__("Latest hits", "wassup")."</h2>"; 
    651665                $to_date = wassup_get_time(); 
     
    662676                $Tot->WpUrl = $wpurl; 
    663677 
     678                // This is the items counters 
    664679                $itemstot = $Tot->calc_tot("count", $search, null, "DISTINCT"); 
    665680                $pagestot = $Tot->calc_tot("count", $search, null, null); 
     
    9901005        } //end MAIN/DETAILS VIEW 
    9911006 
    992                 print "<p><small>WassUp ver: $version - Check the official <a href='http://www.wpwp.org' target='_BLANK'>WassUp</a> page for updates, bug reports and your hints to improve it</small></p>"; 
     1007                print "<p><small>WassUp ver: $version - Check the official <a href='http://www.wpwp.org' target='_BLANK'>WassUp</a> page for updates, bug reports and your hints to improve it - <a href='http://trac.wpwp.org/wiki/Documentation' title='WassUp User Guide documentation'>WassUp User Guide documentation</a></small></p>"; 
    9931008                print "</div>";  
    9941009} //end function Wassup 
    9951010 
     1011// Function to create the initial Database table for WassUp 
    9961012function CreateTable() { 
    9971013        global $wpdb; 
     
    10251041} //end function createTable 
    10261042 
     1043// If there is some table different from previous version 
     1044// use this function to update the table 
    10271045function UpdateTable() { 
    10281046        global $wpdb, $wassup_settings;