1 頁 (共 1 頁)

[問題] 請問.滑鼠移至主題上變色..(修改後重裝已解決)

發表於 : 2004-04-11 02:26
link
我照著這篇文章下去改\r
http://phpbb-tw.net/phpbb/viewtopic.php?t=2974

結果出現錯誤..

Parse error: parse error in /data/members/..(省略)
/phpbb2/includes/template.php(127) : eval()'d code on line 54

template.php (line 45-62)
[php]
// Root template directory.
var $root = "";

// this will hash handle names to the compiled code for that handle.
var $compiled_code = array();

// This will hold the uncompiled code for that handle.
var $uncompiled_code = array();

/**
* Constructor. Simply sets the root dir.
*
*/
function Template($root = ".")
{
$this->set_rootdir($root);
}

[/php]

如果不算註解跟空白行..
template.php (line 45-64)

[php]
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
{
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
}

eval($this->compiled_code[$handle]);
return true;
}

function assign_var_from_handle($varname, $handle)
{
if (!$this->loadfile($handle))
{
die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle");
}

$_str = "";
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');

eval($code);

$this->assign_var($varname, $_str);

return true;
}

[/php]

請問是什麼問題呢 ~ ~"

PS.附上原文程式碼..

代碼: 選擇全部


####################################################### 
## 
## Hack Title:          Hypercells for phpBB 2.0 
## Hack Version:        1.0 
## Author:              Darkman (darkman@lexicon.net) 
## Description:         Taken from the Hypercells MOD from phpBB 1.X, 
##                      I just made little adjustments to fit phpBB 2.0, 
##         full credit still goes to the originators from phpBB 1.X 
##         I just made some tweaking to make it work on phpBB 2.0 
## 
## Installation Level:  Very Easy 
## Installation Time:   5 Minutes or less 
## Files To Edit:       /templates/subSilver/index_body.tpl and viewforum_body.tpl 
## Included Files:      Nufin... 
## 
######################################################## 


# 
# Please back up your files prior to modifying your phpBB. 
# 
#-----[ACTION: OPEN]------------------------------------------ 
# 

/templates/subSilver/index_body.tpl 

# 
#-----[ ACTION: FIND]------------------------------------------ 
# 
# 

      <td class="row1" width="100%" height="50"> 


# 
#-----[ ACTION: REPLACE WITH]------------------------------------------ 
# 

      <td class="row1" width="100%" height="50" onMouseOver="this.style.backgroundColor='#cccccc'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#EFEFEF';" onclick="window.location.href='{catrow.forumrow.U_VIEWFORUM}'"> 

      # NOTE: You can change the values for the color for the background, but to make it effective, make sure the OnMouseOut color is the same as the default table row color. 





# 
#-----[ ACTION: OPEN]------------------------------------------ 
# 


/templates/subSilver/viewforum_body.tpl 


# 
#-----[ ACTION: FIND]------------------------------------------ 
# 

      <td class="row1" width="100%"> 

# 
#-----[ ACTION: REPLACE WITH]------------------------------------------ 
# 

      <td class="row1" width="100%" onMouseOver="this.style.backgroundColor='#cccccc'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#EFEFEF';" onclick="window.location.href='{topicrow.U_VIEW_TOPIC}'"> 

      # NOTE: You can change the values for the color for the background, but to make it effective, make sure the OnMouseOut color is the same as the default table row color. 

# 
#-----[ END OF MOD ]--------------------- 
# 
EOF 
照這篇改也出現同樣的錯誤訊息(沒改TOP5的部份)..
http://phpbb-tw.net/phpbb/viewtopic.php ... light=TOP5

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 

index_body.tpl 

# 
#-----[  FIND ]------------------------------------------ 
#  

      <td class="row1" width="100%" height="50"> 


# 
#-----[ SUBSTITUTE ]------------------------------------------ 
# 

      <td class="row1" width="100%" height="50" onMouseOver="this.style.backgroundColor='#E8EFF7'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#F5F8FB';" onclick="window.location.href='{catrow.forumrow.U_VIEWFORUM}'"> 

      PS:那個顏色可以自行修訂成適合自己版面的顏色 





