kidzior Wysłany: Sob 21 Kwi, 2007 |
|
|
This modification allows You to put any banner under any post in Your Forum.
Kod###################################################################
## Translate: kidzior www.niezal.org
## Installation Level: Easy
## Installation Time: 11 minutes
## Files To Edit: viewtopic.php
## includes/constants.php
## templates/subSilver/overall_header.tpl
## templates/subSilver/viewtopic_body.tpl
## language/lang_english/lang_admin.php
## Included Files: (admin_firstpost_ad.php, firstpost_ad_body.tpl)
###################################################################
#
#-----[ SQL ]------------------------------------------
#
CREATE TABLE `phpbb_ads` (
`ad_type` VARCHAR( 10 ) NOT NULL ,
`ad_id` TINYINT( 5 ) NOT NULL ,
`ad_code` TEXT NOT NULL ,
`ad_name` TINYINT( 25 ) NOT NULL,
UNIQUE (
`ad_id`
)
);
#
#-----[ COPY ]------------------------------------------
#
kopiuj firstpost_ad_body.tpl do templates/subSilver/admin/firstpost_ad_body.tpl
kopiuj admin_firstpost_ad.php do admin/admin_firstpost_ad.php
#
#-----[ Open ]------------------------------------------
#
viewtopic.php
#
#-----[ Find ]------------------------------------------
#
// Helped end
#
#-----[ Add after ]------------------------------------------
#
$display_ad = false;
if ($board_config['ad_forums'] == 'all'){
$display_ad = true;
}else{
$ad_forums = explode(",", $board_config['ad_forums']);
for ($a=0; $a < count($ad_forums); $a++){
if ($forum_id == $ad_forums[$a]){
$display_ad = true;
break;
}
}
}
if ($display_ad){
if ($board_config['ad_who'] == 'all' || ($board_config['ad_who'] == 'guest' && $userdata['user_id'] == -1) || ($board_config['ad_who'] == 'reg' && $userdata['user_id'] != -1))
{
if (($board_config['ad_after_post'] != 0 && $i == $board_config['ad_after_post'] - 1)||($board_config['ad_every_post'] != 0 && ($i + 1) % $board_config['ad_every_post'] == 0))
{
$sql = "SELECT a.ad_code
FROM " . ADS_TABLE . " a
WHERE a.ad_id=1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query ad information', '', __LINE__, __FILE__, $sql);
}
$adRow = array();
while( $row = $db->sql_fetchrow($result) )
{
$adRow[] = $row;
}
$db->sql_freeresult($result);
$post_ad = '<tr><td colspan=2 class="firstPostAd">' . $adRow[0]['ad_code'] . '</td></tr>';
}
else
{
$post_ad = ' ';
}
}
}
#
#-----[ Find ]------------------------------------------
#
'DELETE' => $delpost,
#
#-----[ After add ]------------------------------------------
#
'POST_AD' => $post_ad,
#
#-----[ Open ]------------------------------------------
#
includes/constants.php
#
#-----[ Find ]------------------------------------------
#
define('VOTE_USERS_TABLE', $table_prefix . 'vote_voters');
#
#-----[ After add ]------------------------------------------
#
define('ADS_TABLE', $table_prefix.'ads');
#
#-----[ Open ]------------------------------------------
#
templates/subSilver/subSilver.css
#
#-----[ Find ]------------------------------------------
#
.helpline { background-color: {T_TR_COLOR2}; border-style: none; }
#
#-----[ After add ]------------------------------------------
#
td.firstPostAd {
background-color: {T_TR_COLOR3}; border: {T_TH_COLOR3}; border-style: solid; border-width: 1px; text-align: center;
}
#
#-----[ Open ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ Find ]------------------------------------------
#
<!-- END postrow -->
#
#-----[ Before add ]------------------------------------------
#
{postrow.POST_AD}
#
#-----[ Open ]------------------------------------------
#
language/lang_polish/lang_admin.php
#
#-----[ Find ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ Before add ]------------------------------------------
#
$lang['ad_managment'] = 'Banner po poscie';
$lang['first_post_ad'] = 'Konfiguracja';
$lang['firstpost_ad'] = 'Konfiguracja modulu.';
$lang['Click_return_firstpost'] = 'Kliknij %stutaj%s by powrocic do konfiguracji';
$lang['ad_after_post'] = 'Dodawaj zawsze po x poscie';
$lang['ad_every_post'] = 'Dodawaj zawsze po x postach';
$lang['ad_display'] = 'Pokazuj';
$lang['ad_all'] = 'Wszystkim';
$lang['ad_reg'] = 'Zarejestrowanym';
$lang['ad_guest'] = 'Goscia';
$lang['ad_forums'] = 'Wyswietlaj w forach';
$lang['ad_code'] = 'Kod';
#
#-----[ Open ]------------------------------------------
#
admin/modules_data.php
#
#-----[ Find ]------------------------------------------
#
'Poll Admin' => array(
'Poll Results' => array("admin_voting.$phpEx", 55),
),
#
#-----[ After add ]------------------------------------------
#
'Banner pod X postem' => array(
'ad_managment' => array("admin_firstpost_ad.$phpEx", 80),
),
#
#-----[ Open ]------------------------------------------
#
admin/admin_firstpost_ad.php
#
#-----[ Find ]------------------------------------------
#
define('IN_PHPBB', 1);
#
#-----[ Before add ]------------------------------------------
#
define('MODULE_ID', 80);
##############
## Save and close all files
Still not working? Try to:
Wiadomo?? ukryta / Hidden messageAby zobaczy? wiadomo?? postaw piwo autorowi piwo. KodSQL:
INSERT INTO `phpbb_ads` ( `ad_type` , `ad_id` , `ad_code`, `ad_name` )
VALUES (
'first_post', '1', '<script type="text/javascript"><!--
google_ad_client = "pub-2930568312118905";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_ad_type = "text_image";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
google_color_border = "336699";
google_color_bg = "FFFFFF";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>', 'Defualt'
);
INSERT INTO `phpbb_config` ( `config_name` , `config_value` )
VALUES (
'ad_after_post', '1'
);
INSERT INTO `phpbb_config` ( `config_name` , `config_value` )
VALUES (
'ad_every_post', '0'
);
INSERT INTO `phpbb_config` ( `config_name` , `config_value` )
VALUES (
'ad_who', 'all'
);
INSERT INTO `phpbb_config` ( `config_name` , `config_value` )
VALUES (
'ad_forums', 'all'
);
Image: http://mody.lastinn.info/download-id_251.html |
|