Пример #1
0
 function update_post()
 {
     $spinned = $this->article;
     //synonyms
     if (stristr($spinned, '911911')) {
         $spinned = str_replace('911911', '**9999**', $spinned);
     }
     $spinned_arr = explode('**9999**', $spinned);
     $spinned_ttl = $spinned_arr[0];
     $spinned_cnt = $spinned_arr[1];
     //spintaxed wrirretten instance
     require_once 'class.spintax.php';
     $spintax = new wp_auto_spinner_Spintax();
     $spintaxed = $spintax->spin($spinned);
     $spintaxed2 = $spintax->editor_form;
     $spintaxed_arr = explode('**9999**', $spintaxed);
     $spintaxed_arr2 = explode('**9999**', $spintaxed2);
     $spintaxed_ttl = $spintaxed_arr[0];
     $spintaxed_cnt = $spintaxed_arr[1];
     $spintaxed_cnt2 = $spintaxed_arr2[1];
     //update post meta
     $post_id = $this->id;
     update_post_meta($post_id, 'spinned_ttl', $spinned_ttl);
     update_post_meta($post_id, 'spinned_cnt', $spinned_cnt);
     update_post_meta($post_id, 'spintaxed_ttl', $spintaxed_ttl);
     update_post_meta($post_id, 'spintaxed_cnt', $spintaxed_cnt);
     update_post_meta($post_id, 'spintaxed_cnt2', $spintaxed_cnt2);
     update_post_meta($post_id, 'original_ttl', stripslashes($this->title));
     update_post_meta($post_id, 'original_cnt', stripslashes($this->post));
     $return = array();
     $return['spinned_ttl'] = $spinned_ttl;
     $return['spinned_cnt'] = $spinned_cnt;
     $return['spintaxed_ttl'] = $spintaxed_ttl;
     $return['spintaxed_cnt'] = $spintaxed_cnt;
     $return['spintaxed_cnt2'] = $spintaxed_cnt2;
     $return['original_ttl'] = $this->title;
     $return['original_cnt'] = $this->post;
     return $return;
 }
Пример #2
0
if ($_GET['action'] == 'identifysyn') {
    //spintax
    require_once 'inc/class.spintax.php';
    //spin it now
    require_once 'inc/class.spin.php';
    $spin = new wp_auto_spin_spin($_POST['post_id'], $_POST['title'], $_POST['post']);
    $return = $spin->spin_wrap();
    $return['status'] = 'success';
    print_r(json_encode($return));
    //REWRITE
} elseif ($_GET['action'] == 'rewrite') {
    //spintax
    require_once 'inc/class.spintax.php';
    //generate new spintax
    $content = stripslashes($_POST['title'] . '**9999**' . $_POST['post']);
    $spintax = new wp_auto_spinner_Spintax();
    $spintaxed = $spintax->spin($content);
    $spintaxed_arr = explode('**9999**', $spintaxed);
    $spintaxed_ttl = $spintaxed_arr[0];
    $spintaxed_cnt = $spintaxed_arr[1];
    $post_id = $_POST['post_id'];
    $spintaxed2 = $spintax->editor_form;
    $spintaxed2_arr = explode('**9999**', $spintaxed2);
    $spintaxed2_cnt = $spintaxed2_arr[1];
    update_post_meta($post_id, 'spintaxed_cnt2', $spintaxed2_cnt);
    //update post meta
    $post_id = $_POST['post_id'];
    update_post_meta($post_id, 'spintaxed_ttl', $spintaxed_ttl);
    update_post_meta($post_id, 'spintaxed_cnt', $spintaxed_cnt);
    $return['spintaxed_ttl'] = $spintaxed_arr[0];
    $return['spintaxed_cnt2'] = $spintaxed2_arr[1];