Changeset 1460249
- Timestamp:
- 07/25/2016 01:58:26 PM (10 years ago)
- File:
-
- 1 edited
-
selectyco/trunk/selectyco.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
selectyco/trunk/selectyco.php
r1431480 r1460249 14 14 define("SELECTYCO_DIR", plugin_dir_path( __FILE__ )); 15 15 //define("SELECTYCO_HOST", "http://api.selectyco.local"); 16 define("SELECTYCO_HOST", "http://api-qa.selectyco.com");17 //define("SELECTYCO_HOST", "https://api-qa.selectyco.com");16 //define("SELECTYCO_HOST", "http://api-qa.selectyco.com"); 17 define("SELECTYCO_HOST", "https://api-qa.selectyco.com"); 18 18 //define("SELECTYCO_HOST", "https://api.selectyco.com"); 19 19 20 require('FirePHPCore/fb.php'); 21 ob_start(); 22 20 23 if(!class_exists('syc_class')) { 21 24 class syc_class { … … 42 45 } 43 46 else { 44 add_filter( 'the_content', array($this, 'mod_single_post') );45 47 add_filter( 'the_content', array($this, 'add_button_to_post') ); 46 48 } … … 239 241 240 242 curl_setopt_array($ch, array( 243 CURLOPT_SSL_VERIFYPEER => FALSE, 241 244 CURLOPT_POST => TRUE, 242 245 CURLOPT_RETURNTRANSFER => TRUE, … … 327 330 328 331 329 330 function mod_single_post($sycContent) { 331 if ( !is_front_page() && !is_home() ) { 332 if(isset($_POST['token'])) { 332 function add_button_to_post($sycContent) { 333 $a = array('is_admin' => is_admin(),'is_home' => is_home(), 'is_front_page' => is_front_page(), 'is_single' => is_single(), 'is_page' => is_page()); 334 fb($a); 335 336 //posts over-view 337 if(is_front_page() && is_home()) { 338 fb('is_front_page && is_home'); 339 return $this->generate_button(); 340 } 341 //single post-view 342 elseif(is_single()) { 343 fb($sycContent); 344 345 //purchasing process 346 if(isset($_POST['token'])) { 333 347 $sig_req = $_POST['token']; 334 348 $fsi = new VerificateSycItem(); 335 349 $success = $fsi->parse_signed_request($sig_req); 336 350 if($success) { 337 echo$sycContent;351 return $sycContent; 338 352 } 339 353 } 340 else { 341 echo $this->generate_button(); 342 } 343 } 344 } 345 346 function add_button_to_post() 347 { 348 if ( is_home() ) { 349 return $this->generate_button(); 350 } 351 } 352 354 //direct link 355 else { 356 return $this->generate_button(); 357 } 358 } 359 elseif(is_page()) { 360 fb($sycContent); 361 return $sycContent; 362 } 363 } 364 353 365 354 366 function generate_button()
Note: See TracChangeset
for help on using the changeset viewer.