/** *导出magazine *@date 2011-1-25 / @time 下午05:57:55 */ function magazine() { //导出magazine import("@.Com.Split"); $dao = D("Archives"); $AddonArc = M("AddonArc"); $typeid = 3001; $condition = array(); $arctype = D("Arctype"); $info = $arctype->where("id={$typeid}")->find(); if ($info['ispart'] == 1) { $small = $arctype->where("reid={$typeid}")->field("id")->findAll(); $str = ''; foreach ($small as $v) { $str .= $v['id'] . ','; } $condition['typeid'] = array('IN', trim($str, ',')); } else { $condition['typeid'] = $typeid; } $time = mktime(0, 0, 0, date('m'), date("d") - 5, date("Y")); $condition['channel'] = 12; $condition['ismake'] = 1; $condition['pubdate'] = array('gt', $time); $condition['edittime'] = array('gt', $time); $data = $dao->where($condition)->findAll(); //dump($dao->getLastSql()); $arr = array(); $i = 0; foreach ($data as $v) { if (!empty($v['reurl']) && $v['reurl'] != 'http://') { continue; } else { $v['content'] = $AddonArc->where("aid={$v['id']}")->find(); $str = $v['title'] . ' ' . $v['my_content']; $split = new Split($str); $str = $split->get_tags(); $arr[$i]['post_title'] = $v['title']; //标题 $content = $v['content']['content']; $content .= "<br/><br/>Source from:<a href='http://www.beingfunchina.com/article/{$v['id']}/" . str_to_url($v['title']) . ".html' target='_blank'>{$v['title']}</a>"; $content .= "<br/><br/>{$str}"; $arr[$i]['content'] = $content; //内容 $arr[$i]['excerpt'] = $v['my_content']; //摘要 $arr[$i]['tags_input'] = $str; //标签 $arr[$i]['post_category'][] = 1; //分类 $arr[$i]['ping_status'] = 'open'; //开启ping $arr[$i]['comment_status'] = 'open'; //开启评论 $i++; } } echo serialize($arr); }
/** *生成文章关键字 *@date 2011-1-19 / @time 上午11:34:30 */ function ctags() { //生成文章关键字 $arc = D("Archives"); import("@.Com.Split"); $str = ''; $split = new Split($str); $str = $split->get_tags(); $tags = D("Tags"); $tagslink = D("TagsLink"); }