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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] KK_XSHOW,草稿也调用了,怎么解决?

[复制链接]
hajhb 发表于 2010-10-26 12:11:55 | 显示全部楼层
谢谢分享。
回复

使用道具 举报

freemangl 发表于 2010-10-26 13:22:46 | 显示全部楼层
调用规则的问题吧。。。看来要改代码了。
回复

使用道具 举报

love322093 发表于 2010-10-26 13:48:43 | 显示全部楼层
  1. <?php
  2. /*
  3.         [Discuz!] (C)2001-2009 Comsenz Inc.
  4.         This is NOT a freeware, use is subject to license terms

  5.         $Id: kk_xshow hack 2010-09-20 22:00:00Z ANE $
  6. */

  7. if(!defined('IN_DISCUZ')) {
  8.        exit('Access Denied');
  9. }

  10. class plugin_kk_xshow_forum {
  11.         function index_top() {
  12.                 global $_G,$kk_xshow,$notshow,$onlyshow,$thread_num;

  13.                 $kk_xshow = $_G['cache']['plugin']['kk_xshow'];
  14.                 $attachurl = $_G['setting']['attachurl'];
  15.                 $kk_xshow['cache_time'] = $kk_xshow['cache_time'] < 10 ? 10 : $kk_xshow['cache_time'];
  16.                
  17.                 if($kk_xshow['is_guest'] || $_G['uid']) {
  18.                         $cacheFile = DISCUZ_ROOT.'./data/cache/cache_kk_xshow.php';
  19.                         $kk_xkk_xshowupdate = ($_G['timestamp']-@filemtime($cacheFile)) > $kk_xshow['cache_time'] ? 1 : 0;//
  20.                         $notshow = $kk_xshow['not_show'] ? 'AND f.fid not IN('.$kk_xshow['not_show'].')' : '';//不显示的版块  all
  21.                         $onlyshow = $kk_xshow['only_show'] ? 'AND f.fid IN('.$kk_xshow['only_show'].')' : '';//仅显示的版块  all
  22.                         $x_title = explode('|', str_replace(array("\r\n", "\n"), '|', $kk_xshow['set_title']));// all
  23.                         $propre = explode('|', str_replace(array("\r\n", "\n"), '|', $kk_xshow['propre']));//前缀 all

  24.                         $linkwindow = $kk_xshow['link_window'] == 1 ? ' target="_blank"' : ''; //all
  25.                         $pic_color = $kk_xshow['pic_color'] ? str_replace('#', '0x', $kk_xshow['pic_color']) : '0x0099ff'; //all
  26.                         $authnum_color = $kk_xshow['authnum_color'] ? $kk_xshow['authnum_color'] : str_replace('0x', '#', $pic_color); //all
  27.                         $author_color = $kk_xshow['author_color'] ? $kk_xshow['author_color'] : $authnum_color; //all
  28.                         $user_num = $kk_xshow['user_num'] ? $kk_xshow['user_num'] : '15'; //user
  29.                         $pic_on = $kk_xshow['pic_on']; //image
  30.                         $userdefinecss = $kk_xshow['userdefinecss']; //none
  31.                         $thread_num = $kk_xshow['thread_num'] ? $kk_xshow['thread_num'] : 10; //thread reply 4th       
  32.                         $tab_style = $kk_xshow['tab_style']; //all
  33.                         if(!$kk_xshow['five_list']) {
  34.                                 $pic_height = max($user_num,$thread_num)*20 -2; //pic
  35.                                 $thread_num = max($user_num,$thread_num);
  36.                         } else {
  37.                                 $pic_height = $thread_num*20 - 2;
  38.                         }
  39.                         $thread_height = $thread_num*20; //thread reply 4th

  40.                         $row_num = 5;
  41.                         $td_star_row = '13%';
  42.                         !$pic_on && $row_num--;
  43.                         $kk_xshow['five_list'] && $row_num--;
  44.                         if($row_num == 5) {
  45.                                 $td_row = '21%';
  46.                         } elseif($row_num == 4 && $pic_on) {
  47.                                 $td_row = '25%';
  48.                         } elseif($row_num == 4 && !$pic_on) {
  49.                                 $td_row = '29%';
  50.                         } elseif($row_num == 3) {
  51.                                 $td_row = '33%';
  52.                         }
  53.                         if($kk_xshow['five_list']) {
  54.                                 $tab_num = 3;
  55.                         } else {
  56.                                 $tab_num = 4;
  57.                         }

  58.                         if ($kk_xshow['pic_switch'] && $pic_on) {//是否自定义图片
  59.                                 $picpics = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_urls']);
  60.                                 $piclinks = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_links']);
  61.                                 $pictexts = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_titles']);
  62.                         }

  63.                         require_once libfile('function/cache');
  64.                         require_once DISCUZ_ROOT.'./source/plugin/kk_xshow/xshow.func.php';
  65.                         $cache_array = array(
  66.                                 5 => 'image',
  67.                                 2 => 'thread',
  68.                                 0 => 'reply',
  69.                                 1 => '4th',
  70.                                 3 =>'user'
  71.                         );
  72.                         foreach($cache_array as $time => $cache) {
  73.                                 $cache_file = DISCUZ_ROOT.'./data/cache/cache_kk_xshow_'.$cache.'.php';
  74.                                 if(($_G['timestamp'] - @filemtime($cache_file)) > ($kk_xshow['cache_time'] + $time)) {
  75.                                         $a = 'update_'.$cache;
  76.                                         $this->$a();
  77.                                 }
  78.                         }
  79.                        
  80.                         @include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow_image.php';
  81.                         @include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow_thread.php';
  82.                         @include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow_reply.php';
  83.                         @include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow_4th.php';
  84.                         @include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow_user.php';
  85.                        
  86.                         if (@$pic && !$kk_xshow['pic_switch']) {//
  87.                                 PHP_VERSION > 4.3 ? shuffle($pic) : '';
  88.                                 $i = 0; $comma = '';
  89.                                 foreach ($pic as $key=>$val) {
  90.                                         if (is_readable($val['picpics']) || substr($val['picpics'], 0, 4) == 'http') {
  91.                                                 $picpics .= $comma.$val['picpics'];
  92.                                                 $piclinks .= $comma.$val['piclinks'];
  93.                                                 $pictexts .= $comma.$val['pictexts'];
  94.                                                 $i++;
  95.                                         } else {
  96.                                                 if($_G['setting']['ftp']['on']) {
  97.                                                         $picpics .= $comma.$_G['setting']['ftp']['attachurl'].str_replace($attachurl, '', $val['picpics']);
  98.                                                         $piclinks .= $comma.$val['piclinks'];
  99.                                                         $pictexts .= $comma.$val['pictexts'];
  100.                                                         $i++;
  101.                                                 } else {
  102.                                                         $picpics .= $comma.$val['picpics'];
  103.                                                         $piclinks .= $comma.$val['piclinks'];
  104.                                                         $pictexts .= $comma.$val['pictexts'];
  105.                                                         $i++;
  106.                                                 }
  107.                                         }
  108.                                         $comma = '|';
  109.                                         if ($i == $kk_xshow['pic_num']) break;
  110.                                 }
  111.                                 unset($pic);
  112.                         }
  113.                         if($kk_xshow['tab_style']) {
  114.                                 include template('kk_xshow:xshow_tab');
  115.                         } else {
  116.                                 include template('kk_xshow:xshow');
  117.                         }
  118.                        
  119.                 }

  120.                 //include_once DISCUZ_ROOT.'./data/cache/cache_kk_xshow.php';
  121.                
  122.                 return $return;
  123.         }


  124.         function update_image() {
  125.                 global $_G,$kk_xshow,$notshow,$onlyshow,$thread_num;
  126.                
  127.                 if ($kk_xshow['pic_switch'] && $kk_xshow['pic_on']) {//是否自定义图片
  128.                         $picpics = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_urls']);
  129.                         $piclinks = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_links']);
  130.                         $pictexts = str_replace(array("\r\n", "\n"), '|', $kk_xshow['pic_titles']);
  131.                 }
  132.                 if($kk_xshow['pic_on']) {
  133.                         if (!@$picpics || !$kk_xshow['pic_switch']) {//正常状态
  134.                                 $datapic = array();
  135.                                 $fids = $kk_xshow['only_pic'] ? 'AND t.fid IN('.$kk_xshow['only_pic'].')' : '';
  136.                                 $PicNums = $kk_xshow['pic_schnum'];
  137.        
  138.                                 if ($kk_xshow['pic_transfer'] == 1) {
  139.                                         $orderby = 'dateline';
  140.                                 } else if ($kk_xshow['pic_transfer'] == 2) {
  141.                                         $orderby = 'downloads';
  142.                                 } else {
  143.                                         $orderby = 'rand';
  144.                                 }
  145.                                 $orderby = $orderby != 'rand' ? 'attach.'.$orderby : 'rand()';
  146.                                 $query = DB::query("SELECT attach.aid, attach.attachment,attach.remote, t.tid, t.fid, t.subject FROM ".DB::table('forum_attachment')." attach INNER JOIN ".DB::table('forum_thread')." t ON t.tid=attach.tid WHERE attach.readperm=0 AND t.isgroup=0 AND t.displayorder>=0 AND attach.isimage=1 $fids GROUP BY attach.tid ORDER BY $orderby DESC LIMIT 0, ".$PicNums);
  147.                                 while($pic = DB::fetch($query)) {
  148.                                         $pics['picpics'] = $_G['setting']['attachurl'].'forum/'.$pic['attachment'];
  149.                                         $pics['piclinks'] = 'forum.php?mod=viewthread%26tid='.$pic['tid'];
  150.                                         $pics['pictexts'] = str_replace('\'', ' ',$pic['subject']);
  151.                                         $pics['attaid'] = $pic['aid'];
  152.                                         $datapic[] = $pics;
  153.                                 }
  154.                                 $cacheArray .= "\$pic=".arrayeval($datapic).";\n";
  155.                                 unset($query, $datapic, $pics);
  156.                         }
  157.                         writetocache('kk_xshow_image', $cacheArray);
  158.                 }

  159.         }

  160.         function update_thread() {
  161.                 global $_G,$kk_xshow,$notshow,$onlyshow,$thread_num;

  162.                 $thread_num = $kk_xshow['thread_num'] ? $kk_xshow['thread_num'] : 10; //thread reply 4th
  163.                 $sql = "SELECT t.*, f.name FROM ".DB::table('forum_thread')." t, ".DB::table('forum_forum')." f WHERE f.status<>'3' AND f.fid=t.fid $notshow $onlyshow AND t.displayorder not IN(-1,-2,-4) ORDER BY t.dateline DESC LIMIT 0, $thread_num";
  164.                 $objarray = kk_xshow_query($sql);
  165.                 $cacheArray .= "\$newPost=".arrayeval($objarray).";\n\n";
  166.                 unset($sql, $objarray);
  167.                 writetocache('kk_xshow_thread', $cacheArray);
  168.         }
  169.         function update_reply() {
  170.                 global $_G,$kk_xshow,$notshow,$onlyshow,$thread_num;

  171.                 $thread_num = $kk_xshow['thread_num'] ? $kk_xshow['thread_num'] : 10; //thread reply 4th
  172.                 $sql = "SELECT t.*, f.name FROM ".DB::table('forum_thread')." t, ".DB::table('forum_forum')." f WHERE f.status<>'3' AND f.fid=t.fid $notshow $onlyshow AND t.displayorder not IN(-1,-2,-4) AND t.closed NOT LIKE 'moved|%' AND t.replies!=0 ORDER BY t.lastpost DESC LIMIT 0, $thread_num";
  173.                 $objarray = kk_xshow_query($sql);
  174.                 $cacheArray .= "\$newReply=".arrayeval($objarray).";\n\n";
  175.                 writetocache('kk_xshow_reply', $cacheArray);
  176.         }
  177.         function update_4th() {
  178.                 global $_G,$kk_xshow;

  179.                 $thread_num = $kk_xshow['thread_num'] ? $kk_xshow['thread_num'] : 10; //thread reply 4th
  180.                 $sortway = array('', 'replies', 'views', 'dateline', 'lastpost');
  181.                 $hotdig = $kk_xshow['hot_dig'] == 2 ? $sortway[$kk_xshow['dig_list']] : $sortway[$kk_xshow['hot_list']];
  182.                 $ctime = $kk_xshow['tid_day'] ? $_G['timestamp'] - (3600 * 24 * $kk_xshow['tid_day']) : 0;
  183.                 $DigShow = $kk_xshow['hot_dig'] == 2 && $kk_xshow['dig_rank'] ? 'AND t.digest IN('.$kk_xshow['dig_rank'].')' : '';
  184.                 $sql = "SELECT t.*, f.name FROM ".DB::table('forum_thread')." t, ".DB::table('forum_forum')." f WHERE f.status<>'3' AND f.fid=t.fid $notshow $onlyshow $DigShow AND t.displayorder not IN(-1,-2,-4) AND t.replies!=0 AND t.dateline>$ctime ORDER BY t.$hotdig DESC LIMIT 0, $thread_num";
  185.                 $objarray = kk_xshow_query($sql);
  186.                 $cacheArray .= "\$ObjArray=".arrayeval($objarray).";\n\n";
  187.                 unset($sortway, $hotdig, $sql, $ctime, $DigShow, $objarray);
  188.                 writetocache('kk_xshow_4th', $cacheArray);
  189.         }
  190.         function update_user() {
  191.                 global $_G,$kk_xshow;

  192.                 $user_num = $kk_xshow['user_num'] ? $kk_xshow['user_num'] : '15'; //user
  193.                 $poststar = array();
  194.                 $tomonth = date('n');
  195.                 $todate = date('j');
  196.                 $toyear = date('Y');
  197.                 if ($kk_xshow['author_date'] == 1) {
  198.                         $time = mktime(0, 0, 0, $tomonth, $todate, $toyear);
  199.                 }else if ($kk_xshow['author_date'] == 2) {
  200.                         $time = mktime(0, 0, 0, $tomonth, $todate, $toyear) - 604800;
  201.                 }else if ($kk_xshow['author_date'] == 3) {
  202.                         $time = mktime(0, 0, 0, $tomonth, 1, $toyear);
  203.                 }else if ($kk_xshow['author_date'] == 4) {
  204.                         $time = mktime(0, 0, 0, 1, 1, $toyear);
  205.                 }else {
  206.                         $time = 0;
  207.                 }
  208.                 if($kk_xshow['author_date'] != 6) {
  209.                         $query = DB::query("select count(pid) as num, authorid, author from ".DB::table('forum_post')." where dateline>=$time group by authorid order by num desc limit 0, $user_num");
  210.                 } else {
  211.                         $query = DB::query("SELECT uid as authorid,username as author,regdate FROM ".DB::table('common_member')." ORDER BY regdate DESC limit 0, $user_num");
  212.                 }
  213.                 while($result = DB::fetch($query)) {
  214.                         $result['avatar'] = discuz_uc_avatar($result['authorid'], 'small');
  215.                         $result['autitl'] = $result['author'];
  216.                         if($kk_xshow['author_date'] == 6) {
  217.                                 $result['num'] = gmdate('Y-m-d', $result['regdate'] + $_G['setting']['timeoffset'] * 3600);
  218.                         }
  219.                         $poststar[] = $result;
  220.                 }
  221.                 $cacheArray .= "\$postStar=".arrayeval($poststar).";\n";
  222.                 writetocache('kk_xshow_user', $cacheArray);
  223.         }
  224. }
  225. ?>
