setDefault('parentId=0'); /** 初始化回调函数 */ if (function_exists('singlePing')) { $this->customSinglePingCallback = true; } } /** * 输出文章回响数 * * @param mixed ...$args 评论数格式化数据 */ public function num(...$args) { if (empty($args)) { $args[] = '%d'; } echo sprintf($args[$this->length] ?? array_pop($args), $this->length); } /** * execute * * @access public * @return void * @throws Exception */ public function execute() { if (!$this->parameter->parentId) { return; } $select = $this->select()->where('table.comments.status = ?', 'approved') ->where('table.comments.cid = ?', $this->parameter->parentId) ->where('table.comments.type <> ?', 'comment') ->order('table.comments.coid', 'ASC'); $this->db->fetchAll($select, [$this, 'push']); } /** * 列出回响 * * @param mixed $singlePingOptions 单个回响自定义选项 */ public function listPings($singlePingOptions = null) { if ($this->have()) { //初始化一些变量 $parsedSinglePingOptions = Config::factory($singlePingOptions); $parsedSinglePingOptions->setDefault([ 'before' => '