public function pageList() { $firstRow = I('post.firstRow'); $count = M('article')->count(); //总条数 if ($firstRow >= $count) { $this->error('complate'); } $data = M('article')->limit($firstRow . ',' . $this->rowCowIndex)->order('posttime desc')->select(); if ($data) { $str = ''; $couData = count($data); for ($i = 0; $i != $couData; $i++) { $str .= '<div class="row" style="padding-top:20px;">'; $str .= ' <div class="col-md-9">'; $str .= ' <a href="' . U(CONTENT . '/' . $data[$i]['id']) . '}"><h3 style="padding-bottom: 3px;margin-top:3px;">' . $data[$i]['title'] . '</h3></a> '; $str .= ' <p style="padding-bottom: 10px;">' . subtext(strip_tags(htmlspecialchars_decode($data[$i]['content'])), 120) . '</p> '; $str .= ' <p class="p-bottom">'; $str .= ' <span class="glyphicon glyphicon-tag"></span>'; $str .= $data[$i]['lable']; $str .= ' <span class="glyphicon glyphicon-thumbs-up" style="margin-left: 20px;"></span>'; $str .= $data[$i]['rise']; $str .= ' <span style="margin-left: 20px;"> '; $str .= ' <span class="glyphicon glyphicon-eye-open"></span> '; $str .= $data[$i]['view']; $str .= ' </span> '; $str .= ' <span style="margin-left: 20px;"> '; $str .= ' <span class="glyphicon glyphicon-calendar"></span> '; $str .= $data[$i]['posttime']; $str .= ' </span>'; $str .= ' <a href="' . U(CONTENT . '/' . $data[$i]['id']) . '" style="float:right;text-decoration:none;">'; $str .= ' 阅读全文'; $str .= ' </a>'; $str .= ' </p>'; $str .= ' </div>'; $str .= ' <div class="col-md-3">'; if (empty($vo['logo'])) { $str .= '<img src="/myblog/Public/images/shanzhijing.png" class="img-responsive ">'; } else { $str .= '<img src="' . $data[$i]['logo'] . '" class="img-responsive ">'; } $str .= ' </div>'; $str .= ' </div>'; $str .= ' <hr class="hr-bottom">'; } $this->success($str); } else { $this->error("加载失败"); } }
public function doAddSysMsg($type, $receiverid, $objid = NULL) { if (empty($type) || empty($receiverid)) { return; } $theme = ""; $content = ""; $uid = $this->user['id']; $user = M('user')->where("id={$uid}")->find(); switch ($type) { case 'follow': $theme = "新的关注"; $content = "用户" . $user['username'] . "关注了你!"; break; case 'followproject': $theme = "新的关注"; $projectname = M('project')->where("id={$objid}")->getField('pname'); $content = "用户" . $user['username'] . "关注了你的项目:" . $projectname; break; case 'liketopic': $theme = "主题获得了赞"; $topicname = M('topic')->where("id={$objid}")->getField('content'); $topicname = subtext($topicname, 15); $content = "用户" . $user['username'] . "赞了你的主题:" . $topicname; break; case 'likeblog': $theme = "博客获得了赞"; $blogname = M('blog')->where("id={$objid}")->getField('title'); $blogname = subtext($blogname, 20); $content = "用户" . $user['username'] . "赞了你的博客:" . $blogname; break; case 'replytopic': $theme = "主题新回复"; $topic = M('topic')->where("id={$objid}")->find(); $tid = $topic['id']; $topicname = subtext($topic['content'], 15); $url = U('Home/Share/detailtopic', array('id' => $tid, 'uid' => $receiverid)); $content = "用户" . $user['username'] . "回复了你的主题:<a href='" . $url . "' target='_blank'>" . $topicname . "</a>"; $content = htmlspecialchars($content); break; case 'replyblog': $theme = "博客新回复"; $blog = M('blog')->where("id={$objid}")->find(); $bid = $blog['id']; $blogname = subtext($blog['title'], 20); $url = U('Home/Share/detailblog', array('id' => $bid, 'uid' => $receiverid)); $content = "用户" . $user['username'] . "回复了你的博客:<a href='" . $url . "' target='_blank'>" . $blogname . "</a>"; $content = htmlspecialchars($content); break; /* case 'liketopiccomment': $theme = "博客新回复"; $blogname = M('blog')->where("id=$objid")->getField('title'); $blogname = subtext($blogname, 12); $content = "用户" . $user['username'] . "回复了你的:" . $blogname; break; case 'likeblogcomment': $theme = "博客新回复"; $blogname = M('blog')->where("id=$objid")->getField('title'); $blogname = subtext($blogname, 12); $content = "用户" . $user['username'] . "回复了你的博客:" . $blogname; break;*/ } $add['senderid'] = 0; $add['content'] = $content; $add['statu'] = 1; $add['theme'] = $theme; $add['fromname'] = "系统消息"; $add['receiverid'] = $receiverid; $add['sendtime'] = date("Y-m-d H:i:s"); M('message')->add($add); }
<td align="center"> <label class="pos-rel"> <input name='n_id[]' id="navid" class="ace" type='checkbox' value='<?php echo $v["n_id"]; ?> '> <span class="lbl"></span> </label> </td> <td align="center"><?php echo $v["n_id"]; ?> </td> <td><a href="" target="_blank" title="<?php echo $v["news_title"]; ?> "><?php echo subtext($v["news_title"], 25); ?> </a>【<?php echo $v["news_auto"]; ?> 】</td> <td><?php echo $v["column_name"]; ?> </td> <td> <?php if (strstr($v['news_flag'], 'h') == true) { ?> <span style="color:#03C">头</span><?php }
<th>审核</th> <th>份数</th> <th>人数</th> <th class="align-center">操作</th> </tr> <?php if (is_array($data)) { foreach ($data as $key => $vo) { ?> <tr> <td title="<?php echo $vo["ac_title"]; ?> "><?php echo subtext($vo["ac_title"], 10); ?> </td> <td> <?php if ($vo["ac_mode"] == 0) { ?> 图文 <?php } elseif ($vo["ac_mode"] == 1) { ?> 链接 <?php } else { ?> <strong class="wrong">错误</strong><?php
echo ""; } else { foreach ($__LIST__ as $key => $vo) { $mod = $i % 2; ++$i; ?> <a href="<?php echo U(CONTENT . '/' . $vo['id']); ?> " class="list-group-item"> <h4 class="list-group-item-heading"><?php echo subtext($vo["title"], 15); ?> </h4> <p class="list-group-item-text"><?php echo subtext(strip_tags(htmlspecialchars_decode($vo["content"])), 20); ?> </p> </a><?php } } } else { echo ""; } ?> </div> </div> </div> <hr> <div class="row">
$i = 0; $__LIST__ = $recommend; if (count($__LIST__) == 0) { echo ""; } else { foreach ($__LIST__ as $key => $vo) { $mod = $i % 2; ++$i; if ($vo['id'] != $article['id']) { ?> <a href="<?php echo U(CONTENT . '/' . $vo['id']); ?> "> <li><?php echo subtext($vo["title"], 20); ?> </li> </a> <?php } } } } else { echo ""; } ?> </ol> </div> <div> <hr>
?> <div class="blogs"> <h3><a href="<?php echo U(GROUP_NAME . '/article/details', array('id' => $vo['id'])); ?> "><?php echo $vo["title"]; ?> </a></h3> <figure><img src="<?php echo $vo["show_img"]; ?> " ></figure> <ul> <p><?php echo subtext($vo["content"], 1200); ?> </p> <a href="<?php echo U(GROUP_NAME . '/article/details', array('id' => $vo['id'])); ?> " target="_blank" class="readmore">阅读全文>></a> </ul> <p class="autor"> <span>分类:【<a href="<?php echo U(GROUP_NAME . '/article/categorylist', array('id' => $vo['category_id'])); ?> "><?php echo $vo["category_name"]; ?> </a>】</span>
</a> <ul class="d-menu" data-role="dropdown"> <li class="divider"></li> <li> <a href="/myblog/index.php/Admin/Subject/index">专题管理</a> </li> </ul> </li> </ul> <div class="app-bar-element place-right"> <span class="dropdown-toggle"> <span class="mif-user"></span> <?php echo subtext($_SESSION['admin']['username'], 12); ?> </span> <div class="app-bar-drop-container padding10 place-right no-margin-top block-shadow fg-dark" data-role="dropdown" data-no-close="true" style="width: 150px"> <!-- <h2 class="text-light">Quick settings</h2> --> <ul class="unstyled-list fg-dark"> <li> <a href="/myblog/index.php/Admin/Login/logout" class="fg-white fg-hover-red">退出</a> </li> </ul> </div> </div> <div class="app-bar-pullbutton automatic" style="display: none;"></div> <div class="clearfix" style="width: 0;"></div> <nav class="app-bar-pullmenu hidden flexstyle-app-bar-menu" style="display: none;"> <ul class="app-bar-pullmenubar hidden app-bar-menu"></ul>