Plugin Directory

Changeset 847524


Ignore:
Timestamp:
01/29/2014 07:27:54 AM (12 years ago)
Author:
adamljsorensen11
Message:

feature : notification flag

Location:
free-guest-post/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • free-guest-post/trunk/Model.php

    r760822 r847524  
    11<?php
    22
    3 define('MODEL_SIMULATION_LOCAL', false); // set to true for proudction mode
     3define('MODEL_SIMULATION_LOCAL', true); // set to true for proudction mode
    44
    55class eSourceGhostWriterPluginModel{
    6    
     6
    77    public $api_key;
    88    public $api_url;
    99    public $api_action_url;
    10    
     10
    1111    public function __construct(){
    12        
     12
    1313        if(MODEL_SIMULATION_LOCAL){
    14             $this->api_url = 'http://freeguestpost.com/app/api/';
     14            $this->api_url = 'http://freeguestpost.loc/api/';
    1515        }else{
    1616            $this->api_url = 'http://freeguestpost.com/app/api/';
     
    205205
    206206        $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 ));
    211213
    212214        $res = json_decode($res['body']);
     
    219221
    220222        $api_url = $this->api_url . 'publisher/setarticleaspublish/' . $this->api_key . '/' . $article_id . '/' . $post_id ;
    221        
     223
    222224        $post_array['site_url'] = $_SERVER['SERVER_NAME'];
    223                
     225
    224226        $request = new WP_Http;
    225227
     
    422424    }
    423425
     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
    424440}
  • free-guest-post/trunk/index.php

    r761557 r847524  
    592592                    'post_category' => $categories
    593593                  );
    594  
     594
    595595              $post_id = wp_insert_post( $post_to_import );
    596596     
     
    636636       
    637637        $content_requests = $this->ghostwriter_model->getContentRequests();
    638        
     638
     639        $is_flagged = $this->ghostwriter_model->getIsFlagged();
     640
    639641        include_once($this->plugin_path . 'views/dashboard.php');
    640642
Note: See TracChangeset for help on using the changeset viewer.