help with phpBB ads

Status
Not open for further replies.

falken

New Member
Messages
8
Reaction score
0
Points
0
hi sry about this but i'm totally new to php coding and i need to know how to add the corporate ad codes to my phpbb2 message board before i get suspended.

thanks a million
 

Master Yoda

New Member
Messages
398
Reaction score
0
Points
0
Mike-lane said:
...or you could mod the template file.

Exactly which template files??

Also will it work with the phpbb3 BETA1 which I'm currently putting on my account?
 

randomize

New Member
Messages
674
Reaction score
0
Points
0
You should just mod the template file, for the template you are using.

The template file should be located in:

/public_html/your forum directory here/templates/your forum template name here/overall_header.tpl

Code Example Below:
Code:
[COLOR=#000000]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" [/COLOR][COLOR=#000000]
"[URL="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xmlns="[URL="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/URL]" dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="Author" content="[URL="http://www.phpbbstyles.com"]http://www.phpbbstyles.com[/URL]" />
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="{T_TEMPLATE_PATH}/style_{TPL_COLOR}.css" type="text/css" />
<style type="text/css">
<!--
@import url("{T_TEMPLATE_PATH}/formIE.css"); 
-->
</style>
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
{CA_XS_COMMENT_JS_START}
if ( {PRIVATE_MESSAGE_NEW_FLAG} )
{
 window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
{CA_XS_COMMENT_JS_END}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<script language="javascript" type="text/javascript">
<!--[/COLOR]
[COLOR=#000000]var PreloadFlag = false;[/COLOR][COLOR=#000000]
var expDays = 90;
var exp = new Date(); 
var tmp = '';
var tmp_counter = 0;
var tmp_open = 0;[/COLOR]
[COLOR=#000000]exp.setTime(exp.getTime() + (expDays*24*60*60*1000));[/COLOR]
[COLOR=#000000]function SetCookie(name, value) [/COLOR][COLOR=#000000]
{
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape(value) +
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
 ((path == null) ? "" : ("; path=" + path)) +
 ((domain == null) ? "" : ("; domain=" + domain)) +
 ((secure == true) ? "; secure" : "");
}[/COLOR]
[COLOR=#000000]function getCookieVal(offset) [/COLOR][COLOR=#000000]
{
var endstr = document.cookie.indexOf(";",offset);
if (endstr == -1)
{
 endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset, endstr));
}[/COLOR]
[COLOR=#000000]function GetCookie(name) [/COLOR][COLOR=#000000]
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) 
{
 var j = i + alen;
 if (document.cookie.substring(i, j) == arg)
  return getCookieVal(j);
 i = document.cookie.indexOf(" ", i) + 1;
 if (i == 0)
  break;
} 
return null;
}[/COLOR]
[COLOR=#000000]function ShowHide(id1, id2, id3) [/COLOR][COLOR=#000000]
{
var res = expMenu(id1);
if (id2 != '') expMenu(id2);
if (id3 != '') SetCookie(id3, res, exp);
}
 
function expMenu(id) 
{
var itm = null;
if (document.getElementById) 
{
 itm = document.getElementById(id);
}
else if (document.all)
{
 itm = document.all[id];
} 
else if (document.layers)
{
 itm = document.layers[id];
}
if (!itm) 
{
 // do nothing
}
else if (itm.style) 
{
 if (itm.style.display == "none")
 { 
  itm.style.display = ""; 
  return 1;
 }
 else
 {
  itm.style.display = "none"; 
  return 2;
 }
}
else 
{
 itm.visibility = "show"; 
 return 1;
}
}[/COLOR]
[COLOR=#000000]//-->[/COLOR][COLOR=#000000]
</script>
</head>
<body>
<a name="top"></a>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
<td width="15" class="border-left"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="15" height="1" alt="" /></td>
<td width="100%" class="content" valign="top"><div class="border-over">
 <div class="logo"><a href="{U_INDEX}"><img src="{T_TEMPLATE_PATH}/images/logo.gif" height="66" alt="{L_INDEX}" /></a></div>
 <div class="buttons-bg1"><div class="buttons-bg1a"><div class="buttons-bg1b"><table border="0" align="center" cellspacing="0" cellpadding="0" class="buttons-table">
 <tr>
  <td width="25" class="buttons-border"><img src="{T_TEMPLATE_PATH}/images/{TPL_COLOR}/buttons_left2.gif" width="25" height="28" alt="" /></td>
  <td nowrap="nowrap" class="buttons-buttons">
   <!-- BEGIN switch_user_logged_out -->
   &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a>&nbsp; | 
   <!-- END switch_user_logged_out -->
   &nbsp;<a href="{U_FAQ}">{L_FAQ}</a>&nbsp; | 
   &nbsp;<a href="{U_SEARCH}">{L_SEARCH}</a>&nbsp; | 
   &nbsp;<a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a>&nbsp; | 
   &nbsp;<a href="{U_GROUP_CP}">{L_USERGROUPS}</a>&nbsp; | 
   <!-- BEGIN switch_user_logged_in -->
   &nbsp;<a href="{U_PROFILE}">{L_PROFILE}</a>&nbsp; | 
   &nbsp;<a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}{C_PM}</a>&nbsp; | 
   <!-- END switch_user_logged_in -->
   &nbsp;<a href="{U_LOGIN_LOGOUT}">{CA_L_LOGIN_LOGOUT}</a>&nbsp;
  </td>
  <td width="25" class="buttons-border"><img src="{T_TEMPLATE_PATH}/images/{TPL_COLOR}/buttons_right2.gif" width="25" height="28" alt="" /></td>
 </tr>
 </table></div></div></div>[/COLOR]
[COLOR=#000000]</div>[/COLOR]
[COLOR=#000000]<!-- BEGIN switch_xs_enabled -->[/COLOR][COLOR=#000000]
<?php if($this->vars['CA_NEW_MSGS'] && $this->vars['PRIVATE_MESSAGE_INFO'] !== $this->vars['CA_L_NO_MSG'] && !defined('CA_POPUP_SHOWED')) { ?>
<div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{PRIVATE_MESSAGE_INFO}</a></div>
<?php define('CA_POPUP_SHOWED', true); } ?>
<!-- END switch_xs_enabled -->[/COLOR]
[COLOR=#000000]<!-- BEGIN ca_new_privmsgs -->[/COLOR][COLOR=#000000]
{CA_XS_COMMENT_START}<div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{ca_new_privmsgs.TEXT}</a></div>{CA_XS_COMMENT_END}
<!-- END ca_new_privmsgs -->[/COLOR]
[COLOR=#000000][COLOR=red]<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>[/COLOR][/COLOR][COLOR=#000000][COLOR=red]
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
 
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("[/COLOR][URL="http://x10hosting.com/advert/adjs.php?n"][COLOR=red]http://x10hosting.com/advert/adjs.php?n[/COLOR][/URL][COLOR=red]=" + phpAds_random);[/COLOR][COLOR=red]
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
 document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>[/COLOR]
[/COLOR]

Then just click on Edit this file in the top right, and insert the ad code right at the top, or in a relevant place for your template.

Notice in the example above the ad code is placed at the bottom of the file, in the Template Artimis

Working Example:
http://forums.sapiencreations.x10hosting.com

(Remember, ads must be placed at the top, without having to scroll down)

Hope this helps :S
 

Master Yoda

New Member
Messages
398
Reaction score
0
Points
0
randomize said:


Hope this helps :S

It does but what about users like myself on the advanced rather than coprate??

and can that be placed up the very top as well or is it specific??
 

randomize

New Member
Messages
674
Reaction score
0
Points
0
I am not entirely sure about that, you could try editing the header, so that along with the PM, login links etc at the top, you could try and put a link in there, that directs to X10.


It might work, I can have a look for you!

EDIT:

Amended Code for you Advanced users:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="Author" content="http://www.phpbbstyles.com" />
{META}
{NAV_LINKS}
<title>{SITENAME} :: {PAGE_TITLE}</title>
<link rel="stylesheet" href="{T_TEMPLATE_PATH}/style_{TPL_COLOR}.css" type="text/css" />
<style type="text/css">
<!--
@import url("{T_TEMPLATE_PATH}/formIE.css"); 
-->
</style>
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
{CA_XS_COMMENT_JS_START}
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
{CA_XS_COMMENT_JS_END}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<script language="javascript" type="text/javascript">
<!--

var PreloadFlag = false;
var expDays = 90;
var exp = new Date(); 
var tmp = '';
var tmp_counter = 0;
var tmp_open = 0;

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function SetCookie(name, value) 
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function getCookieVal(offset) 
{
	var endstr = document.cookie.indexOf(";",offset);
	if (endstr == -1)
	{
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) 
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break;
	} 
	return null;
}

function ShowHide(id1, id2, id3) 
{
	var res = expMenu(id1);
	if (id2 != '') expMenu(id2);
	if (id3 != '') SetCookie(id3, res, exp);
}
	
function expMenu(id) 
{
	var itm = null;
	if (document.getElementById) 
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	} 
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	if (!itm) 
	{
		// do nothing
	}
	else if (itm.style) 
	{
		if (itm.style.display == "none")
		{ 
			itm.style.display = ""; 
			return 1;
		}
		else
		{
			itm.style.display = "none"; 
			return 2;
		}
	}
	else 
	{
		itm.visibility = "show"; 
		return 1;
	}
}

//-->
</script>
</head>
<body>
<a name="top"></a>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr>
	<td width="15" class="border-left"><img src="{T_TEMPLATE_PATH}/images/spacer.gif" width="15" height="1" alt="" /></td>
	<td width="100%" class="content" valign="top"><div class="border-over">
		<div class="logo"><a href="{U_INDEX}"><img src="{T_TEMPLATE_PATH}/images/logo.gif" height="66" alt="{L_INDEX}" /></a></div>
		<div class="buttons-bg1"><div class="buttons-bg1a"><div class="buttons-bg1b"><table border="0" align="center" cellspacing="0" cellpadding="0" class="buttons-table">
		<tr>
			<td width="25" class="buttons-border"><img src="{T_TEMPLATE_PATH}/images/{TPL_COLOR}/buttons_left2.gif" width="25" height="28" alt="" /></td>
			<td nowrap="nowrap" class="buttons-buttons">
				<!-- BEGIN switch_user_logged_out -->
				&nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a>&nbsp; | 
				<!-- END switch_user_logged_out -->
				&nbsp;<a href="{U_FAQ}">{L_FAQ}</a>&nbsp; | 
				&nbsp;<a href="{U_SEARCH}">{L_SEARCH}</a>&nbsp; | 
				&nbsp;<a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a>&nbsp; | 
				&nbsp;<a href="{U_GROUP_CP}">{L_USERGROUPS}</a>&nbsp; | 
				<!-- BEGIN switch_user_logged_in -->
				&nbsp;<a href="{U_PROFILE}">{L_PROFILE}</a>&nbsp; | 
				&nbsp;<a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}{C_PM}</a>&nbsp; | 
				<!-- END switch_user_logged_in -->
				&nbsp;<a href="{U_LOGIN_LOGOUT}">{CA_L_LOGIN_LOGOUT}</a>&nbsp;
			</td>
			<td width="25" class="buttons-border"><img src="{T_TEMPLATE_PATH}/images/{TPL_COLOR}/buttons_right2.gif" width="25" height="28" alt="" /></td>
		</tr>
		</table></div></div></div>

	</div>

	<!-- BEGIN switch_xs_enabled -->
	<?php if($this->vars['CA_NEW_MSGS'] && $this->vars['PRIVATE_MESSAGE_INFO'] !== $this->vars['CA_L_NO_MSG'] && !defined('CA_POPUP_SHOWED')) { ?>
	<div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{PRIVATE_MESSAGE_INFO}</a></div>
	<?php define('CA_POPUP_SHOWED', true); } ?>
	<!-- END switch_xs_enabled -->

	<!-- BEGIN ca_new_privmsgs -->
	{CA_XS_COMMENT_START}<div id="newmsgs"><a href="{U_PRIVATEMSGS}" class="newmsgs">{ca_new_privmsgs.TEXT}</a></div>{CA_XS_COMMENT_END}
	<!-- END ca_new_privmsgs -->

[B][COLOR="Red"]<center><script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
	if (!document.phpAds_used) document.phpAds_used = ',';
	phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

	document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
	document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
	document.write ("&amp;what=zone:3&amp;target=_blank");
	document.write ("&amp;exclude=" + document.phpAds_used);
	if (document.referrer)
		document.write ("&amp;referer=" + escape(document.referrer));
	document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a915c788' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788' border='0' alt=''></a></noscript></center>
[/COLOR][/B]

Again, Place at the bottom of the code and the Link will appear in the gap above all your areas in the forums. Just like the ads on

http://forums.sapiencreations.x10hosting.com

except your version will be a text link!

Again, hope this helps!
 
Last edited:

Master Yoda

New Member
Messages
398
Reaction score
0
Points
0
As soon as I get it running I'll post a li nk to my forums :biggrin:

and thanks for the code..just checking, the same file as above??

EDIT: btw randomize, the forum link the the post above this one doesn't work
 
Last edited:

falken

New Member
Messages
8
Reaction score
0
Points
0
yes this works! thank you very much randomize! all my points for you ( a measly 77.15 but its all i got)
 
Status
Not open for further replies.
Top