[Beta] Banner displayed inside topics

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
kolczyk
Registered User
Posts: 73
Joined: Sat Dec 14, 2002 8:57 pm

[Beta] Banner displayed inside topics

Post by kolczyk »

Code: Select all

############################################################## 
## MOD Title: Banner inside topic
## MOD Author: Kamil Gulczuk <elektroda@elektroda.pl>
## MOD Description: This mod will put banner beetwen messages
## MOD Version: 0.0.1
## 
## Installation Level: Easy
## Installation Time: 3 Minutes 
## Files To Edit: viewtopic_body.tpl, 
##                viewtopic.php

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

viewtopic.php


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

//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
for($i = 0; $i < $total_posts; $i++)
{

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

if (mt_rand(1,7) == 1) { 
 	
$banner = "</tr></td></table><br><center><script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");
   document.write (\"http://www.elektroda.net/adclick/adjs.php?n=afb49d06\");
   document.write (\"&what=zone:2&target=_blank\");
   document.write (\"&exclude=\" + document.phpAds_used);
   document.write (\"'><\" + \"/script>\");
//-->
</script></center><br><table class=\"forumline\" width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\">"; 
    }

else { $banner = "</tr></td>"; }

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

'POSTER_NAME' => $poster,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#


'BANNER' => $banner,

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

viewtopic_body.tpl

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

<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></tr></td>

# 
#-----[ REPLACE BY ]------------------------------------------ 
#

	<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" />{postrow.BANNER}

 
$banner - here put banner code (in this mod we have an example how to use phpAdsNew) or GOOGLE ADWORDS(sic!)
(mt_rand(1,7) == 1) - change 7 to ex. 2 if you want display own banner more often

DEMO:
http://www.edaboard.com
http://www.elektroda.pl/rtvforum
Image
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

Fine but 2 things :
- you are using HTML/Javascript into PHP files, but to make a correct MOD, you need to put the HTML/Javascript code into the template files
- what is that :

Code: Select all

document.write (\"http://www.elektroda.net/adclick/adjs.php?n=afb49d06\"); 
what will happen if www.elektroda.net stop to exist :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
kolczyk
Registered User
Posts: 73
Joined: Sat Dec 14, 2002 8:57 pm

Post by kolczyk »

- you are using HTML/Javascript into PHP files, but to make a correct MOD, you need to put the HTML/Javascript code into the template files


yes you have right, but I don't know how to exactly make that...
- what is that :


This is java code generated by phpadsnew, maybe this is for analyze number of clicks
what will happen if www.elektroda.net stop to exist


nothing, just stopped apache and page was loaded but with small space beetween messages sometimes
the problem can be worst when banner server will be very slowly
Post Reply

Return to “[2.0.x] MODs in Development”