這是在建立資料表格的SQL命令~~
沒有整份的文件嗎~~~
這只是新增2個資料表~~並沒有PHP的程式部分
[問題]complete_banner_1.3.2em問題
版主: 版主管理群
請問整份文件是什麼意思???
您是說這個嗎??
##############################################################
## MOD Title: Complete banner
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. R鷣) http://mods.db9.dk
## MOD Description: This mod makes it posible to add banners to
## your phpbb2 pages, by default banners are
## placed in top/botton but you may place the
## tags, inside any template file.
## MOD Version: 1.3.2.
## MOD Compatibility: 2.0.0->2.0.6
##
## Installation Level: Easy
## Installation Time: 10 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 10
## viewonline.php
## admin/admin_db_utilities.php
## includes/constants.php
## includes/page_header.php
## includes/page_tail.php
## includes/functions.php
## templates/subSilver/overall_footer.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/viewforum_body.tpl
## templates/subSilver/viewtopic_body.tpl
##
## Included Files: 7
## complete_banner_db_update.php
## root/redirect.php
## root/admin/admin_banner.php
## root/language/lang_english/lang_banner.php
## root/templates/subSilver/redirect.tpl
## root/templates/subSilver/admin/banner_edit_body.tpl
## root/templates/subSilver/admin/banner_list_body.tpl
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod makes it posible to add banners to your phpbb2
## pages, by default banners are placed in top/botton but
## you may place the tags, inside any template file.
## I have given a example with 15 banner placements, you
## may add more in the language file, if you need others the
## text in the language file are only examples, you may change it.
## you may add banners, and define priority and time/day/date
## based rules, to let banners rotate you may also specify who
## may/shall see the banners, e.g. guest only or not admin
## number of clicks and views are counted, and can be viewed
## in ACP - after a user click a banner, you may specify how long time
## before the same users click will be re-counted,
## it is even posible to specify to hide the banner after a user have clicked it.
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 2.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 2.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
## For this MOD, copy lang_*.php file(s) manually from
## their root/language/lang_xxx directories to their respective
## language/lang_xxx directories in the phpBB root dir.
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=1503
##
##############################################################
## MOD History:
##
## 2003-15-11 - Version 1.3.2
## - english language file was missing the $lang['Left_via_banner'], now updated to include this once again
##
## 2003-15-11 - Version 1.3.1
## - added changes ned to functions.php
## - corrected a typo in db_update.php
##
## 2003-15-11 - Version 1.3.0
## - added ability to specify "hide banner after click"
## - added ability to specify "banner click inactive time"
##
## 2003-15-11 - Version 1.2.3
## - changed "'width to 'width
##
## 2003-12-11 - Version 1.2.2
## - a error in admin_banner.php ver 1.2.0./1.2.1. did cause problems - now corrected
##
## 2003-12-11 - Version 1.2.1
## - $lang['Banner_comment_explain']+ $lang['Left_via_banner'] - added
##
## 2003-12-10 - Version 1.2.0
## - added option to change banner size
## - added option to make banners as flash (or other types)
##
## 2003-12-08 - Version 1.1.5
## - phpBB template & EasyMOD compliance enhancement
## - Italian translation now provide with the MOD
##
## 2003-10-25 - Version 1.1.4
## - minor change redirect.php
## - added PAGE_REDIRECT constant
## - added change to viewonline.php
## - corrected how-to header
## - updated lang_banner.php
##
## 2003-10-25 - Version 1.1.3
## - added change to admin_db_utils.php
##
## 2003-08-23 - Version 1.1.2
## - updated redirect.php, db_update.php and constants.php
## - click statistics are now stored
##
## 2003-08-23 - Version 1.1.1
## - updated admin_banner.php, and improved the
## template/lang_banner.php
##
## 2003-08-23 - Version 1.1.0
## - now EM ready
##
## ????-??-?? - Version 1.0.5
## - admin_banner.php, redirect.php updated
##
## ????-??-?? - Version 1.0.4
## - minor typo in the file names, now corrected
##
## ????-??-?? - Version 1.0.3
## - 1.0.2 did require change to page_tail.php witch
## is now included
##
## ????-??-?? - Version 1.0.2
## - now support that banner are to show in a specific forum
##
## ????-??-?? - Version 1.0.1
## - added new feature, banners can show depending
## on user type
##
## ????-??-?? - Version 1.0.0
## - corrected redirect.tpl file, now considered as final
##
## ????-??-?? - Version 0.9.3
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.2
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.1
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.1
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.0
## - initial beta
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy complete_banner_db_update.php to complete_banner_db_update.php
copy root/redirect.php to redirect.php
copy root/admin/admin_banner.php to admin/admin_banner.php
copy root/language/lang_english/lang_banner.php to language/lang_english/lang_banner.php
copy root/templates/subSilver/redirect.tpl to templates/subSilver/redirect.tpl
copy root/templates/subSilver/admin/banner_edit_body.tpl to templates/subSilver/admin/banner_edit_body.tpl
copy root/templates/subSilver/admin/banner_list_body.tpl to templates/subSilver/admin/banner_list_body.tpl
#
# This MOD need a database update.
# Then, as you must have now copied the complete_banner_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir ... update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#
#
# Moreover, because EM 0.0.10a can not already manage files for not
# necessarily existing language, language provide with this MOD can
# not be automatically installed (if I add the above instruction it
# can cause an installation error). So, if you need this language
# copy this file manually.
#
# copy root/language/lang_french/lang_banner.php to language/lang_french/lang_banner.php
# copy root/language/lang_spanish/lang_banner.php to language/lang_spanish/lang_banner.php
#
#
#-----[ OPEN ]------------------------------------------------
#
viewonline.php
#
#-----[ FIND ]------------------------------------------------
#
default:
$location = $lang['Forum_index'];
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Start add - Complete banner MOD
case PAGE_REDIRECT:
require_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_banner.' . $phpEx);
if ($row['session_topic'])
{
$sql = "SELECT banner_description FROM " . BANNERS_TABLE . " WHERE banner_id=" . $row['session_topic'];
if ( $result2 = $db->sql_query($sql) )
{
$banner_data = $db->sql_fetchrow($result2);
}
else
{
message_die(GENERAL_ERROR, 'Could not obtain redirect online information', '', __LINE__, __FILE__, $sql);
}
$location_url = append_sid("redirect.$phpEx?banner_id=" . $row['session_topic']);
$location = $lang['Left_via_banner'] .' --> '.$banner_data['banner_description'];
} else
{
$location_url = "";
$location = $lang['Left_via_banner'];
}
break;
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_db_utilities.php
#
#-----[ FIND ]------------------------------------------------
#
$tables = array(
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
$tables[] = 'banner';
$tables[] = 'banner_stats';
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------------
#
define('PAGE_GROUPCP', -11);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('PAGE_REDIRECT', -1031);
// End add - Complete banner MOD
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------------
#
//
// The following assigns all _common_ variables that may be used at any point
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Start add - Complete banner MOD
$time_now=time();
$hour_now=create_date('Hi',$time_now,$board_config['board_timezone']);
$date_now=create_date('Ymd',$time_now,$board_config['board_timezone']);
$week_now=create_date('w',$time_now,$board_config['board_timezone']);
$sql_level= ($userdata['user_id']==ANONYMOUS) ? ANONYMOUS : (($userdata['user_level']==ADMIN) ? MOD : (($userdata['user_level']==MOD) ? ADMIN : $userdata['user_level']));
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum, banner_type, banner_width, banner_height, banner_filter FROM ".BANNERS_TABLE ."
WHERE banner_active
AND IF(banner_level_type,IF(banner_level_type=1,".intval($sql_level)."<=banner_level,IF(banner_level_type=2,".intval($sql_level).">=banner_level,".intval($sql_level)."<>banner_level)),banner_level=".intval($sql_level).")
AND (banner_timetype=0
OR (( $hour_now BETWEEN time_begin AND time_end) AND ((banner_timetype=2
OR (( $week_now BETWEEN date_begin AND date_end) AND banner_timetype=4)
OR (( $date_now BETWEEN date_begin AND date_end) AND banner_timetype=6)
)))) ORDER BY banner_spot,banner_weigth*SUBSTRING(RAND(),6,2) DESC";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
$banners = array();
$i=0;
while ($banners[$i] = $db->sql_fetchrow($result))
{
\n $cookie_name = $board_config['cookie_name'] . '_b_' . $banners[$i]['banner_id'];
if ( !($HTTP_COOKIE_VARS[$cookie_name] && $banners[$i]['banner_filter']) )
{
$banner_spot=$banners[$i]['banner_spot'];
if ($banner_spot<>$last_spot AND ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])))
{
$banner_size = ($banners[$i]['banner_width'] && $banners[$i]['banner_height']) ? '"width="'.$banners[$i]['banner_width'].'" height="'.$banners[$i]['banner_height'].'"' : '';
switch ($banners[$i]['banner_type'])
{
case 6 :
// swf file
$template->assign_vars(array('BANNER_'.$banner_spot.'_IMG' => '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shoc ... n=6,0,23,0" id=macromedia '.$banner_size.' align="abscenter"><param name=movie value="'.$banners[$i]['banner_name'].'"><param name=quality value=high><embed src="'.$banners[$i]['banner_name'].'" quality=high pluginspage="http://www.macromedia.com/shockwave/dow ... kwaveFlash" type="application/x-shockwave-flash" autostart="true" /><noembed><a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_description'].'</a></noembed></object>'));
break;
case 4 :
// custom code
$template->assign_var('BANNER_'.$banner_spot.'_IMG', $banners[$i]['banner_name'] );
break;
case 2 :
// Text link
$banner_example = '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_name'].'</a>';
break;
case 0 :
default:
$template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" '.$banner_size.' border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'" /></a>');
}
$banner_show_list.= ', '.$banners[$i]['banner_id'];
}
$last_spot = ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])) ? $banner_spot : $last_spot;
}
$i++;
}
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------------
#
die('Hacking attempt');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
if ($banner_show_list)
{
$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't update banners data", "", __LINE__, __FILE__, $sql);
}
}
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
global $starttime;
#
#-----[ AFTER, ADD ]------------------------------------------------
#
global $HTTP_COOKIE_VARS;
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------------
#
</tr>
</table>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<!-- Banners -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_7_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_8_IMG}</div></td></tr>
</table>
</td>
<td width="60%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_9_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_10_IMG}</div></td></tr>
</table>
</td>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_11_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_12_IMG}</div></td></tr>
</table>
</td>
</tr>
</table>
<!-- End Banners -->
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------------
#
<a name="top"></a>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<!-- Banners -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="3"><div align="center">{BANNER_0_IMG}</div></td>
</tr>
<tr>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_1_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_2_IMG}</div></td></tr>
</table>
</td>
<td width="60%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_3_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_4_IMG}</div></td></tr>
</table>
</td>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_5_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_6_IMG}</div></td></tr>
</table>
</td>
</tr>
</table>
<!-- End Banners -->
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------ \r
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<b>{PAGINATION}</b>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
{BANNER_13_IMG}<br/>
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<b>{PAGINATION}</b>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
{BANNER_14_IMG}<br/>
<!-- End add - Complete banner MOD -->
#
#-----[ FIND ]------------------------------------------------
#
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<td align="left" valign="bottom" colspan="2">{BANNER_15_IMG}</td>
<!-- End add - Complete banner MOD -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
您是說這個嗎??
##############################################################
## MOD Title: Complete banner
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. R鷣) http://mods.db9.dk
## MOD Description: This mod makes it posible to add banners to
## your phpbb2 pages, by default banners are
## placed in top/botton but you may place the
## tags, inside any template file.
## MOD Version: 1.3.2.
## MOD Compatibility: 2.0.0->2.0.6
##
## Installation Level: Easy
## Installation Time: 10 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 10
## viewonline.php
## admin/admin_db_utilities.php
## includes/constants.php
## includes/page_header.php
## includes/page_tail.php
## includes/functions.php
## templates/subSilver/overall_footer.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/viewforum_body.tpl
## templates/subSilver/viewtopic_body.tpl
##
## Included Files: 7
## complete_banner_db_update.php
## root/redirect.php
## root/admin/admin_banner.php
## root/language/lang_english/lang_banner.php
## root/templates/subSilver/redirect.tpl
## root/templates/subSilver/admin/banner_edit_body.tpl
## root/templates/subSilver/admin/banner_list_body.tpl
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod makes it posible to add banners to your phpbb2
## pages, by default banners are placed in top/botton but
## you may place the tags, inside any template file.
## I have given a example with 15 banner placements, you
## may add more in the language file, if you need others the
## text in the language file are only examples, you may change it.
## you may add banners, and define priority and time/day/date
## based rules, to let banners rotate you may also specify who
## may/shall see the banners, e.g. guest only or not admin
## number of clicks and views are counted, and can be viewed
## in ACP - after a user click a banner, you may specify how long time
## before the same users click will be re-counted,
## it is even posible to specify to hide the banner after a user have clicked it.
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 2.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 2.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
## For this MOD, copy lang_*.php file(s) manually from
## their root/language/lang_xxx directories to their respective
## language/lang_xxx directories in the phpBB root dir.
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=1503
##
##############################################################
## MOD History:
##
## 2003-15-11 - Version 1.3.2
## - english language file was missing the $lang['Left_via_banner'], now updated to include this once again
##
## 2003-15-11 - Version 1.3.1
## - added changes ned to functions.php
## - corrected a typo in db_update.php
##
## 2003-15-11 - Version 1.3.0
## - added ability to specify "hide banner after click"
## - added ability to specify "banner click inactive time"
##
## 2003-15-11 - Version 1.2.3
## - changed "'width to 'width
##
## 2003-12-11 - Version 1.2.2
## - a error in admin_banner.php ver 1.2.0./1.2.1. did cause problems - now corrected
##
## 2003-12-11 - Version 1.2.1
## - $lang['Banner_comment_explain']+ $lang['Left_via_banner'] - added
##
## 2003-12-10 - Version 1.2.0
## - added option to change banner size
## - added option to make banners as flash (or other types)
##
## 2003-12-08 - Version 1.1.5
## - phpBB template & EasyMOD compliance enhancement
## - Italian translation now provide with the MOD
##
## 2003-10-25 - Version 1.1.4
## - minor change redirect.php
## - added PAGE_REDIRECT constant
## - added change to viewonline.php
## - corrected how-to header
## - updated lang_banner.php
##
## 2003-10-25 - Version 1.1.3
## - added change to admin_db_utils.php
##
## 2003-08-23 - Version 1.1.2
## - updated redirect.php, db_update.php and constants.php
## - click statistics are now stored
##
## 2003-08-23 - Version 1.1.1
## - updated admin_banner.php, and improved the
## template/lang_banner.php
##
## 2003-08-23 - Version 1.1.0
## - now EM ready
##
## ????-??-?? - Version 1.0.5
## - admin_banner.php, redirect.php updated
##
## ????-??-?? - Version 1.0.4
## - minor typo in the file names, now corrected
##
## ????-??-?? - Version 1.0.3
## - 1.0.2 did require change to page_tail.php witch
## is now included
##
## ????-??-?? - Version 1.0.2
## - now support that banner are to show in a specific forum
##
## ????-??-?? - Version 1.0.1
## - added new feature, banners can show depending
## on user type
##
## ????-??-?? - Version 1.0.0
## - corrected redirect.tpl file, now considered as final
##
## ????-??-?? - Version 0.9.3
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.2
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.1
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.1
## - correction to page_header.php
##
## ????-??-?? - Version 0.9.0
## - initial beta
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy complete_banner_db_update.php to complete_banner_db_update.php
copy root/redirect.php to redirect.php
copy root/admin/admin_banner.php to admin/admin_banner.php
copy root/language/lang_english/lang_banner.php to language/lang_english/lang_banner.php
copy root/templates/subSilver/redirect.tpl to templates/subSilver/redirect.tpl
copy root/templates/subSilver/admin/banner_edit_body.tpl to templates/subSilver/admin/banner_edit_body.tpl
copy root/templates/subSilver/admin/banner_list_body.tpl to templates/subSilver/admin/banner_list_body.tpl
#
# This MOD need a database update.
# Then, as you must have now copied the complete_banner_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir ... update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#
#
# Moreover, because EM 0.0.10a can not already manage files for not
# necessarily existing language, language provide with this MOD can
# not be automatically installed (if I add the above instruction it
# can cause an installation error). So, if you need this language
# copy this file manually.
#
# copy root/language/lang_french/lang_banner.php to language/lang_french/lang_banner.php
# copy root/language/lang_spanish/lang_banner.php to language/lang_spanish/lang_banner.php
#
#
#-----[ OPEN ]------------------------------------------------
#
viewonline.php
#
#-----[ FIND ]------------------------------------------------
#
default:
$location = $lang['Forum_index'];
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Start add - Complete banner MOD
case PAGE_REDIRECT:
require_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_banner.' . $phpEx);
if ($row['session_topic'])
{
$sql = "SELECT banner_description FROM " . BANNERS_TABLE . " WHERE banner_id=" . $row['session_topic'];
if ( $result2 = $db->sql_query($sql) )
{
$banner_data = $db->sql_fetchrow($result2);
}
else
{
message_die(GENERAL_ERROR, 'Could not obtain redirect online information', '', __LINE__, __FILE__, $sql);
}
$location_url = append_sid("redirect.$phpEx?banner_id=" . $row['session_topic']);
$location = $lang['Left_via_banner'] .' --> '.$banner_data['banner_description'];
} else
{
$location_url = "";
$location = $lang['Left_via_banner'];
}
break;
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_db_utilities.php
#
#-----[ FIND ]------------------------------------------------
#
$tables = array(
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
$tables[] = 'banner';
$tables[] = 'banner_stats';
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------------
#
define('PAGE_GROUPCP', -11);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('PAGE_REDIRECT', -1031);
// End add - Complete banner MOD
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------------
#
//
// The following assigns all _common_ variables that may be used at any point
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Start add - Complete banner MOD
$time_now=time();
$hour_now=create_date('Hi',$time_now,$board_config['board_timezone']);
$date_now=create_date('Ymd',$time_now,$board_config['board_timezone']);
$week_now=create_date('w',$time_now,$board_config['board_timezone']);
$sql_level= ($userdata['user_id']==ANONYMOUS) ? ANONYMOUS : (($userdata['user_level']==ADMIN) ? MOD : (($userdata['user_level']==MOD) ? ADMIN : $userdata['user_level']));
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum, banner_type, banner_width, banner_height, banner_filter FROM ".BANNERS_TABLE ."
WHERE banner_active
AND IF(banner_level_type,IF(banner_level_type=1,".intval($sql_level)."<=banner_level,IF(banner_level_type=2,".intval($sql_level).">=banner_level,".intval($sql_level)."<>banner_level)),banner_level=".intval($sql_level).")
AND (banner_timetype=0
OR (( $hour_now BETWEEN time_begin AND time_end) AND ((banner_timetype=2
OR (( $week_now BETWEEN date_begin AND date_end) AND banner_timetype=4)
OR (( $date_now BETWEEN date_begin AND date_end) AND banner_timetype=6)
)))) ORDER BY banner_spot,banner_weigth*SUBSTRING(RAND(),6,2) DESC";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
$banners = array();
$i=0;
while ($banners[$i] = $db->sql_fetchrow($result))
{
\n $cookie_name = $board_config['cookie_name'] . '_b_' . $banners[$i]['banner_id'];
if ( !($HTTP_COOKIE_VARS[$cookie_name] && $banners[$i]['banner_filter']) )
{
$banner_spot=$banners[$i]['banner_spot'];
if ($banner_spot<>$last_spot AND ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])))
{
$banner_size = ($banners[$i]['banner_width'] && $banners[$i]['banner_height']) ? '"width="'.$banners[$i]['banner_width'].'" height="'.$banners[$i]['banner_height'].'"' : '';
switch ($banners[$i]['banner_type'])
{
case 6 :
// swf file
$template->assign_vars(array('BANNER_'.$banner_spot.'_IMG' => '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shoc ... n=6,0,23,0" id=macromedia '.$banner_size.' align="abscenter"><param name=movie value="'.$banners[$i]['banner_name'].'"><param name=quality value=high><embed src="'.$banners[$i]['banner_name'].'" quality=high pluginspage="http://www.macromedia.com/shockwave/dow ... kwaveFlash" type="application/x-shockwave-flash" autostart="true" /><noembed><a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_description'].'</a></noembed></object>'));
break;
case 4 :
// custom code
$template->assign_var('BANNER_'.$banner_spot.'_IMG', $banners[$i]['banner_name'] );
break;
case 2 :
// Text link
$banner_example = '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_name'].'</a>';
break;
case 0 :
default:
$template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" '.$banner_size.' border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'" /></a>');
}
$banner_show_list.= ', '.$banners[$i]['banner_id'];
}
$last_spot = ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])) ? $banner_spot : $last_spot;
}
$i++;
}
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------------
#
die('Hacking attempt');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
if ($banner_show_list)
{
$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't update banners data", "", __LINE__, __FILE__, $sql);
}
}
// End add - Complete banner MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------------
#
global $starttime;
#
#-----[ AFTER, ADD ]------------------------------------------------
#
global $HTTP_COOKIE_VARS;
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------------
#
</tr>
</table>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<!-- Banners -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_7_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_8_IMG}</div></td></tr>
</table>
</td>
<td width="60%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_9_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_10_IMG}</div></td></tr>
</table>
</td>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_11_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_12_IMG}</div></td></tr>
</table>
</td>
</tr>
</table>
<!-- End Banners -->
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------------
#
<a name="top"></a>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<!-- Banners -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="3"><div align="center">{BANNER_0_IMG}</div></td>
</tr>
<tr>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_1_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_2_IMG}</div></td></tr>
</table>
</td>
<td width="60%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_3_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_4_IMG}</div></td></tr>
</table>
</td>
<td width="20%">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr><td><div align="center">{BANNER_5_IMG}</div></td></tr>
<tr><td><div align="center">{BANNER_6_IMG}</div></td></tr>
</table>
</td>
</tr>
</table>
<!-- End Banners -->
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------ \r
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<b>{PAGINATION}</b>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
{BANNER_13_IMG}<br/>
<!-- End add - Complete banner MOD -->
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<b>{PAGINATION}</b>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
{BANNER_14_IMG}<br/>
<!-- End add - Complete banner MOD -->
#
#-----[ FIND ]------------------------------------------------
#
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
<!-- Start add - Complete banner MOD -->
<td align="left" valign="bottom" colspan="2">{BANNER_15_IMG}</td>
<!-- End add - Complete banner MOD -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
架設主機作業系統: linux
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
-
messagebox
- 竹貓忠實會員