# 
#-----[ OPEN ]------------------------------------------ 
# 


viewforum_body.tpl 


# 
#-----[ FIND ]------------------------------------------ 
# 

      <td class="row1" width="100%"> 

# 
#-----[ SUBSTITUTE ]------------------------------------------ 
# 

      <td class="row1" width="100%" onMouseOver="this.style.backgroundColor='#E8EFF7'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#F5F8FB';" onclick="window.location.href='{row.topicrow.U_VIEW_TOPIC}'"> 

      PS:那個顏色可以自行修訂成適合自己版面的顏色 

# 
#-----[ END OF MOD ]--------------------- 
# 
EOF

發表於 : 2004-04-11 10:42
webspirit
Hypercells for phpBB 2.0這個MOD
從頭到尾都沒改到.php的檔案
你用的是subSilver的風格嗎?
若不是,你就不能直接照做
要針對你所使用的風格做修改

發表於 : 2004-04-11 16:46
link
我用的是subSilver的風格..
不過裝過一些MOD所以有更動到一點內容
是因為這個關係嗎?


PS.我裝過的MOD..
PHPBB-TW
mod-post_icons
adv_top5_mod_2.1
appraise_post_1.0.1(4/10 BY 藍色的天空)
主題類型分區劃(資料庫版)

[討論]修改後可以用了 =.=+

發表於 : 2004-04-11 18:37
link
我重改了一些語法後,再重裝就好了.. :-o
也許是COPY下來的語法有點錯誤 :?:

下面是我修改後的

代碼: 選擇全部

# 
# Please back up your files prior to modifying your phpBB. 
# 
#-----[ACTION: OPEN]------------------------------------------ 
# 

/templates/subSilver/index_body.tpl 

# 
#-----[ ACTION: FIND]------------------------------------------ 
# 
# 

      <td class="row1" width="100%" height="50"> 


# 
#-----[ ACTION: REPLACE WITH]------------------------------------------ 
# 

      <td class="row1" width="100%" height="50" onMouseOver=this.style.backgroundColor='#DBE4EE' onMouseOut=this.style.backgroundColor="{T_TR_COLOR1}">

      # NOTE: You can change the values for the color for the background, but to make it effective, make sure the OnMouseOut color is the same as the default table row color. 
      PS:那個顏色可以自行修訂成適合自己版面的顏色\r

#
#-----[ SAVE CLOSE UPLOAD ]--------------------------- 
# 

   templates/subSilver/index_body.tpl 

# 
\n#-----[ ACTION: OPEN]------------------------------------------ 
# 

/templates/subSilver/viewforum_body.tpl 

# 
#-----[ ACTION: FIND]------------------------------------------ 
# 

      <td class="row1" width="100%"> 

# 
#-----[ ACTION: REPLACE WITH]------------------------------------------ 
# 

      <td class="row1" width="100%" onMouseOver=this.style.backgroundColor='#DBE4EE' onMouseOut=this.style.backgroundColor="{T_TR_COLOR1}">
      # NOTE: You can change the values for the color for the background, but to make it effective, make sure the OnMouseOut color is the same as the default table row color. 
      PS:那個顏色可以自行修訂成適合自己版面的顏色\r

# 
#-----[ SAVE CLOSE UPLOAD ]-------------------------- 
# 

   viewforum_body.tpl 

# 
#-----[ END OF MOD ]--------------------- 
# 

EOF 


#
# 應用在 TOP 5 上面..
#
# 
#-----[ OPEN ]------------------------------------------ 
# 

 adv_top5_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

    <td class="row2" nowrap><span class="topictitle"><a href="{toprow.topic_url}" target="_top" class="topictitle">{toprow.topic}</a></span></td>

# 
#-----[ REPLACE ]------------------------------------------ 
# 

    <td class="row2" onMouseOver=this.style.backgroundColor='#DBE4EE' onMouseOut=this.style.backgroundColor="{T_TR_COLOR1}" nowrap><span class="topictitle"><a href="{toprow.topic_url}" target="_top" class="topictitle">{toprow.topic}</a></span></td>

# 
#-----[ END OF MOD ]--------------------- 
# 
EOF