Plugin Directory

Changeset 1741743


Ignore:
Timestamp:
10/05/2017 04:34:29 PM (8 years ago)
Author:
oskarn97
Message:

added zaki

File:
1 edited

Legend:

Unmodified
Added
Removed
  • appful/trunk/singletons/api.php

    r1741710 r1741743  
    2727        add_action('create_term', array(&$this, 'updateTaxonomy'));
    2828        add_action('wp_enqueue_scripts', array(&$this, 'load_jquery'));
     29
     30        add_action('wp_ajax_zaki_like_dislike_ajax', array(&$this,'onZakiCommentLike'), 1, 0);
     31        add_action('wp_ajax_nopriv_zaki_like_dislike_ajax', array(&$this,'onZakiCommentLike'), 1, 0);
    2932
    3033
     
    504507                        $post_id = get_the_ID();
    505508                        if ($post_id) {
    506                             $this->response->respond(appful_on_post($post_id, isset($_REQUEST["push"])));
     509                            $this->response->respond(appful_on_post($post_id, isset($_REQUEST["dopush"])));
    507510                        }
    508511                        die();
     
    13881391    }
    13891392
     1393
    13901394    function hasZakiCommentLike() {
    13911395        include_once(ABSPATH . 'wp-admin/includes/plugin.php');
    13921396        return is_plugin_active("zaki-like-dislike-comments/zaki-like-dislike-comments.php");
    13931397    }
     1398
     1399
     1400    function onZakiCommentLike() {
     1401        global $wpdb;
     1402        $commentID = intval($_POST['postid']);
     1403        $row = $wpdb->get_row("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = ". $commentID);
     1404        if($row) {
     1405            appful_on_post($row->comment_post_ID, false);
     1406        }
     1407    }
    13941408}
    13951409
Note: See TracChangeset for help on using the changeset viewer.