| :: |
| Author |
Message |
Pisius
Joined: 22 Mar 2008 Posts: 20
|
Posted: Sun Mar 23, 2008 11:46 pm Post subject: Help with inserting ads to my forum |
|
|
I have another dilemma,i want to insert some javascript based ads in my forum, i would like to put some in top, somewhere around below header and some at the bottom of the page. ALso is it possible to insert adds in various places, for example between 2 forums,etc?
Thanks, any help will be appreciated  |
|
|
| Back to top |
|
 |
|
 |
MathieuM. phpBB SEO Team


Joined: 10 Feb 2008 Posts: 698 Location: Rhône-Alpes
|
|
| Back to top |
|
 |
Pisius
Joined: 22 Mar 2008 Posts: 20
|
Posted: Mon Mar 24, 2008 12:26 am Post subject: Re: Help with inserting ads to my forum |
|
|
it looks like this
| Quote: | <center>
<script type='text/javascript'>
var sid = '0000';
var title_color = '000000';
var description_color = '646360';
var link_color = '000000';
var background_color = 'FFFFFF';
var border_color = '646360';
</script><a href='zxxxxx' style='display: none'>xxx</a><script type='text/javascript' src='xxxx'></script>
<a href='xxx' style='color: #000000; font-size: 14px' target='_blank'>xxx</a>
</center> |
do i need to edit something or i can just instert it like that? |
|
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 829
|
|
| Back to top |
|
 |
MathieuM. phpBB SEO Team


Joined: 10 Feb 2008 Posts: 698 Location: Rhône-Alpes
|
Posted: Mon Mar 24, 2008 10:12 am Post subject: Re: Help with inserting ads to my forum |
|
|
Hi,
If you want to add this Javascript in the header :
| Code: | Find:
<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
<div id="message" class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
Before, add:
<center>
<script type='text/javascript'>
var sid = '0000';
var title_color = '000000';
var description_color = '646360';
var link_color = '000000';
var background_color = 'FFFFFF';
var border_color = '646360';
</script><a href='zxxxxx' style='display: none'>xxx</a><script type='text/javascript' src='xxxx'></script>
<a href='xxx' style='color: #000000; font-size: 14px' target='_blank'>xxx</a>
</center>
EoM |
In the footer :
| Code: | Find:
<div class="copyright">
After, add: (no <center> cause the class "copyright" is already centred)
<script type='text/javascript'>
var sid = '0000';
var title_color = '000000';
var description_color = '646360';
var link_color = '000000';
var background_color = 'FFFFFF';
var border_color = '646360';
</script><a href='zxxxxx' style='display: none'>xxx</a><script type='text/javascript' src='xxxx'></script>
<a href='xxx' style='color: #000000; font-size: 14px' target='_blank'>xxx</a>
EoM |
No idea if your JS is ok, but it seems
One more thing, the attribut target='_blank' isn't appreciate by the W3C Validator
Mathieu. |
_________________ [ Site phpBB SEO ] [ Téléchargements ] [ L'annuaire SEO ] [ Venez vous présenter ] [ Fonction Recherche ]
---------------------------
[ phpBB SEO Site ] [ Downloads ] [ SEO Directory ] [ Introduce yourself ] [ Search function ] |
|
| Back to top |
|
 |
Pisius
Joined: 22 Mar 2008 Posts: 20
|
Posted: Mon Mar 24, 2008 3:47 pm Post subject: Re: Help with inserting ads to my forum |
|
|
Thanks a lot once more!
Amm only one more question regarding this,is any way to change that target _blank to be W3 friendly?
Thanks. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
Pisius
Joined: 22 Mar 2008 Posts: 20
|
Posted: Mon Mar 24, 2008 6:17 pm Post subject: Re: Help with inserting ads to my forum |
|
|
what u recon if i put this in .js file and load it with appropriate placement in <head> of the page would it work?
| Quote: |
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;
|
and link would look something like in normal page <a rel=”external” href=”http:/xxxxxxx”>link</a>
EDIT: Implemented and working  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
Posted: Sat Mar 29, 2008 9:26 am Post subject: Re: Help with inserting ads to my forum |
|
|
Within phpBB3, you should use the standardized onload method, to make sure that all JS supposed to be loaded upon page load will, at the end of the <head> section in overall_header.html :
| Code: | function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
onload_functions.push('externalLinks()'); |
 |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
|
|