由于组图插件版本不同,下面的代码可能有些差异,但代码位置是相同的。
1、删除独立文件,包括
admin/qcomic.inc.php
api/image.php
include/javascript/qcomic.js
include/qcomic.inc.php
2、修改admin/menu.inc.php
删除- showmenu($lang['menu_qcomic'],array(array('name' => $lang['menu_qcomic_config'], 'url' => 'admincp.php?action=qcomic')));
复制代码 3、修改include/javascript/post_editor.js
删除- if (typeof(qcomic_enabled)=='undefined' || !qcomic_enabled) {
- } else {
- if ($('phidstatus').value == '1') {
- alert(lang['phidstatus']);
- return false;
- }
- }
复制代码 4、修改include/editpost.inc.php
删除- 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($_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);
- }
- }
复制代码 5、修改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);
- }
复制代码 6、修改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);
- }
复制代码 7、修改templates/default/post_editor.htm
删除- <!--{if $_DCACHE['settings']['qihoo_image']['senable'] && (!$_DCACHE['settings']['qihoo_image']['sboard'] || strstr($_DCACHE['settings']['qihoo_image']['sboard'],',0,') || strstr($_DCACHE['settings']['qihoo_image']['sboard'],','.$fid.','))}-->
- <script type="text/javascript">
- var qcomic_enabled = 1;
- lang['phidstatus'] = "请先完成Flash的保存,否则会丢失数据!";
- function setImageInfo(phid, phidstatus) {
- $('phid').value = phid;
- $('phidstatus').value = phidstatus;
- }
- function qcomic_postsubmit(phid) {
- setImageInfo(phid, 0);
- var retval = document.getElementById('postform').onsubmit();
- if (retval==true) document.getElementById('postform').submit();
- }
- </script>
- <!--{eval $phidstring = empty($postinfo[phid]) ? '' : '&phid='.$postinfo[phid];}-->
- <!--{eval $iwidth = $_DCACHE[settings][qihoo_image][iwidth];}-->
- <!--{eval $iheight = $_DCACHE[settings][qihoo_image][iheight];}-->
- <!--{eval $qcomic_sid = $_DCACHE[settings][qihoo_image][sid];}-->
- <!--{eval $qcomic_spassword = $_DCACHE[settings][qihoo_image][spassword];}-->
- <!--{eval $qcomic_skey = $_DCACHE[settings][qihoo_image][skey];}-->
- <!--{eval $code = "&spassword=$qcomic_spassword&tid=$tid&pid=$pid".$phidstring;}-->
- <!--{eval $code = urlencode(authcode($code,"",$qcomic_skey))}-->
- <script src="include/javascript/qcomic.js" type="text/javascript"></script>
- <script language="javascript" type="text/javascript">
- //<![CDATA[
- flashTagIns.setNew("http://p.qihoo.com/flash/upload.swf", $iwidth, $iheight);
- flashTagIns.setVersion("7,0,19,0");
- flashTagIns.setId('qcomic_upload');
- flashTagIns.allowScriptAccess = "always";
- flashTagIns.swLiveConnect = "true";
- flashTagIns.wmode = "window";
- flashTagIns.flashVars = 'sid=$qcomic_sid&code=$code{$phidstring}&ver=dz_2';
- flashTagIns.write(document);
- window.qcomic_upload = document.getElementById('postform').qcomic_upload;
- //qcomic_proxy.qcomic_debug('[post_editor.htm]'+flashTagIns);
- //]]>
- </script>
- <div style="height:10px; clear:both;"><!-- --></div>
- <input type="hidden" name="phid" id="phid" value="$postinfo[phid]" />
- <input type="hidden" name="phidstatus" id="phidstatus" value="0" />
- <!--{/if}-->
复制代码 8、修改templates/default/viewthread.htm
删除- <!--{if $_DCACHE['settings']['qihoo_image']['senable'] && $post['qipid'] && $post['phid'] && ($post['phid'] != '-1')}-->
- <!--{eval $phidtemp = $post[phid];}-->
- <!--{eval $owidth = $_DCACHE[settings][qihoo_image][owidth];}-->
- <!--{eval $oheight = $_DCACHE[settings][qihoo_image][oheight];}-->
- <!--{eval $qcomic_sid = $_DCACHE[settings][qihoo_image][sid];}-->
- <!--{eval $qcomic_spassword = $_DCACHE[settings][qihoo_image][spassword];}-->
- <!--{eval $qcomic_skey = $_DCACHE[settings][qihoo_image][skey];}-->
- <!--{eval $code = "&spassword=$qcomic_spassword&phid=$phidtemp&ctime=$timestamp";}-->
- <!--{eval $code = urlencode(authcode($code,"",$qcomic_skey))}-->
- <script type="text/javascript" src="include/javascript/qcomic.js"></script><br>
- <div id="qcomic_view_{$qcomic_sid}_{$phidtemp}_before" style="clear:both; overflow:hidden;"></div>
- <script language="javascript" type="text/javascript">
- //<![CDATA[
- flashTagIns.setNew("http://p.qihoo.com/flash/pic_nav.swf", $owidth, $oheight);
- flashTagIns.setVersion("7,0,19,0");
- flashTagIns.allowScriptAccess = "always";
- flashTagIns.allowFullScreen = "true";
- flashTagIns.setId('qcomic_flash_{$qcomic_sid}_{$phidtemp}');
- flashTagIns.swLiveConnect = "true";
- flashTagIns.wmode = null;
- flashTagIns.flashVars = 'idx={$qcomic_sid}_{$phidtemp}&sid=$qcomic_sid&code=$code&auto={$post[first]}&ver=dz_2';
- flashTagIns.write(document);
- window.qcomic_flash_{$qcomic_sid}_{$phidtemp} = document.modactions.qcomic_flash_{$qcomic_sid}_{$phidtemp};
- //qcomic_proxy.qcomic_debug('[viewthread.htm]'+flashTagIns);
- //]]>
- </script>
- <div id="qcomic_view_{$qcomic_sid}_{$phidtemp}_after" style="clear:both; overflow:hidden;"></div>
- <!--{/if}-->
复制代码 9、修改viewthread.php
删除- if($_DCACHE['settings']['qihoo_image']['senable']) {
- $fieldsadd .= ', qi.pid AS qipid, qi.thid, qi.phid ';
- $tablesadd = "LEFT JOIN {$tablepre}qihooimages qi USING (pid)";
- }
复制代码
[ 本帖最后由 todidot 于 2008-2-29 15:12 编辑 ] |