function send_mail(&$smtp, $website, $id, $email, $order, $updatefile) { global $test; $hash = id_encode($id); $subject = $_SESSION['subject']; $emailfrom = $_SESSION['emailfrom']; $htmlemail = $_SESSION['htmlemail']; $emailname = $_SESSION['emailname'] . "<{$emailfrom}>"; $bounce = $_SESSION['bounce']; $text = $_SESSION['body']; $goto = $website . $updatefile; if ($updatefile != "none") { if ($htmlemail == 1) { $text .= "<br>_____________________________________________________<br>"; $text .= "To unsubscribe or update your listing <a href=\"" . $goto . "?id={$id}&token=" . $hash . "\">click here</a> "; } else { $text .= "\n_____________________________________________________\n"; $text .= "To unsubscribe or update your listing go to:\n "; $text .= $goto . "?id={$id}&token=" . $hash; } } if (!$test) { //glog("compose $email"); $headers = "From: {$emailname}\r\n"; $headers .= "Reply-To: {$emailfrom}\r\n"; $headers .= "X-Sender: {$emailfrom}\r\n"; if ($htmlemail == 1) { $headers .= "Content-Type: text/html\r\n"; } $headers .= "Return-Path: {$bounce}\r\n"; $ok = $smtp->email($bounce, $email, '', $headers, $subject, $text); //mail($email, stripslashes($subject), stripslashes($text), $headers); if ($ok) { //glog(" sent $email id=$id order=$order ok=" . ($ok ? 'TRUE' : 'FALSE') ); echo "sent {$email}<br>"; return true; } else { //glog("error $email id=$id order=$order ok=" . ($ok ? 'TRUE' : 'FALSE') ); if (function_exists('glog')) { glog(" smtp_client error: " . $smtp->msg); } echo "error sending {$email} ({$smtp->msg})<br>"; return false; } } else { echo "test {$email}<br>"; return true; } }
</td> <td align='center'><?php echo format::date($r['updatetime'], 1); ?> </td> <td align='center'><a href="javascript:;" onclick="javascript:openwinx('?m=content&c=content&a=edit&catid=<?php echo $catid; ?> &id=<?php echo $r['id']; ?> ','')"><?php echo L('edit'); ?> </a> | <a href="javascript:view_comment('<?php echo id_encode('content_' . $catid, $r['id'], $this->siteid); ?> ','<?php echo safe_replace($r['title']); ?> ')"><?php echo L('comment'); ?> </a></td> </tr> <?php } } ?> </tbody> </table>
echo $info['id']; ?> '><?php if ($info['elite'] == 0) { echo L('elite_special'); } else { ?> <font color="red"><?php echo L('remove_elite'); ?> </font><?php } ?> </a></span> | <span style="height:22"><a href="javascript:comment('<?php echo id_encode('special', $info['id'], $this->get_siteid()); ?> ', '<?php echo addslashes(new_html_special_chars($info['title'])); ?> ');void(0);"><?php echo L('special_comment'); ?> </a></span><br/> <span style="height:22"><a href="?m=special&c=special&a=edit&specialid=<?php echo $info['id']; ?> &menuid=<?php echo $_GET['menuid']; ?> "><?php
public function comment() { if (!$_GET['id']) { return '0'; } $siteid = $_GET['siteid'] ? $_GET['siteid'] : get_siteid(); $id = intval($_GET['id']); $commentid = id_encode('special', $id, $siteid); $username = param::get_cookie('_username'); $userid = param::get_cookie('_userid'); if (!$userid) { showmessage(L('login_website'), APP_PATH . 'index.php?m=member&c=index'); } $date = date('m-d H:i', SYS_TIME); if ($_POST['dosubmit']) { $r = $this->db->get_one(array('id' => intval($_POST['id'])), '`title`, `url`'); $comment = pc_base::load_app_class('comment', 'comment'); if ($comment->add($commentid, $siteid, array('userid' => $userid, 'username' => $username, 'content' => addslashes($_POST['content'])), '', $r['title'], $r['url'])) { exit($username . '|' . SYS_TIME . '|' . $_POST['content']); } else { exit(0); } } else { pc_base::load_sys_class('form'); include template('special', 'comment'); } }
/** * * 删除评论 * @param string $commentid 评论ID * @param intval $siteid 站点ID * @param intval $id 内容ID * @param intval $catid 栏目ID */ public function del($commentid, $siteid, $id, $catid) { if ($commentid != id_encode('content_' . $catid, $id, $siteid)) { return false; } //循环评论内容表删除commentid的评论内容 for ($i = 1;; $i++) { $table = 'comment_data_' . $i; //构建评论内容存储表名 if ($this->comment_data_db->table_exists($table)) { //检查构建的表名是否存在,如果存在执行删除操作 $this->comment_data_db->table_name($i); $this->comment_data_db->delete(array('commentid' => $commentid)); } else { //不存在,则退出循环 break; } } $this->comment_db->delete(array('commentid' => $commentid)); //删除评论主表的内容 return true; }
?> <script type="text/javascript" src="<?php echo APP_PATH; ?> index.php?m=mood&c=index&a=init&id=<?php echo id_encode($catid, $id, $siteid); ?> "></script><?php } ?> </div> </div> <div id="SOHUCS" sid="<?php echo id_encode("content_{$catid}", $id, $siteid); ?> "></div> <script charset="utf-8" type="text/javascript" src="<?php echo JS_PATH; ?> changyan.js"></script> </div><!--panel panel-default end--> </div><!--col-left end--> </div><!--col-sm-9 end--> </div><!--row end--> </div><!--container end--> </div><!--context end-->
/** * 删除 */ public function delete() { if (isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if (!$catid) { showmessage(L('missing_part_parameters')); } $modelid = $this->categorys[$catid]['modelid']; $sethtml = $this->categorys[$catid]['sethtml']; $siteid = $this->categorys[$catid]['siteid']; $html_root = pc_base::load_config('system', 'html_root'); if ($sethtml) { $html_root = ''; } $setting = string2array($this->categorys[$catid]['setting']); $content_ishtml = $setting['content_ishtml']; $this->db->set_model($modelid); $this->hits_db = pc_base::load_model('hits_model'); $this->queue = pc_base::load_model('queue_model'); if (isset($_GET['ajax_preview'])) { $ids = intval($_GET['id']); $_POST['ids'] = array(0 => $ids); } if (empty($_POST['ids'])) { showmessage(L('you_do_not_check')); } //附件初始化 $attachment = pc_base::load_model('attachment_model'); $this->content_check_db = pc_base::load_model('content_check_model'); $this->position_data_db = pc_base::load_model('position_data_model'); $this->search_db = pc_base::load_model('search_model'); //判断视频模块是否安装 if (module_exists('video') && file_exists(PC_PATH . 'model' . DIRECTORY_SEPARATOR . 'video_content_model.class.php')) { $video_content_db = pc_base::load_model('video_content_model'); $video_install = 1; } $this->comment = pc_base::load_app_class('comment', 'comment'); $search_model = getcache('search_model_' . $this->siteid, 'search'); $typeid = $search_model[$modelid]['typeid']; $this->url = pc_base::load_app_class('url', 'content'); foreach ($_POST['ids'] as $id) { $r = $this->db->get_one(array('id' => $id)); if ($content_ishtml && !$r['islink']) { $urls = $this->url->show($id, 0, $r['catid'], $r['inputtime']); $fileurl = $urls[1]; if ($this->siteid != 1) { $sitelist = getcache('sitelist', 'commons'); $fileurl = $html_root . '/' . $sitelist[$this->siteid]['dirname'] . $fileurl; } //删除静态文件,排除htm/html/shtml外的文件 $lasttext = strrchr($fileurl, '.'); $len = -strlen($lasttext); $path = substr($fileurl, 0, $len); $path = ltrim($path, '/'); $filelist = glob(PHPCMS_PATH . $path . '*'); foreach ($filelist as $delfile) { $lasttext = strrchr($delfile, '.'); if (!in_array($lasttext, array('.htm', '.html', '.shtml'))) { continue; } @unlink($delfile); //删除发布点队列数据 $delfile = str_replace(PHPCMS_PATH, '/', $delfile); $this->queue->add_queue('del', $delfile, $this->siteid); } } else { $fileurl = 0; } //删除内容 $this->db->delete_content($id, $fileurl, $catid); //删除统计表数据 $this->hits_db->delete(array('hitsid' => 'c-' . $modelid . '-' . $id)); //删除附件 $attachment->api_delete('c-' . $catid . '-' . $id); //删除审核表数据 $this->content_check_db->delete(array('checkid' => 'c-' . $id . '-' . $modelid)); //删除推荐位数据 $this->position_data_db->delete(array('id' => $id, 'catid' => $catid, 'module' => 'content')); //删除全站搜索中数据 $this->search_db->delete_search($typeid, $id); //删除视频库与内容对应关系数据 if ($video_install == 1) { $video_content_db->delete(array('contentid' => $id, 'modelid' => $modelid)); } //删除相关的评论,删除前应该判断是否还存在此模块 if (module_exists('comment')) { $commentid = id_encode('content_' . $catid, $id, $siteid); $this->comment->del($commentid, $siteid, $id, $catid); } } //更新栏目统计 $this->db->cache_items(); showmessage(L('operation_success'), HTTP_REFERER); } else { showmessage(L('operation_failure')); } }
<div class="iptd"><input class="tit_ipt" value="<?php echo $r['title'];?>" type="text" id="title_<?php echo $r['id'];?>"></input> <textarea name="description" cols="96%" rows="3" id="description_<?php echo $r['id'];?>" max="255" class="cps_ipt"><?php echo $r['description']?></textarea> </div> </td> <td align='center' title="<?php echo L('today_hits');?>:<?php echo $hits_r['dayviews'];?> <?php echo L('yestoday_hits');?>:<?php echo $hits_r['yestodayviews'];?> <?php echo L('week_hits');?>:<?php echo $hits_r['weekviews'];?> <?php echo L('month_hits');?>:<?php echo $hits_r['monthviews'];?>"><?php echo $hits_r['views'];?></td> <td align='center'> <?php if($r['sysadd']==0) { echo "<a href='?m=member&c=member&a=memberinfo&username="******"&pc_hash=".$_SESSION['pc_hash']."' >".$r['username']."</a>"; echo '<img src="'.IMG_PATH.'icon/contribute.png" title="'.L('member_contribute').'">'; } else { echo $r['username']; } ?></td> <td align='center'><?php echo format::date($r['updatetime'],1);?></td> <td align='center'><a href="javascript:;" onclick="javascript:openwinx('?m=content&c=content&a=edit&catid=<?php echo $catid;?>&id=<?php echo $r['id']?>','')"><?php echo L('edit');?></a> | <a href="javascript:view_comment('<?php echo id_encode('content_'.$catid,$r['id'],$this->siteid);?>','<?php echo safe_replace($r['title']);?>')"><?php echo L('comment');?></a></td> </tr> <?php } } ?> </tbody> </table> <div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label> <input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash"> <input type="button" class="button" value="<?php echo L('listorder');?>" onclick="myform.action='?m=content&c=content&a=listorder&dosubmit=1&catid=<?php echo $catid;?>&steps=<?php echo $steps;?>';myform.submit();"/> <?php if($category['content_ishtml']) {?> <input type="button" class="button" value="<?php echo L('createhtml');?>" onclick="myform.action='?m=content&c=create_html&a=batch_show&dosubmit=1&catid=<?php echo $catid;?>&steps=<?php echo $steps;?>';myform.submit();"/> <?php } if($status!=99) {?> <input type="button" class="button" value="<?php echo L('passed_checked');?>" onclick="myform.action='?m=content&c=content&a=pass&catid=<?php echo $catid;?>&steps=<?php echo $steps;?>';myform.submit();"/> <?php }?>
/** * 生成专题首页 * @param intval $specialid 专题ID * @param intval $pagesize 每页个数 * @param intval $pages_num 最大更新页数 * @return boolen/intval 成功返回生成文件的大小 */ public function _index($specialid = 0, $pagesize = 20, $pages_num = 0) { pc_base::load_app_func('global', 'special'); $specialid = intval($specialid); if (!$specialid) { return false; } $r = $this->db->get_one(array('id' => $specialid, 'siteid' => get_siteid())); if (!$r['ishtml'] || $r['disabled'] != 0) { return true; } if (!$specialid) { showmessage(L('illegal_action')); } $info = $this->db->get_one(array('id' => $specialid)); if (!$info) { showmessage(L('special_not_exist'), 'back'); } extract($info); if ($pics) { $pic_data = get_pic_content($pics); unset($pics); } if ($voteid) { $vote_info = explode('|', $voteid); $voteid = $vote_info[1]; } $commentid = id_encode('special', $id, $siteid); //分站时计算路径 if ($siteid > 1) { $site_info = $this->site->get_by_id($siteid); $file = pc_base::load_config('system', 'html_root') . '/' . $site_info['dirname'] . '/special/' . $filename . '/index.html'; } else { $file = pc_base::load_config('system', 'html_root') . '/special/' . $filename . '/index.html'; } if (!$ispage) { $type_db = pc_base::load_model('type_model'); $types = $type_db->select(array('module' => 'special', 'parentid' => $specialid), '*', '', '`listorder` ASC, `typeid` ASC', '', 'listorder'); } $css = get_css(unserialize($css)); $template = $index_template ? $index_template : 'index'; $SEO = seo($siteid, '', $title, $description); if ($ispage) { $re = $this->c_db->get_one(array('specialid' => $specialid), 'COUNT(`id`) AS num'); $total = $re['num']; $times = ceil($total / $pagesize); if ($pages_num) { $pages_num = min($times, $pages_num); } else { $pages_num = $times; } for ($i = 1; $i <= $pages_num; $i++) { if ($i == 1) { $file_root = $file; } else { $file_root = str_replace('index', 'index-' . $i, $file); } $this->queue->add_queue('add', $file_root, $siteid); //添加至信息队列 $file_root = PHPCMS_PATH . $file_root; ob_start(); include template('special', $template); $this->create_html($file_root); } return true; } else { $this->queue->add_queue('add', $file, $siteid); //添加至信息队列 $file = PHPCMS_PATH . $file; ob_start(); include template('special', $template, $style); return $this->create_html($file); } }
/** * 生成专题首页 * * @param intval $specialid * 专题ID * @param intval $pagesize * 每页个数 * @param intval $pages_num * 最大更新页数 * @return boolen/intval 成功返回生成文件的大小 */ public function _index($specialid = 0, $pagesize = 20, $pages_num = 0) { Loader::helper('special:global'); $specialid = intval($specialid); if (!$specialid) { return false; } $r = $this->db->getby_id($specialid); if (!$r['ishtml'] || $r['disabled'] != 0) { return true; } if (!$specialid) { showmessage(L('illegal_action')); } $info = $this->db->getby_id($specialid); if (!$info) { showmessage(L('special_not_exist'), 'back'); } extract($info); if ($pics) { $pic_data = get_pic_content($pics); unset($pics); } if ($voteid) { $vote_info = explode('|', $voteid); $voteid = $vote_info[1]; } $commentid = id_encode('special', $id); $file = $this->html_root . '/special/' . $filename . '/index.html'; if (!$ispage) { $type_db = Loader::model('type_model'); $types = $type_db->where(array('application' => 'special', 'parentid' => $specialid))->order('listorder ASC, typeid ASC')->key('listorder')->select(); } $css = get_css(unserialize($css)); $template = $index_template ? $index_template : 'index'; $SEO = seo('', $title, $description); if ($ispage) { $total = $this->c_db->where(array('specialid' => $specialid))->count(); $times = ceil($total / $pagesize); if ($pages_num) { $pages_num = min($times, $pages_num); } else { $pages_num = $times; } for ($i = 1; $i <= $pages_num; $i++) { if ($i == 1) { $file_root = $file; } else { $file_root = str_replace('index', 'index-' . $i, $file); } $file_root = BASE_PATH . $file_root; ob_start(); include template('special', $template); $this->create_html($file_root); } return true; } else { $file = BASE_PATH . $file; ob_start(); include template('special', $template, $style); return $this->create_html($file); } }
<td> <div class="col-left mr10" style="width:146px; height:112px"><?php if ($info['thumb']) {?> <a href="<?php echo $info['url']?>" target="_blank"><img src="<?php echo $info['thumb']?>" width="146" height="112" style="border:1px solid #eee" align="left"></a><?php }?> </div> <div class="col-auto"> <h2 class="title-1 f14 lh28 mb6 blue"><a href="<?php echo $info['url']?>" target="_blank"><?php echo $info['title']?></a></h2> <div class="lh22"><?php echo $info['description']?></div> <p class="gray4"><?php echo L('create_man')?>:<a href="#" class="blue"><?php echo $info['username']?></a>, <?php echo L('create_time')?>:<?php echo format::date($info['createtime'], 1)?></p> </div> </td> <td align="center"><span style="height:22"><a href='?m=special&c=content&a=init&specialid=<?php echo $info['id']?>' onclick="javascript:openwinx('?m=special&c=content&a=add&specialid=<?php echo $info['id']?>&pc_hash=<?php echo $_SESSION['pc_hash']?>','')"><?php echo L('add_news')?></a></span> | <span style="height:22"><a href='javascript:import_c(<?php echo $info['id']?>);void(0);'><?php echo L('import_news')?></a></span><br /> <span style="height:22"><a href='?m=special&c=content&a=init&specialid=<?php echo $info['id']?>'><?php echo L('manage_news')?></a></span> | <span style="height:22"><a href='?m=special&c=template&specialid=<?php echo $info['id']?>' style="color:red" target="_blank"><?php echo L('template_manage')?></a></span><br/> <span style="height:22"><a href='?m=special&c=special&a=elite&value=<?php if($info['elite']==0) {?>1<?php } elseif($info['elite']==1) { ?>0<?php }?>&id=<?php echo $info['id']?>'><?php if($info['elite']==0) { echo L('elite_special'); } else {?><font color="red"><?php echo L('remove_elite')?></font><?php }?></a></span> | <span style="height:22"><a href="javascript:comment('<?php echo id_encode('special', $info['id'], $this->get_siteid())?>', '<?php echo addslashes(new_html_special_chars($info['title']))?>');void(0);"><?php echo L('special_comment')?></a></span><br/> <span style="height:22"><a href="?m=special&c=special&a=edit&specialid=<?php echo $info['id']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('edit_special')?></a></span> | <span style="height:22"><a href="?m=special&c=special&a=delete&id=<?php echo $info['id']?>" onclick="return confirm('<?php echo L('confirm', array('message'=>addslashes(new_html_special_chars($info['title']))))?>')"><?php echo L('del_special')?></a></span></td> </tr> <?php } } ?> </tbody> </table> <div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label> <input name='dosubmit' type='submit' class="button" value='<?php echo L('listorder')?>'> <input type="submit" class="button" value="<?php echo L('delete')?>" onclick="if(confirm('<?php echo L('confirm', array('message' => L('selected')))?>')){document.myform.action='?m=special&c=special&a=delete';}else{return false;}"/> <input type="submit" class="button" value="<?php echo L('update')?>html" onclick="document.myform.action='?m=special&c=special&a=html'"/></div> <div id="pages"><?php echo $this->db->pages;?></div><script>window.top.$("#display_center_id").css("display","none");</script>
public function comment() { if (!$_GET['id']) { return '0'; } $id = intval($_GET['id']); $commentid = id_encode('special', $id); $username = cookie('_username'); $userid = cookie('_userid'); if (!$userid) { showmessage(L('login_website'), SITE_URL . 'index.php?app=member&controller=index'); } $date = date('m-d H:i', TIME); if ($_POST['dosubmit']) { $r = $this->db->where(array('id' => $_POST['id']))->field('title, url')->find(); $comment = Loader::lib('comment:comment'); if ($comment->add($commentid, array('userid' => $userid, 'username' => $username, 'content' => $_POST['content']), '', $r['title'], $r['url'])) { exit($username . '|' . TIME . '|' . $_POST['content']); } else { exit(0); } } else { include template('special', 'comment'); } }
} </script> <script type="text/javascript">document.write('<a href="http://v.t.sina.com.cn/share/share.php?url='+encodeURIComponent(location.href)+'&appkey=3172366919&title='+encodeURIComponent('<?php echo new_addslashes($title);?>')+'" title="分享到新浪微博" class="t1" target="_blank"> </a>');</script> <script type="text/javascript">document.write('<a href="http://www.douban.com/recommend/?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent('<?php echo new_addslashes($title);?>')+'" title="分享到豆瓣" class="t2" target="_blank"> </a>');</script> <script type="text/javascript">document.write('<a href="http://share.renren.com/share/buttonshare.do?link='+encodeURIComponent(location.href)+'&title='+encodeURIComponent('<?php echo new_addslashes($title);?>')+'" title="分享到人人" class="t3" target="_blank"> </a>');</script> <script type="text/javascript">document.write('<a href="http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent('<?php echo new_addslashes($title);?>')+'&rurl='+encodeURIComponent(location.href)+'&rcontent=" title="分享到开心网" class="t4" target="_blank"> </a>');</script> <script type="text/javascript">document.write('<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(location.href)+'" title="分享到QQ空间" class="t5" target="_blank"> </a>');</script> <span id='favorite'> <a href="javascript:;" onclick="add_favorite('<?php echo addslashes($title);?>');" class="t6">收藏</a> </span> </div> <div class="bk10"></div> <?php if($allow_comment && module_exists('comment')) { ?> <iframe src="<?php echo APP_PATH;?>index.php?m=comment&c=index&a=init&commentid=<?php echo id_encode("content_$catid",$id,$siteid);?>&iframe=1" width="100%" height="100%" id="comment_iframe" frameborder="0" scrolling="no"></iframe> <div class="box"> <h5>评论排行</h5> <?php if(defined('IN_ADMIN') && !defined('HTML')) {echo "<div class=\"admin_piao\" pc_action=\"comment\" data=\"op=comment&tag_md5=9eeaba0a57bcf88c1b4779f4dc232d7a&action=bang&siteid=%24siteid&cache=3600\"><a href=\"javascript:void(0)\" class=\"admin_piao_edit\">编辑</a>";}$tag_cache_name = md5(implode('&',array('siteid'=>$siteid,)).'9eeaba0a57bcf88c1b4779f4dc232d7a');if(!$data = tpl_cache($tag_cache_name,3600)){$comment_tag = pc_base::load_app_class("comment_tag", "comment");if (method_exists($comment_tag, 'bang')) {$data = $comment_tag->bang(array('siteid'=>$siteid,'limit'=>'20',));}if(!empty($data)){setcache($tag_cache_name, $data, 'tpl_data');}}?> <ul class="content list blue f14 row-2"> <?php $n=1;if(is_array($data)) foreach($data AS $r) { ?> <li>·<a href="<?php echo $r['url'];?>" target="_blank"><?php echo str_cut($r[title], 40);?></a><span>(<?php echo $r['total'];?>)</span></li> <?php $n++;}unset($n); ?> </ul> <?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?> </div> <?php } ?> </div> <div class="col-auto"> <div class="box"> <h5 class="title-2">频道总排行</h5>
</td> <td align='center'><?php echo Format::date($r['updatetime'], 1); ?> </td> <td align='center'><a href="javascript:;" onclick="javascript:openwinx('?app=content&controller=content&action=edit&catid=<?php echo $catid; ?> &id=<?php echo $r['id']; ?> ','')"><?php echo L('edit'); ?> </a> | <a href="javascript:view_comment('<?php echo id_encode('content_' . $catid, $r['id']); ?> ','<?php echo safe_replace($r['title']); ?> ')"><?php echo L('comment'); ?> </a></td> </tr> <?php } } ?> </tbody> </table>
/** * 删除 */ public function delete() { if (isset($_GET['dosubmit'])) { $catid = intval($_GET['catid']); if (!$catid) { showmessage(L('missing_part_parameters')); } $modelid = $this->categorys[$catid]['modelid']; $sethtml = $this->categorys[$catid]['sethtml']; $html_root = C('system', 'html_root'); if ($sethtml) { $html_root = ''; } $setting = string2array($this->categorys[$catid]['setting']); $content_ishtml = $setting['content_ishtml']; $this->db->set_model($modelid); $this->hits_db = Loader::model('hits_model'); if (isset($_GET['ajax_preview'])) { $ids = intval($_GET['id']); $_POST['ids'] = array(0 => $ids); } if (empty($_POST['ids'])) { showmessage(L('you_do_not_check')); } // 附件初始化 $attachment = Loader::model('attachment_model'); $this->content_check_db = Loader::model('content_check_model'); $this->position_data_db = Loader::model('position_data_model'); $this->search_db = Loader::model('search_model'); $this->comment = Loader::lib('comment:comment'); $search_model = S('search/search_model'); $typeid = $search_model[$modelid]['typeid']; $this->url = loader::lib('content:url'); foreach ($_POST['ids'] as $id) { $r = $this->db->getby_id($id); if ($content_ishtml && !$r['islink']) { $urls = $this->url->show($id, 0, $r['catid'], $r['inputtime']); $fileurl = $urls[1]; // 删除静态文件,排除htm/html/shtml外的文件 $lasttext = strrchr($fileurl, '.'); $len = -strlen($lasttext); $path = substr($fileurl, 0, $len); $path = ltrim($path, '/'); $filelist = glob(BASE_PATH . $path . '*'); foreach ($filelist as $delfile) { $lasttext = strrchr($delfile, '.'); if (!in_array($lasttext, array('.htm', '.html', '.shtml'))) { continue; } @unlink($delfile); } } else { $fileurl = 0; } // 删除内容 $this->db->delete_content($id, $fileurl, $catid); // 删除统计表数据 $this->hits_db->delete(array('hitsid' => 'c-' . $modelid . '-' . $id)); // 删除附件 $attachment->api_delete('c-' . $catid . '-' . $id); // 删除审核表数据 $this->content_check_db->delete(array('checkid' => 'c-' . $id . '-' . $modelid)); // 删除推荐位数据 $this->position_data_db->delete(array('id' => $id, 'catid' => $catid, 'application' => 'content')); // 删除全站搜索中数据 $this->search_db->delete_search($typeid, $id); // 删除相关的评论 $commentid = id_encode('content_' . $catid, $id); $this->comment->del($commentid, $id, $catid); } // 更新栏目统计 $this->db->cache_items(); showmessage(L('operation_success'), HTTP_REFERER); } else { showmessage(L('operation_failure')); } }
echo $info['id']; ?> '><?php if ($info['elite'] == 0) { echo L('elite_special'); } else { ?> <font color="red"><?php echo L('remove_elite'); ?> </font><?php } ?> </a></span> | <span style="height:22"><a href="javascript:comment('<?php echo id_encode('special', $info['id']); ?> ', '<?php echo addslashes(htmlspecialchars($info['title'])); ?> ');void(0);"><?php echo L('special_comment'); ?> </a></span><br/> <span style="height:22"><a href="?app=special&controller=special&action=edit&specialid=<?php echo $info['id']; ?> &menuid=<?php echo $_GET['menuid']; ?> "><?php