Typecho二开之文章无限点赞

以JOE主题为例,其他主题可以参考目录寻找对应文件

修改 /usr/themes/Joe/core/route.php

图片[1]-Typecho二开之文章无限点赞-米克随笔
if (sizeof($row) > 0) {
//        if ($type === "agree") {
//            $db->query($db->update('table.contents')->rows(array('agree' => (int)$row['agree'] + 1))->where('cid = ?', $cid));
//        } else {
//            $db->query($db->update('table.contents')->rows(array('agree' => (int)$row['agree'] - 1))->where('cid = ?', $cid));
//        }
        $db->query($db->update('table.contents')->rows(array('agree' => (int)$row['agree'] + 1))->where('cid = ?', $cid));

        $self->response->throwJson(array(
            "code" => 1,
            "data" => array('agree' => number_format($db->fetchRow($db->select('agree')->from('table.contents')->where('cid = ?', $cid))['agree']))
        ));
    } else {
        $self->response->throwJson(array("code" => 0, "data" => null));
    }

找不到上面的文件可以搜索关键词

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容