phpBB Type: Standard phpBB
MODs: No
Your knowledge: Beginner
Board URL: [url]http://[/url]
PHP Version:
MySQL Version:
What was done before the problem appeared?
What was done to try to solve the problem?
De.scription and Message
#############################################################################################################
## MOD Title: Adverts In Posts
## MOD Author: Dale Rodgers < http://www.tntboards.com
## MOD De.scription: Automatically displays an advert in a topic as a post.
## MOD Version : 1.3.7
##
## Installation Level : Easy
##
## Installation Time : ~30 Secs
##
## Files To Edit : viewtopic.php
##
##
## Included Files : None
##
##
############################################################################################################
## For Security Purposes, Please Check: http://www.phpbbhacks.com/allhacks.php 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.phpbbhacks.com/allhacks.php
############################################################################################################
## Author Notes:
## This MOD was made to have adverts on your forum without ruining the design or looking nasty.
##
## - Abilty to change the advert
## - Ability to change how many ads are displayed per topic
############################################################################################################
## Other Notes:
## You need to replace Ad Code Here with your ad code.
############################################################################################################
############################################################################################################
## MOD History:
##
##
## 2005-02-06 - Version 1.3.7
## - First release of the MOD
##
##
############################################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
############################################################################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
#
#-----[ FIND ]------------------------------------------
#
'U_POST_ID' => $postrow[$i]['post_id'])
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if($i == $ad_after)
{
$row_color = ( !($num % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$num ++;
$mini_post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['post_id']) . '#ad';
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'POST_DATE' => $post_date,
'POST_SUBJECT' => 'Advertisement',
'MINI_POST_IMG' => $mini_post_img,
'POSTER_NAME' => 'Advertisement',
'POSTER_RANK' => 'Advertiser',
'MESSAGE' => '<div>Ad code here</div>',
'L_MINI_POST_ALT' => $mini_post_alt,
'U_MINI_POST' => $mini_post_url,
'U_POST_ID' => 'ad')
);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM