修改admin/menu.inc.php
在google菜单,即- showmenu($lang['menu_google']
复制代码 之前,加如下代码- showmenu($lang['menu_qcomic'],array(array('name' => $lang['menu_qcomic_config'], 'url' => 'admincp.php?action=qcomic')));
复制代码 修改templates/default/admincp.lang.php
在之前,根据语言版本,分别加如下代码- 'menu_qcomic' => '组图功能',
- 'menu_qcomic_config' => '参数设置',
复制代码- 'menu_qcomic' => '舱瓜?? ',
- 'menu_qcomic_config' => '把计砞竚',
复制代码- 'menu_qcomic' => '缁勫浘鍔熻兘',
- 'menu_qcomic_config' => '鍙傛暟璁剧疆',
复制代码 修改admincp.php
在google菜单动作,即- } elseif($action == 'google_config') {
复制代码 之前,加如下代码- } elseif($action == 'qcomic') {
- $cpscript = 'qcomic';
复制代码 修改include/cache.func.php
在对特定配置做unserialize处理,即- in_array($setting['variable'], array('creditspolicy', 'ftp'
复制代码 在creditspolicy之后,加上qihoo_image,最后看上去是- in_array($setting['variable'], array('creditspolicy', 'qihoo_image', 'ftp'
复制代码 修改include/newthread.inc.php
在修改附件信息,即之前,加如下代码- if($_DCACHE['settings']['qihoo_image']['senable'] && $phid) {
- require_once DISCUZ_ROOT.'./include/qcomic.inc.php';
- qcomic_update($pid, $tid, $phid);
- qcomic_fopen("http://comic.qihoo.com/discuz/update.php?sid=".$_DCACHE['settings']['qihoo_image']['sid']."&code=".urlencode(authcode("spassword=".$_DCACHE['settings']['qihoo_image']['spassword']."&phid=$phid&tid=$tid&pid=$pid&uid=".$discuz_uid."&ctime=".$timestamp."&mtime=$timestamp", '', $_DCACHE['settings']['qihoo_image']['skey']))."&title=".urlencode($subject)."&content=".urlencode(qcomic_spacecutstr($message, 500)), 10000, '', '', TRUE, '', 20, FALSE);
- }
复制代码 修改include/newreply.inc.php
在修改附件信息,即之前,加如下代码- if($_DCACHE['settings']['qihoo_image']['senable'] && $phid) {
- require_once DISCUZ_ROOT.'./include/qcomic.inc.php';
- qcomic_update($pid, $tid, $phid);
- if(empty($subject)) {
- $threadsubject = $db->fetch_array($db->query("SELECT subject FROM {$tablepre}threads WHERE tid='$tid'"));
- $subject = $threadsubject['subject'];
- }
- qcomic_fopen("http://comic.qihoo.com/discuz/update.php?sid=".$_DCACHE['settings']['qihoo_image']['sid']."&code=".urlencode(authcode("spassword=".$_DCACHE['settings']['qihoo_image']['spassword']."&phid=$phid&tid=$tid&pid=$pid&uid=".$discuz_uid."&ctime=".$timestamp."&mtime=$timestamp", '', $_DCACHE['settings']['qihoo_image']['skey']))."&title=".urlencode($subject)."&content=".urlencode(qcomic_spacecutstr($message, 500)), 10000, '', '', TRUE, '', 20, FALSE);
- }
复制代码 修改include/editpost.inc.php
在获取帖子信息,即- $query = $db->query("SELECT * FROM {$tablepre}posts WHERE pid='$pid' AND tid='$tid' AND fid='$fid'");
- $postinfo = $db->fetch_array($query);
复制代码 之后,加如下代码- if($_DCACHE['settings']['qihoo_image']['senable']) {
- $qihoophid = $db->fetch_array($db->query("SELECT phid FROM {$tablepre}qihooimages WHERE pid='$pid' AND tid='$tid' LIMIT 1"));
- $postinfo['phid'] = (empty($qihoophid['phid']) || $qihoophid['phid'] == '-1') ? 0 : $qihoophid['phid'];
- }
复制代码 在获取最后发布信息,即- $forum['lastpost'] = explode("\t", $forum['lastpost']);
复制代码 之前(这个代码有两处,只改前面的一个),加如下代码- if($_DCACHE['settings']['qihoo_image']['senable']) {
- $qihoophid = $db->fetch_array($db->query("SELECT phid FROM {$tablepre}qihooimages WHERE pid='$pid' AND tid='$tid' LIMIT 1"));
- $postinfo['phid'] = (empty($qihoophid['phid']) || $qihoophid['phid'] == '-1') ? 0 : $qihoophid['phid'];
- if($phid || $postinfo['phid']) {
- require_once DISCUZ_ROOT.'./include/qcomic.inc.php';
- $phid = $phid ? $phid : '-1';
- qcomic_update($pid, $tid, $phid);
- if(empty($subject)) {
- $threadsubject = $db->fetch_array($db->query("SELECT subject FROM {$tablepre}threads WHERE tid='$tid'"));
- $subject = $threadsubject['subject'];
- }
- qcomic_fopen("http://comic.qihoo.com/discuz/update.php?sid=".$_DCACHE['settings']['qihoo_image']['sid']."&code=".urlencode(authcode("spassword=".$_DCACHE['settings']['qihoo_image']['spassword']."&phid=$phid&tid=$tid&pid=$pid&uid=".$postinfo['authorid']."&mtime=$timestamp", '', $_DCACHE['settings']['qihoo_image']['skey']))."&title=".urlencode($subject)."&content=".urlencode(qcomic_spacecutstr($message, 500)), 10000, '', '', TRUE, '', 20, FALSE);
- }
- }
复制代码 修改viewthread.php
在获取帖子信息,即- $onlineauthors = array();
- $query = $db->query("SELECT p.*, m.uid, m.username, m.groupid
复制代码 之前,加如下代码- if($_DCACHE['settings']['qihoo_image']['senable']) {
- $fieldsadd .= ', qi.pid AS qipid, qi.thid, qi.phid ';
- $tablesadd = "LEFT JOIN {$tablepre}qihooimages qi USING (pid)";
- }
复制代码 在接下来的获取帖子的SQl语句行尾加上$tablesadd,即这一行改为- FROM {$tablepre}posts p $tablesadd
复制代码 修改include/javascript/post_editor.js
在函数validate内对标题长度检查,即- } else if(mb_strlen(theform.subject.value) > 80) {
- alert(lang['post_subject_toolong']);
- theform.subject.focus();
- return false;
- }
复制代码 之后,加如下代码
- if (typeof(qcomic_enabled)=='undefined' || !qcomic_enabled) {
- } else {
- if ($('phidstatus').value == '1') {
- alert(lang['phidstatus']);
- return false;
- }
- }
复制代码 修改templates/default/post_js.htm
把这一行- $('postform').onsubmit = function() {validate(this);if($('postsubmit').name != 'editsubmit') return false};
复制代码 改为- $('postform').onsubmit = function() {
- var check_ret = validate(this);
- if($('postsubmit').name != 'editsubmit') return false;
- if (check_ret==false) return false;
- return true;
- };
复制代码
[ 本帖最后由 todidot 于 2008-2-21 15:36 编辑 ] |