! .
(phpbb). Banners (, , ..).

(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




.

(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

DEMO ( )

#
#-----[ ]-----
#
viewonline.php

#
#-----[ ]-----
#
default:
$location = $lang['Forum_index'];

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

// 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

#
#-----[ ]------
#
admin/admin_db_utilities.php

#
#-----[ ]------
#
$tables = array(

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

// Start add - Complete banner MOD
$tables[] = 'banner';
$tables[] = 'banner_stats';
// End add - Complete banner MOD

#
#-----[ ]------
#
includes/constants.php

#
#-----[ ]------
#
define('PAGE_GROUPCP', -11);

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

// Start add - Complete banner MOD
define('PAGE_REDIRECT', -1031);
// End add - Complete banner MOD

#
#-----[ ]-------
#
define('USERS_TABLE', $table_prefix.'users');

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

// Start add - Complete banner MOD
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
define('BANNERS_TABLE', $table_prefix.'banner');
// End add - Complete banner MOD

#
#-----[ ]------
#
includes/page_header.php

#
#-----[ ]------
#
//
// The following assigns all _common_ variables that may be used at any point

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

// 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))
{
$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 = '';
$banner_size = ( ($banners[$i]['banner_width'] == '') || ($banners[$i]['banner_width'] == '0') ) ? '' : ' width="' . $banners[$i]['banner_width'] . '"';
$banner_size .= ( ($banners[$i]['banner_height'] == '') || ($banners[$i]['banner_height'] == '0') ) ? '' : ' 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/shockwave/cabs/flash/swflash.cab#version=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/download/index.cgi?P1_Prod_Version=ShockwaveFlash" 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
$template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'">'.$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

#
#-----[ ]------
#
includes/page_tail.php

#
#-----[ ]------
#
die('Hacking attempt');
}

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

// 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


#
#-----[ ]------
#
includes/functions.php

#
#-----[ ]------
#
global $starttime;

#
#-----[ ]------
#
global $HTTP_COOKIE_VARS;

#
#-----[ ]-----
#
templates/subSilver/overall_footer.tpl

#
#-----[ ]-----
#
</tr>
</table>

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

<!-- 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 -->

#
#-----[ ]------
#
templates/subSilver/overall_header.tpl

#
#-----[ ]------
#
<a name="top"></a>

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

<!-- 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 -->

#
#-----[ ]------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ ]------
#
<b>{PAGINATION}</b>

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

<!-- Start add - Complete banner MOD -->
{BANNER_13_IMG}<br/>
<!-- End add - Complete banner MOD -->

#
#-----[ ]------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ ]------
#
<b>{PAGINATION}</b>

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

<!-- Start add - Complete banner MOD -->
{BANNER_14_IMG}<br/>
<!-- End add - Complete banner MOD -->

#
#-----[ ]-----
#
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}

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

<!-- Start add - Complete banner MOD -->
<td align="left" valign="bottom" colspan="2">{BANNER_15_IMG}</td>
<!-- End add - Complete banner MOD -->

#
#-----[ ]-----
#
MOD .

complete_banner_db_update.php.

complete_banner_db_update.php .

http://www. .xxx/ /complete_banner_db_update.php

, !


DEMO ( )




/ /
: Genius_m
23:29 22-09-2010
...
1