public function getErrorPage($pageName) { $errorPage = cockpit('collections')->collection('Error Pages')->findOne(["name" => $pageName]); if (!sizeof($errorPage)) { throw new Exception("Unable to load {$pageName}."); } try { $errorPageTemplate = new Templates($this->cabin); $errorPageTemplate->renderPage($errorPage, get_markdown($errorPage["content"])); } catch (Exception $e) { echo $e->getMessage(), "\n"; } }
?> <?php foreach ($__list as $v) { ?> <div class="well well-sm"> <p><?php echo $v['comment_time']; ?> 在:<a href="<?php echo $v['info']['link']; ?> "><?php echo $v['info']['title']; ?> </a> 上</p> <div class="comment_show_content"> <?php echo get_markdown($v['comment_content']); ?> </div> </div> <?php } ?> <?php } ?> </div> </div>
public function mail_send_system_message($rt, $data, $msg_id) { try { if ($data['from_users_id'] !== NULL || !$this->notice($data['to_users_id'], 'mail', 'send_system_message')) { //检测是否为系统邮件 return $rt; } $to_user = User::getUser($data['to_users_id']); $mt = new MailTemplate("mail_notice/send_system_message.html"); $mt->setUserInfo($to_user->getInfo()); $mt->setValues(['msg_title' => $data['msg_title'] ?: "无标题信息", 'msg_content' => get_markdown($data['msg_content']), 'msg_link' => get_url(['Message', 'view'], "?id={$msg_id}"), 'msg_datetime' => $data['msg_datetime']]); $mt->mailSend($to_user->getName(), $to_user->getEmail()); } catch (\Exception $ex) { Log::write(_("NoticeApply mail_send_system_message create a Exception.") . "EX:[" . $ex->getCode() . "]:" . $ex->getMessage(), Log::NOTICE); } return $rt; }
echo $__comment->getUser()->getName(); ?> </span> </p> <p> <small class="comment-post-at">评论于:</small> <span class="comment-time"><?php echo convert_time($__comment->getCommentTime()); ?> </span></p> </div> </div> <div class="comment-content"> <?php echo get_markdown($__comment->getCommentContent()); ?> </div> <div class="comment-like"> <?php if (!$__comment->userLikeComment()) { ?> <a class="comment-action-like" href="#Comment-id-<?php echo $__comment->getCommentId(); ?> "><span class="glyphicon glyphicon-heart text-danger">喜欢<span>[<?php echo $__comment->getCommentLikeCount(); ?> ]</span></span></a> <?php } else {
if (strlen($__info['gallery_description'])) { ?> <p class="desc"><?php echo $__info['gallery_description']; ?> </p> <?php } ?> <?php $more = $__gallery->more_info(); if (!empty($more)) { ?> <div id="Gallery-More-Info" class="more_info"> <?php echo get_markdown($more); ?> </div> <?php } ?> <p class="tags"> <span class="glyphicon glyphicon-tags"><span><?php echo tag($__info['gallery_tags']); ?> </span></span> <?php if (empty($__info['gallery_like_time'])) { ?> <a href="#" class="like_gallery"><span
</span><br> </p> </div> <div class="col-md-9"> <p class="text-right"> <button class="btn btn-success hidden-print" onclick="follow_user('<?php echo $__user->getId(); ?> ',this);">关注Ta</button> </p> <?php $pm = $__user->profile_message(); if (!empty($pm)) { ?> <div class="profile"><?php echo get_markdown($pm); ?> </div> <?php } $msg = ""; $i = 1; foreach (convert_video_code($__user->profile_video()) as $v) { $rt = convert_video_param($v['name'], $v['param']); if (filter_var($rt, FILTER_VALIDATE_URL)) { $msg .= "<embed class='profile_video' id='Profile_video_{$i}' src='{$rt}' />\n"; $i++; } } if ($i > 1) { ?>
* @var \ULib\User $__user * @var \ULib\CommentData $__CommentData */ ?> <article> <h1 id="Post-title"><a href="<?php echo post_link($__info['post_name']); ?> "><?php echo $__info['post_title']; ?> </a></h1> <div id="Post-content"> <?php echo get_markdown($__info['post_content']); ?> </div> <div id="Post-meta"> <a href="<?php echo user_link($__user->getName()); ?> "><?php echo $__user->getAliases(); ?> </a> 发布于:<span><?php echo $__info['post_time']; ?> </span>
private function parseContent() { return get_markdown($this->content); }
<h3><a class="glyphicon glyphicon-link" href="<?php echo post_link($v['post_name']); ?> "><?php echo $v['post_title']; ?> </a></h3> <p class="glyphicon glyphicon-time">发表于<span class="text-success"><?php echo explode(" ", $v['post_time'])[0]; ?> </span></p> </div> <div class="post-content"> <?php $s = preg_replace("/[\n\r]+/", "<br />", mb_substr(htmlspecialchars(strip_tags(preg_replace("/<pre[\\s\\S]*>[\\s\\S]+<\\/pre>/", "", get_markdown($v['post_content'])))), 0, 200, "UTF-8")); echo "<p>", $s, "</p>"; ?> </div> <div class="post-tag text-right"> <p> <span class="glyphicon glyphicon-tag">分类:<span class="text-primary"><?php echo $v['post_category']; ?> </span></span> <span class="glyphicon glyphicon-comment"><a href="<?php echo post_link($v['post_name']); ?> #Comment"><span class="text-success"><?php echo $v['post_comment_count'];
public function markdown() { try { $this->throwMsgCheck('is_post'); $this->rt_msg['content'] = get_markdown(htmlspecialchars(req()->post('content'), ENT_NOQUOTES)); $this->rt_msg['status'] = true; } catch (\Exception $ex) { $this->rt_msg['msg'] = $ex->getMessage(); $this->rt_msg['code'] = $ex->getCode(); } }