- 文章: 981
- 註冊時間: 2003-02-24 23:34
http://mods.db9.dk/viewtopic.php?t=1503
附上這個連結就好~~~
那麼長一串會很難看文章~
/*****這是分格線*****/
首先~~~你有執行complete_banner_db_update.php這檔案嗎~~~
(需使用ADMIN權限登入PHPBB後執行)
[php]
//引述部分程式
if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
[/php]
因為你的錯誤是找不到資料表格~~
附上這個連結就好~~~
那麼長一串會很難看文章~
/*****這是分格線*****/
首先~~~你有執行complete_banner_db_update.php這檔案嗎~~~
(需使用ADMIN權限登入PHPBB後執行)
[php]
//引述部分程式
if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
[/php]
因為你的錯誤是找不到資料表格~~
抱歉我不知道...
我已經執行過了
剛剛已經po過執行顯示出來的字面\r
現在po的是在系統管理內按下banner的字面\r
Warning: main(./../language/lang_chinese_traditional_taiwan/lang_banner.php): failed to open stream: No such file or directory in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
Warning: main(): Failed opening './../language/lang_chinese_traditional_taiwan/lang_banner.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
一般錯誤
Couldn't obtain ranks data
DEBUG MODE
SQL Error : 1146 Table 'mo31.BANNERS_TABLE' doesn't exist
SELECT * FROM BANNERS_TABLE order by banner_spot
Line : 666
File : /usr/home/mo31/www/phpbb3/admin/admin_banner.php
我已經執行過了
剛剛已經po過執行顯示出來的字面\r
現在po的是在系統管理內按下banner的字面\r
Warning: main(./../language/lang_chinese_traditional_taiwan/lang_banner.php): failed to open stream: No such file or directory in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
Warning: main(): Failed opening './../language/lang_chinese_traditional_taiwan/lang_banner.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
一般錯誤
Couldn't obtain ranks data
DEBUG MODE
SQL Error : 1146 Table 'mo31.BANNERS_TABLE' doesn't exist
SELECT * FROM BANNERS_TABLE order by banner_spot
Line : 666
File : /usr/home/mo31/www/phpbb3/admin/admin_banner.php
架設主機作業系統: linux
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
沒有上傳lang_banner.php 或沒上傳到正確位置\r騎狼的林小毛 寫:抱歉我不知道...
我已經執行過了
剛剛已經po過執行顯示出來的字面\r
現在po的是在系統管理內按下banner的字面\r
Warning: main(./../language/lang_chinese_traditional_taiwan/lang_banner.php): failed to open stream: No such file or directory in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
Warning: main(): Failed opening './../language/lang_chinese_traditional_taiwan/lang_banner.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
沒寫入該外掛的SQL語法...所以 BANNERS_TABLE 這個資料表不存在騎狼的林小毛 寫: 一般錯誤
Couldn't obtain ranks data
DEBUG MODE
SQL Error : 1146 Table 'mo31.BANNERS_TABLE' doesn't exist
SELECT * FROM BANNERS_TABLE order by banner_spot
Line : 666
File : /usr/home/mo31/www/phpbb3/admin/admin_banner.php
-
messagebox
- 竹貓忠實會員

