/** * 对前后文章数据进行组织 */ private function formatPrevNext($prevNext) { if (!is_array($prevNext)) { return false; } $out = array(); foreach ($prevNext as $pkey => $pN) { if (is_array($pN)) { if (!$pN) { $out[$pkey] = array(); } foreach ($pN as $key => $val) { $out[$pkey][$key]['title'] = $val['title']; $out[$pkey][$key]['url'] = Blog_Plugin_Urls::getDetailUrl(array('articleid' => $val['id'])); } } } return $out; }
?> <span>未发布</span><?php } else { ?> <span> </span><?php } ?> <span><?php echo date("Y-m-d H:i:s", $val['insertTime']); ?> </span><a class="link1">[<?php echo $val['cate']; ?> ]</a> <a target="_blank" href="<?php echo Blog_Plugin_Urls::getDetailUrl(array('articleid' => $val['id'])); ?> "><?php echo $val['title']; ?> </a> </li> <?php } } ?> <p class="page"><?php echo $pageStr; ?> </p> </ul>
<div class="cm_M"> <div class="news_nav"> <div class="subbar wp"> <h1> 给你推荐的博文 </h1> <div class="tab_box"> <ul> <?php if ($recommendList) { foreach ($recommendList as $articleInfo) { ?> <li> <h2> <a target="_blank" href="<?php echo str_replace(APP_BLOG_NAME, $articleInfo['webSite'], Blog_Plugin_Urls::getDetailUrl(array('articleid' => $articleInfo['articleId']))); ?> " title="<?php echo $articleInfo['title']; ?> "><?php echo $articleInfo['title']; ?> </a> </h2> <p><?php echo $articleInfo['descript']; ?> ...</p> <p class="list_title">发布于:<?php echo date('m-d H:i', $articleInfo['publishTime']);
ispublish: p,//发布或者预览的标志0:预览,1:发布 articleId: articleId,//如果有改id说明是修改,否则为新增 cate: cate, title: title, tags: tags, source: source, content: content, imgArr: imgArr }, function(r) { articleId = r; if(r==='error'){ alert('在同一个类型下,不允许发布两篇文章的题目相同。');return false; } //window.open(""); window.location.href = "<?php echo Blog_Plugin_Urls::getDetailUrl(array('articleid' => '"+articleId+"')); ?> "; }) } })(); } } publishArticle() //实例化编辑器 //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 var ue = UE.getEditor('editor'); //图片追加到内容 function appendImgToContent(){ var imgArr = document.getElementById("upload-images").getElementsByTagName("img"); if(imgArr){