Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[疑难] 求人改一下红土地插件产生过多feed的问题

[复制链接]
chinaprc 发表于 2009-7-11 11:13:45 | 显示全部楼层 |阅读模式
UCHome模板
适用版本:
语言编码:  
风格转换者:
下面这段代码,产生了过多的feed,我要改一下,改成打开页面时,不产生feed,也就是不提示,大家帮我改一下,谢谢
  1. <?php
  2. if ( !defined( "IN_UCHOME" ) ) exit( "Access Denied" );
  3. $id = (int)$_GET['id'];
  4. if (empty($id)) showmessage('参数错误', 'brand.php?ac=index');
  5. $data = get_brand($id, 'b');
  6. if(empty($data)) showmessage('参数错误', 'brand.php?ac=index');
  7. $data['brand'] = $data['has_brand'] ? get_player($data['id']) : array();
  8. $my = $uid > 0 ? get_reply($data['id'] , $uid) : '';
  9. if(empty($my)){
  10. $my['score'] = -2 ;
  11. $my['content'] = '' ;
  12. }
  13. $my['display'] = $my['content'] ? array('block', 'none') : array('none', 'block');
  14. $auto_see = get_auto_see($data, $id);
  15. $has_see = get_has_see($id);
  16. $reply = get_reply($id);
  17. $total = count($reply);
  18. realname_get();
  19. $hash = substr(md5($data['id'] . $uid . UC_KEY) , 0, 10);
  20. $id = (int)$_GET['id'];
  21. $mv = get_brand($id, 'b');
  22. if(empty($mv)) exit();
  23. $fs = array();
  24. $fs['icon'] = 'brand';
  25. $fs['title_template'] = "{actor} 观看了影片 {brand}";
  26. $fs['title_data'] = array(
  27. 'brand'=> "《<a href='brand.php?ac=show&id={$id}'>{$mv['name']}</a>》",
  28. );
  29. $fs['body_template'] = '';
  30. include_once(S_ROOT.'./source/function_cp.php');
  31. 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);
  32. update_view($id);

  33. include_once( template( "brand/view/show" ) );

  34. function get_auto_see($brand, $id)
  35. {
  36. $key = 'brand_auto_'.$id;
  37. if(false === ($list = cache::get($key))){
  38. global $_SGLOBAL;
  39. $param = array();
  40. $arr = array('actor', 'leader','pic');
  41. foreach($arr as $type){
  42. $brand[$type] = explode(' / ', preg_replace("/<.*?>/", '', $brand[$type]));
  43. $brand[$type] = array_slice($brand[$type], 0, 4);
  44. foreach($brand[$type] as $val){
  45. $param[] = " $type like '%{$val}%' ";
  46. }
  47. }
  48. if(count($param) == 0) return array();
  49. $string = " (" . implode(' OR ', $param) . " ) ";
  50. $sql = "SELECT * FROM ".tname("yake_dianying")." where {$string} order by has_brand desc, karma desc limit 5";
  51. $query = $_SGLOBAL['db']->query( $sql );
  52. $list = array();
  53. while($value = $_SGLOBAL['db']->fetch_array( $query )){
  54. if($value['id'] == $id) continue;
  55. $list[] = $value;
  56. }
  57. if(count($list) == 0) return array();
  58. shuffle($list);
  59. $list = array_slice($list, 0 , 4);
  60. foreach($list as $val){
  61. format_brand($val, 's');
  62. }
  63. cache::set($key, $list);
  64. }
  65. return $list;
  66. }
  67. function get_has_see($id)
  68. {
  69. global $_SGLOBAL;
  70. $sql = "SELECT uid, username FROM ".tname("yake_dianying_view")." where id = '{$id}' ";
  71. $query = $_SGLOBAL['db']->query( $sql );
  72. while($value = $_SGLOBAL['db']->fetch_array( $query )){
  73. realname_set($value['uid'], $value['username']);
  74. $list[] = $value;
  75. }
  76. return $list;
  77. }
  78. ?>
复制代码
 楼主| chinaprc 发表于 2009-7-11 14:06:33 | 显示全部楼层
插件区更没人么
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-29 07:18 , Processed in 0.122038 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表