复制代码
替换名字为:xshow.class.php原文件的内容

评分

1

查看全部评分

回复

使用道具 举报

love322093 发表于 2010-10-26 13:50:35 | 显示全部楼层
本帖最后由 love322093 于 2010-10-26 13:50 编辑

主要是没有排除 displayorder == -4的 主题

评分

1

查看全部评分

回复

使用道具 举报

 楼主| 一个人在飘 发表于 2010-10-26 14:38:32 | 显示全部楼层
回复 love322093 的帖子

怎么搞?
回复

使用道具 举报

love322093 发表于 2010-10-26 15:00:04 | 显示全部楼层
回复 一个人在飘 的帖子

我不是给你方法了吗?
望楼上看

评分

1

查看全部评分

回复

使用道具 举报

maxingxu 发表于 2010-10-26 15:03:05 | 显示全部楼层
这得帮顶一下
回复

使用道具 举报

82076322 发表于 2010-10-26 19:52:04 | 显示全部楼层
一个人在飘 发表于 2010-10-25 19:35
不知道站长朋友有没有发现这个问题,当会员在写一个帖子,保存为草稿时,在“最新主题”那里已经调用了,打 ...

该插件的作者为官方,请联系官方
回复

使用道具 举报

898869 发表于 2010-10-26 20:18:21 | 显示全部楼层
回复 love322093 的帖子

不是GBK的啊
回复

使用道具 举报

 楼主| 一个人在飘 发表于 2010-10-26 21:24:47 | 显示全部楼层
回复 love322093 的帖子

这个太深奥了,能不能直接说一下“去掉哪段代码”或者“改哪一段代码”?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-21 15:53 , Processed in 0.119484 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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