首页 > 春风满楼 > itemstats 整合论坛显示
2008
03-24

itemstats 整合论坛显示

网上收集的方法

[code]Discuz5.5下文件修改:
1、下载适合版本的Itemstats并安装,wow属性是采用utf8,需配合相应的Discuz5.5版本。

2、修改Discuz5.5的viewthread.php
开始寻找:

require_once DISCUZ_ROOT.'./include/discuzcode.func.php';

后面添加:

include_once(DISCUZ_ROOT.'./itemstats/phpbb_itemstats.php');

继续寻找:

$post['signature'] = $post['usesig'] ? $post['signature'] : '';

后面添加:

$post['message'] = itemstats_parse($post['message']);

3、修改Discuz5.5的/templates/风格/header.php
开始寻找:

<!--{if $allowcsscache}--><link rel="stylesheet" type="text/css" id="css" href="forumdata/cache/style_{STYLEID}.css"><!--{else}--><style type="text/css" id="css">{template css}</style><!--{/if}-->

后面添加:

<link rel="stylesheet" href="itemstats/templates/itemstats.css" type="text/css"\>
<script type="text/javascript" src="itemstats/overlib/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>

签名能用
修改viewthread.php文件,找到:
$post['signature'] =$post['usesig'] ? $post['signature'] : '';
修改为
$post['signature'] = itemstats_parse($post['usesig'] ? $post['signature'] : '');

等于加个itemstats_parse就支持[ITEM]了
[/code]

[code]
首先去http://itemstats.free.fr下个1.55 Core版的,然后改下里面的config.php文件内容如下:

// The location and extension type for the Icon store.
define('ICON_STORE_LOCATION', 'http://wow.allakhazam.com/images/icons/');  默认不用改,如果自己有图片的话,改成自己本地的,我的是images/icons/
define('ICON_EXTENSION', '.png');    //默认不用改

// Database config
define('dbhost', 'localhost');                    //数据库地址,一般写localhost
define('dbname', '我是数据库,改我');                    //数据库名字,自己对照着改
define('dbuser', '我是用户名,改我');                            //数据库用户名,自己对照着改
define('dbpass', '我是密码,改我');              //数据库密码,自己对照着改
define('item_cache_table', 'item_cache'); //表名,不用改,默认就行了

1.然后查找文件config_itemstats.php,打开,按下面改,把查询其他网站数据库功能去掉,不然网站会很慢
//$GLOBALS["prio"][] = 'allakhazam';
//$GLOBALS["prio"][] = 'judgehype';
//$GLOBALS["prio"][] = 'buffed';
//$GLOBALS["prio"][] = 'wowdbu';
//$GLOBALS["prio"][] = 'thottbot';

2.然后把下面几个语言也屏蔽掉,
//$GLOBALS["allakhazam_lang"][] = 'frFR';
$GLOBALS["allakhazam_lang"][] = 'enUS';    //这个不能屏蔽了,不然有可能会报错,其实也没什么关系 2007-04-29
//$GLOBALS["allakhazam_lang"][] = 'deDE';
//$GLOBALS["allakhazam_lang"][] = 'esES';
//$GLOBALS["allakhazam_lang"][] = 'koKR';
$GLOBALS["allakhazam_lang"][] = 'zhCN';  //这个不能屏蔽了,不然有可能会报错,其实也没什么关系 2007-04-29
//$GLOBALS["allakhazam_lang"][] = 'zhTW';

3.把默认语言设为中文,
define('item_lang_default', 'zh');

4.把查询语句屏蔽掉
打开 includes目录下面的urlreader.php,在第20行处有一句

$html_data = @file_get_contents($url);                

把他屏蔽掉,在他前面加上两个斜杠就行了,如下:

// $html_data = @file_get_contents($url);

5.最重要一步,如果你想加快论坛的速度的话,最好跟着做
新建一个.PHP文件,名字随便,我的是用index.php,里面内容如下:
<?php
onitem($message){
if (!(preg_match('#\[(item)(=[0-5])?\](.+?)\[/item\]#s', $message, $match) OR preg_match('#\[(itemico)(=[0-5])?\](.+?)\[/itemico\]#s', $message, $match)))
return ($message);
include_once(dirname(__FILE__) . '/generic_itemstats.php');
$message=itemstats_parse($message);
return ($message);
}
?>

弄好后保存,然后把ITEMSTATS这个文件夹上传到服务器根目录下,到这里Itemstats这个算是好了,下面是论坛了[/code]

觉得文章有用,微信打赏一元。



留下一个回复

你的email不会被公开。