Changeset 93

Show
Ignore:
Timestamp:
02/19/08 09:36:23 (9 months ago)
Author:
root
Message:
 
Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/action.php

    r89 r93  
    1313$table_name = $wpdb->prefix . "wassup"; 
    1414 
    15 if ( $_GET['hash'] != wp_hash(SECRET_KEY)) { 
    16         echo "Nothing to do here"; 
    17 } else { 
    1815        //Retrieve command-line arguments... 
    1916        $max_char_len = (urlencode(attribute_escape($_GET['width']))/10); 
     
    159156</div> 
    160157<?php 
    161         } 
    162158} 
    163159?> 
  • trunk/wassup.php

    r87 r93  
    2727 
    2828global $wp_version; 
     29/* 
    2930if (!defined('SECRET_KEY')) { 
    3031        function wassup_warning() { 
     
    3435        add_action('admin_notices', 'wassup_warning'); 
    3536        return; 
     37*/ 
    3638//#This works only in WP2.2 or higher 
    37 } elseif (version_compare($wp_version, '2.2', '<')) { 
     39if (version_compare($wp_version, '2.2', '<')) { 
    3840        wp_die( '<strong style="color:#c00;background-color:#dff;padding:5px;">'.__("Sorry, Wassup requires WordPress 2.2 or higher to work","wassup").'.</strong>'); 
    3941} else { 
     
    114116        //# display google chart by default for upgrades from 1.4.4 
    115117        if (!isset($wassup_settings['wassup_chart'])) { 
    116                 $wassup_settings['wassup_chart'] == 1; 
     118                $wassup_settings['wassup_chart'] = 1; 
    117119        } 
    118120        //#save wassup settings changes 
     
    172174function add_wassup_css() { 
    173175        global $wpurl; 
    174         $hash = wp_hash(SECRET_KEY); 
     176        //$hash = wp_hash(SECRET_KEY); 
    175177        $plugin_page = attribute_escape($_GET['page']); 
    176178 
     
    249251           var id = $(this).attr('id'); 
    250252                 $.ajax({ 
    251                   url: "<?php echo $wpurl; ?>/wp-content/plugins/<?php echo WASSUPFOLDER; ?>/lib/action.php?action=delete&hash=<?php echo $hash; ?>&id=" + id, 
     253                  url: "<?php echo $wpurl; ?>/wp-content/plugins/<?php echo WASSUPFOLDER; ?>/lib/action.php?action=delete&id=" + id, 
    252254                  async: false 
    253255                 }) 
     
    335337                limit: 10,  
    336338                fadeLast: 5,  
    337                 ajax: '<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?action=spy&hash=$hash"; ?>', 
     339                ajax: '<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?action=spy"; ?>', 
    338340                timeout: 2000,  
    339341                'timestamp': myTimestamp,  
     
    378380function WassUp() { 
    379381        global $wpdb, $version, $wpurl, $defaultWdata; 
     382        /* 
    380383        if ( !defined('SECRET_KEY') ) { 
    381384                echo "<div id='wassup-warning' class='updated fade-ff0000' style='padding:25px;'><p><strong style='color:#c00;'>".__("Sorry, Wassup requires SECRET_KEY constant declared in wp-config.php... Please read <a href='http://www.wpwp.org/download'>documentation</a> for more info...","wassup").".</strong></p></div>"; 
    382385        } 
    383386        $hash = wp_hash(SECRET_KEY); 
     387        */ 
    384388        $table_name = $wpdb->prefix . "wassup"; 
    385389        $wassup_settings = get_option('wassup_settings'); 
     
    798802                echo __('Auto refresh in','wassup').' <span id="CountDownPanel"></span> '.__('seconds','wassup'); ?> 
    799803                </td> 
    800                 <td align="right" style="font-size: 11px;"><a href="<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?height=400&width=$res&action=topten&hash=$hash&from_date=$from_date&to_date=$to_date"; ?>" class="thickbox"><?php _e('Show TopTen','wassup'); ?></a> - <a href="#" class='show-search'><?php _e('Search','wassup'); ?></a></td> 
     804                <td align="right" style="font-size: 11px;"><a href="<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?height=400&width=$res&action=topten&from_date=$from_date&to_date=$to_date"; ?>" class="thickbox"><?php _e('Show TopTen','wassup'); ?></a> - <a href="#" class='show-search'><?php _e('Search','wassup'); ?></a></td> 
    801805                </tr> 
    802806                </table> 
     
    864868                        <img src="<?php echo $wpurl.'/wp-content/plugins/'.WASSUPFOLDER.'/img/error_add.png" alt="'.__('mark','wassup').'" title="'.__('Mark IP','wassup'); ?>" /></a> 
    865869                <?php } ?> 
    866                 <a href="<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?height=400&width=$res&action=displayraw&hash=$hash&wassup_id=".$rk->wassup_id.""; ?>" class="thickbox"> 
     870                <a href="<?php echo $wpurl."/wp-content/plugins/".WASSUPFOLDER."/lib/action.php?height=400&width=$res&action=displayraw&wassup_id=".$rk->wassup_id.""; ?>" class="thickbox"> 
    867871                <img src="<?php echo $wpurl.'/wp-content/plugins/'.WASSUPFOLDER.'/img/database_table.png" alt="'.__('show raw table','wassup').'" title="'.__('Show the items as raw table','wassup'); ?>" /></a> 
    868872                </p> 
     
    10221026        global $wpdb, $wassup_settings; 
    10231027        $table_name = $wpdb->prefix . "wassup"; 
    1024         // Upgrade from version < 1.1b  
    1025         if ($wpdb->get_var("SHOW COLUMNS FROM $table_name LIKE 'username'") == "") { 
    1026                 $sql_add_username = "ALTER TABLE {$table_name} ADD COLUMN username VARCHAR( 50 ) NULL"; 
    1027                 $wpdb->query( $sql_add_username ); 
    1028         } 
    1029         if ($wpdb->get_var("SHOW COLUMNS FROM $table_name LIKE 'comment_author'") == "") { 
    1030                 $sql_add_comment_author = "ALTER TABLE {$table_name} ADD COLUMN comment_author VARCHAR( 50 ) NULL"; 
    1031                 $wpdb->query( $sql_add_comment_author ); 
    1032         } 
    1033         // Upgrade from version < 1.1.4b  
    1034         $Freferrer = $wpdb->get_results("show columns from $table_name LIKE 'referrer'"); 
    1035         foreach ($Freferrer as $ff) { 
    1036                 if (eregi("varchar", $ff->Type)) { 
    1037                         $sql_alter_referrer = "ALTER TABLE {$table_name} CHANGE referrer referrer TEXT NULL"; 
    1038                         $wpdb->query( $sql_alter_referrer ); 
    1039                 } 
    1040         } 
    1041         // Upgrade from version < 1.2b 
    1042         $Fsearchpage = $wpdb->get_results("show columns from $table_name LIKE 'searchpage'"); 
    1043         foreach ($Fsearchpage as $ss) { 
    1044                 if ($ss->Default == "") { 
    1045                         $sql_alter_searchpage = "ALTER TABLE {$table_name} CHANGE searchpage searchpage INT( 11 ) NULL DEFAULT '0'"; 
    1046                         $wpdb->query( $sql_alter_searchpage ); 
    1047                 } 
    1048         } 
    1049         $Fuseragent = $wpdb->get_results("show columns from $table_name LIKE 'agent'"); 
    1050         foreach ($Fuseragent as $ua) { 
    1051                 if ($ua->Type != "varchar(255)") { 
    1052                         $sql_alter_useragent = "ALTER TABLE {$table_name} CHANGE agent agent varchar(255) NULL"; 
    1053                         $wpdb->query( $sql_alter_useragent ); 
    1054                 } 
    1055         } 
    1056         $Fbrowser = $wpdb->get_results("show columns from $table_name LIKE 'browser'"); 
    1057         foreach ($Fbrowser as $br) { 
    1058                 if ($br->Type != "varchar(50)") { 
    1059                         $sql_alter_browser = "ALTER TABLE {$table_name} CHANGE browser browser varchar(50) NULL"; 
    1060                         $wpdb->query( $sql_alter_browser ); 
    1061                 } 
    1062         } 
    1063         $Fspider = $wpdb->get_results("show columns from $table_name LIKE 'spider'"); 
    1064         foreach ($Fspider as $sp) { 
    1065                 if ($sp->Type != "varchar(50)") { 
    1066                         $sql_alter_spider = "ALTER TABLE {$table_name} CHANGE spider spider varchar(50) NULL"; 
    1067                         $wpdb->query( $sql_alter_spider ); 
    1068                 } 
    1069         } 
    10701028        // Upgrade from version < 1.3.9  
    10711029        if ($wpdb->get_var("SHOW COLUMNS FROM $table_name LIKE 'spam'") == "") { 
     
    10781036function wassupAppend() { 
    10791037        global $wpdb, $wassup_id, $wp_query, $HTTP_COOKIE_VARS, $screen_res, $wassup_settings, $wpurl; 
     1038        /* 
    10801039        // don't do anything if SECRET_KEY is missing 
    10811040        if (defined('SECRET_KEY')) { 
     1041        */ 
    10821042        $siteurl =  get_bloginfo('siteurl'); 
    10831043        $table_name = $wpdb->prefix . "wassup"; //moved; 
     
    12781238 
    12791239        if ( $wassup_settings['wassup_spamcheck'] == 1 ) {  
    1280                 // 
    1281                 //# No duplicate spam testing in same session unless there  
    1282                 //#  is a forum page request or comment... 
    1283                 if (isset($spamresult) && stristr($urlRequested,"comment") === FALSE && stristr($urlRequested,"forum") === FALSE && empty($comment_user) && empty($_POST['comment'])) {  
    12841240                   //#first check for referrer spam (faster, if positive) 
    12851241                   //#...but skip when referrer is own blog ($siteurl/$wpurl) 
     
    12951251                   $spam = $spamresult; 
    12961252 
     1253                // 
     1254                //# No duplicate spam testing in same session unless there  
     1255                //#  is a forum page request or comment... 
     1256                if (isset($spamresult) && stristr($urlRequested,"comment") === FALSE && stristr($urlRequested,"forum") === FALSE && empty($comment_user) && empty($_POST['comment'])) {  
    12971257                //# No spam check on known bots (google, yahoo,...) unless 
    12981258                //#  there is a comment or forum page request... 
     
    14451405           } 
    14461406        } //if wassup_remind_flag 
    1447         } //if SECRET_KEY 
     1407        //} //if SECRET_KEY 
    14481408} //end function wassupAppend() 
    14491409