function __construct()
 {
     $widget_ops = array('classname' => 'ds-widget-recent-visitors', 'description' => '最近访客(由多说提供)');
     parent::__construct('ds-recent-visitors', '最近访客(多说)', $widget_ops);
     $this->alt_option_name = 'duoshuo_widget_recent_visitors';
     if (is_active_widget(false, false, $this->id_base)) {
         add_action('wp_head', array(&$this, 'printScripts'));
     }
     //add_action( 'comment_post', array(&$this, 'flush_widget_cache') );
     //add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') );
     $this->duoshuoPlugin = Duoshuo_WordPress::getInstance();
 }
Exemple #2
0
	die('-1');*/
if (!extension_loaded('json')) {
    include dirname(__FILE__) . '/compat-json.php';
}
require '../../../wp-load.php';
require '../../../wp-admin/includes/admin.php';
do_action('admin_init');
if (!headers_sent()) {
    nocache_headers();
    header('Content-Type: text/javascript; charset=utf-8');
}
if (!class_exists('Duoshuo_WordPress', false)) {
    $response = array('code' => 30, 'errorMessage' => 'Duoshuo plugin hasn\'t been activated.');
    echo json_encode($response);
    exit;
}
require DUOSHUO_PLUGIN_PATH . '/LocalServer.php';
$plugin = Duoshuo_WordPress::getInstance();
try {
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $input = $_POST;
        if (isset($input['spam_confirmed'])) {
            //D-Z Theme 会给POST设置这个参数
            unset($input['spam_confirmed']);
        }
        $server = new Duoshuo_LocalServer($plugin);
        $server->dispatch($input);
    }
} catch (Exception $e) {
    $plugin->sendException($e);
}
Exemple #3
0
 function __construct()
 {
     $widget_ops = array('classname' => 'ds-widget-top-threads', 'description' => '热评文章(由多说提供)');
     parent::__construct('ds-top-threads', '热评文章(多说)', $widget_ops);
     $this->alt_option_name = 'duoshuo_widget_top_threads';
     $this->duoshuoPlugin = Duoshuo_WordPress::getInstance();
 }