Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Aug 18, 2007 7:34 am Reply with quote

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?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Aug 18, 2007 10:11 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Aug 18, 2007 10:25 am Reply with quote

Good idea!
I'm not using a custom_mainfile.php, I'm working in the core mainfile.php Smile
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.
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Aug 18, 2007 10:29 am Reply with quote

Hot diggety dam, I need to learn to read! Embarassed
mainfile.php doesn't call an include to custom_footer.php at all
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Aug 18, 2007 10:29 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sat Aug 18, 2007 10:35 am Reply with quote

Yep I did it as you were posting Smile
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 Smile

Wish I had done this a long time ago Smile
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Aug 18, 2007 11:26 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch
linear-bunch