下面这段代码,产生了过多的feed,我要改一下,改成打开页面时,不产生feed,也就是不提示,大家帮我改一下,谢谢- <?php
- if ( !defined( "IN_UCHOME" ) ) exit( "Access Denied" );
- $id = (int)$_GET['id'];
- if (empty($id)) showmessage('参数错误', 'brand.php?ac=index');
- $data = get_brand($id, 'b');
- if(empty($data)) showmessage('参数错误', 'brand.php?ac=index');
- $data['brand'] = $data['has_brand'] ? get_player($data['id']) : array();
- $my = $uid > 0 ? get_reply($data['id'] , $uid) : '';
- if(empty($my)){
- $my['score'] = -2 ;
- $my['content'] = '' ;
- }
- $my['display'] = $my['content'] ? array('block', 'none') : array('none', 'block');
- $auto_see = get_auto_see($data, $id);
- $has_see = get_has_see($id);
- $reply = get_reply($id);
- $total = count($reply);
- realname_get();
- $hash = substr(md5($data['id'] . $uid . UC_KEY) , 0, 10);
- $id = (int)$_GET['id'];
- $mv = get_brand($id, 'b');
- if(empty($mv)) exit();
- $fs = array();
- $fs['icon'] = 'brand';
- $fs['title_template'] = "{actor} 观看了影片 {brand}";
- $fs['title_data'] = array(
- 'brand'=> "《<a href='brand.php?ac=show&id={$id}'>{$mv['name']}</a>》",
- );
- $fs['body_template'] = '';
- include_once(S_ROOT.'./source/function_cp.php');
- feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'],$fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend'], UC_APPID, 1);
- update_view($id);
- include_once( template( "brand/view/show" ) );
- function get_auto_see($brand, $id)
- {
- $key = 'brand_auto_'.$id;
- if(false === ($list = cache::get($key))){
- global $_SGLOBAL;
- $param = array();
- $arr = array('actor', 'leader','pic');
- foreach($arr as $type){
- $brand[$type] = explode(' / ', preg_replace("/<.*?>/", '', $brand[$type]));
- $brand[$type] = array_slice($brand[$type], 0, 4);
- foreach($brand[$type] as $val){
- $param[] = " $type like '%{$val}%' ";
- }
- }
- if(count($param) == 0) return array();
- $string = " (" . implode(' OR ', $param) . " ) ";
- $sql = "SELECT * FROM ".tname("yake_dianying")." where {$string} order by has_brand desc, karma desc limit 5";
- $query = $_SGLOBAL['db']->query( $sql );
- $list = array();
- while($value = $_SGLOBAL['db']->fetch_array( $query )){
- if($value['id'] == $id) continue;
- $list[] = $value;
- }
- if(count($list) == 0) return array();
- shuffle($list);
- $list = array_slice($list, 0 , 4);
- foreach($list as $val){
- format_brand($val, 's');
- }
- cache::set($key, $list);
- }
- return $list;
- }
- function get_has_see($id)
- {
- global $_SGLOBAL;
- $sql = "SELECT uid, username FROM ".tname("yake_dianying_view")." where id = '{$id}' ";
- $query = $_SGLOBAL['db']->query( $sql );
- while($value = $_SGLOBAL['db']->fetch_array( $query )){
- realname_set($value['uid'], $value['username']);
- $list[] = $value;
- }
- return $list;
- }
- ?>
复制代码 |