Changeset 864461
- Timestamp:
- 02/25/2014 03:27:56 AM (12 years ago)
- Location:
- td-instagram-import/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
td-instagram-import.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
td-instagram-import/trunk/readme.txt
r854502 r864461 5 5 Requires at least: 3.0 6 6 Tested up to: 3.8.1 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 44 44 45 45 == Changelog == 46 = 1.0.2 = 47 * several bugs fixed 46 48 47 49 = 1.0.1 = … … 61 63 62 64 == Upgrade Notice == 65 = 1.0.2 = 66 A minor bug fixing update 63 67 64 68 = 1.0.1 = -
td-instagram-import/trunk/td-instagram-import.php
r854502 r864461 4 4 * Plugin URI: http://www.transcendevelopment.com/td-instagram-import/ 5 5 * Description: Import your instagram pics 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Author: TranscenDevelopment 8 8 * Author URI: http://www.transcendevelopment.com … … 29 29 30 30 define('DIRURL', plugin_dir_url( __FILE__ )); 31 define('TDIIVER', '1.0. 1');31 define('TDIIVER', '1.0.2'); 32 32 define('TDIIICON', '../wp-content/plugins/td-instagram-import/images/td_ii_icon.png'); 33 33 … … 48 48 global $wpdb; 49 49 50 if ($_POST[td_ii_action] == 'removeCID') { 50 if (isset($_POST['td_ii_action'])) {$td_ii_action = filter_var($_POST['td_ii_action'], FILTER_SANITIZE_STRING);} else {$td_ii_action='';} 51 52 if ($td_ii_action == 'removeCID') { 51 53 delete_option('td_ii_clientID'); 52 54 delete_option('td_ii_clientSEC'); … … 60 62 } 61 63 62 if ($_POST[td_ii_clientID]) { 63 $theID = filter_var($_POST[td_ii_clientID], FILTER_SANITIZE_STRING); 64 $theSEC = filter_var($_POST[td_ii_clientSEC], FILTER_SANITIZE_STRING); 64 if (isset($_POST['td_ii_clientID'])) {$clientID = filter_var($_POST['td_ii_clientID'], FILTER_SANITIZE_STRING);} else {$clientID='';} 65 if (isset($_POST['td_ii_clientSEC'])) {$clientSEC = filter_var($_POST['td_ii_clientSEC'], FILTER_SANITIZE_STRING);} else {$clientSEC='';} 66 if ($clientID) { 67 $theID = $clientID; 68 $theSEC = $clientSEC; 65 69 add_option('td_ii_clientID', $theID, '', 'yes'); 66 70 add_option('td_ii_clientSEC', $theSEC, '', 'yes'); … … 74 78 $td_ii_clientSEC = get_option('td_ii_clientSEC'); 75 79 76 if ($_GET[code]) { 77 td_ii_getAuthorization($_GET[code], $reURLnoEnc, $td_ii_clientID, $td_ii_clientSEC); 80 if (isset($_GET['code'])) {$code = filter_var($_GET['code'], FILTER_SANITIZE_STRING);} else {$code='';} 81 if ($code) { 82 if (($td_ii_clientID) && ($td_ii_clientSEC)) { 83 td_ii_getAuthorization($code, $reURLnoEnc, $td_ii_clientID, $td_ii_clientSEC); 84 } 78 85 } 79 86 … … 140 147 } 141 148 142 143 if ($_GET[action] == 'showfeed') { 149 $showFeed=''; 150 if (isset($_GET['action'])) {$action = filter_var($_GET['action'], FILTER_SANITIZE_STRING);} else {$action='';} 151 if ($action == 'showfeed') { 144 152 if ($td_ii_AccessToken) { 145 153 $showFeed = td_ii_getUsersFeed(0, 0); 146 154 } 147 } elseif ($ _GET[action]== 'bulkimport') {155 } elseif ($action == 'bulkimport') { 148 156 $showFeed = " 149 157 <h3>Bulk Import</h3> … … 189 197 //---------------------------------------------------------// 190 198 global $wpdb; 191 199 $retVal=''; 192 200 $td_ii_AccessToken = get_option('td_ii_AccessToken'); 193 $td_ii_uID = get_option('td_ii_uID'); 194 $whichURL = filter_var($_GET[i], FILTER_SANITIZE_STRING);201 $td_ii_uID = get_option('td_ii_uID'); 202 if (isset($_GET['i'])) {$whichURL = filter_var($_GET['i'], FILTER_SANITIZE_STRING);} else {$whichURL='';} 195 203 196 204 $extraQuery = "&count=10000"; … … 215 223 $instAr = json_decode($output, true); 216 224 217 $nextPage = $instAr['pagination']['next_url'];225 if (isset($instAr['pagination']['next_url'])) {$nextPage = $instAr['pagination']['next_url'];} else {$nextPage='';} 218 226 if ($nextPage) {$nextPage = urlencode($nextPage);} 219 227 220 228 foreach ($instAr['data'] as $key => $value) { 221 229 unset($tags); 230 $tags=''; 222 231 if ($value['tags']) { 223 232 foreach ($value['tags'] as $tag => $tagVal) { … … 281 290 function td_ii_loadMore() { 282 291 //---------------------------------------------------------// 283 $count = filter_var($_POST[ count], FILTER_SANITIZE_STRING);284 $page = filter_var($_POST[ page], FILTER_SANITIZE_STRING);292 $count = filter_var($_POST['count'], FILTER_SANITIZE_STRING); 293 $page = filter_var($_POST['page'], FILTER_SANITIZE_STRING); 285 294 $page = urldecode($page); 286 295 echo td_ii_getUsersFeed($page, $count); … … 462 471 $instObj = json_decode($output); 463 472 464 $td_ii_AccessToken = $instObj->access_token;465 $td_ii_username = $instObj->user->username;466 $td_ii_bio = $instObj->user->bio;467 $td_ii_website = $instObj->user->website;468 $td_ii_picture = $instObj->user->profile_picture;469 $td_ii_fullname = $instObj->user->fullname;470 $td_ii_uID = $instObj->user->id;471 472 delete_option('td_ii_AccessToken'); add_option('td_ii_AccessToken', $td_ii_AccessToken,'', 'yes');473 delete_option('td_ii_username'); add_option('td_ii_username', $td_ii_username,'', 'yes');474 delete_option('td_ii_bio'); add_option('td_ii_bio', $td_ii_bio,'', 'yes');475 delete_option('td_ii_website'); add_option('td_ii_website', $td_ii_website,'', 'yes');476 delete_option('td_ii_picture'); add_option('td_ii_picture', $td_ii_picture,'', 'yes');477 delete_option('td_ii_fullname'); add_option('td_ii_fullname', $td_ii_fullname,'', 'yes');478 delete_option('td_ii_uID'); add_option('td_ii_uID', $td_ii_uID,'', 'yes'); 473 $td_ii_AccessToken = $instObj->access_token; 474 $td_ii_username = $instObj->user->username; 475 $td_ii_bio = $instObj->user->bio; 476 $td_ii_website = $instObj->user->website; 477 $td_ii_picture = $instObj->user->profile_picture; 478 $td_ii_fullname = ''; 479 $td_ii_uID = $instObj->user->id; 480 delete_option('td_ii_AccessToken'); add_option('td_ii_AccessToken', $td_ii_AccessToken,'', 'yes'); 481 delete_option('td_ii_username'); add_option('td_ii_username', $td_ii_username,'', 'yes'); 482 delete_option('td_ii_bio'); add_option('td_ii_bio', $td_ii_bio,'', 'yes'); 483 delete_option('td_ii_website'); add_option('td_ii_website', $td_ii_website,'', 'yes'); 484 delete_option('td_ii_picture'); add_option('td_ii_picture', $td_ii_picture,'', 'yes'); 485 delete_option('td_ii_fullname'); add_option('td_ii_fullname', $td_ii_fullname,'', 'yes'); 486 delete_option('td_ii_uID'); add_option('td_ii_uID', $td_ii_uID,'', 'yes'); 487 479 488 } 480 489 //---------------------------------------------------------// 481 490 function td_ii_settings() { 482 491 //---------------------------------------------------------// 483 $action = $_POST[action]; 484 492 if (isset($_POST['action'])) {$action = filter_var($_POST['action'], FILTER_SANITIZE_STRING);} else {$action='';} 485 493 if ($action == 'td_ii_saveSettings') { 486 $td_ii_importTags = filter_var($_POST[td_ii_importTags], FILTER_SANITIZE_STRING); 487 $td_ii_cat = filter_var($_POST[td_ii_cat], FILTER_SANITIZE_STRING); 488 $td_ii_postType = filter_var($_POST[td_ii_postType], FILTER_SANITIZE_STRING); 489 $td_ii_theTemplate = filter_var($_POST[td_ii_theTemplate], FILTER_SANITIZE_SPECIAL_CHARS); 494 if (isset($_POST['td_ii_importTags'])) {$td_ii_importTags = filter_var($_POST['td_ii_importTags'], FILTER_SANITIZE_STRING);} 495 else {$td_ii_importTags='';} 496 $td_ii_cat = filter_var($_POST['td_ii_cat'], FILTER_SANITIZE_STRING); 497 $td_ii_postType = filter_var($_POST['td_ii_postType'], FILTER_SANITIZE_STRING); 498 $td_ii_theTemplate = filter_var($_POST['td_ii_theTemplate'], FILTER_SANITIZE_SPECIAL_CHARS); 490 499 491 500 delete_option('td_ii_importTags'); … … 502 511 } 503 512 513 $select1=''; $select2=''; 504 514 $td_ii_importTags = get_option('td_ii_importTags'); 505 if ($td_ii_importTags == 1) {$checkBox1='checked';} 515 if ($td_ii_importTags == 1) {$checkBox1='checked';} else {$checkBox1='';} 506 516 $td_ii_cat = get_option('td_ii_cat'); 507 517 $td_ii_postType = get_option('td_ii_postType'); … … 582 592 '; 583 593 add_option( "td_ii_theTemplate", $theTemplate, '', 'yes'); 584 add_option( "td_ii_db_version", "1.0. 1" );594 add_option( "td_ii_db_version", "1.0.2" ); 585 595 586 596 }
Note: See TracChangeset
for help on using the changeset viewer.