先裝這個 : http://phpbb-tw.net/phpbb/viewtopic.php?t=23166
----------------修改為看該版面的文章也會加該版面的點擊數-------------
打開viewtopic.php
找到\r
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
AND f.forum_id = t.forum_id
$order_sql";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
在行內找到 f.auth_attachments 後面加上
,f.hot_views
找到\r
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
在前面加上
$sql = "UPDATE `phpbb_forums`
SET `hot_views` = '".($forum_topic_data['hot_views']+1)."'
WHERE `forum_id` = '". $forum_topic_data['forum_id']."'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'failed updating forum hot views', '', __LINE__, __FILE__, $sql);
}
-------------------修改為百分比顯示------------------------
打開 index.php
找到\r
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
在裡面的
$forum_data[] = $row;
下面加上
$total_forum_hotviews += $row['hot_views'];
然後在 } 下面加上
if($total_forum_hotviews==0){$total_forum_hotviews= 1;}
變成
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
$total_forum_hotviews += $row['hot_views'];
}
if($total_forum_hotviews==0){$total_forum_hotviews= 1;}
找到\r
'HOT_VIEWS' => $forum_data[$j]['hot_views'],
取代為\r
'HOT_VIEWS' => sprintf("%.1f", 100*$forum_data[$j]['hot_views']/$total_forum_hotviews).'%',
-----------------------------------------------------
---------------修改為百分比圖示顯示---------------
先裝「修改為百分比顯示」這個修改...
把「這個」圖檔丟到 images/ 下面 (這個圖檔取自Mac大的hp/mp mod..^^")
打開 index.php
找到
'HOT_VIEWS' => sprintf("%.1f", 100*$forum_data[$j]['hot_views']/$total_forum_hotviews).'%',
後面加上
'HOT_VIEWS_SPACE' => (100-sprintf("%.1f", 100*$forum_data[$j]['hot_views']/$total_forum_hotviews)).'%',
打開 templates/your_template/index_body.tpl
找到\r
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.HOT_VIEWS}</span></td>
取代為\r
<td class="row2" align="center" valign="bottom" height="50"><img src="images/spacer.gif" alt="" width="9" height="{catrow.forumrow.HOT_VIEWS_SPACE}" /><span class="gensmall"><img src="./images/hotview_bar.gif" alt="{catrow.forumrow.HOT_VIEWS}" title="{catrow.forumrow.HOT_VIEWS}" width="9" height="{catrow.forumrow.HOT_VIEWS}" /><br>{catrow.forumrow.HOT_VIEWS}</span></td>
--------------修改為版面的點擊率到達一定程度就有hot的圖示出現----------
需要先安裝 -------------------修改為百分比顯示------------------------
先把「這個」 抓到 images/ 下面..
打開 index.php
找到\r
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('catrow.forumrow',
array(
前面加上
$hotview_img_hot='';
if(100*$forum_data[$j]['hot_views']/$total_forum_hotviews>30){$hotview_img_hot="<img src =\"images/hot.gif\">";}
找到\r
'HOT_VIEWS' => sprintf("%.1f", 100*$forum_data[$j]['hot_views']/$total_forum_hotviews).'%',
在後面加上
'HOT_IMG' => $hotview_img_hot,
打開 index_body.tpl
找到\r
<a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a>
後面加上
{catrow.forumrow.HOT_IMG}
[修改]Forum-Hotviews修改--目前3筆XD
MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!
版主: 版主管理群
前往
- Announcement
- ↳ 系統公告區
- Support
- ↳ [3.3.x] 安裝與使用
- ↳ [3.3.x] 中文
- ↳ [3.3.x] 轉換
- ↳ [3.2.x] 安裝與使用
- ↳ [3.2.x] 中文
- ↳ [3.2.x] 轉換
- Extensions
- ↳ 官方認證擴充功能
- ↳ [3.2.x] 官方認證擴充功能
- ↳ [3.3.x] 官方認證擴充功能
- ↳ 非官方認證擴充功能
- ↳ 擴充功能問題討論
- Style
- ↳ 官方認證風格
- ↳ [3.2.x] 官方認證風格
- ↳ [3.3.x] 官方認證風格
- ↳ 風格問題討論
- Knowledge
- ↳ 教學文件庫
- ↳ 2.0
- ↳ 3.0
- ↳ 3.1
- ↳ 3.2
- ↳ 3.3
- ↳ phpBB 技術文件與知識庫
- ↳ 2.0
- ↳ 3.0
- ↳ 3.1
- ↳ 3.2
- Non-phpBB specific
- ↳ 塔羅占卜
- ↳ 塔羅精華
- ↳ 每週運勢
- ↳ 我想發問
- ↳ 站長交流
- ↳ 自由軟體或免費軟體
- ↳ 架站
- ↳ AppServ
- ↳ WampServer
- ↳ XAMPP
- ↳ phpMyAdmin
- ↳ ExoBUD MP
- ↳ 4images
- ↳ Coppermine Photo Gallery
- ↳ 網路
- ↳ 文書
- ↳ 檔案
- ↳ 美工
- ↳ 系統
- ↳ 安全
- ↳ 多媒體
- ↳ 遊戲
- ↳ 光碟
- ↳ 休閒哈拉與心情小品
- ↳ 意見反應或無法分類
- Link
- ↳ 竹貓星球數位(股)
- ↳ FaceBook_phpBB3-官方中文支援
- ↳ SSD 不限流量-網站空間( .tw or .com.tw域名免費送)
- ↳ 推薦網站
- ↳ phpBB.com
- ↳ phpBBHacks.com
- Archives
- ↳ phpBB 3.1.x Forum Archive
- ↳ [3.1.x] 安裝與使用
- ↳ [3.1.x] 中文
- ↳ [3.1.x] 轉換
- ↳ [3.1.x] 官方認證風格
- ↳ phpBB 3.0.x Forum Archive
- ↳ [3.0.x] Support
- ↳ [3.0.x] 安裝與使用
- ↳ [3.0.x] 中文
- ↳ [3.0.x] 轉換
- ↳ [3.0.x] Mod
- ↳ [3.0.x] 官方認證外掛
- ↳ [3.0.x] 非官方認證外掛
- ↳ [3.0.x] 外掛問題討論
- ↳ [3.0.x] Style
- ↳ [3.0.x] 官方認證風格
- ↳ [3.0.x] 非官方認證風格
- ↳ [3.0.x] 風格問題討論
- ↳ phpBB2 Forum Archive
- ↳ Support
- ↳ phpBB 2 安裝與使用
- ↳ phpBB 2 plus 綜合討論
- ↳ MOD
- ↳ 官方認證外掛
- ↳ 非官方認證外掛
- ↳ 外掛問題討論
- ↳ Style
- ↳ 官方認證風格
- ↳ 非官方認證風格
- ↳ 風格問題討論