From 9dc5374759668b41feefb9c6603faf39bcf51710 Mon Sep 17 00:00:00 2001 From: Comsenz <10433182@qq.com> Date: Fri, 3 Nov 2017 09:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E5=BC=83=20=E5=88=A0=E9=99=A4TAG?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E8=8E=B7=E5=8F=96=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/forum.php | 2 +- .../include/spacecp/spacecp_relatekw.php | 56 --------- upload/source/module/forum/forum_relatekw.php | 70 ----------- .../module/forum/forum_relatethread.php | 118 ------------------ upload/source/module/home/home_spacecp.php | 2 +- upload/static/image/editor/editor_function.js | 13 -- upload/static/js/forum_post.js | 17 --- .../default/forum/post_editor_attribute.htm | 2 +- .../default/forum/post_editor_extra.htm | 2 +- upload/template/default/home/spacecp_blog.htm | 4 +- 10 files changed, 6 insertions(+), 280 deletions(-) delete mode 100644 upload/source/include/spacecp/spacecp_relatekw.php delete mode 100644 upload/source/module/forum/forum_relatekw.php delete mode 100644 upload/source/module/forum/forum_relatethread.php diff --git a/upload/forum.php b/upload/forum.php index 4ceb2e4..ca44d25 100644 --- a/upload/forum.php +++ b/upload/forum.php @@ -20,7 +20,7 @@ require './source/function/function_forum.php'; $modarray = array('ajax','announcement','attachment','forumdisplay', 'group','image','index','medal','misc','modcp','notice','post','redirect', - 'relatekw','relatethread','rss','topicadmin','trade','viewthread','tag','collection','guide' + 'rss','topicadmin','trade','viewthread','tag','collection','guide' ); $modcachelist = array( diff --git a/upload/source/include/spacecp/spacecp_relatekw.php b/upload/source/include/spacecp/spacecp_relatekw.php deleted file mode 100644 index 3d1072c..0000000 --- a/upload/source/include/spacecp/spacecp_relatekw.php +++ /dev/null @@ -1,56 +0,0 @@ - '5' && CHARSET != 'utf-8') { - $kws[] = diconv(trim($valuearray['value']), 'utf-8'); - } else { - $kws[] = trim($valuearray['value']); - } - } - } - - $return = ''; - if($kws) { - foreach($kws as $kw) { - $kw = dhtmlspecialchars($kw); - $return .= $kw.' '; - } - $return = trim($return); - } - - showmessage($return, '', array(), array('msgtype' => 3, 'handle' => false)); -} else { - showmessage(' ', '', array(), array('msgtype' => 3, 'handle' => false)); -} - -?> \ No newline at end of file diff --git a/upload/source/module/forum/forum_relatekw.php b/upload/source/module/forum/forum_relatekw.php deleted file mode 100644 index 1035957..0000000 --- a/upload/source/module/forum/forum_relatekw.php +++ /dev/null @@ -1,70 +0,0 @@ -fetch_threadpost_by_tid_invisible($tid); - $subject = $data['subject']; - $message = cutstr($data['message'], 500, ''); - $pid = $data['pid']; -} else { - $subject = $_GET['subjectenc']; - $message = $_GET['messageenc']; -} - -$subjectenc = rawurlencode(strip_tags($subject)); -$messageenc = rawurlencode(strip_tags(preg_replace("/\[.+?\]/U", '', $message))); -$data = @implode('', file("http://keyword.discuz.com/related_kw.html?ics=".CHARSET."&ocs=".CHARSET."&title=$subjectenc&content=$messageenc")); - -if($data) { - - if(PHP_VERSION > '5' && CHARSET != 'utf-8') { - require_once libfile('class/chinese'); - $chs = new Chinese('utf-8', CHARSET); - } - - $parser = xml_parser_create(); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, $data, $values, $index); - xml_parser_free($parser); - - $kws = array(); - - foreach($values as $valuearray) { - if($valuearray['tag'] == 'kw' || $valuearray['tag'] == 'ekw') { - $kws[] = !empty($chs) ? $chs->convert(trim($valuearray['value'])) : trim($valuearray['value']); - } - } - - $return = ''; - if($kws) { - foreach($kws as $kw) { - $kw = dhtmlspecialchars($kw); - $return .= $kw.','; - } - $return = dhtmlspecialchars($return); - } - $return = substr($return, 0, strlen($return)-1); - - if(!$tid) { - $_G['inajax'] = 1; - include template('forum/relatekw'); - } elseif($kws) { - loadcache('censor'); - C::t('forum_post')->update('tid:'.$_G['tid'], $pid, array( - 'tags' => implode(',', $kws), - )); - } -} - -?> \ No newline at end of file diff --git a/upload/source/module/forum/forum_relatethread.php b/upload/source/module/forum/forum_relatethread.php deleted file mode 100644 index 614b932..0000000 --- a/upload/source/module/forum/forum_relatethread.php +++ /dev/null @@ -1,118 +0,0 @@ - md5($_G['authkey'].$tid.$subjectenc.CHARSET.$site)) { - exit(); -} - -$tshow = !$_G['setting']['qihoo']['relate']['position'] ? 'mid' : 'bot'; -$intnum = intval($_G['setting']['qihoo']['relate']['bbsnum']); -$extnum = intval($_G['setting']['qihoo']['relate']['webnum']); -$exttype = $_G['setting']['qihoo']['relate']['type']; -$up = intval($_GET['qihoo_up']); -$data = @implode('', file("http://related.code.qihoo.com/related.html?title=$subjectenc&ics=".CHARSET."&ocs=".CHARSET."&site=$site&sort=pdate&tshow=$tshow&intnum=$intnum&extnum=$extnum&exttype=$exttype&up=$up")); - -if($data) { - $timestamp = time(); - $chs = ''; - - if(PHP_VERSION > '5' && CHARSET != 'utf-8') { - require_once libfile('class/chinese'); - $chs = new Chinese('utf-8', CHARSET); - } - - $parser = xml_parser_create(); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, $data, $values, $index); - xml_parser_free($parser); - - $xmldata = array('chanl', 'fid', 'title', 'tid', 'author', 'pdate', 'rdate', 'rnum', 'vnum', 'insite'); - $relatedthreadlist = $keywords = array(); - $nextuptime = 0; - foreach($index as $tag => $valuearray) { - if(in_array($tag, $xmldata)) { - foreach($valuearray as $key => $value) { - if($values[$index['title'][$key]]['value']) { - $relatedthreadlist[$key][$tag] = !empty($chs) ? $chs->convert(trim($values[$value]['value'])) : trim($values[$value]['value']); - $relatedthreadlist[$key]['fid'] = !$values[$index['fid'][$key]]['value'] ? preg_replace("/(.+?)\/forum\-(\d+)\-(\d+)\.html/", "\\2", trim($values[$index['curl'][$key]]['value'])) : trim($values[$index['fid'][$key]]['value']); - $relatedthreadlist[$key]['tid'] = !$values[$index['tid'][$key]]['value'] ? preg_replace("/(.+?)\/thread\-(\d+)\-(\d+)-(\d+)\.html/", "\\2", trim($values[$index['surl'][$key]]['value'])) : trim($values[$index['tid'][$key]]['value']); - } - } - } elseif(in_array($tag, array('kw', 'ekw'))) { - $type = $tag == 'kw' ? 'general' : 'trade'; - foreach($valuearray as $value) { - $keywords[$type][] = !empty($chs) ? $chs->convert(trim($values[$value]['value'])) : trim($values[$value]['value']); - } - } elseif($tag == 'nextuptime') { - $nextuptime = $values[$index['nextuptime'][0]]['value']; - } elseif($tag == 'keep' && intval($values[$index['keep'][0]]['value'])) { - exit; - } - } - - $generalnew = array(); - if($keywords['general']) { - $searchkeywords = rawurlencode(implode(' ', $keywords['general'])); - foreach($keywords['general'] as $keyword) { - $generalnew[] = $keyword; - if(!in_array($keyword, $tags)) { - $relatedkeywords .= ''.$keyword.' '; - } - } - } - $keywords['general'] = $generalnew; - - $threadlist = array(); - if($relatedthreadlist) { - foreach($relatedthreadlist as $key => $relatedthread) { - if($relatedthread['insite'] == 1) { - $threadlist['bbsthread'][] = $relatedthread; - } elseif($_G['setting']['qihoo']['relate']['webnum']) { - if(empty($_G['setting']['qihoo']['relate']['banurl']) || !preg_match($_G['setting']['qihoo']['relate']['banurl'], $relatedthread['tid'])) { - $threadlist['webthread'][] = $relatedthread; - } - } - } - $threadlist['bbsthread'] = $threadlist['bbsthread'] ? array_slice($threadlist['bbsthread'], 0, $_G['setting']['qihoo']['relate']['bbsnum']) : array(); - $threadlist['webthread'] = $threadlist['webthread'] ? array_slice($threadlist['webthread'], 0, $_G['setting']['qihoo']['relate']['bbsnum'] - count($threadlist['bbsthread'])) : array(); - $relatedthreadlist = array_merge($threadlist['bbsthread'], $threadlist['webthread']); - } - - $keywords['general'] = $keywords['general'][0] ? implode("\t", $keywords['general']) : ''; - $keywords['trade'] = $keywords['trade'][0] ? implode("\t", $keywords['trade']) : ''; - $relatedthreads = $relatedthreadlist ? addslashes(serialize($relatedthreadlist)) : ''; - $expiration = $nextuptime ? $nextuptime : $timestamp + 86400; - - $data = array('tid' => $tid, 'type' => 'general', 'expiration' => $expiration, 'keywords' => $keywords[general], 'relatedthreads' => $relatedthreads); - C::t('forum_relatedthread')->insert($data, 0, 1); - if($keywords['trade']) { - $data['type'] = 'trade'; - $data['keywords'] = $keywords['trade']; - C::t('forum_relatedthread')->insert($data, 0, 1); - } -} - -?> \ No newline at end of file diff --git a/upload/source/module/home/home_spacecp.php b/upload/source/module/home/home_spacecp.php index a2608df..93559d7 100644 --- a/upload/source/module/home/home_spacecp.php +++ b/upload/source/module/home/home_spacecp.php @@ -14,7 +14,7 @@ if(!defined('IN_DISCUZ')) { require_once libfile('function/spacecp'); require_once libfile('function/magic'); -$acs = array('doing', 'upload', 'comment', 'blog', 'album', 'relatekw', 'common', 'class', +$acs = array('doing', 'upload', 'comment', 'blog', 'album', 'common', 'class', 'swfupload', 'poke', 'friend', 'eccredit', 'favorite', 'follow', 'avatar', 'profile', 'theme', 'feed', 'privacy', 'pm', 'share', 'invite','sendmail', 'credit', 'usergroup', 'domain', 'click','magic', 'top', 'videophoto', 'index', 'plugin', 'search', 'promotion'); diff --git a/upload/static/image/editor/editor_function.js b/upload/static/image/editor/editor_function.js index 250407b..46315b6 100644 --- a/upload/static/image/editor/editor_function.js +++ b/upload/static/image/editor/editor_function.js @@ -27,19 +27,6 @@ function edit_save() { backupContent($('uchome-ttHtmlEditor').value); } -function relatekw() { - edit_save(); - var subject = cnCode($('subject').value); - var message = cnCode($('uchome-ttHtmlEditor').value); - if(message) { - message = message.substr(0, 500); - } - var x = new Ajax(); - x.get('home.php?mod=spacecp&ac=relatekw&inajax=1&subjectenc=' + subject + '&messageenc=' + message, function(s){ - $('tag').value = s; - }); -} - function downRemoteFile() { edit_save(); var formObj = $("articleform"); diff --git a/upload/static/js/forum_post.js b/upload/static/js/forum_post.js index 5d0c88f..347d998 100644 --- a/upload/static/js/forum_post.js +++ b/upload/static/js/forum_post.js @@ -185,23 +185,6 @@ function postsubmit(theform) { theform.submit(); } -function relatekw(subject, message) { - if(isUndefined(subject) || subject == -1) { - subject = $('subject').value; - subject = subject.replace(/<\/?[^>]+>|\[\/?.+?\]|"/ig, ""); - subject = subject.replace(/\s{2,}/ig, ' '); - } - if(isUndefined(message) || message == -1) { - message = getEditorContents(); - message = message.replace(/<\/?[^>]+>|\[\/?.+?\]|"/ig, ""); - message = message.replace(/\s{2,}/ig, ' '); - } - subject = (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(subject) : subject); - message = (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(message) : message); - message = message.replace(/&/ig, '', message).substr(0, 500); - ajaxget('forum.php?mod=relatekw&subjectenc=' + subject + '&messageenc=' + message, 'tagselect'); -} - function switchicon(iconid, obj) { $('iconid').value = iconid; $('icon_img').src = obj.src; diff --git a/upload/template/default/forum/post_editor_attribute.htm b/upload/template/default/forum/post_editor_attribute.htm index 28c822b..7772337 100644 --- a/upload/template/default/forum/post_editor_attribute.htm +++ b/upload/template/default/forum/post_editor_attribute.htm @@ -88,7 +88,7 @@
+ | ||
@@ -138,7 +138,7 @@ | ||
{lang label} | -+ |
---|