Changeset 1055221
- Timestamp:
- 12/27/2014 09:26:55 PM (11 years ago)
- Location:
- mygamertag/trunk
- Files:
-
- 2 edited
-
MyGamerTag.php (modified) (9 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mygamertag/trunk/MyGamerTag.php
r1053691 r1055221 5 5 Plugin URI: http://thecertifiedtech.net 6 6 Description: Pulls Xbox Gamertag Info And Displays In Widget 7 Version: 1. 07 Version: 1.1 8 8 Author: Paul Dow 9 9 Author URI: http://thecertifiedtech.net … … 84 84 function widget($args, $instance) 85 85 { 86 extract( $args , EXTR_SKIP);86 extract( $args); 87 87 $title = ($instance['title']); 88 88 // 89 89 global $wpdb; 90 90 $table_name = $wpdb->prefix . 'MyGamerTag'; 91 $userdata = $wpdb->get_row("SELECT * FROM ".$table_name.""); 92 91 $id = 0;$userdata = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$table_name." WHERE id = %d", $id)); 93 92 $currentgamertag = $userdata->gamertag; 94 93 $currentgamerscore = $userdata->gamerscore; 95 $currentname = $userdata->name;96 $currentlocation = $userdata->location;97 94 $currenttier = $userdata->tier; 98 95 $currentrep = $userdata->xboxonerep; … … 147 144 add_menu_page( 'MyGamerTag', 'MGT Settings', 'manage_options', __FILE__, 'MGT_settings' ); 148 145 } 149 add_action('settings_refresh','MGT_settings');150 146 function MGT_settings() 151 147 { … … 153 149 <?php 154 150 global $wpdb; 155 $table_name = $wpdb->prefix . 'MyGamerTag'; 156 $userdata = $wpdb->get_row( "SELECT * FROM ".$table_name."");151 $table_name = $wpdb->prefix . 'MyGamerTag';$id = 0; 152 $userdata = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$table_name." WHERE id = %d", $id)); 157 153 $currentgamertag = $userdata->gamertag; 158 154 $currentxboxapikey = $userdata->xboxapikey; … … 194 190 $table_name = $wpdb->prefix . 'MyGamerTag'; 195 191 $cleangamertag = rawurlencode($_POST['gamertag']); 196 $wpdb->replace( $table_name, array( 'gamertag' => $cleangamertag, 'xboxapikey' => $_POST['xboxapikey'] ) ); 192 $id = 0; 193 $wpdb->update( $table_name, array( 'gamertag' => $cleangamertag, 'xboxapikey' => $_POST['xboxapikey'] ), array('ID' => $id) ); 197 194 // 198 195 do_action('xbox_api','execute_xboxapi'); … … 215 212 // 216 213 $table_name = $wpdb->prefix . 'MyGamerTag'; 217 $ userdata = $wpdb->get_row("SELECT * FROM ".$table_name."");214 $id = 0;$userdata = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".$table_name." WHERE id = %d", $id)); 218 215 $insertgamertag = $userdata->gamertag; 219 216 $insertxboxapikey = $userdata->xboxapikey; … … 227 224 curl_close($ch); 228 225 $pdata = json_decode ( $presult ); 229 $table_name = $wpdb->prefix . 'MyGamerTag'; 230 $wpdb->replace( 226 if ($pdata === NULL){ 227 die(); 228 } 229 else{ 230 $id = 0; 231 $table_name = $wpdb->prefix . 'MyGamerTag'; 232 $wpdb->update( 231 233 $table_name, 232 234 array( … … 234 236 'gamerpic' => $pdata->GameDisplayPicRaw, 235 237 'gamerscore' => $pdata->Gamerscore, 236 'gamertag' => $ pdata->Gamertag,238 'gamertag' => $userdata->gamertag, 237 239 'xboxonerep' => $pdata->XboxOneRep, 238 240 'xboxapikey' => $userdata->xboxapikey, 239 ) 241 ), array('ID' => $id) 240 242 ); 241 243 // … … 255 257 ); 256 258 } 259 } 257 260 register_deactivation_hook(__FILE__,'stop_grabdata'); 258 261 function stop_grabdata(){ wp_clear_scheduled_hook('xbox_api');} -
mygamertag/trunk/readme.txt
r1053700 r1055221 5 5 Requires at least: 4.0 6 6 Tested up to: 4.1 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 28 28 = Option 1 = 29 1. Click 'Add New' -> Search WordPress Plugin Directory For 'MyGamerTag'. 30 1. Click 'Install Now' Then Click 'Activate'. 31 32 = Option 2 = 29 33 1. Unzip 'MyGamerTag.zip' Upload the `MyGamerTag` folder to the `/wp-content/plugins/` directory. 30 34 1. Activate the plugin through the 'Plugins' menu in WordPress. 31 35 32 = Option 2=36 = Option 3 = 33 37 1. Click 'Add New' -> 'Upload Plugin' -> 'Choose File' -> Choose The 'MyGamerTag.zip' that you downloaded. 34 1. Then Activate Plugin38 1. Activate the plugin through the 'Plugins' menu in WordPress. 35 39 36 40 You will find 'MGT' settings menu in your WordPress admin panel on the left side. … … 57 61 == Changelog == 58 62 63 = 1.1 = 64 65 * Plugin Now Retains Data If Xbox Live or API Goes Offline 66 59 67 = 1.0 = 60 68 … … 63 71 == Upgrade Notice == 64 72 73 = 1.1 = 74 75 * Plugin Now Retains Data If Xbox Live or API Goes Offline 76 65 77 = 1.0 = 66 78
Note: See TracChangeset
for help on using the changeset viewer.