Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 11:08 am EDT

Geeklog Forums

Alternative header...


Status: offline

orfilms

Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
Ok here's the problem... I have some ads that cause the story editor not to work sometimes. The ads are contained in the HEAD section of the header. I was wondering if for the ADMIN areas of the geeklog site if I could make geeklog call an alternative header template file (sans advertisements)?


I know I saw something like this done with the advanced story editor header code in the CVS version, but I'm not going to try to play with the CVS code...
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
Quote by orfilms: Ok here's the problem... I have some ads that cause the story editor not to work sometimes. The ads are contained in the HEAD section of the header. I was wondering if for the ADMIN areas of the geeklog site if I could make geeklog call an alternative header template file (sans advertisements)?


I know I saw something like this done with the advanced story editor header code in the CVS version, but I'm not going to try to play with the CVS code...


You can actually use PHP in your header.thtml file.

Here is something I just adapted from my site that should work.
Text Formatted Code

<?php
    $clicked = "http://";
    $clicked .= $_SERVER['HTTP_HOST'];
    $clicked .= $_SERVER['REQUEST_URI'];
    $siteurl = $_CONF['site_url']."/";
    $address = array('admin');
    if (!empty( $address )){
        foreach ($address as $val){
            if (eregi($val, $clicked)) {
               $showad = 'false';
           }else if($showad != 'false') {
               $showad = 'true';
             }
         }    
    If ($showad == 'true'){
    echo 'your ad code here';
    }
?>

 


It's a bit more complex then you really need, but I wrote it super fast. If you didn't want to show the ads on other pages just add something unique about the url for that page to the $address array. For instance if you didn't want the ad to show on the admin section and the forums you would put $address = array('admin', 'forum');

Good luck and just as an fyi I just tested the code above very shortly but I adapted it from something that has been working flawlessly for quite awhile now. Not 100% sure but I believe I got the original code, which I edited quite a bit, from a theme by machinari.

I know a way to actually show an alternate header like you actually asked for, but it is a bit more complicated, and I am not about to go into that until I have a few more cups of coffee.

Good Luck!
Yes I am mental.
 Quote

Status: offline

orfilms

Forum User
Regular Poster
Registered: 08/02/05
Posts: 70
That may work but my ad code has a lot of the ' character in it, how ould I accomidate that?
 Quote

Status: offline

drshakagee

Forum User
Full Member
Registered: 10/01/03
Posts: 231
Quote by orfilms: That may work but my ad code has a lot of the ' character in it, how ould I accomidate that?


Put a backslash in front of each one in your code.
Yes I am mental.
 Quote

All times are EDT. The time is now 11:08 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content