Help with inserting ads to my forum

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

Help with inserting ads to my forum

Postby Pisius » Sun Mar 23, 2008 11:46 pm

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 :)
Pisius
 
Posts: 20
Joined: Sat Mar 22, 2008 2:56 pm

Advertisement

Postby MathieuM. » Mon Mar 24, 2008 12:19 am

Hi,

Give us more details about the JavaScript :wink:
But it's possible to add them in the overall_header, under your logo image, and another one at the bottom of pages.

Then, to insert adds between 2 forums, without a MOD, don't think it's possible...


Mathieu.
Tennis et Actualité du tennis sur lemondedutennis.com ;)
User avatar
MathieuM.
phpBB SEO Team
phpBB SEO Team
 
Posts: 1469
Joined: Sun Feb 10, 2008 9:33 pm
Location: Rhône-Alpes

Postby Pisius » Mon Mar 24, 2008 12:26 am

it looks like this
<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?
Pisius
 
Posts: 20
Joined: Sat Mar 22, 2008 2:56 pm

Postby HB » Mon Mar 24, 2008 2:18 am

Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1509
Joined: Mon Oct 16, 2006 2:25 am

Postby MathieuM. » Mon Mar 24, 2008 10:12 am

Hi,

If you want to add this Javascript in the header :

Code: Select all
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: Select all
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 :wink:
One more thing, the attribut target='_blank' isn't appreciate by the W3C Validator


Mathieu.
Tennis et Actualité du tennis sur lemondedutennis.com ;)
User avatar
MathieuM.
phpBB SEO Team
phpBB SEO Team
 
Posts: 1469
Joined: Sun Feb 10, 2008 9:33 pm
Location: Rhône-Alpes

Postby Pisius » Mon Mar 24, 2008 3:47 pm

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.
Pisius
 
Posts: 20
Joined: Sat Mar 22, 2008 2:56 pm

Postby dcz » Mon Mar 24, 2008 4:45 pm

It's usable in XHTML 1.0 transitional, but not in strict.

There is no real point to go for strict standard and use blank target, but you can still use some JS to do the trick.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Postby Pisius » Mon Mar 24, 2008 6:17 pm

what u recon if i put this in .js file and load it with appropriate placement in <head> of the page would it work?

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>
:roll:


EDIT: Implemented and working :)
Pisius
 
Posts: 20
Joined: Sat Mar 22, 2008 2:56 pm

Postby dcz » Sat Mar 29, 2008 9:26 am

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: Select all
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 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21376
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 100 guests