parent
f845217e07
commit
5928991d51
|
@ -4,7 +4,7 @@
|
|||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_function.php 36313 2016-12-19 07:06:44Z nemohou $
|
||||
* $Id: install_function.php 36324 2016-12-22 01:01:16Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install_var.php 36311 2016-12-19 01:47:34Z nemohou $
|
||||
* $Id: install_var.php 36324 2016-12-22 01:01:16Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_COMSENZ')) {
|
||||
|
|
|
@ -789,7 +789,7 @@ ea0804418f05dc8372abb669d3b4c67e *source/function/function_blog.php
|
|||
1f719213dcd973d4fc1ba9c32e53383e *source/function/function_cloudaddons.php
|
||||
77f06f33b827d1155c5c3c2f28bc7909 *source/function/function_collection.php
|
||||
90ee4789682564336c6043e19dc2dcb8 *source/function/function_comment.php
|
||||
c0f18f403dce9a8fbc001761bd600489 *source/function/function_core.php
|
||||
3db07b798e015607661ad9de1d74f165 *source/function/function_core.php
|
||||
9bc78bc4596f7711cd5d338a791bc9be *source/function/function_credit.php
|
||||
dc26872be5adc5364f42bc0335c4b504 *source/function/function_delete.php
|
||||
160406afb012cbe8f93ce949a8bcb4bf *source/function/function_discuzcode.php
|
||||
|
@ -1206,7 +1206,7 @@ c4cc92f6de3bddcbe452039bba167d4f *source/module/misc/misc_diyhelp.php
|
|||
aed09ee91f0152cf394e8fe7eb83d007 *source/module/misc/misc_faq.php
|
||||
0c2a7a825561f1cbb9d74112086bc430 *source/module/misc/misc_getatuser.php
|
||||
670249a9c4264680aeaef53d39d9da8e *source/module/misc/misc_imgcropper.php
|
||||
0131e5eb18245cf4191f92b940a0ea45 *source/module/misc/misc_initsys.php
|
||||
9a85bd4b036ae0fd179429e7523e1fc2 *source/module/misc/misc_initsys.php
|
||||
c41c71f883fd0e79e84bd620edc6e747 *source/module/misc/misc_invite.php
|
||||
9f78eea5aef9b4d27aa5159edba88316 *source/module/misc/misc_manyou.php
|
||||
6fba6243a1f3df7466accb774e11230c *source/module/misc/misc_mobile.php
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: function_core.php 36293 2016-12-14 02:50:56Z nemohou $
|
||||
* $Id: function_core.php 36324 2016-12-22 01:01:16Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: misc_initsys.php 35993 2016-06-30 03:10:50Z nemohou $
|
||||
* $Id: misc_initsys.php 36323 2016-12-20 09:49:00Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
|
@ -29,7 +29,7 @@ if($_G['config']['output']['tplrefresh']) {
|
|||
cleartemplatecache();
|
||||
}
|
||||
|
||||
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'cloudsearch', 'security', 'xf_storage', 'mobile', 'pcmgr_url_safeguard', 'manyou', 'cloudunion', 'cloudcaptcha', 'wechat');
|
||||
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'security', 'mobile', 'pcmgr_url_safeguard', 'manyou', 'cloudcaptcha', 'wechat');
|
||||
$opens = array('mobile', 'pcmgr_url_safeguard', 'security', 'cloudcaptcha');
|
||||
$checkcloses = array('cloudcaptcha');
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: admincp_setting.inc.php 33704 2013-08-06 06:45:48Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
dheader('location: '.ADMINSCRIPT.'?action=cloud&operation=search&anchor='.$_GET['ac']);
|
||||
|
||||
?>
|
|
@ -1,133 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: cloudsearch.inc.php 29366 2012-04-09 03:00:26Z zhouxiaobo $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if($_GET['formhash'] != FORMHASH) {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
if(!$_G['uid']) {
|
||||
showmessage('undefined_action');
|
||||
}
|
||||
|
||||
if($_G['cookie']['ffids' . $_G['uid']]) {
|
||||
showmessage('get_forbidden_formula_forum_already');
|
||||
}
|
||||
|
||||
require_once libfile('function/forum');
|
||||
$forbiddenFids = array();
|
||||
foreach(C::t('#cloudsearch#forum_forum_plugin')->fetch_all_forum_by_formula_for_plugin() as $forum) {
|
||||
if (check_formula_forum_isforbidden($forum['formulaperm'])) {
|
||||
$forbiddenFids[] = $forum['fid'];
|
||||
}
|
||||
}
|
||||
dsetcookie('ffids' . $_G['uid'], authcode(implode('D', $forbiddenFids), 'ENCODE'), 86400);
|
||||
|
||||
|
||||
function check_formula_forum_isforbidden($formula) {
|
||||
global $_G;
|
||||
|
||||
$formula = dunserialize($formula);
|
||||
$medalperm = $formula['medal'];
|
||||
$permusers = $formula['users'];
|
||||
$permmessage = $formula['message'];
|
||||
|
||||
$formulatext = $formula[0];
|
||||
$formula = $formula[1];
|
||||
if($_G['adminid'] == 1 || $_G['forum']['ismoderator'] || in_array($_G['groupid'], explode("\t", $_G['forum']['spviewperm']))) {
|
||||
return FALSE;
|
||||
}
|
||||
if($permusers) {
|
||||
$permusers = str_replace(array("\r\n", "\r"), array("\n", "\n"), $permusers);
|
||||
$permusers = explode("\n", trim($permusers));
|
||||
if(!in_array($_G['member']['username'], $permusers)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if(!$formula) {
|
||||
return FALSE;
|
||||
}
|
||||
if(strexists($formula, '$memberformula[')) {
|
||||
preg_match_all("/\\\$memberformula\['(\w+?)'\]/", $formula, $a);
|
||||
$profilefields = array();
|
||||
foreach($a[1] as $field) {
|
||||
switch($field) {
|
||||
case 'regdate':
|
||||
$formula = preg_replace("/\{(\d{4})\-(\d{1,2})\-(\d{1,2})\}/e", "'\'\\1-'.sprintf('%02d', '\\2').'-'.sprintf('%02d', '\\3').'\''", $formula);
|
||||
case 'regday':
|
||||
break;
|
||||
case 'regip':
|
||||
case 'lastip':
|
||||
$formula = preg_replace("/\{([\d\.]+?)\}/", "'\\1'", $formula);
|
||||
$formula = preg_replace('/(\$memberformula\[\'(regip|lastip)\'\])\s*=+\s*\'([\d\.]+?)\'/', "strpos(\\1, '\\3')===0", $formula);
|
||||
case 'buyercredit':
|
||||
case 'sellercredit':
|
||||
space_merge($_G['member'], 'status');break;
|
||||
case substr($field, 0, 5) == 'field':
|
||||
space_merge($_G['member'], 'profile');
|
||||
$profilefields[] = $field;break;
|
||||
}
|
||||
}
|
||||
$memberformula = array();
|
||||
if($_G['uid']) {
|
||||
$memberformula = $_G['member'];
|
||||
if(in_array('regday', $a[1])) {
|
||||
$memberformula['regday'] = intval((TIMESTAMP - $memberformula['regdate']) / 86400);
|
||||
}
|
||||
if(in_array('regdate', $a[1])) {
|
||||
$memberformula['regdate'] = date('Y-m-d', $memberformula['regdate']);
|
||||
}
|
||||
$memberformula['lastip'] = $memberformula['lastip'] ? $memberformula['lastip'] : $_G['clientip'];
|
||||
} else {
|
||||
if(isset($memberformula['regip'])) {
|
||||
$memberformula['regip'] = $_G['clientip'];
|
||||
}
|
||||
if(isset($memberformula['lastip'])) {
|
||||
$memberformula['lastip'] = $_G['clientip'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@eval("\$formulaperm = ($formula) ? TRUE : FALSE;");
|
||||
if(!$formulaperm) {
|
||||
if(!$permmessage) {
|
||||
$language = lang('forum/misc');
|
||||
$search = array('regdate', 'regday', 'regip', 'lastip', 'buyercredit', 'sellercredit', 'digestposts', 'posts', 'threads', 'oltime');
|
||||
$replace = array($language['formulaperm_regdate'], $language['formulaperm_regday'], $language['formulaperm_regip'], $language['formulaperm_lastip'], $language['formulaperm_buyercredit'], $language['formulaperm_sellercredit'], $language['formulaperm_digestposts'], $language['formulaperm_posts'], $language['formulaperm_threads'], $language['formulaperm_oltime']);
|
||||
for($i = 1; $i <= 8; $i++) {
|
||||
$search[] = 'extcredits'.$i;
|
||||
$replace[] = $_G['setting']['extcredits'][$i]['title'] ? $_G['setting']['extcredits'][$i]['title'] : $language['formulaperm_extcredits'].$i;
|
||||
}
|
||||
if($profilefields) {
|
||||
loadcache(array('fields_required', 'fields_optional'));
|
||||
foreach($profilefields as $profilefield) {
|
||||
$search[] = $profilefield;
|
||||
$replace[] = !empty($_G['cache']['fields_optional']['field_'.$profilefield]) ? $_G['cache']['fields_optional']['field_'.$profilefield]['title'] : $_G['cache']['fields_required']['field_'.$profilefield]['title'];
|
||||
}
|
||||
}
|
||||
$i = 0;$_G['forum_usermsg'] = '';
|
||||
foreach($search as $s) {
|
||||
if(in_array($s, array('digestposts', 'posts', 'threads', 'oltime', 'extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8'))) {
|
||||
$_G['forum_usermsg'] .= strexists($formulatext, $s) ? '<br /> '.$replace[$i].': '.(@eval('return intval(getuserprofile(\''.$s.'\'));')) : '';
|
||||
} elseif(in_array($s, array('regdate', 'regip', 'regday'))) {
|
||||
$_G['forum_usermsg'] .= strexists($formulatext, $s) ? '<br /> '.$replace[$i].': '.(@eval('return $memberformula[\''.$s.'\'];')) : '';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$search = array_merge($search, array('and', 'or', '>=', '<=', '=='));
|
||||
$replace = array_merge($replace, array(' <b>'.$language['formulaperm_and'].'</b> ', ' <b>'.$language['formulaperm_or'].'</b> ', '≥', '≤', '='));
|
||||
$_G['forum_formulamessage'] = str_replace($search, $replace, $formulatext);
|
||||
} else {
|
||||
$_G['forum_formulamessage'] = $permmessage;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<root>
|
||||
<item id="Title"><![CDATA[Discuz! Plugin]]></item>
|
||||
<item id="Data">
|
||||
<item id="plugin">
|
||||
<item id="available"><![CDATA[1]]></item>
|
||||
<item id="adminid"><![CDATA[1]]></item>
|
||||
<item id="name"><![CDATA[纵横搜索]]></item>
|
||||
<item id="identifier"><![CDATA[cloudsearch]]></item>
|
||||
<item id="description"><![CDATA[]]></item>
|
||||
<item id="datatables"><![CDATA[]]></item>
|
||||
<item id="directory"><![CDATA[cloudsearch/]]></item>
|
||||
<item id="copyright"><![CDATA[Comsenz Inc.]]></item>
|
||||
<item id="version"><![CDATA[1.07.1]]></item>
|
||||
<item id="__modules">
|
||||
<item id="0">
|
||||
<item id="name"><![CDATA[search]]></item>
|
||||
<item id="param"><![CDATA[]]></item>
|
||||
<item id="menu"><![CDATA[]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[11]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[0]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
<item id="1">
|
||||
<item id="name"><![CDATA[search_wap]]></item>
|
||||
<item id="param"><![CDATA[]]></item>
|
||||
<item id="menu"><![CDATA[]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[28]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[0]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
<item id="2">
|
||||
<item id="name"><![CDATA[admincp]]></item>
|
||||
<item id="param"><![CDATA[ac=setting]]></item>
|
||||
<item id="menu"><![CDATA[基本设置]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[3]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[0]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
<item id="3">
|
||||
<item id="name"><![CDATA[admincp]]></item>
|
||||
<item id="param"><![CDATA[ac=iwenwen]]></item>
|
||||
<item id="menu"><![CDATA[Iwenwen]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[3]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[1]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="version"><![CDATA[X3.2]]></item>
|
||||
<item id="language">
|
||||
<item id="templatelang">
|
||||
<item id="hottopic"><![CDATA[热门话题]]></item>
|
||||
<item id="realtedthread"><![CDATA[搜索相关主题]]></item>
|
||||
<item id="forum"><![CDATA[版块]]></item>
|
||||
<item id="addtocollection"><![CDATA[添加到淘专辑]]></item>
|
||||
<item id="no_content"><![CDATA[暂时还没有内容]]></item>
|
||||
<item id="viewmore"><![CDATA[查看更多]]></item>
|
||||
<item id="relate"><![CDATA[相关主题]]></item>
|
||||
<item id="orderby"><![CDATA[筛选]]></item>
|
||||
<item id="order_default"><![CDATA[相关度]]></item>
|
||||
<item id="order_posted"><![CDATA[发帖时间]]></item>
|
||||
<item id="thread_class"><![CDATA[主题分类]]></item>
|
||||
<item id="loading"><![CDATA[正在加载……]]></item>
|
||||
<item id="forumhottopic"><![CDATA[热点]]></item>
|
||||
<item id="current"><![CDATA[本版]]></item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="installfile"><![CDATA[install.php]]></item>
|
||||
<item id="upgradefile"><![CDATA[upgrade.php]]></item>
|
||||
<item id="enablefile"><![CDATA[switch.php]]></item>
|
||||
<item id="disablefile"><![CDATA[switch.php]]></item>
|
||||
</item>
|
||||
</root>
|
|
@ -1,83 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz! X] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: forumdisplay.inc.php 29449 2012-04-12 08:31:54Z chenmengshu $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$page = $_G['page'];
|
||||
|
||||
if($_GET['cloudop'] == 'relatedthread') {
|
||||
|
||||
list($threadlist, $cloudData) = getCloudRelateThreads('tao', $_GET['keyword'], $page, $_G['tpp'], '', false);
|
||||
|
||||
include_once template('cloudsearch:forumdisplay');
|
||||
|
||||
$enKeyword = urlencode($_GET['keyword']);
|
||||
$threaddiv = str_replace(array("\r", "\n"), "", tpl_cloudsearch_forumdisplay_relatedlist($threadlist, $enKeyword));
|
||||
$multipage = str_replace(array("\r", "\n"), "", multi($cloudData['result']['total'], $_G['tpp'], $page, 'switchPage(', 0, 10, false, false, ');'));
|
||||
|
||||
$_GET['handlekey'] = 'getRelatedData';
|
||||
showmessage('get_data_succ', dreferer(), array('threaddiv' => $threaddiv, 'page'=> $multipage), array('closetime' => '2', 'showmsg' => '1'));
|
||||
|
||||
} elseif($_GET['cloudop'] == 'relatelist') {
|
||||
|
||||
list($threadlist, $cloudData) = getCloudRelateThreads(($_GET['fid'] ? 'forum' : 'tao'), $_GET['keyword'], $_G['page'], ($_GET['fid'] ? $_G['tpp'] : 5), ($_GET['fid'] ? $_GET['fid'] : ''), false);
|
||||
|
||||
if ($_GET['fid']) {
|
||||
loadcache('forums');
|
||||
}
|
||||
|
||||
$searchHelper = Cloud::loadClass('Service_SearchHelper');
|
||||
$searchparams = $searchHelper->makeSearchSignUrl();
|
||||
$srchotquery = '';
|
||||
if(!empty($searchparams['params'])) {
|
||||
foreach($searchparams['params'] as $key => $value) {
|
||||
$srchotquery .= '&' . $key . '=' . $value;
|
||||
}
|
||||
}
|
||||
|
||||
include template('common/header');
|
||||
echo tpl_cloudsearch_relate_threadlist_js_output($threadlist, $_GET['fid'] ? urlencode(strip_tags($_G['cache']['forums'][$_GET['fid']]['name'])) : urlencode(strip_tags($_GET['keyword'])), $searchparams, $srchotquery);
|
||||
include template('common/footer');
|
||||
}
|
||||
|
||||
dexit();
|
||||
|
||||
function getCloudRelateThreads($api = 'tao', $keyword, $page, $tpp = 20, $excludeForumIds = '', $cache = false) {
|
||||
global $_G;
|
||||
|
||||
$threadlist = array();
|
||||
$searchHelper = Cloud::loadClass('Service_SearchHelper');
|
||||
if($api != 'tao') {
|
||||
$cloudData = $searchHelper->getRelatedThreads($excludeForumIds);
|
||||
} else {
|
||||
$cloudData = $searchHelper->getRelatedThreadsTao($keyword, $page, $tpp, $disAd, $of, $ot, $cache, $excludeForumIds);
|
||||
}
|
||||
if($cloudData['result']['data']) {
|
||||
foreach ($cloudData['result']['ad']['content'] as $sAdv) {
|
||||
$threadlist[] = array('icon' => (string)$cloudData['result']['ad']['icon']) + $sAdv;
|
||||
}
|
||||
foreach ($cloudData['result']['data'] as $sPost) {
|
||||
$threadlist[] = $sPost;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
loadcache('forums');
|
||||
|
||||
foreach($threadlist as $curtid=>&$curvalue) {
|
||||
$curvalue['pForumName'] = $_G['cache']['forums'][$curvalue['pForumId']]['name'];
|
||||
$curvalue['istoday'] = strtotime($curvalue['pPosted']) > $todaytime ? 1 : 0;
|
||||
$curvalue['dateline'] = $curvalue['pPosted'];
|
||||
}
|
||||
|
||||
return array($threadlist, $cloudData);
|
||||
}
|
||||
?>
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: install.php 33387 2013-06-05 03:21:26Z jeffjzhang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$my_search_data = array(
|
||||
'status' => 0,
|
||||
'allow_hot_topic' => 1,
|
||||
'allow_thread_related' => 1,
|
||||
'allow_recommend_related' => 1,
|
||||
'allow_thread_related_bottom' => 0,
|
||||
'allow_forum_recommend' => 1,
|
||||
'allow_forum_related' => 0,
|
||||
'allow_collection_related' => 1,
|
||||
'allow_search_suggest' => 0,
|
||||
'cp_version' => 1,
|
||||
'recwords_lifetime' => 21600,
|
||||
);
|
||||
|
||||
if (is_array($_G['setting']['my_search_data'])) {
|
||||
$my_search_data = array_merge($my_search_data, $_G['setting']['my_search_data']);
|
||||
}
|
||||
|
||||
$insertData = serialize($my_search_data);
|
||||
|
||||
$sql = <<<EOF
|
||||
REPLACE INTO pre_common_setting VALUES ('my_search_data', '{$insertData}');
|
||||
EOF;
|
||||
runquery($sql);
|
||||
|
||||
$finish = true;
|
|
@ -1,576 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz! X] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: search.class.php 33387 2013-06-05 03:21:26Z jeffjzhang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
|
||||
class plugin_cloudsearch {
|
||||
|
||||
protected $allow = FALSE;
|
||||
|
||||
protected $allow_hot_topic = FALSE;
|
||||
protected $allow_thread_related = FALSE;
|
||||
protected $allow_forum_recommend = FALSE;
|
||||
protected $allow_forum_related = FALSE;
|
||||
protected $allow_collection_related = FALSE;
|
||||
protected $allow_search_suggest = FALSE;
|
||||
|
||||
public function plugin_cloudsearch() {
|
||||
global $_G, $searchparams;
|
||||
|
||||
$cloudAppService = Cloud::loadClass('Service_App');
|
||||
$this->allow = $cloudAppService->getCloudAppStatus('search');
|
||||
if($this->allow) {
|
||||
$this->allow_hot_topic = $_G['setting']['my_search_data']['allow_hot_topic'];
|
||||
$this->allow_thread_related = isset($_G['setting']['my_search_data']['allow_thread_related']) ? $_G['setting']['my_search_data']['allow_thread_related'] : 1;
|
||||
$this->allow_recommend_related = isset($_G['setting']['my_search_data']['allow_recommend_related']) ? $_G['setting']['my_search_data']['allow_recommend_related'] : 1;
|
||||
$this->allow_forum_recommend = $_G['setting']['my_search_data']['allow_forum_recommend'];
|
||||
$this->allow_forum_related = $_G['setting']['my_search_data']['allow_forum_related'];
|
||||
$this->allow_collection_related = $_G['setting']['my_search_data']['allow_collection_related'];
|
||||
$this->allow_search_suggest = $_G['setting']['my_search_data']['allow_search_suggest'];
|
||||
$this->allow_thread_related_bottom = $_G['setting']['my_search_data']['allow_thread_related_bottom'];
|
||||
include_once template('cloudsearch:module');
|
||||
|
||||
if (!$searchparams) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$searchparams = $searchHelper->makeSearchSignUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function common() {
|
||||
if(!$this->allow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($_GET['mod'] == 'redirect' && $_GET['goto'] == 'findpost' && $_GET['ptid'] && $_GET['pid']) {
|
||||
$post = get_post_by_pid($_GET['pid']);
|
||||
if (empty($post)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$searchHelper->myPostLog('redelete', array('pid' => $_GET['pid']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function global_footer() {
|
||||
if(!$this->allow) {
|
||||
return;
|
||||
}
|
||||
|
||||
$res = '';
|
||||
if(($this->allow_thread_related && $GLOBALS['page'] == 1 || $this->allow_thread_related_bottom) && CURSCRIPT == 'forum' && CURMODULE == 'viewthread') {
|
||||
$res = tpl_cloudsearch_global_footer_related();
|
||||
}
|
||||
|
||||
if($this->allow_recommend_related && CURSCRIPT == 'forum' && (CURMODULE == 'viewthread' || CURMODULE == 'forumdisplay')) {
|
||||
if($this->_is_from_search_engine()) {
|
||||
$res .= tpl_cloudsearch_global_footer_mini();
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->allow_search_suggest) {
|
||||
$params = array(
|
||||
'callback' => 'cloudsearch_suggest_callback'
|
||||
);
|
||||
$util = Cloud::loadClass('Cloud_Service_Util');
|
||||
$queryString = $util->generateSiteSignUrl($params, true);
|
||||
$res .= tpl_cloudsearch_global_footer_suggest($queryString);
|
||||
}
|
||||
$res .= tpl_cloudsearch_global_footer_formula_output();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
private function _is_from_search_engine() {
|
||||
|
||||
$regex = "((http|https)\:\/\/)?";
|
||||
$regex .= "([a-z]*.)+?(ask.com|yahoo.com|bing.com|baidu.com|soso.com|google.com|google.cn|gougou.com|sogou.com|yahoo.cn|youdao.com|google.com.hk|360.cn|360sou.com|so.com)(.[a-z]{2,3})?\/";
|
||||
if(preg_match("/^$regex/i", $_SERVER['HTTP_REFERER'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function topicadmin_message($params) {
|
||||
if(!$this->allow || !$params) {
|
||||
return;
|
||||
}
|
||||
|
||||
$param = $params['param'];
|
||||
if($param[0] == 'admin_succeed') {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$action = $_GET['action'];
|
||||
|
||||
switch($action) {
|
||||
case 'moderate':
|
||||
global $operations;
|
||||
$moderate = empty($_GET['moderate']) ? array() : $_GET['moderate'];
|
||||
|
||||
foreach($moderate as $tid) {
|
||||
if(!$tid = max(0, intval($tid))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach($operations as $operation) {
|
||||
if(in_array($operation, array('stick', 'highlight', 'digest', 'bump', 'down', 'delete', 'move', 'close', 'open'))) {
|
||||
|
||||
if($operation == 'stick') {
|
||||
$my_opt = $_GET['sticklevel'] ? 'sticky' : 'update';
|
||||
} elseif($operation == 'digest') {
|
||||
$my_opt = $_GET['digestlevel'] ? 'digest' : 'update';
|
||||
} elseif($operation == 'highlight') {
|
||||
$my_opt = $_GET['highlight_color'] ? 'highlight' : 'update';
|
||||
} else {
|
||||
$my_opt = $operation;
|
||||
}
|
||||
|
||||
$data = array('tid' => $tid);
|
||||
if($my_opt == 'move' && $_GET['moveto']) {
|
||||
global $toforum;
|
||||
$data['otherid'] = $toforum['fid'];
|
||||
}
|
||||
|
||||
$searchHelper->myThreadLog($my_opt, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'banpost':
|
||||
global $posts;
|
||||
|
||||
$banned = intval($_GET['banned']);
|
||||
foreach($posts as $post) {
|
||||
if ($banned) {
|
||||
$searchHelper->myPostLog('ban', array('pid' => $post['pid'], 'uid' => $post['authorid']));
|
||||
} else {
|
||||
$searchHelper->myPostLog('unban', array('pid' => $post['pid'], 'uid' => $post['authorid']));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'merge':
|
||||
global $_G, $thread;
|
||||
$othertid = intval($_GET['othertid']);
|
||||
|
||||
if ($thread) {
|
||||
$searchHelper->myThreadLog('merge', array('tid' => $othertid, 'otherid' => $_G['tid'], 'fid' => $thread['fid']));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'split':
|
||||
global $_G, $pids;
|
||||
|
||||
$searchHelper->myThreadLog('split', array('tid' => $_G['tid']));
|
||||
|
||||
foreach((array)explode(',', $pids) as $pid) {
|
||||
$searchHelper->myPostLog('split', array('pid' => $pid));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'warn':
|
||||
global $warned, $posts;
|
||||
|
||||
foreach((array)$posts as $k => $post) {
|
||||
if($warned && !($post['status'] & 2)) {
|
||||
$searchHelper->myPostLog('warn', array('pid' => $post['pid'], 'uid' => $post['authorid']));
|
||||
} elseif(!$warned && ($post['status'] & 2)) {
|
||||
$searchHelper->myPostLog('unwarn', array('pid' => $post['pid'], 'uid' => $post['authorid']));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function modcp_message($params) {
|
||||
if(!$this->allow || !$params) {
|
||||
return;
|
||||
}
|
||||
|
||||
$param = $params['param'];
|
||||
if(in_array($param[0], array('modcp_member_ban_succeed', 'modcp_mod_succeed', 'modcp_recyclebin_restore_succeed', 'modcp_recyclebin_delete_succeed'))) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$action = $_GET['action'];
|
||||
|
||||
switch($action) {
|
||||
case 'member':
|
||||
global $groupidnew, $member;
|
||||
|
||||
$my_opt = in_array($groupidnew, array(4, 5)) ? 'banuser' : 'unbanuser';
|
||||
$searchHelper->myThreadLog($my_opt, array('uid' => $member['uid']));
|
||||
break;
|
||||
|
||||
case 'moderate':
|
||||
global $op, $postlist;
|
||||
|
||||
if($op == 'replies') {
|
||||
global $postlist;
|
||||
|
||||
foreach((array)$postlist as $post) {
|
||||
$searchHelper->myPostLog('validate', array('pid' => $post['pid']));
|
||||
}
|
||||
} else {
|
||||
global $moderation;
|
||||
|
||||
foreach((array)$moderation['validate'] as $tid) {
|
||||
$searchHelper->myThreadLog('validate', array('tid' => $tid));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'recyclebin':
|
||||
if(!empty($_GET['moderate'])) {
|
||||
global $_G;
|
||||
|
||||
foreach(C::t('forum_thread')->fetch_all_by_tid_displayorder($_GET['moderate'], -1, '=', $_G['fid']) as $tid) {
|
||||
if($op == 'restore') {
|
||||
$searchHelper->myThreadLog('restore', array('tid' => $tid['tid']));
|
||||
} elseif($op == 'delete' && $_G['group']['allowclearrecycle']) {
|
||||
$searchHelper->myPostLog('delete', array('tid' => $tid['tid']));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function viewthread_message($params) {
|
||||
if(!$this->allow || !$params) {
|
||||
return;
|
||||
}
|
||||
|
||||
$param = $params['param'];
|
||||
if ($param[0] == 'thread_nonexistence' && $_GET['tid']) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$searchHelper->myThreadLog('redelete', array('tid' => $_GET['tid']));
|
||||
}
|
||||
}
|
||||
|
||||
public function space_message($params) {
|
||||
if(!$this->allow || !$params) {
|
||||
return;
|
||||
}
|
||||
|
||||
$param = $params['param'];
|
||||
if ($param[0] == 'thread_delete_succeed') {
|
||||
global $moderate;
|
||||
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach((array)$moderate as $tid) {
|
||||
$searchHelper->myThreadLog('delete', array('tid' => $tid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function post_message($params) {
|
||||
if(!$this->allow || !$params) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $_G, $isfirstpost, $pid, $modnewthreads, $pinvisible;
|
||||
$param = $params['param'];
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
if($param[0] == 'post_edit_delete_succeed' && !empty($_GET['delete']) && $isfirstpost) {
|
||||
$searchHelper->myThreadLog('delete', array('tid' => $_G['tid']));
|
||||
} elseif($param[0] == 'post_edit_delete_succeed' && !empty($_GET['delete'])) {
|
||||
$searchHelper->myPostLog('delete', array('pid' => $pid));
|
||||
} elseif($param[0] == 'post_edit_succeed' && !$modnewreplies && $pinvisible != -3) {
|
||||
$searchHelper->myPostLog('update', array('pid' => $pid));
|
||||
}
|
||||
}
|
||||
|
||||
public function deletemember($params) {
|
||||
$uids = $params['param'][0];
|
||||
$step = $params['step'];
|
||||
|
||||
if($step == 'delete' && is_array($uids)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach($uids as $uid) {
|
||||
$searchHelper->myThreadLog('deluser', array('uid' => $uid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deletepost($params) {
|
||||
$pids = $params['param'][0];
|
||||
$idtype = $params['param'][1];
|
||||
$step = $params['step'];
|
||||
|
||||
if($step == 'delete' && $idtype == 'pid' && is_array($pids)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach($pids as $pid) {
|
||||
$searchHelper->myPostLog('delete', array('pid' => $pid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function deletethread($params) {
|
||||
$tids = $params['param'][0];
|
||||
$step = $params['step'];
|
||||
|
||||
if($step == 'delete' && is_array($tids)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach($tids as $tid) {
|
||||
$searchHelper->myThreadLog('delete', array('tid' => $tid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function undeletethreads($params) {
|
||||
$tids = $params['param'][0];
|
||||
|
||||
if(is_array($tids)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach($tids as $tid) {
|
||||
$searchHelper->myThreadLog('restore', array('tid' => $tid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function recyclebinpostundelete($params) {
|
||||
$pids = $params['param'][0];
|
||||
|
||||
if(is_array($pids)) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
foreach($pids as $pid) {
|
||||
$searchHelper->myPostLog('restore', array('pid' => $pid));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function threadpubsave($params) {
|
||||
global $thread;
|
||||
$step = $params['step'];
|
||||
$posts = $params['posts'];
|
||||
|
||||
if($step == 'save') {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
if ($thread['tid']) {
|
||||
$searchHelper->myThreadLog('update', array('tid' => $thread['tid']));
|
||||
}
|
||||
|
||||
if($thread['replies'] && is_array($posts)) {
|
||||
foreach($posts as $post) {
|
||||
$searchHelper->myPostLog('update', array('pid' => $post['pid']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class plugin_cloudsearch_member extends plugin_cloudsearch {
|
||||
|
||||
}
|
||||
|
||||
class plugin_cloudsearch_forum extends plugin_cloudsearch {
|
||||
|
||||
public function index_catlist_top_output() {
|
||||
if(!$this->allow || !$this->allow_hot_topic) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $searchparams;
|
||||
|
||||
$searchHelper = Cloud::loadClass('Service_SearchHelper');
|
||||
$recwords = $searchHelper->getRecWords(14, 'assoc');
|
||||
$srchotquery = '';
|
||||
if(!empty($searchparams['params'])) {
|
||||
foreach($searchparams['params'] as $key => $value) {
|
||||
$srchotquery .= '&' . $key . '=' . rawurlencode($value);
|
||||
}
|
||||
}
|
||||
return tpl_cloudsearch_index_top($recwords, $searchparams, $srchotquery);
|
||||
}
|
||||
|
||||
public function viewthread_postbottom_output() {
|
||||
if(!$this->allow_thread_related) {
|
||||
return;
|
||||
}
|
||||
global $_G;
|
||||
$return = array();
|
||||
if($GLOBALS['page'] == 1 && $_G['forum_firstpid'] && $GLOBALS['postlist'][$_G['forum_firstpid']]['invisible'] == 0) {
|
||||
$return[] = tpl_cloudsearch_viewthread_postbottom_output();
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
public function collection_viewoptions_output() {
|
||||
if(!$this->allow) {
|
||||
return;
|
||||
}
|
||||
global $_G;
|
||||
|
||||
if($GLOBALS['permission'] || $GLOBALS['isteamworkers']) {
|
||||
return tpl_cloudsearch_collection_viewoptions_output();
|
||||
}
|
||||
}
|
||||
|
||||
public function collection_relatedop_output() {
|
||||
if(!$this->allow || $GLOBALS['op'] != 'related') {
|
||||
return;
|
||||
}
|
||||
global $_G;
|
||||
|
||||
if(!$GLOBALS['permission'] && !$GLOBALS['isteamworkers']) {
|
||||
showmessage('undefined_action', NULL);
|
||||
}
|
||||
$_GET['keyword'] = trim($_GET['keyword']);
|
||||
$gKeyword = $_GET['keyword'] ? $_GET['keyword'] : $_G['collection']['name'];
|
||||
|
||||
$tids = array();
|
||||
|
||||
$searchHelper = Cloud::loadClass('Service_SearchHelper');
|
||||
$cloudData = $searchHelper->getRelatedThreadsTao($gKeyword, $_G['page'], $_G['tpp']);
|
||||
|
||||
if($cloudData['result']['data']) {
|
||||
foreach ($cloudData['result']['ad']['content'] as $sAdv) {
|
||||
$threadlist[] = array('icon' => (string)$cloudData['result']['ad']['icon']) + $sAdv;
|
||||
}
|
||||
foreach ($cloudData['result']['data'] as $sPost) {
|
||||
$threadlist[] = $sPost;
|
||||
}
|
||||
|
||||
loadcache('forums');
|
||||
foreach($threadlist as $curtid=>&$curvalue) {
|
||||
$curvalue['pForumName'] = $_G['cache']['forums'][$curvalue['pForumId']]['name'];
|
||||
$curvalue['istoday'] = strtotime($curvalue['pPosted']) > $todaytime ? 1 : 0;
|
||||
$curvalue['dateline'] = $curvalue['pPosted'];
|
||||
}
|
||||
$multipage = multi($cloudData['result']['total'], $_G['tpp'], $_G['page'], "forum.php?mod=collection&action=view&op=related&ctid={$_G['collection']['ctid']}&keyword=".urlencode($_GET['keyword']));
|
||||
}
|
||||
return tpl_cloudsearch_collection_relatedop_output($threadlist, $multipage);
|
||||
}
|
||||
|
||||
public function collection_threadlistbottom_output() {
|
||||
if(!$this->allow_collection_related || !$GLOBALS['ctid'] || $GLOBALS['action'] != 'view' || $GLOBALS['op']) {
|
||||
return;
|
||||
}
|
||||
global $_G;
|
||||
|
||||
return tpl_cloudsearch_relate_threadlist_output(urlencode($_G['collection']['name'].' '.implode(' ', $_G['collection']['arraykeyword'])));
|
||||
}
|
||||
|
||||
public function forumdisplay_threadlist_bottom_output() {
|
||||
global $_G;
|
||||
|
||||
if(!$this->allow_forum_related|| $_G['page'] > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
return tpl_cloudsearch_relate_threadlist_output(urlencode($_G['forum']['name']));
|
||||
}
|
||||
|
||||
public function forumdisplay_middle_output() {
|
||||
if(!$this->allow || !$this->allow_forum_recommend) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $_G, $searchparams;
|
||||
$result = '';
|
||||
if ($_G['fid']) {
|
||||
$searchHelper = Cloud::loadClass('Service_SearchHelper');
|
||||
$recwords = $searchHelper->getRecWords(14, 'assoc', $_G['fid']);
|
||||
$srchotquery = '';
|
||||
if(!empty($searchparams['params'])) {
|
||||
foreach($searchparams['params'] as $key => $value) {
|
||||
$srchotquery .= '&' . $key . '=' . rawurlencode($value);
|
||||
}
|
||||
}
|
||||
$result = tpl_cloudsearch_index_top($recwords, $searchparams, $srchotquery, 'hotopic_fm');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function viewthread_middle_output() {
|
||||
|
||||
if (!$this->allow || !$this->allow_thread_related_bottom) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $_G;
|
||||
if ($_G['page'] == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
return tpl_cloudsearch_viewthread_modaction_output();
|
||||
}
|
||||
|
||||
public function index_forum_extra_output() {
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function forumdisplay_subforum_extra_output() {
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
private function _get_forum_hotspot($forumlist) {
|
||||
if (!$this->allow || !$this->allow_forum_recommend) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $_G, $searchparams;
|
||||
|
||||
if (!is_array($forumlist) || count($forumlist) == 0 || !$searchparams) {
|
||||
return;
|
||||
}
|
||||
|
||||
$srchotquery = '';
|
||||
if(!empty($searchparams['params'])) {
|
||||
foreach($searchparams['params'] as $key => $value) {
|
||||
$srchotquery .= '&' . $key . '=' . rawurlencode($value);
|
||||
}
|
||||
}
|
||||
|
||||
$return = $cachenames = $fids = array();
|
||||
foreach ($forumlist as $fid => $forum) {
|
||||
$cachenames[] = 'search_recommend_words_' . $forum['fid'];
|
||||
$fids[] = $forum['fid'];
|
||||
}
|
||||
|
||||
loadcache($cachenames);
|
||||
foreach ($fids as $v) {
|
||||
$forum_recwords = $_G['cache']['search_recommend_words_' . $v]['result'];
|
||||
if (!$forum_recwords) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$forum_recwords = array_slice($forum_recwords, 0, 3);
|
||||
|
||||
foreach($forum_recwords as $key => $word) {
|
||||
$forum_recwords[$key]['url'] = $searchparams['url'] . '?' . $srchotquery . '&q=' . urlencode($word['word']) . '&source=word.hotopic_if.'.($key + 1).'&keywordType=recommend&hwfId=' . $v;
|
||||
}
|
||||
$return[$v] = tpl_index_forum_extra_output($forum_recwords);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class plugin_cloudsearch_group extends plugin_cloudsearch {
|
||||
|
||||
}
|
||||
|
||||
class plugin_cloudsearch_home extends plugin_cloudsearch {
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz! X] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: search_wap.class.php 34044 2013-09-25 02:55:02Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class mobileplugin_cloudsearch {
|
||||
|
||||
public function mobileplugin_cloudsearch() {
|
||||
global $_G, $searchparams;
|
||||
|
||||
$cloudAppService = Cloud::loadClass('Service_App');
|
||||
$this->allow = $cloudAppService->getCloudAppStatus('search');
|
||||
if($this->allow) {
|
||||
include_once template('cloudsearch:module');
|
||||
if(!function_exists('tpl_global_header_mobile')) {
|
||||
$this->allow = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$searchparams) {
|
||||
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
|
||||
$searchparams = $searchHelper->makeSearchSignUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function global_header_mobile() {
|
||||
|
||||
if (!$this->allow) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $_G, $searchparams;
|
||||
|
||||
$srchotquery = '';
|
||||
if(!empty($searchparams['params'])) {
|
||||
foreach($searchparams['params'] as $key => $value) {
|
||||
$srchotquery .= '&' . $key . '=' . rawurlencode($value);
|
||||
}
|
||||
}
|
||||
|
||||
return tpl_global_header_mobile($searchparams, $srchotquery);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: switch.php 33950 2013-09-05 02:17:27Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$appIdentifier = 'search';
|
||||
$pluginid = intval($_GET['pluginid']);
|
||||
|
||||
require_once libfile('class/cloudregister');
|
||||
|
||||
if($operation == 'enable') {
|
||||
|
||||
new Cloud_Register($appIdentifier, $pluginid, 'appOpenFormView');
|
||||
|
||||
} elseif($operation == 'disable') {
|
||||
|
||||
new Cloud_Register($appIdentifier, $pluginid, 'appCloseReasonsView');
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: table_forum_forum_plugin.php 29366 2012-04-09 03:00:26Z zhouxiaobo $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class table_forum_forum_plugin extends discuz_table {
|
||||
|
||||
public function __construct() {
|
||||
|
||||
$this->_table = 'forum_forum';
|
||||
$this->_pk = 'fid';
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function fetch_all_forum_by_formula_for_plugin() {
|
||||
$statusql = 'f.status<>\'3\'';
|
||||
return DB::fetch_all("SELECT f.*, ff.*, a.uid FROM ".DB::table($this->_table)." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON ff.fid=f.fid LEFT JOIN ".DB::table('forum_access')." a ON a.fid=f.fid AND a.allowview>'0' WHERE $statusql AND formulaperm<>'' ORDER BY f.type, f.displayorder");
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
/** forum::index, forum::forumdisplay **/
|
||||
.fl_g_hot { height: 18px; overflow: hidden; }
|
||||
.fl_g_hot strong, .fl_g_hot a { float: left; margin-right: 8px; font-weight: 400; white-space: nowrap; }
|
||||
/** end **/
|
|
@ -1,72 +0,0 @@
|
|||
{eval
|
||||
function tpl_cloudsearch_forumdisplay_relatedlist($relatethreadlist, $urlkw) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if $relatethreadlist}-->
|
||||
<div class="th">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<div class="tf">
|
||||
{lang thread}
|
||||
</div>
|
||||
</th>
|
||||
<td class="by">{lang cloudsearch:forum}</td>
|
||||
<td class="by">{lang author}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="bm_c">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<!--{loop $relatethreadlist $thread}-->
|
||||
<tbody id="$thread[id]">
|
||||
<tr>
|
||||
<td class="icn">
|
||||
<!--{if $thread[icon]}-->
|
||||
<img src="{$thread[icon]}" />
|
||||
<!--{else}-->
|
||||
<img src="{IMGDIR}/folder_common.gif" />
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<th>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=viewthread&tid=$thread[tThreadId]" target="_blank" class="xst">$thread['pSubject']</a>
|
||||
<!--{else}-->
|
||||
<a href="$thread['mTargetUrl']" target="_blank" class="xst">$thread['mTitle']</a>
|
||||
<!--{/if}-->
|
||||
</th>
|
||||
<td class="by">
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=forumdisplay&fid=$thread[pForumId]">$thread[pForumName]</a>
|
||||
<!--{else}-->
|
||||
$thread[mShowUrl]
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<td class="by">
|
||||
<cite>
|
||||
<!--{if !isset($thread[icon]) && $thread['pAuthorId'] && $thread['pAuthorName']}-->
|
||||
<a href="home.php?mod=space&uid=$thread[pAuthorId]">$thread[pAuthorName]</a>
|
||||
<!--{else}-->
|
||||
{lang anonymous}
|
||||
<!--{/if}-->
|
||||
</cite>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<em class="xi1">$thread[dateline]</em>
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!--{/loop}-->
|
||||
</table>
|
||||
</div>
|
||||
<!--{else}-->
|
||||
<div style="line-height:50px;text-align:center;">
|
||||
{lang cloudsearch:no_content}
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 313 B |
|
@ -1,56 +0,0 @@
|
|||
{eval
|
||||
|
||||
function tpl_global_header_mobile($searchparams, $srchotquery) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if !empty($searchparams[url])}-->
|
||||
<div id="scbar" class="{if $_G['setting']['srchhotkeywords'] && count($_G['setting']['srchhotkeywords']) > 5}scbar_narrow {/if}cl">
|
||||
<form id="scbar_form" method="get" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="$searchparams[url]" target="_blank">
|
||||
<input type="hidden" name="mod" id="scbar_mod" value="search" />
|
||||
<input type="hidden" name="formhash" value="{FORMHASH}" />
|
||||
<input type="hidden" name="srchtype" value="title" />
|
||||
<input type="hidden" name="srhfid" value="$_G[fid]" />
|
||||
<input type="hidden" name="srhlocality" value="$_G['basescript']::{CURMODULE}" />
|
||||
<!--{loop $searchparams[params] $key $value}-->
|
||||
<input type="hidden" name="$key" value="$value" />
|
||||
<!--{/loop}-->
|
||||
<input type="hidden" name="source" value="txt.form_{if $_G['setting']['mobile']['mobilesimpletype']}sim{else}nor{/if}.a" />
|
||||
<input type="hidden" name="wap" value="yes" />
|
||||
<input type="hidden" name="fId" value="$_G[fid]" />
|
||||
<div style="display: none; position: absolute; top:37px; left:44px;" id="sg">
|
||||
<div id="st_box" cellpadding="2" cellspacing="0"></div>
|
||||
</div>
|
||||
<table width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><input type="text" class="txt xg1" name="q" id="scbar_txt" value="" autocomplete="off" /></td>
|
||||
<td align="center" width="46" class="scbar_btn_td"><input type="submit" name="btnsubmit" id="scbar_btn" class="pn pnc" value="{lang search}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!--{if $_G['setting']['srchhotkeywords'] && CURMODULE == 'index'}-->
|
||||
<td class="scbar_hot_td" colspan="3">
|
||||
<div id="scbar_hot">
|
||||
<strong class="xw1">{lang hot_search}: </strong>
|
||||
<!--{loop $_G['setting']['srchhotkeywords'] $val}-->
|
||||
<!--{if $encodeval=rawurlencode(trim($val))}-->
|
||||
<!--{if !empty($searchparams[url])}-->
|
||||
<a href="$searchparams[url]?q=$encodeval&source=txt.hotsearch_{if $_G['setting']['mobile']['mobilesimpletype']}sim{else}nor{/if}.a{$srchotquery}&wap=yes" target="_blank" class="xi2" sc="1">$val</a>
|
||||
<!--{else}-->
|
||||
<a href="search.php?mod=forum&srchtxt=$encodeval&formhash={FORMHASH}&searchsubmit=true&source=txt.hotsearch_{if $_G['setting']['mobile']['mobilesimpletype']}sim{else}nor{/if}.a&wap=yes" target="_blank" class="xi2" sc="1">$val</a>
|
||||
<!--{/if}-->
|
||||
<!--{/if}-->
|
||||
<!--{/loop}-->
|
||||
</div>
|
||||
</td>
|
||||
<!--{/if}-->
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<ul id="scbar_type_menu" class="p_pop" style="display: none;"><!--{echo implode('', $slist);}--></ul>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
}
|
|
@ -1,651 +0,0 @@
|
|||
{eval
|
||||
function tpl_cloudsearch_index_top($recwords, $searchparams, $srchotquery, $position = 'hotopicf') {
|
||||
global $_G;
|
||||
if($recwords) {
|
||||
$recwords_tmp = $recwords;
|
||||
$recwords = array();
|
||||
foreach ($recwords_tmp as $k => $v) {
|
||||
$recwords[$k+1] = $v;
|
||||
}{eval }}{eval }}
|
||||
<!--{block return}-->
|
||||
<!--{if is_array($recwords) && count($recwords) > 0 && !empty($searchparams[url])}-->
|
||||
<div class="fl bm">
|
||||
<div class="bm bmw hottopic cl">
|
||||
<div class="bm_h cl">
|
||||
<span class="y"></span>
|
||||
<h2>{if $_G['fid']}{lang cloudsearch:current}{/if}{lang cloudsearch:hottopic}</h2>
|
||||
</div>
|
||||
<style>
|
||||
.filter { padding: 10px; border-bottom: none; font-size: 12px; color: #999; }
|
||||
.filter ul {}
|
||||
.filter li { float: left; margin-right: 16px; height: 22px; line-height: 22px; white-space:nowrap; width:12.5%; }
|
||||
.filter li a { margin-right: 2px; text-decoration: none; color: #369; }
|
||||
.filter li.clewcolor a { background:url(source/plugin/cloudsearch/template/keyword_hot.gif) no-repeat 100% 2px; margin-right: 2px; text-decoration: none; color: #F00; padding-right:18px; }
|
||||
.filter li a:hover { text-decoration: underline; }
|
||||
.filter li a:visited { text-decoration: none; color: #666; }
|
||||
.filter li.clewcolor a:visited { text-decoration: none; color: #F00; }
|
||||
.filter .number { color: #666; }
|
||||
.filter li.clewcolor .number { color:#F00; }
|
||||
</style>
|
||||
<div class="filter">
|
||||
<ul class="cl">
|
||||
<!--{loop $recwords $key $recword}-->
|
||||
<!--{if $encodeWord=rawurlencode(trim($recword[word]))}-->
|
||||
<!--{if empty($recword[inc_num])}-->
|
||||
<li><a href="$searchparams[url]?q=$encodeWord&source=word.$position.$key$srchotquery&num=$recword[result_num]" sc="1" target="_blank">$recword[word]<span class="number">($recword[result_num])</span></a></li>
|
||||
<!--{else}-->
|
||||
<li class="clewcolor"><a href="$searchparams[url]?q=$encodeWord&source=word.$position.$key$srchotquery&num=$recword[result_num]" sc="1" target="_blank">$recword[word]<span class="number">($recword[result_num])</span></a></li>
|
||||
<!--{/if}-->
|
||||
<!--{/if}-->
|
||||
<!--{/loop}-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_global_footer_formula_output() {
|
||||
global $_G;
|
||||
$formHash = FORMHASH;
|
||||
$cookie = $_G['cookie']['ffids' . $_G['uid']];
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if !$cookie}-->
|
||||
<script type="text/javascript">
|
||||
_attachEvent(window, 'load', getForbiddenFormula, document);
|
||||
function getForbiddenFormula() {
|
||||
var toGetForbiddenFormulaFIds = function () {
|
||||
ajaxget('plugin.php?id=cloudsearch&formhash={$formHash}');
|
||||
};
|
||||
var a = document.body.getElementsByTagName('a');
|
||||
for(var i = 0;i < a.length;i++){
|
||||
if(a[i].getAttribute('sc')) {
|
||||
a[i].setAttribute('mid', hash(a[i].href));
|
||||
a[i].onmousedown = function() {toGetForbiddenFormulaFIds();};
|
||||
}
|
||||
}
|
||||
var btn = document.body.getElementsByTagName('button');
|
||||
for(var i = 0;i < btn.length;i++){
|
||||
if(btn[i].getAttribute('sc')) {
|
||||
btn[i].setAttribute('mid', hash(btn[i].id));
|
||||
btn[i].onmousedown = function() {toGetForbiddenFormulaFIds();};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_viewthread_postbottom_output() {
|
||||
}
|
||||
<!--{block return}-->
|
||||
<div id="relate_subject"></div>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_forumdisplay_threadtype_extra_output($recwords) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<style>
|
||||
.sort_ttp { padding-top: 0;margin-bottom:5px;}
|
||||
.sort_tit { padding:4px 8px 3px 0; color:#999; }
|
||||
.loadingCloud { text-align:center;line-height:50px; }
|
||||
</style>
|
||||
<script>
|
||||
var currentKeyword = '';
|
||||
var currentOrder = '';
|
||||
function switchkeyword(keyword, order, page) {
|
||||
page = page ? page : 1;
|
||||
order = order ? order : '';
|
||||
if (currentKeyword == keyword && order == '' && page == 1) {
|
||||
window.location = 'forum.php?mod=forumdisplay&fid={$_G[fid]}';
|
||||
return true;
|
||||
}
|
||||
if (currentKeyword != '') {
|
||||
$("ckw_"+currentKeyword).className = '';
|
||||
}
|
||||
$("ckw_"+keyword).className = 'xw1 a';
|
||||
currentKeyword = keyword;
|
||||
currentOrder = order;
|
||||
getclouddata(keyword, order, page);
|
||||
}
|
||||
function switchPage(page) {
|
||||
getclouddata(currentKeyword, currentOrder, page);
|
||||
}
|
||||
function switchOrder(order) {
|
||||
currentOrder = order;
|
||||
getclouddata(currentKeyword, order, 1);
|
||||
}
|
||||
function getclouddata(keyword, order, page) {
|
||||
$("threadlist").innerHTML = '<div class="loadingCloud"><img src="{IMGDIR}/loading.gif" alt="loading..." class="vm" /> {lang cloudsearch:loading}</div>';
|
||||
ajaxget('forum.php?mod=forumdisplay&fid={$_G[fid]}&cloudop=relatedthread&page='+page+'&of='+order+'&keyword='+keyword);
|
||||
}
|
||||
function succeedhandle_getRelatedData(url, msg, data) {
|
||||
if(data['threaddiv']) {
|
||||
$("threadlist").innerHTML = data['threaddiv'];
|
||||
$("fd_page_top").innerHTML = $("fd_page_bottom").innerHTML = data['page'];
|
||||
}
|
||||
}
|
||||
function errorhandle_getRelatedData(msg, data) {
|
||||
showError(msg);
|
||||
}
|
||||
</script>
|
||||
<ul class="ttp cl" id="thread_types2" style="padding-top:0px;">
|
||||
<li class="sort_tit">{lang cloudsearch:hottopic}</li>
|
||||
<!--{loop $recwords $keyword}-->
|
||||
<li id="ckw_$keyword[0]"><a href="javascript:void(0);return false;" onclick="switchkeyword('$keyword[0]');">$keyword[0]</a></li>
|
||||
<!--{/loop}-->
|
||||
</ul>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_forumdisplay_threadtype_inner_output() {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<style>
|
||||
.sort_tit { padding:4px 8px 3px 0; color:#999; }
|
||||
</style>
|
||||
<li class="sort_tit">{lang cloudsearch:thread_class}</li>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_collection_viewoptions_output() {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related" class="xi2">{lang cloudsearch:realtedthread}</a>
|
||||
<span class="pipe">|</span>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_collection_relatedop_output($threadlist, $multipage) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
|
||||
<ul class="ttp bm cl cttp">
|
||||
<li{if !$_GET['keyword']} class="xw1 a"{/if}>
|
||||
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related" class="xi2">{$_G['collection']['name']}</a>
|
||||
</li>
|
||||
<!--{loop $_G['collection']['arraykeyword'] $kid $unique_keyword}-->
|
||||
<li{if $unique_keyword == $_GET['keyword']} class="xw1 a"{/if}>
|
||||
<a href="forum.php?mod=collection&action=view&ctid={$_G['collection']['ctid']}&op=related&keyword={$_G['collection']['urlkeyword'][$kid]}" class="xi2">$unique_keyword</a>
|
||||
</li>
|
||||
<!--{/loop}-->
|
||||
</ul>
|
||||
<div class="tl bm">
|
||||
<!--{if $threadlist}-->
|
||||
<form action="forum.php?mod=collection&action=edit&op=addthread" method="POST">
|
||||
<div class="th">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="icn"></td>
|
||||
<td class="o"><label class="z" onclick="checkall(this.form, 'tids')"><input class="pc" type="checkbox" name="chkall" title="{lang checkall}" /></label></td>
|
||||
<td class="common">{lang thread}</td>
|
||||
<td class="forum">{lang cloudsearch:forum}</td>
|
||||
<td class="by">{lang author}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bm_c">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<!--{loop $threadlist $thread}-->
|
||||
<tr>
|
||||
<td class="icn">
|
||||
<!--{if $thread[icon]}-->
|
||||
<img src="{$thread[icon]}" />
|
||||
<!--{else}-->
|
||||
<img src="{IMGDIR}/folder_common.gif" />
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<td class="o">
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<input type="checkbox" value="$thread[tThreadId]" name="tids[]" />
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<th>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=viewthread&tid=$thread[tThreadId]" target="_blank" class="xst">$thread['pSubject']</a>
|
||||
<!--{else}-->
|
||||
<a href="$thread['mTargetUrl']" target="_blank" class="xst">$thread['mTitle']</a>
|
||||
<!--{/if}-->
|
||||
</th>
|
||||
<td class="forum">
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=forumdisplay&fid=$thread[pForumId]">$thread[pForumName]</a>
|
||||
<!--{else}-->
|
||||
$thread[mShowUrl]
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<td class="by">
|
||||
<cite>
|
||||
<!--{if $thread['pAuthorId'] && $thread['pAuthorName']}-->
|
||||
<a href="home.php?mod=space&uid=$thread[pAuthorId]">$thread[pAuthorName]</a>
|
||||
<!--{else}-->
|
||||
{lang anonymous}
|
||||
<!--{/if}-->
|
||||
</cite>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<em class="xi1">$thread[dateline]</em>
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--{/loop}-->
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bm_c cl">
|
||||
<input type="hidden" value="{$_G['collection']['ctid']}" name="ctid" />
|
||||
<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
|
||||
<input type="hidden" name="addthread" id="addthread" value="1" />
|
||||
<button type="submit" class="pn pnc"><span>{lang cloudsearch:addtocollection}</span></button>
|
||||
</div>
|
||||
</form>
|
||||
<!--{else}-->
|
||||
<p class="emp">
|
||||
{lang cloudsearch:no_content}
|
||||
</p>
|
||||
<!--{/if}-->
|
||||
</div>
|
||||
<!--{if $multipage}--><div class="pgs mtm cl">$multipage</div><!--{/if}-->
|
||||
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_relate_threadlist_output($kw) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<div id="cloudsearch_relate"><img src="{IMGDIR}/loading.gif" alt="loading..." class="vm" /> {lang cloudsearch:loading}</div>
|
||||
<script>
|
||||
ajaxget('plugin.php?id=cloudsearch:forumdisplay&cloudop=relatelist&fid={$_G['fid']}&keyword={$kw}&page={$_G['page']}', 'cloudsearch_relate');
|
||||
</script>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_relate_threadlist_js_output($relatethreadlist, $urlkw, $searchparams, $srchotquery) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if $relatethreadlist}-->
|
||||
<div class="th">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="icn"></td>
|
||||
<td class="common">{lang cloudsearch:relate}</td>
|
||||
<td class="by">{lang cloudsearch:forum}</td>
|
||||
<td class="by">{lang author}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bm_c">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<!--{loop $relatethreadlist $thread}-->
|
||||
<tbody id="$thread[id]">
|
||||
<tr>
|
||||
<td class="icn">
|
||||
<!--{if $thread[icon]}-->
|
||||
<img src="{$thread[icon]}" />
|
||||
<!--{else}-->
|
||||
<img src="{IMGDIR}/folder_common.gif" />
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<th>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=viewthread&tid=$thread[tThreadId]" target="_blank" class="xst">$thread['pSubject']</a>
|
||||
<!--{else}-->
|
||||
<a href="$thread['mTargetUrl']" target="_blank" class="xst">$thread['mTitle']</a>
|
||||
<!--{/if}-->
|
||||
</th>
|
||||
<td class="by">
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<a href="forum.php?mod=forumdisplay&fid=$thread[pForumId]">$thread[pForumName]</a>
|
||||
<!--{else}-->
|
||||
$thread[mShowUrl]
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
<td class="by">
|
||||
<cite>
|
||||
<!--{if $thread['pAuthorId'] && $thread['pAuthorName']}-->
|
||||
<a href="home.php?mod=space&uid=$thread[pAuthorId]">$thread[pAuthorName]</a>
|
||||
<!--{else}-->
|
||||
{lang anonymous}
|
||||
<!--{/if}-->
|
||||
</cite>
|
||||
<!--{if !isset($thread[icon])}-->
|
||||
<em class="xi1">$thread[dateline]</em>
|
||||
<!--{/if}-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!--{/loop}-->
|
||||
<tr>
|
||||
<td colspan="4" align="center" style="line-height:25px;">
|
||||
<a href="$searchparams[url]?q={$urlkw}&source=word.tao_more.a$srchotquery">{lang cloudsearch:viewmore}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_global_footer_related() {
|
||||
global $_G;
|
||||
$rel_title = urlencode($_G['forum_thread']['subject']);
|
||||
$widthauto = widthauto();
|
||||
$get_reltid = dintval($_GET[reltid]);
|
||||
$get_pre_pos = dhtmlspecialchars(trim($_GET[pre_pos]));
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if empty($_G['inajax'])}-->
|
||||
<script type="text/javascript">
|
||||
var rel_tid = "$_G['tid']";
|
||||
var rel_title = "$rel_title";
|
||||
var rel_reltid = "$get_reltid";
|
||||
var rel_prepos = "$get_pre_pos";
|
||||
var my_siteid = "$_G['setting']['my_siteid']";
|
||||
var rel_uid = "$_G['uid']";
|
||||
var rel_views = "$_G['forum_thread']['views']";
|
||||
var rel_replies = "$_G['forum_thread']['replies']";
|
||||
var rel_page = "$_G['page']";
|
||||
var rel_show = "$widthauto";
|
||||
</script>
|
||||
<script type="text/javascript" src="http://cache.soso.com/30d/js/discuz/relate_subject.js" charset="GBK"></script>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_global_footer_mini() {
|
||||
global $_G;
|
||||
$utilService = Cloud::loadClass('Service_Util');
|
||||
$params = array(
|
||||
's_site_gid' => $_G['groupid'],
|
||||
'response_type' => 'JSONP',
|
||||
);
|
||||
$params = $utilService->generateSiteSignUrl($params, false, true);
|
||||
$signUrlParams = json_encode($params);
|
||||
$discuz_mini_js_url = 'http://discuz.gtimg.cn/search/scripts/discuz_mini.js';
|
||||
$referer = htmlspecialchars($_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if empty($_GET['inajax'])}-->
|
||||
<script type="text/javascript" charset="utf-8" src="$discuz_mini_js_url"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
if (typeof DiscuzMini != 'undefined' && typeof DiscuzMini == 'object') {
|
||||
DiscuzMini.showMini('$referer', $signUrlParams);
|
||||
}
|
||||
</script>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_index_forum_extra_output($forum_recwords) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if $forum_recwords}-->
|
||||
<dd class="fl_g_hot">
|
||||
<strong>{lang cloudsearch:forumhottopic}: </strong>
|
||||
<!--{loop $forum_recwords $k $frecword}--><a class="xi2" href="$frecword[url]" target="_blank">$frecword[word]</a><!--{/loop}-->
|
||||
</dd>
|
||||
<!--{/if}-->
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
|
||||
function tpl_cloudsearch_global_footer_suggest($queryString) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<script type="text/javascript">
|
||||
var cloudsearch_suggest = {};
|
||||
cloudsearch_suggest.cache = {}; // 缓存
|
||||
cloudsearch_suggest.sId = "$_G['setting']['my_siteid']";
|
||||
cloudsearch_suggest.keyInterval = null; // 按住上下键时的setTimeout时间值
|
||||
cloudsearch_suggest.requestTimeout = null; // 发送jsonp请求时的setTimeout时间值
|
||||
cloudsearch_suggest.responseTimeout = null; // jsonp请求超时时的setTimeout时间值
|
||||
cloudsearch_suggest.slideSpeed = 700; // 按住上下键时的滚动速度
|
||||
cloudsearch_suggest.linenow = 0; // 当前所在行
|
||||
cloudsearch_suggest.queryString = "$queryString"; // 当前所在行
|
||||
|
||||
function cloudsearch_suggest_preventEnter(oEvent) {
|
||||
|
||||
var code = oEvent.keyCode;
|
||||
var lines = $('sg').getElementsByTagName('li');
|
||||
|
||||
if ((38 == code || 40 == code) && !cloudsearch_suggest.keyInterval) {
|
||||
cloudsearch_suggest_moveOneStep(code, lines);
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_moveOneStep(code, lines) {
|
||||
|
||||
if (38 == code || 40 == code) {
|
||||
var panel = $('sg');
|
||||
if ('block' == panel.style.display) {
|
||||
|
||||
cloudsearch_suggest_clearStyle(); // 清掉所有li的选中状态
|
||||
var suggestNum = lines.length;
|
||||
|
||||
if (38 == code) {
|
||||
if (cloudsearch_suggest.linenow > 1) {
|
||||
cloudsearch_suggest.linenow--;
|
||||
} else {
|
||||
cloudsearch_suggest.linenow = suggestNum;
|
||||
}
|
||||
}
|
||||
|
||||
if (40 == code) {
|
||||
cloudsearch_suggest.linenow = (cloudsearch_suggest.linenow == suggestNum) ? 1 : (cloudsearch_suggest.linenow + 1);
|
||||
}
|
||||
lines[cloudsearch_suggest.linenow - 1].className = 'smo';
|
||||
}
|
||||
|
||||
cloudsearch_suggest.keyInterval = setTimeout(function() {cloudsearch_suggest_moveOneStep(code, lines);}, cloudsearch_suggest.slideSpeed);
|
||||
cloudsearch_suggest.slideSpeed = 80;
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_suggest(oEvent) {
|
||||
|
||||
var q = trim($('scbar_txt').value); // 输入框的输入
|
||||
|
||||
var code = oEvent.keyCode; // 键盘按键值
|
||||
var lines = $('sg').getElementsByTagName('li');
|
||||
|
||||
if (38 == code || 40 == code) { // up down
|
||||
if (null != cloudsearch_suggest.keyInterval) {
|
||||
clearTimeout(cloudsearch_suggest.keyInterval);
|
||||
cloudsearch_suggest.keyInterval = null;
|
||||
cloudsearch_suggest.slideSpeed = 700;
|
||||
}
|
||||
// 把所选值放入输入框(去除html标签)
|
||||
$('scbar_txt').value = lines[cloudsearch_suggest.linenow - 1].innerHTML.replace(/<\s*(\/)?\s*[0-9a-zA-Z]+\s*>/g, '');
|
||||
} else if (27 == code) { // ESC
|
||||
|
||||
if (null != cloudsearch_suggest.requestTimeout) {
|
||||
clearTimeout(cloudsearch_suggest.requestTimeout);
|
||||
}
|
||||
|
||||
cloudsearch_suggest_hide();
|
||||
} else {
|
||||
if ('' != q) {
|
||||
var data = cloudsearch_suggest_getCache(q);
|
||||
if (data) {
|
||||
cloudsearch_suggest_menuMaker(data);
|
||||
} else {
|
||||
if (null != cloudsearch_suggest.requestTimeout) {
|
||||
clearTimeout(cloudsearch_suggest.requestTimeout);
|
||||
}
|
||||
// 请求延时0.3秒执行,因为有可能用户是在持续输入
|
||||
cloudsearch_suggest.requestTimeout = setTimeout(function() {cloudsearch_suggest_sendRequest(q);}, 500);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (null != cloudsearch_suggest.requestTimeout) {
|
||||
clearTimeout(cloudsearch_suggest.requestTimeout);
|
||||
}
|
||||
|
||||
cloudsearch_suggest_hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_sendRequest(q) {
|
||||
|
||||
// 删掉之前的请求(包括超时处理)
|
||||
if ($('cloudsearch_suggest') != null) {
|
||||
document.getElementsByTagName('head')[0].removeChild($('cloudsearch_suggest'));
|
||||
if (null != cloudsearch_suggest.responseTimeout) {
|
||||
clearTimeout(cloudsearch_suggest.responseTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
var script = document.createElement('script');
|
||||
with (script) {
|
||||
src = 'http://search.discuz.qq.com/api/suggest?q=' + encodeURIComponent(q) + '&' + cloudsearch_suggest.queryString;
|
||||
id = 'cloudsearch_suggest';
|
||||
charset = 'utf-8';
|
||||
}
|
||||
|
||||
document.getElementsByTagName('head')[0].appendChild(script); // jsonp加载外域接口数据
|
||||
cloudsearch_suggest.responseTimeout = setTimeout(function() {cloudsearch_suggest_clearRequest();}, 1000); // 0.5秒后没返回就抛弃
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_clearRequest() {
|
||||
// 删掉之前的请求(包括超时处理)
|
||||
if ($('cloudsearch_suggest') != null) {
|
||||
document.getElementsByTagName('head')[0].removeChild($('cloudsearch_suggest'));
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_callback(data) {
|
||||
|
||||
if (typeof data != undefined && 0 == data.status) {
|
||||
|
||||
cloudsearch_suggest_menuMaker(data.result);
|
||||
|
||||
cloudsearch_suggest_setCache(data.q, data.result);
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_menuMaker(data) {
|
||||
|
||||
if (data.length > 0) {
|
||||
|
||||
var list = '<ul>';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
list += '<li class="sml" onmouseover="cloudsearch_suggest_mouseOver(this);" onclick="cloudsearch_suggest_mouseClick(this);">' + data[i] + '</li>';
|
||||
}
|
||||
list += '</ul>';
|
||||
$('st_box').innerHTML = list;
|
||||
|
||||
cloudsearch_suggest_show();
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_mouseClick(obj) {
|
||||
$('scbar_txt').value = obj.innerHTML.replace(/<\s*(\/)?\s*[0-9a-zA-Z]+\s*>/g, '');
|
||||
$('scbar_btn').click();
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_mouseOver(obj) {
|
||||
cloudsearch_suggest_clearStyle(); // 清掉之前的选中状态
|
||||
obj.className = "smo"; // 当前的li设置为选中状态
|
||||
|
||||
// 把linenow设置为当前悬停的值
|
||||
var lis = $('st_box').getElementsByTagName('li');
|
||||
if (typeof lis != undefined && lis.length > 0) {
|
||||
for (var i = 0; i < lis.length; i++) {
|
||||
if (lis[i] == obj) {
|
||||
cloudsearch_suggest.linenow = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_show(oEvent) {
|
||||
cloudsearch_suggest.linenow = 0;
|
||||
cloudsearch_suggest.slideSpeed = 700;
|
||||
$('sg').style.display = 'block';
|
||||
$('scbar_txt').focus();
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_hide() {
|
||||
$('sg').style.display = 'none';
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_setCache(key, data) {
|
||||
cloudsearch_suggest.cache[key] = data;
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_getCache(key) {
|
||||
return cloudsearch_suggest.cache[key];
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_clearStyle() {
|
||||
var lis = $('st_box').getElementsByTagName('li');
|
||||
if (typeof lis != undefined && lis.length > 0) {
|
||||
for (var i = 0; i < lis.length; i++) {
|
||||
lis[i].className = 'sml';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_sgMouseOver() {
|
||||
$('scbar_txt').focus();
|
||||
_detachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
|
||||
}
|
||||
|
||||
function cloudsearch_suggest_sgMouseOut() {
|
||||
cloudsearch_suggest_clearStyle();
|
||||
_attachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
|
||||
}
|
||||
|
||||
if (!BROWSER.ie || BROWSER.ie > 6) {
|
||||
// 输入框绑定onkeydown和onkeyup事件
|
||||
_attachEvent($('scbar_txt'), 'keydown', cloudsearch_suggest_preventEnter);
|
||||
_attachEvent($('scbar_txt'), 'keyup', cloudsearch_suggest_suggest);
|
||||
_attachEvent($('scbar_txt'), 'blur', cloudsearch_suggest_hide);
|
||||
_attachEvent($('sg'), 'mouseover', cloudsearch_suggest_sgMouseOver);
|
||||
_attachEvent($('sg'), 'mouseout', cloudsearch_suggest_sgMouseOut);
|
||||
}
|
||||
</script>
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
{eval
|
||||
|
||||
function tpl_global_header_mobile($searchparams, $srchotquery) {
|
||||
global $_G;
|
||||
}
|
||||
<!--{block return}-->
|
||||
<!--{if !empty($searchparams[url])}-->
|
||||
<style>
|
||||
.keyword {padding:0 10px;margin-bottom: 100px;}
|
||||
.keyword a{ background:#FFF;border: 1px solid #DDDDDD; color: #336699; display: inline-block; margin-bottom: 10px; margin-right: 10px; padding: 3px 10px; white-space: nowrap;}
|
||||
.keyword a:hover {background-color: none;}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var obj = $('#searchform');
|
||||
if(obj.length > 0) {
|
||||
var getstr = {mod:'search', srchtype:'title', srhfid:0, srhlocality:'$_G[basescript]::{CURMODULE}', source:'txt.form_{if $_G[setting][mobile][mobilesimpletype]}sim{else}nor{/if}.a', wap:'yes', fId:0};
|
||||
<!--{loop $searchparams[params] $key $value}-->
|
||||
getstr.$key = '$value';
|
||||
<!--{/loop}-->
|
||||
var str = '';
|
||||
for(var i in getstr) {
|
||||
str += '<input type="hidden" name="'+ i +'" value="'+ getstr[i] +'">';
|
||||
}
|
||||
obj.append(str);
|
||||
obj.attr('action', '$searchparams[url]').attr('method', 'get');
|
||||
|
||||
obj.on('submit', function() {
|
||||
obj.append('<input type="hidden" name="q" value="' + $('#scform_srchtxt').val() + '">');
|
||||
});
|
||||
|
||||
<!--{if $_G['setting']['srchhotkeywords']}-->
|
||||
var str = '';
|
||||
str += '<div class="keyword cl">';
|
||||
<!--{loop $_G['setting']['srchhotkeywords'] $val}-->
|
||||
<!--{if $val=trim($val)}--><!--{/if}-->
|
||||
<!--{if $encodeval=rawurlencode(trim($val))}-->
|
||||
<!--{if !empty($searchparams[url])}-->
|
||||
str += '<a href="$searchparams[url]?q=$encodeval&source=txt.hotsearch_{if $_G[setting][mobile][mobilesimpletype]}sim{else}nor{/if}.a{$srchotquery}&wap=yes" target="_blank" sc="1">$val</a>';
|
||||
<!--{else}-->
|
||||
str += '<a href="search.php?mod=forum&srchtxt=$encodeval&formhash={FORMHASH}&searchsubmit=true&source=txt.hotsearch_{if $_G[setting][mobile][mobilesimpletype]}sim{else}nor{/if}.a&wap=yes" target="_blank" class="xi2" sc="1">$val</a>';
|
||||
<!--{/if}-->
|
||||
<!--{/if}-->
|
||||
<!--{/loop}-->
|
||||
str += '</div>';
|
||||
obj.after(str);
|
||||
<!--{/if}-->
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!--{/if}-->
|
||||
|
||||
<!--{/block}-->
|
||||
<!--{eval return $return;}-->
|
||||
{eval
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: upgrade.php 33387 2013-06-05 03:21:26Z jeffjzhang $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
if ($_GET['fromversion'] < 1.04) {
|
||||
$my_search_data = array(
|
||||
'status' => 0,
|
||||
'allow_hot_topic' => 1,
|
||||
'allow_thread_related' => 1,
|
||||
'allow_recommend_related' => 1,
|
||||
'allow_thread_related_bottom' => 0,
|
||||
'allow_forum_recommend' => 1,
|
||||
'allow_forum_related' => 0,
|
||||
'allow_collection_related' => 1,
|
||||
'allow_search_suggest' => 0,
|
||||
'cp_version' => 1,
|
||||
'recwords_lifetime' => 21600,
|
||||
);
|
||||
|
||||
if (is_array($_G['setting']['my_search_data'])) {
|
||||
$my_search_data = array_merge($my_search_data, $_G['setting']['my_search_data']);
|
||||
}
|
||||
|
||||
$insertData = serialize($my_search_data);
|
||||
|
||||
$sql = <<<EOF
|
||||
REPLACE INTO pre_common_setting VALUES ('my_search_data', '{$insertData}');
|
||||
EOF;
|
||||
runquery($sql);
|
||||
}
|
||||
|
||||
$finish = TRUE;
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: admincp_setting.inc.php 33704 2013-08-06 06:45:48Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
dheader('location: '.ADMINSCRIPT.'?action=cloud&operation=union');
|
||||
|
||||
?>
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<root>
|
||||
<item id="Title"><![CDATA[Discuz! Plugin]]></item>
|
||||
<item id="Data">
|
||||
<item id="plugin">
|
||||
<item id="available"><![CDATA[1]]></item>
|
||||
<item id="adminid"><![CDATA[1]]></item>
|
||||
<item id="name"><![CDATA[Discuz!联盟]]></item>
|
||||
<item id="identifier"><![CDATA[cloudunion]]></item>
|
||||
<item id="description"><![CDATA[]]></item>
|
||||
<item id="datatables"><![CDATA[]]></item>
|
||||
<item id="directory"><![CDATA[cloudunion/]]></item>
|
||||
<item id="copyright"><![CDATA[Comsenz Inc.]]></item>
|
||||
<item id="version"><![CDATA[1.0]]></item>
|
||||
<item id="__modules">
|
||||
<item id="0">
|
||||
<item id="name"><![CDATA[admincp]]></item>
|
||||
<item id="param"><![CDATA[]]></item>
|
||||
<item id="menu"><![CDATA[]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[3]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[0]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="version"><![CDATA[X3.2]]></item>
|
||||
<item id="enablefile"><![CDATA[switch.php]]></item>
|
||||
<item id="disablefile"><![CDATA[switch.php]]></item>
|
||||
</item>
|
||||
</root>
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: switch.php 33950 2013-09-05 02:17:27Z nemohou $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$appIdentifier = 'union';
|
||||
$pluginid = intval($_GET['pluginid']);
|
||||
|
||||
require_once libfile('class/cloudregister');
|
||||
|
||||
if($operation == 'enable') {
|
||||
|
||||
new Cloud_Register($appIdentifier, $pluginid, 'appOpenFormView');
|
||||
|
||||
} elseif($operation == 'disable') {
|
||||
|
||||
new Cloud_Register($appIdentifier, $pluginid, 'appCloseReasonsView');
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<root>
|
||||
<item id="Title"><![CDATA[Discuz! Plugin]]></item>
|
||||
<item id="Data">
|
||||
<item id="plugin">
|
||||
<item id="available"><![CDATA[1]]></item>
|
||||
<item id="adminid"><![CDATA[1]]></item>
|
||||
<item id="name"><![CDATA[旋风存储]]></item>
|
||||
<item id="identifier"><![CDATA[xf_storage]]></item>
|
||||
<item id="description"><![CDATA[]]></item>
|
||||
<item id="datatables"><![CDATA[]]></item>
|
||||
<item id="directory"><![CDATA[xf_storage/]]></item>
|
||||
<item id="copyright"><![CDATA[Comsenz Inc.]]></item>
|
||||
<item id="version"><![CDATA[1.04]]></item>
|
||||
<item id="__modules">
|
||||
<item id="0">
|
||||
<item id="name"><![CDATA[xf_storage]]></item>
|
||||
<item id="menu"><![CDATA[]]></item>
|
||||
<item id="url"><![CDATA[]]></item>
|
||||
<item id="type"><![CDATA[11]]></item>
|
||||
<item id="adminid"><![CDATA[0]]></item>
|
||||
<item id="displayorder"><![CDATA[0]]></item>
|
||||
<item id="navtitle"><![CDATA[]]></item>
|
||||
<item id="navicon"><![CDATA[]]></item>
|
||||
<item id="navsubname"><![CDATA[]]></item>
|
||||
<item id="navsuburl"><![CDATA[]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
<item id="version"><![CDATA[X3.2]]></item>
|
||||
<item id="language">
|
||||
<item id="templatelang">
|
||||
<item id="sava_attachlist"><![CDATA[完毕,保存到附件列表]]></item>
|
||||
<item id="xf_storage_tips"><![CDATA[您可以在上传过程中关闭这个小窗口,上传完毕后会通知您]]></item>
|
||||
<item id="wait_for_url"><![CDATA[页面加载中,请稍等...]]></item>
|
||||
<item id="timeout_tips"><![CDATA[超大附件上传页面加载失败,是否切换到批量上传?]]></item>
|
||||
<item id="filesize_limit"><![CDATA[文件尺寸: 小于 2GB]]></item>
|
||||
<item id="xf_storage_btn"><![CDATA[大附件上传]]></item>
|
||||
<item id="update_tips"><![CDATA[该附件是通过QQ旋风方式上传的大附件,不支持直接更新方式修改。]]></item>
|
||||
<item id="notice_name"><![CDATA[通知信息]]></item>
|
||||
<item id="download_xf"><![CDATA[旋风高速下载]]></item>
|
||||
<item id="attachlist"><![CDATA[附件列表]]></item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</root>
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: ftn_cross.inc.php 29265 2012-03-31 06:03:26Z yexinhao $
|
||||
*/
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$storageService = Cloud::loadClass('Service_Storage');
|
||||
|
||||
if(empty($_GET['ftn_formhash']) || empty($_G['uid']) || empty($_GET['filesize']) || empty($_GET['sha1']) || empty($_GET['filename'])){
|
||||
if(empty($_GET['allcount']) && empty($_GET['uploadedcount']) && empty($_GET['errorcount'])){
|
||||
exit;
|
||||
} else {
|
||||
if($_GET['allcount'] == ($_GET['uploadedcount']+$_GET['errorcount'])){
|
||||
$allowUpdate = 1;
|
||||
} else {
|
||||
$allowUpdate = 0;
|
||||
}
|
||||
include template('xf_storage:cross');
|
||||
}
|
||||
} elseif($_GET['ftn_formhash'] != $storageService->ftnFormhash()){
|
||||
exit;//showmessage('操作超时或者数据来源错误','','error');
|
||||
}
|
||||
|
||||
if($_GET['ftn_submit']) {
|
||||
|
||||
$data = array();$index = array();
|
||||
$filesize = intval($_GET['filesize']);
|
||||
$filename = diconv(trim($_GET['filename']),'UTF-8');
|
||||
$filename = str_replace(array('\'','"','\/','\\','<','>'),array('','','','','',''),$filename);
|
||||
$sha = trim($_GET['sha1']);
|
||||
$index = array(
|
||||
'tid' => 0,
|
||||
'pid' => 0,
|
||||
'uid' => $_G['uid'],
|
||||
'tableid' => '127',
|
||||
'downloads' => 0
|
||||
);
|
||||
$aid = C::t('forum_attachment')->insert($index, 1);
|
||||
|
||||
$data = array(
|
||||
'aid' => $aid,
|
||||
'uid' => $_G['uid'],
|
||||
'dateline' => $_G['timestamp'],
|
||||
'filename' => $filename,
|
||||
'filesize' => $filesize,
|
||||
'attachment' => 'storage:' . $sha,
|
||||
'remote' => 0,
|
||||
'isimage' => 0,
|
||||
'width' => 0,
|
||||
'thumb' => 0,
|
||||
);
|
||||
C::t('forum_attachment_unused')->insert($data);
|
||||
if(empty($_GET['allcount']) && empty($_GET['uploadedcount']) && empty($_GET['errorcount'])){
|
||||
exit;
|
||||
} else {
|
||||
if($_GET['allcount'] == ($_GET['uploadedcount'] + $_GET['errorcount'])){
|
||||
$allowUpdate = 1;
|
||||
} else {
|
||||
$allowUpdate = 0;
|
||||
}
|
||||
include template('xf_storage:cross');
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: ftn_upload.inc.php 29265 2012-03-31 06:03:26Z yexinhao $
|
||||
*/
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
$storageService = Cloud::loadClass('Service_Storage');
|
||||
|
||||
$formhash = formhash();
|
||||
if($_GET['formhash'] == $formhash && $_GET['inajax']){
|
||||
$ftnFormhash = $storageService->ftnFormhash();
|
||||
$iframeurl = $storageService->makeIframeUrl($ftnFormhash);
|
||||
} else {
|
||||
$iframeurl = '';
|
||||
}
|
||||
|
||||
include template('xf_storage:upload');
|
|
@ -1,13 +0,0 @@
|
|||
<!--{template common/header}-->
|
||||
<!--{if $allowUpdate}-->
|
||||
<script type="text/javascript">
|
||||
top.document.getElementById('ftn_over').disabled = false;
|
||||
top.document.getElementById('ftn_over').className = 'pn pnc';
|
||||
</script>
|
||||
<!--{else}-->
|
||||
<script type="text/javascript">
|
||||
top.document.getElementById('ftn_over').disabled = true;
|
||||
top.document.getElementById('ftn_over').className = 'pn';
|
||||
</script>
|
||||
<!--{/if}-->
|
||||
<!--{template common/footer}-->
|
|
@ -1,39 +0,0 @@
|
|||
<!--{block return}-->
|
||||
<style type="text/css">
|
||||
a.ftn_qqdl{
|
||||
color:#369 !important;
|
||||
text-decoration:none;
|
||||
}
|
||||
.ftn_qqdl {
|
||||
font-size:12px;
|
||||
padding:1px 0 3px 20px;
|
||||
margin:2px 0 0 4px;
|
||||
background:url("./source/plugin/xf_storage/template/ftn.png") no-repeat 0 1px;
|
||||
}
|
||||
.ftn_buttondiv {
|
||||
text-align:left;margin:5px 0 5px 22px;
|
||||
}
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
appendscript('http://x.soso.com/js/xf/xflib.js','','','utf-8');
|
||||
try {
|
||||
changeOrigin();
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
|
||||
function updateDownload(aidEncode, obj) {
|
||||
date = new Date();
|
||||
imgLink = 'forum.php?mod=attachment&aid=' + aidEncode + 't=' + date.getTime();
|
||||
imgCode = '<img width="0" height="0" src="' + imgLink + '" />';
|
||||
$('ft').innerHTML = $('ft').innerHTML + imgCode;
|
||||
setTimeout(function() {OnDownloadClick_Simple(obj, window.event, 21504);}, 100);
|
||||
}
|
||||
|
||||
function changeOrigin() {
|
||||
$('e_btn_attachlist').getElementsByTagName('a')[0].innerText = '{lang xf_storage:attachlist}';
|
||||
$('e_attachlist').getElementsByTagName('div')[0].parentNode.removeChild($('e_attachlist').getElementsByTagName('div')[0]);
|
||||
$('attach_confirms').style.display='none';
|
||||
}
|
||||
</script>
|
||||
<!--{/block}-->
|
|
@ -1,4 +0,0 @@
|
|||
<!--{block return}-->
|
||||
<li id="e_btn_ftnupload"><a id="e_ftn" href="javascript:;" hidefocus="true" onclick="switchAttachbutton('ftnupload');">{lang xf_storage:xf_storage_btn}</a></li>
|
||||
|
||||
<!--{/block}-->
|
Binary file not shown.
Before Width: | Height: | Size: 861 B |
|
@ -1,129 +0,0 @@
|
|||
<!--{block return}-->
|
||||
<div class="p_opt" unselectable="on" id="{$editorid}_ftnupload" style="display: none;">
|
||||
<div id="iframeurl" style="height:0px;"></div>
|
||||
|
||||
<div class="hm bbda" id="{$editorid}_ftnattach">
|
||||
<iframe id="ftniframe" name="ftniframe" frameborder="0" scrolling="no" src="about:blank" width="510px" height="310px"></iframe>
|
||||
<div class="ftn_buttondiv">
|
||||
<button id="ftn_over" class="pn" value="true" name="editsubmit" onclick="loadiframe(null,'ftniframe',0,1);updateAttachList();this.disabled=true;this.className='pn'" disabled>
|
||||
<span>{lang xf_storage:sava_attachlist}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="notice uploadinfo">{lang xf_storage:filesize_limit}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script lang="text/javascript" reload="1">
|
||||
|
||||
_attachEvent($('e_ftn'),'click',function(e){loadiframe(null,'ftniframe');});
|
||||
_attachEvent($('e_attach'),'click',function(e){
|
||||
if (ATTACHNUM['attachunused'] == 0 && ATTACHNUM['attachused'] == 0) {
|
||||
loadiframe(null,'ftniframe');switchAttachbutton('ftnupload');
|
||||
}
|
||||
});
|
||||
_attachEvent($('e_btn_ftnupload').getElementsByTagName('a')[0], 'click',
|
||||
function(e){hideConfirm();});
|
||||
_attachEvent($('e_btn_attachlist').getElementsByTagName('a')[0], 'click',
|
||||
function(e){showConfirm();});
|
||||
_attachEvent($('e_btn_upload').getElementsByTagName('a')[0], 'click',
|
||||
function(e){showConfirm();});
|
||||
|
||||
if(BROWSER.firefox && window.HTMLElement) { //为 firefox 增加 innerText 方法
|
||||
HTMLElement.prototype.__defineGetter__("innerText", function(){
|
||||
var anyString = "";
|
||||
var childS = this.childNodes;
|
||||
for(var i=0; i<childS.length; i++) {
|
||||
if(childS[i].nodeType==1)
|
||||
anyString += childS[i].innerText;
|
||||
else if(childS[i].nodeType==3)
|
||||
anyString += childS[i].nodeValue;
|
||||
}
|
||||
return anyString;
|
||||
});
|
||||
HTMLElement.prototype.__defineSetter__("innerText", function(sText){
|
||||
this.textContent=sText;
|
||||
});
|
||||
}
|
||||
|
||||
function showConfirm() {
|
||||
$('attach_confirms').style.display='';
|
||||
}
|
||||
|
||||
function hideConfirm() {
|
||||
$('attach_confirms').style.display='none';
|
||||
}
|
||||
|
||||
function loadiframe(url,iframeid,time,force){
|
||||
var swfupload = 1;
|
||||
var formhash = '{FORMHASH}';
|
||||
if(BROWSER.ie){
|
||||
var loading = "<div style='color:#777;font-size:12px;margin:-15px 0 0 -10px;padding:0px;'>{lang xf_storage:wait_for_url}</div>";
|
||||
} else {
|
||||
var loading = "<div style='color:#777;font-size:12px;margin:-8px 0 0 -7px;padding:0px;'>{lang xf_storage:wait_for_url}</div>";
|
||||
}
|
||||
|
||||
|
||||
var iframe = $(iframeid);
|
||||
|
||||
if(url == null){
|
||||
ajaxget('plugin.php?id=xf_storage:ftn_upload&formhash='+formhash,'iframeurl','',null,null,function(){
|
||||
url = $('iframeurl_ajax').innerText;
|
||||
time = time ? time : 200;
|
||||
force = force ? force : 0;
|
||||
if(iframe.src == "about:blank") {
|
||||
iframe.contentWindow.document.write(loading);
|
||||
//return false;
|
||||
setTimeout(function()
|
||||
{
|
||||
iframe.src = "about:blank";
|
||||
|
||||
iframe.src = url;
|
||||
},time);
|
||||
} else if(force == 1) {
|
||||
setTimeout(function()
|
||||
{
|
||||
iframe.src = "about:blank";
|
||||
|
||||
iframe.src = url;
|
||||
},time);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
time = time ? time : 200;
|
||||
force = force ? force : 0;
|
||||
if(iframe.src == "about:blank") {
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
iframe.src = "about:blank";
|
||||
|
||||
iframe.src = url;
|
||||
},time);
|
||||
} else if(force == 1) {
|
||||
setTimeout(function()
|
||||
{
|
||||
iframe.src = "about:blank";
|
||||
|
||||
iframe.src = url;
|
||||
},time);
|
||||
}
|
||||
}
|
||||
// 页面超时监控,仅IE有效
|
||||
// if (BROWSER.ie) {
|
||||
// var linster = setTimeout(function() {
|
||||
// if(iframe.readyState != 'complete' && swfupload == 1){
|
||||
// if(confirm('{lang xf_storage:timeout_tips}')){
|
||||
// switchAttachbutton('swfupload');
|
||||
// }
|
||||
// } else if(iframe.readyState != 'complete' && swfupload == 0) {
|
||||
// if(confirm('{lang xf_storage:timeout_tips}')){
|
||||
// switchAttachbutton('upload');
|
||||
// }
|
||||
// }
|
||||
// },60000);
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
<!--{/block}-->
|
|
@ -1,7 +0,0 @@
|
|||
<!--{block jscode}-->
|
||||
<script type="text/javascript">
|
||||
if ($('{$spanId}')) {
|
||||
$('{$spanId}').innerHTML += '{$return}';
|
||||
}
|
||||
</script>
|
||||
<!--{/block}-->
|
|
@ -1,5 +0,0 @@
|
|||
<!--{block return}-->
|
||||
<p class="xg2">
|
||||
<a href="javascript:;" QHref="{$qqdlUrl}" class="ftn_qqdl" onclick="updateDownload('{$aidencode}', this);return false;" oncontextmenu="OnContextClick(this, window.event)">{lang xf_storage:download_xf}</a>
|
||||
</p>
|
||||
<!--{/block}-->
|
|
@ -1,3 +0,0 @@
|
|||
<!--{template common/header}-->
|
||||
<div style="display:none;" id="iframeurl_ajax">$iframeurl</div>
|
||||
<!--{template common/footer}-->
|
|
@ -1,111 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* [Discuz!] (C)2001-2099 Comsenz Inc.
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
*
|
||||
* $Id: xf_storage.class.php 29353 2012-04-06 03:00:07Z liudongdong $
|
||||
*/
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class plugin_xf_storage {
|
||||
|
||||
protected $value = array();
|
||||
protected $appStatus = '';
|
||||
protected $jsCode = '';
|
||||
|
||||
public function plugin_xf_storage() {
|
||||
global $_G;
|
||||
$cloudAppService = Cloud::loadClass('Service_App');
|
||||
$this->appStatus = $cloudAppService->getCloudAppStatus('storage');
|
||||
}
|
||||
|
||||
public function common(){
|
||||
global $_G;
|
||||
if (!$this->appStatus) {
|
||||
return false;
|
||||
}
|
||||
if(CURMODULE == 'post' && CURSCRIPT == 'forum' && $_G['uid']){
|
||||
$_G['config']['output']['iecompatible'] = '7';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function global_footer(){
|
||||
if (!$this->appStatus) {
|
||||
return false;
|
||||
}
|
||||
include template('xf_storage:css');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function _output($aid, $sha, $filename) {
|
||||
include_once libfile('function/attachment');
|
||||
$storageService = Cloud::loadClass('Service_Storage');
|
||||
|
||||
$qqdlUrl = $storageService->makeQQdlUrl($sha, $filename);
|
||||
$aidencode = packaids(array('aid' => $aid));
|
||||
include template('xf_storage:link');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function _jsOutput($aid, $return) {
|
||||
$spanId = 'attach_' . $aid;
|
||||
$return = str_replace(array("\r\n", '\'', '<p class="xg2">', '</p>', "\n"), array('', '\\\''), $return);
|
||||
include template('xf_storage:jscode');
|
||||
|
||||
return $jscode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class plugin_xf_storage_forum extends plugin_xf_storage {
|
||||
|
||||
public function post_attach_btn_extra() {
|
||||
global $_G;
|
||||
if (!$this->appStatus) {
|
||||
return false;
|
||||
}
|
||||
include template('xf_storage:editor');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function post_attach_tab_extra() {
|
||||
global $_G;
|
||||
if (!$this->appStatus) {
|
||||
return false;
|
||||
}
|
||||
$editorid = 'e';
|
||||
include template('xf_storage:ftnupload');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function viewthread_attach_extra_output() {
|
||||
global $postlist, $_G;
|
||||
$return = array();
|
||||
foreach ($postlist as $pid => $post) {
|
||||
foreach ($post['attachments'] as $aid => $attachment) {
|
||||
if (strpos($attachment['attachment'], 'storage:') !== false) {
|
||||
$sha1 = substr($attachment['attachment'], -40);
|
||||
$return[$aid] = $this->_output($aid, $sha1, $attachment['filename']);
|
||||
if (in_array($aid, $_G['forum_attachtags'][$pid])) {
|
||||
$postlist[$pid]['message'] .= $this->_jsOutput($aid, $return[$aid]);
|
||||
unset($return[$aid]);
|
||||
}
|
||||
if ($attachment['isimage']) {
|
||||
unset($return[$aid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue