## Mod Title: Arcade Hack
## Mod Version: 1.0
## Author: Tealc < mark@tealc.net >
## Description: This Hack adds 3 small Games to your phpbb
###################################################################
Bitte nicht meckern! Mein erster Hack!
###################################################################
##Beinhaltete Dateien:
###################################################################
個人偷偷修改版
有人有興趣的話幫我打包寄給原作者一下
我除了中文以外都不太懂
又再修改了一些小地方\r
大家可以參考看看
games.php
代碼: 選擇全部
<?php
/***************************************************************************
* faq.php
* -------------------
* begin : Sunday, Jul 8, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: faq.php,v 1.14 2002/03/31 00:06:33 psotfx Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$page_title = '電玩大街' ;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_FAQ);
init_userprefs($userdata);
//
// End session management
//
//
// Load the appropriate faq file
//
if( isset($HTTP_GET_VARS['mode']) )
{
switch( $HTTP_GET_VARS['mode'] )
{
case 'bbcode':
$lang_file = 'lang_bbcode';
$l_title = $lang['BBCode_guide'];
break;
default:
$lang_file = 'lang_faq';
$l_title = $lang['FAQ'];
break;
}
}
else
{
$lang_file = 'lang_faq';
$l_title = $lang['FAQ'];
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
//
// Pull the array data from the lang pack
//
$j = 0;
$counter = 0;
$counter_2 = 0;
$faq_block = array();
$faq_block_titles = array();
for($i = 0; $i < count($faq); $i++)
{
if( $faq[$i][0] != '--' )
{
$faq_block[$j][$counter]['id'] = $counter_2;
$faq_block[$j][$counter]['question'] = $faq[$i][0];
$faq_block[$j][$counter]['answer'] = $faq[$i][1];
$counter++;
$counter_2++;
}
else
{
$j = ( $counter != 0 ) ? $j + 1 : 0;
$faq_block_titles[$j] = $faq[$i][1];
$counter = 0;
}
}
//
// Lets build a page ...
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'games_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
$template->assign_vars(array(
'L_FAQ_TITLE' => $l_title,
'L_BACK_TO_TOP' => $lang['Back_to_top'])
);
for($i = 0; $i < count($faq_block); $i++)
{
if( count($faq_block[$i]) )
{
$template->assign_block_vars('faq_block', array(
'BLOCK_TITLE' => $faq_block_titles[$i])
);
$template->assign_block_vars('faq_block_link', array(
'BLOCK_TITLE' => $faq_block_titles[$i])
);
for($j = 0; $j < count($faq_block[$i]); $j++)
{
$row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('faq_block.faq_row', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FAQ_QUESTION' => $faq_block[$i][$j]['question'],
'FAQ_ANSWER' => $faq_block[$i][$j]['answer'],
'U_FAQ_ID' => $faq_block[$i][$j]['id'])
);
$template->assign_block_vars('faq_block_link.faq_row_link', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FAQ_LINK' => $faq_block[$i][$j]['question'],
'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id'])
);
}
}
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
代碼: 選擇全部
<style>
.fade {behavior:url('games/fade.htc');} /*淡入淡出特效*/
</style>
<script language="javascript">
function play(t,u,w,h,s) {
if(screen.width) {
x = (screen.width-w)/2 - 10
y = (screen.height-h)/2 - 20
}
else {
x = 150
y = 100
}
e7play_games = window.open('','e7play','resizable,width='+w+',height='+h+',top='+y+',left='+x);
if (s == "url") {
var games = '<html><title>{L_INDEX} :: {PAGE_TITLE} - '+t+'</title><meta http-equiv=Content-Type content=text/html; charset=big5><body onLoad=javascript:focus() scroll=no style=margin:0px><table width=100% height=100% border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=center><iframe src='+u+' width=100% height=100% marginwidth=0 marginheight=0 frameborder=0 scrolling=no></td></tr></table></body></html>';
}
else {
var games = '<html><title>{L_INDEX} :: {PAGE_TITLE} - '+t+'</title><meta http-equiv=Content-Type content=text/html; charset=big5><body onLoad=javascript:focus() scroll=no style=margin:0px><table width=100% height=100% border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=center><embed src='+u+' width=100% height=100% quality=High vspace=0></td></tr></table></body></html>';
}
var temp = e7play_games.document;
temp.open();
temp.write(games);
temp.close();
}
</script>
<span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="games.php">{PAGE_TITLE}</a></span>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" colspan="4" height="28">{PAGE_TITLE}</th>
</tr>
<tr>
<td class="catLeft" colspan="4" height="28"><span class="cattitle">GAME</span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle"><span class="genmed"><a href="javascript:void(0);" onClick="play('小精靈','http://www.neave.com/games/pacman/pacman.swf',584,480); return false"><img src="games/PACMAN.gif" width="140" height="105" border="0" class="fade" alt="小精靈"></a><br />小精靈</span></td>
<td class="row1" align="center" valign="middle"><span class="genmed"><a href="javascript:void(0);" onClick="play('貪食蛇','http://www.fx33.com/filer/snakeman.swf',584,480); return false"><img src="games/SNAKEMAN_STEVEN.gif" width="140" height="105" border="0" class="fade" alt="貪食蛇"></a><br />貪食蛇</span></td>
<td class="row1" align="center" valign="middle"><span class="genmed"><a href="javascript:void(0);" onClick="play('打磚塊','http://www.miniclip.com/gamefiles1234/smashing.swf',584,480); return false"><img src="games/Smashing.gif" width="140" height="105" border="0" class="fade" alt="打磚塊"></a><br />打磚塊</span></td>
<td class="row1" align="center" valign="middle"></td>
</tr>
</table>
代碼: 選擇全部
<public:component>
<public:attach event="onmouseover" onevent="fade('in')" />
<public:attach event="onmouseout" onevent="fade('out')" />
<script language="Javascript">
var eTimer = new Object();
var initopa = 40;
var hopa = 100;
element.style.filter="Alpha()";
element.filters.alpha.opacity = initopa;
function fade(s){
/*
* rate - time in milliseconds between trasparency changes (best under 100)
* delta - amount of change each time (ie 5, for 5% change in transparency)
*/
switch(s){
case "in":
destOp = hopa;
rate = 30;
delta = 5;
break;
case "out":
destOp = initopa;
rate = 30;
delta = 5;
break;
}
if(eTimer[element.sourceIndex]) clearTimeout(eTimer[element.sourceIndex]);
if(element.filters.alpha.opacity!=destOp){
diff = destOp-element.filters.alpha.opacity;
direction = 1;
if (element.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
element.filters.alpha.opacity+=direction*delta;
eTimer[element.sourceIndex] = setTimeout(fade, rate)
}
}
</script>
之後複製各個檔案到對應位置
game.php -> ./
game.php -> ./templates/subSilver/
fade.htc -> ./games/
遊戲縮圖 -> ./games/
game.php 裡的 $page_title = '電玩大街' ;
自己把電玩大街改成你想要的名稱
還有 games_body.tpl 裡有關 e7play 的地方
改成你自己想要的名稱(搜尋取代即可)
最後 games_body.tpl 裡遊戲檔以及圖片檔的位置
請自行尋找以及設定