- 文章: 981
- 註冊時間: 2003-02-24 23:34
騎狼的林小毛 寫: Warning: main(./../language/lang_chinese_traditional_taiwan/lang_banner.php): failed to open stream: No such file or directory in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
Warning: main(): Failed opening './../language/lang_chinese_traditional_taiwan/lang_banner.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /usr/home/mo31/www/phpbb3/admin/admin_banner.php on line 51
這邊是因為原本的版本沒有中文語系檔案~~
請自行翻譯或是把英文版的丟進去lang_chinese_traditional_taiwan目錄裡
一般錯誤
Couldn't obtain ranks data
DEBUG MODE
SQL Error : 1146 Table 'mo31.BNANERS_TABLE' doesn't exist
SELECT * FROM BANNERS_TABLE order by banner_spot
Line : 666
File : /usr/home/mo31/www/phpbb3/admin/admin_banner.php
常數BNANERS_TABLE沒有宣告~~~~
很神奇的是~~既然這邊會出錯~~照理說你再執行 complete_banner_db_update.php 時也應該出錯~
說明的第300-312行
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
考完試了繼續來玩外掛
各位大大說了那麼多真是感激
不過小弟還是不知道怎麼解決問題ㄋㄟ
說明的第300-312行
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
要改哪一個文件??
這邊是因為原本的版本沒有中文語系檔案~~
請自行翻譯或是把英文版的丟進去lang_chinese_traditional_taiwan目錄裡
哪一個是英文版語系??
我真的是超級笨的辣\r
勞煩大大囉~^^"
各位大大說了那麼多真是感激
不過小弟還是不知道怎麼解決問題ㄋㄟ
說明的第300-312行
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
要改哪一個文件??
這邊是因為原本的版本沒有中文語系檔案~~
請自行翻譯或是把英文版的丟進去lang_chinese_traditional_taiwan目錄裡
哪一個是英文版語系??
我真的是超級笨的辣\r
勞煩大大囉~^^"
架設主機作業系統: linux
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
空間連結:付費空間
上網方式:ADSL(中華滴)
安裝的程式:不知 (真的不知= =)
phpBB2 版本:2.0.11升級2.0.13中\r
論壇網址:www.thunder2.com
includes/constants.php騎狼的林小毛 寫:說明的第300-312行
#
#-----[ FIND ]------------------------------------------------
#
define('USERS_TABLE', $table_prefix.'users');
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD
要改哪一個文件??
root/language/lang_english/lang_banner.php哪一個是英文版語系??
把它放到lang_chinese_traditional_taiwan目錄裡
