示例#1
0
 public function actionInfo()
 {
     $id = intval($this->post("id", 0));
     if (!$id) {
         return $this->renderJSON([], "指定博文不存在", -1);
     }
     $post_info = Posts::find()->where(['status' => 1, 'id' => $id])->one();
     if (!$post_info) {
         return $this->renderJSON([], "指定博文不存在", -1);
     }
     $tmp_tags = explode(",", $post_info['tags']);
     $content = preg_replace("/brush:(\\w+);toolbar:false/", "prettyprint linenums", $post_info['content']);
     $info = ['author' => ['name' => DataHelper::getAuthorName()], 'title' => $post_info['title'], 'content' => $content, "tags" => $tmp_tags, 'updated_time' => date("Y-m-d H:i", strtotime($post_info['updated_time']))];
     $share_info = ['title' => $post_info['title'], 'content' => UtilHelper::blog_short($post_info['content'], 200), 'url' => GlobalUrlService::buildWapUrl("/default/info", ['id' => $post_info['id']])];
     return $this->renderJSON(['info' => $info, 'share_info' => $share_info]);
 }
示例#2
0
文件: index.php 项目: apanly/dream
use blog\components\StaticService;
use common\components\DataHelper;
use common\service\GlobalUrlService;
StaticService::includeAppJsStatic("/js/wap/wechat_wall/index.js", \blog\assets\WapAsset::className());
?>
<ol class="am-breadcrumb">
    <li><a href="<?php 
echo GlobalUrlService::buildWapUrl("/demo/index");
?>
">Demo列表</a></li>
    <li class="am-active">微信墙</li>
</ol>
<div class="am-g">
    <div class="am-u-sm-12 am-u-md-12">
        <p class="am-text-xl am-text-center"><?php 
echo DataHelper::getAuthorName();
?>
微信墙</p>
    </div>
    <div class="am-u-sm-12 am-u-md-12">
        <?php 
if ($list) {
    ?>
        <ul class="am-comments-list am-comments-list-flip">
            <?php 
    foreach ($list as $_item) {
        ?>
            <li class="am-comment" data_id="<?php 
        echo $_item["id"];
        ?>
">
示例#3
0
    private function urlTips()
    {
        $author_nickname = DataHelper::getAuthorName();
        $resData = <<<EOT
{$author_nickname}收到您提供的链接
系统会自己抓取内容,审核之后就会展示!!
EOT;
        return $resData;
    }