Loading...
 
Skip to main content

Themes


Adding some phpads banners

I have a number of other sites not using tiki therefore I have an openads (phpads) server. I want to add banners to my new site www.doggipedia.orgQuestion and am struggling. I am new to the css smarty php web! thing although I have been helped a lot here.

  • I started by getting the code and creating a new tpl file to include my banner ads - thought it would be tidyer than putting it in the code. I called this vivTopPageAds.
  • I created a new div tag in the css to layout this div later
  • I copied the tpl files I thought I needed to my custom style folder called doggipedia which is based on twist.


I had earlier inserted a banner directly into header.tpl and that worked fine. This time I want it on the top of every page where the "Welcome to the Doggipedia" goes on the front page - I also want to get rid of that.
I searched for the div that this is enclosed in and found it was probably in tiki-index_p.tpl
I opened that file and included the new tpl in it. I saved this file to the doggipedia folder

but it doesn't work. Am I editing the wrong file? I also tried editing
doggiepedia\templates\styles\doggipedia\tiki-site_header.tpl

After this I also want to put one in the left hand bar so any ideas on the location of that tpl would be good. Is there a page in the documentation telling me what all the components of a standard page are in the tpl files?
thanks so much
Vivienne

<!-- vivTopPageAds -->

<div class = "pageBanner">

THIS IS WHERE THE AD IS

<!-- 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://d657987.i86.quadrahosting.com.au/adjs.php?n=" + phpAds_random); document.write ("&what=zone:2"); document.write ("&exclude=" + document.phpAds_used); if (document.referrer) document.write ("&referer=" + escape(document.referrer)); document.write ("'><" + "/script>");
//-->

<noscript><a href='http://d657987.i86.quadrahosting.com.au/adclick.php?n=afabb41f' target='_blank'><img src='http://d657987.i86.quadrahosting.com.au/adview.php?what=zone:2&n=afabb41f' border='0' alt=''></a></noscript> </div>

<!-- END: vivTopPageAds -->

I then include this using{include file = "vivTopPageAds.tpl}

United States

> I have a number of other sites not using tiki therefore I have an openads (phpads) server. I want to add banners to my new site www.doggipedia.orgQuestion and am struggling. I am new to the css smarty php web! thing although I have been helped a lot here.
>
> *I started by getting the code and creating a new tpl file to include my banner ads - thought it would be tidyer than putting it in the code. I called this vivTopPageAds.


This approach will work. However, you could also simply use Tiki's banner functionality.

> *I created a new div tag in the css to layout this div later
> *I copied the tpl files I thought I needed to my custom style folder called doggipedia which is based on twist.
>
> I had earlier inserted a banner directly into header.tpl and that worked fine. This time I want it on the top of every page where the "Welcome to the Doggipedia" goes on the front page - I also want to get rid of that.
> I searched for the div that this is enclosed in and found it was probably in tiki-index_p.tpl

Nope. I believe the "Welcome to the Doggipedia" is your wiki page description. If you only want the ad to appear in a wiki page, you need to edit tiki-show_page.tpl. To have your include.


However, then the ad appear only on wiki pages. Is this what you want?

If you want the ad to appear on every page, add the include to your Site Identity custom code.

> I opened that file and included the new tpl in it. I saved this file to the doggipedia folder
>
> but it doesn't work. Am I editing the wrong file? I also tried editing
> doggiepedia\templates\styles\doggipedia\tiki-site_header.tpl
>
> After this I also want to put one in the left hand bar so any ideas on the location of that tpl would be good. Is there a page in the documentation telling me what all the components of a standard page are in the tpl files?


For the left hand column, you'll need to:

  1. Create a new module.
  2. Add your include to the module.
  3. Assign the module to the left column (and make it available for anonymous viewers).


You can see an example of a banner zone in a module hereQuestion.


> thanks so much
> Vivienne
>
>
>
> THIS IS WHERE THE AD IS
>
>
>
>
>
>
>
> I then include this using{include file = "vivTopPageAds.tpl}


This is exciting - I half solved this. It is in tiki-show_page.tpl for wiki pages but I am still not sure how to do it on ALL pages
United States

> This is exciting - I half solved this. It is in tiki-show_page.tpl for wiki pages but I am still not sure how to do it on ALL pages


OK, I think I understand now. You want it inside every page — not at the top, right? You'll need to edit tiki.tpl.

Look for the {include file=$mid} statement. This marks the start of the actual page content. Add your banner code before this include.

HTH,

-RickQuestion

Thanks again Rick - Thats what I want - so I will edit the tiki.tpl.

One thing that you did for me which I am really starting to appreciate is create a new style instead of editing the twist theme.

If anyone reads this and is thinking of configuring their site this really makes a huge difference, it is just so easy to get to something workable - just copy the style folder and css you want to a new name, change your site to use this then make whatever changes in these new folders. You cant go wrong then, well I can....

Viv