mohawk wrote:2.1.8版本找不到 template.dir
若自行加上 會出錯
安裝完成後的jforum-custom.conf是沒有template.dir這個參數沒錯, 但是在SystemGlobals.properties內是有的,它的值預設是default,我們可以自己手動加到jforum-custom.conf去, 這樣就可以覆蓋掉SystemGlobals.properties內的設定了(因JForum是先載入SystemGlobals.properties的參數值, 再載入jforum-custom.conf的參數值)
原先的檔案是針對JForum v2.1.7修改出來的, 當時花了不少時間去慢慢調整, 如果時間夠應該也可以對v2.1.8做更好的調整, 以下是我簡單的升級步驟, 供您參考
#下載JForum
cd /home/30elite
wget http://www.jforum.net/releases/jforum-2.1.8.zip
#解壓縮
unzip jforum-2.1.8.zip
#備份資料庫
su - postgres
pg_dump elite > /tmp/elite.bak
#更新schema
psql elite elite -f /home/30elite/jforum-2.1.8/upgrade/2.1.8/postgresql_2.1.7_to_2.1.8.sql
exit
#複製現有風格檔過去
cp -rfp /home/30elite/jforum-2.1.8/templates/default /home/30elite/jforum-2.1.8/templates/tp101
cp -p /home/30elite/www/templates/tp101/images/form_shadow.gif /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/header.jpg /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/header.swf /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/member*.gif /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/menu*.gif /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/shadow*.gif /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/top.jpg /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/top2.jpg /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/images/top_bg.jpg /home/30elite/jforum-2.1.8/templates/tp101/images/.
cp -p /home/30elite/www/templates/tp101/js/swfobject.js /home/30elite/jforum-2.1.8/templates/tp101/js/.
cp -rfp /home/30elite/www/templates/tp101/styles/style.css /home/30elite/jforum-2.1.8/templates/tp101/styles/.
cp -rfp /home/30elite/www/templates/tp101/header.htm /home/30elite/jforum-2.1.8/templates/tp101/header.htm
cp -rfp /home/30elite/www/templates/tp101/bottom.htm /home/30elite/jforum-2.1.8/templates/tp101/bottom.htm
#複製現有設定過去
cp -rfp /home/30elite/www/WEB-INF/config/jforum-custom.conf /home/30elite/jforum-2.1.8/WEB-INF/config/.
cp -rfp /home/30elite/www/upload/* /home/30elite/jforum-2.1.8/upload
cp -rfp /home/30elite/www/images/avatar/* /home/30elite/jforum-2.1.8/images/avatar
#更改權限為可寫入
chmod 775 /home/30elite/jforum-2.1.8/tmp
chmod -R 775 /home/30elite/jforum-2.1.8/upload
chmod -R 775 /home/30elite/jforum-2.1.8/images
chmod 775 /home/30elite/jforum-2.1.8/WEB-INF
chown -R 30elite:tomcat /home/30elite/jforum-2.1.8
#變更目錄名稱
mv /home/30elite/www /home/30elite/oldwww
mv /home/30elite/jforum-2.1.8 /home/30elite/www
#修改/home/30elite/www/WEB-INF/config/modulesMapping.properties ,將install改為註解或刪除
#install = net.jforum.view.install.InstallAction
#修改 /home/30elite/www/templates/tp101/header.htm,將v2.1.7版的<title>標籤上方換為v2.1.8版的templates/default/header.htm的<title>標籤上方程式碼
<#setting number_format = "#"/>
<#setting datetime_format = dateTimeFormat/>
<#assign logged = logged?default(false)/>
<#assign language = language?default("en_US")/>
<#assign hasCodeBlock = hasCodeBlock?default(false)/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<style type="text/css">@import url( ${contextPath}/templates/${templateName}/styles/style.css?${startupTime} );</style>
<style type="text/css">@import url( ${contextPath}/templates/${templateName}/styles/${language}.css?${startupTime} );</style>
<#if hasCodeBlock>
<style type="text/css">@import url( ${contextPath}/templates/${templateName}/styles/SyntaxHighlighter.css?${startupTime} );</style>
</#if>
<title>${pageTitle?default("JForum")?html}</title>
#加上熱門主題連結
<tr>
<td><a id="hottest" class="mainmenu" href="${JForumContext.encodeURL("/hottestTopics/list")}"><img src="${contextPath}/templates/${templateName}/images/icon_mini_recentTopics.gif" alt="[Hottest Topics]" /> ${I18n.getMessage("ForumBase.hottestTopics")}</a></td>
</tr>
#加上管理日誌連結
<#if canAccessModerationLog?default(false)>
<tr>
<td><a id="moderationlog" class="mainmenu" href="${JForumContext.encodeURL("/moderation/showActivityLog")}"><img src="${contextPath}/templates/${templateName}/images/icon_mini_members.gif" alt="[Moderation Log]" /> ${I18n.getMessage("ModerationLog.moderationLog")}</a></td>
</tr>
</#if>
#修改 /home/30elite/www/templates/tp101/bottom.htm,將v2.1.7的<iframe>標籤上方到</table>標籤間加上v2.1.8版的templates/default/bottom.htm的<iframe>標籤上方到</table>標籤間的程式碼
<#if hasCodeBlock>
<#include "highlighter_js.htm"/>
</#if>
#刪除forum_list.htm下方的登入表單
#修改post_show.htm
#刪除post_show_user_inc.htm中的<br>
#修改templates/tp101/styles/style.css,加上v.2.1.8新增的部分
附檔是我改過的tp101.zip(沒有psd檔)