| Author |
Message |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Sat Aug 18, 2007 7:34 am |
|
I seem to be acumulating more ads on my site which I'm placing in the custom_footer.php file.
This file is 'included' by mainfile.
I thought it might be a simple matter of wrapping the include like this
| Code: |
if(!is_user($user)) {
@include_once(INCLUDE_PATH.'includes/custom_files/custom_mainfile.php');
} |
But that still displays the content of custom_footer regardless of whether I am logged in or not.
Although I was pretty sure the is_user function would be loaded before it gets to the include I tried moving the include to the bottom of mainfile to be sure but that didn't work either.
Anyone have any ideas? |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Sat Aug 18, 2007 10:11 am |
|
Actually, custom_footer.php has to be called from footer.php. But, I checked, and it has $user in the globals statement, so that it odd.
I am confused by your including of custom_mainfile.php. Isn't that included within mainfile.php?
I would think that if you wrapped your ad code within custom_footer.php with the if (!is_user($user)) statement should work. However, you might want to just try and also add at the top of custom_footer.php a
global $user
Just to be sure it also gets here. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Sat Aug 18, 2007 10:25 am |
|
Good idea!
I'm not using a custom_mainfile.php, I'm working in the core mainfile.php
I'll take a look at footer.php because mainfile seems to be including it with an if file exist, then include it.
The problem is that custom_footer.php has both php and plain html code in it so it drops in and out of the parser (there a fair amount of jaba stuff which I don't really want to convert).
As it drops out of the parser I cannot therefore use a php function to wrap it - atleast I don't think you can as it didn't work.
I thought the easiest way therefore would be to just add an is_user check before actually including the file at all but strangely that failed.
I'll definitely look into global $user and maybe add it again - thanks for that. |
| |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Sat Aug 18, 2007 10:29 am |
|
Hot diggety dam, I need to learn to read!
mainfile.php doesn't call an include to custom_footer.php at all |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Sat Aug 18, 2007 10:29 am |
|
Custom_footer.php is included within footer.php, so within the foot() function, just wrap that include? |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Sat Aug 18, 2007 10:35 am |
|
Yep I did it as you were posting
Thats better, users now do not have to see all the garbage in the footer but the search engines can.
I just need to tweak the existing 'real' footer to get the linkbacks for yours and Kev's site.
Hmm, in fact I'm going to create another custom_footer so I can use one for SEO and paid for text links and the other for users
Wish I had done this a long time ago  |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Sat Aug 18, 2007 11:26 am |
|
No worries m8. Glad its working! |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
|
|