Changeset 847524
- Timestamp:
- 01/29/2014 07:27:54 AM (12 years ago)
- Location:
- free-guest-post/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
free-guest-post/trunk/Model.php
r760822 r847524 1 1 <?php 2 2 3 define('MODEL_SIMULATION_LOCAL', false); // set to true for proudction mode3 define('MODEL_SIMULATION_LOCAL', true); // set to true for proudction mode 4 4 5 5 class eSourceGhostWriterPluginModel{ 6 6 7 7 public $api_key; 8 8 public $api_url; 9 9 public $api_action_url; 10 10 11 11 public function __construct(){ 12 12 13 13 if(MODEL_SIMULATION_LOCAL){ 14 $this->api_url = 'http://freeguestpost. com/app/api/';14 $this->api_url = 'http://freeguestpost.loc/api/'; 15 15 }else{ 16 16 $this->api_url = 'http://freeguestpost.com/app/api/'; … … 205 205 206 206 $api_url = $this->api_url . 'publisher/getpublishedarticles/' . $this->api_key; 207 208 $request = new WP_Http; 209 210 $res = $request->request( $api_url , array( 'method' => 'GET')); 207 208 $request = new WP_Http; 209 210 $post_array['site_url'] = $_SERVER['SERVER_NAME']; 211 212 $res = $request->request( $api_url , array( 'method' => 'POST','body'=>$post_array )); 211 213 212 214 $res = json_decode($res['body']); … … 219 221 220 222 $api_url = $this->api_url . 'publisher/setarticleaspublish/' . $this->api_key . '/' . $article_id . '/' . $post_id ; 221 223 222 224 $post_array['site_url'] = $_SERVER['SERVER_NAME']; 223 225 224 226 $request = new WP_Http; 225 227 … … 422 424 } 423 425 426 public function getIsFlagged() 427 { 428 429 $api_url = $this->api_url .'publisher/isflagged/'.$this->api_key; 430 431 $post_array['site_url'] = $_SERVER['SERVER_NAME']; 432 433 $request = new WP_Http; 434 435 $res = $request->request( $api_url, array('method'=>'POST', 'body'=> $post_array)); 436 return json_decode($res['body']); 437 } 438 439 424 440 } -
free-guest-post/trunk/index.php
r761557 r847524 592 592 'post_category' => $categories 593 593 ); 594 594 595 595 $post_id = wp_insert_post( $post_to_import ); 596 596 … … 636 636 637 637 $content_requests = $this->ghostwriter_model->getContentRequests(); 638 638 639 $is_flagged = $this->ghostwriter_model->getIsFlagged(); 640 639 641 include_once($this->plugin_path . 'views/dashboard.php'); 640 642
Note: See TracChangeset
for help on using the changeset viewer.