查看完整版本: DZ一些使用技巧

rengo 2005-8-25 09:11

DZ一些使用技巧

一些使用技巧

1. 後台論壇簡介字數過長大於char(255)時將會不被記入mysql,不能首頁全部顯示

解決方法:升級數據庫,將char轉為text
   
[code]ALTER TABLE `cdb_forums` CHANGE `description` `description` TEXT NOT NULL[/code]



admin/forums.php找下句刪除


[code]if (strlen($descriptionnew) > 255) cpmsg('forums_forum_description_toolong'); [/code]


2. 後台更改頭像為大小後,前台仍只能維持80x80

解決方法:升級數據庫
假設你想設置為120 x 110

  
[code]UPDATE cdb_members SET avatarwidth=120, avatarheight=110 where avatarwidth=80 and avatarheight=80;[/code]



3. 後台不停要輸入密碼,令無法進行修改
D2.5 後台採用了更加嚴格的身份判斷,如果您的IP 一直是不斷變化的,那麼有可能會出現這個現象。(部分ISP 如此)

您可以降低安全檢查的等級,方法如下:
修改admincp.php
查找:
  
[code]$ipcheck = " AND ip='$onlineip'"; [/code]



修改為:

  
[code]$ipcheck = "";[/code]  



4. 版主進行主題分割,出現錯誤!
編輯topicadmin.php
查找:

  
[code]if(!submitcheck('splitsubmit')) {
        require_once DISCUZ_ROOT.'./include/discuzcode.php'; [/code]



修改為:


[code]require_once DISCUZ_ROOT.'./include/discuzcode.php';
      if(!submitcheck('splitsubmit')) {[/code]



5. SP1改變了提示框為黃底紅字,感覺不美觀

是因為在common.js內取消了一段代碼,只需在尾部補上代碼就可以
  
[code]document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { font-family: Verdana, Tahoma; background-color: #DDEEFF; border: 1px #8899AA dashed; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}");

document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText() {
        var o=event.srcElement;
        MouseX=event.x;
        MouseY=event.y;
        if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
        if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
        if(o.pop!=sPop) {
                sPop=o.pop;
                if(sPop==null || sPop=="") {
                        popLayer.style.visibility="hidden";        
                } else {
                        if(o.dyclass!=null) popStyle=o.dyclass
                        else popStyle="cPopText";
                        popLayer.style.visibility="visible";
                        showIt();
                }
        }
}

function showIt() {
        popLayer.className=popStyle;
        popLayer.innerHTML=sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"<br>");;
        popWidth=popLayer.clientWidth;
        popHeight=popLayer.clientHeight;
        if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
                else popLeftAdjust=0;
        if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
                else popTopAdjust=0;
        popLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
        popLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
}
document.onmouseover=showPopupText;[/code]



6. 如何去掉{論壇公告6}這樣的編號

forumdisplay 模版
共兩個
  
[code]$announcement[id]:[/code]



將:前的$announcement[id]刪除去

announcement.htm模板
找到


[code]{lang announcements} #$announce[id] [/code]



刪除


[code]#$announce[id] [/code]



7. 將.........請返回的訊息改為會自動跳轉前一頁
messages.lang.php



[code]'.... => '...., 請返回。', [/code]



更換為

  
[code]'.... => '...., <a href=\"javascript:history.back(1)\">請返回</a>。',[/code]



8. 首頁顯示發貼數
include/common.php


[code], m.regdate[/code]



之后加


[code], m.postnum[/code]






[code]$discuz_uid = $adminid = $credit =0; [/code]



换成


[code]$discuz_uid = $adminid = $credit = $postnum =0; [/code]



然后在 index 模版

  
[code]{lang credit_title} <span class="bold">$credit</span>
                  {lang credit_unit} [/code]



换成

  
[code]<!--{if $userstatusby == 1}-->
{lang credit_title} <span class="bold">$credit</span>
                  {lang credit_unit}
<!--{else}-->
{lang postnum} <span class="bold">$postnum</span>
<!--{/if}--> [/code]



9. 子版發貼主頁不顯示
include/newthread.php, include/newreply.php


[code]if ($forum['fup'] && $forum['type'] == 'sub' && !$forum['viewperm']) {[/code]



replace with


[code]if ($forum['fup'] && $forum['type'] == 'sub') { [/code]



10. 如何象D4那樣帖子之間用雙線表格
修改 viewthread.htm

找到:

  
[code]$post[newpostanchor][/code]



在下面加:

[code]<tr><td bgColor="{ALTBG1}" height="1" colSpan="2"></tr>[/code]



11. 在論壇頂部添加banner的方法

打開header.htm模板文件

找到

  
[code]<td width="100%" align="center" background="{IMGDIR}/topbg_right.gif">&nbsp;</td>[/code]



然後把裡面
&nbsp;

改成你要的圖片或者廣告代碼就行了

<img src="images/xxxx.gif">

12. 在使用 PHP 代碼時,頭尾加了一行空格

解決辦法:
打開 include\discuzcode.php 文件
找:

   
[code]$buffer = str_replace("&quot;", "\"", $buffer);[/code]



在下面加一句:

  
[code]$buffer = str_replace("\n", "", $buffer); [/code]



13. 投票後主題不想提升方法
misc.php
刪除
   
[code]$db->query("UPDATE $table_threads SET lastpost='$timestamp' WHERE tid='$tid'", 'UNBUFFERED');[/code]
頁: [1]
查看完整版本: DZ一些使用技巧