Reply
how to add bar at top of all sites pages?
Old 11-28-2007, 11:35 AM how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
Okay i want to add a info bar with links and stuff to ALL sites i own exactly like sites like hotscripts etc have.

But how can i do with without editing all my sites (often which means finding the exact template file)

at first i though of the PHP ini thing to include a script at the begining of all sccripts. but if im echoing content surly my scripts (like my mybb forum) would throw up errors etc because of sessions function etc and headers

so how is the best done and how can be done easily.

Thanks,
Dan
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
When You Register, These Ads Go Away!
     
Old 11-28-2007, 11:46 AM Re: how to add bar at top of all sites pages?
Nathand's Avatar
Extreme Talker

Posts: 208
Location: USA
I'd just let go of my pride and add the include function to each file. Oh wait, I already did that
Nathand is offline
Reply With Quote
View Public Profile Visit Nathand's homepage!
 
Old 11-28-2007, 12:13 PM Re: how to add bar at top of all sites pages?
joder's Avatar
Flipotron

Posts: 6,446
Name: James
Location: In the ocean.
<?php
include("header.php");
?>

Add something like the above to the top of all pages. You can put everything at the top of the page that remains the same across pages into it. I do this for all my sites.

I have variables and if statements within my header to take care of navigation content that I might want to add/change etc.

Last edited by joder : 11-28-2007 at 12:14 PM.
joder is offline
Reply With Quote
View Public Profile
 
Old 11-28-2007, 01:25 PM Re: how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
okay i just wanted to know if there was a way without editing all my files lol.

No worries thanks.. .
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-28-2007, 01:31 PM Re: how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
how do i use PHP include on multiple domains etc?

so how can i have include('http://dansgalaxy.co.uk/sitetop.php'); and not get all the errors u get?

or how can i allow it just for the script or something?

Please help!
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-28-2007, 05:19 PM Re: how to add bar at top of all sites pages?
joder's Avatar
Flipotron

Posts: 6,446
Name: James
Location: In the ocean.
First get this
http://www.inforapid.de/html/searchreplace.htm
Allows you to make replacements across multiple files.

Next time you start a site do the includes first

AFAIK, you can't use include from a different domain. That would be insecure at best. You will have to upload the file to the other domains. If you do a Google search there are some links where it may be possible, but the trouble you would have to go through is not worth it.

Tip: keep all the files you include in their own directories. I use /style for header and footer and /lib for library files such as database.
joder is offline
Reply With Quote
View Public Profile
 
Old 11-28-2007, 09:11 PM Re: how to add bar at top of all sites pages?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
You CAN include() from different domains. My host has it disabled though http://www.arenlor.com/test.aren and that's because it's insecure. People can also stop you from including by disabling hotlinking. I have my header and footer in simple .txt files in the same directory.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-29-2007, 12:51 PM Re: how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
i know it can and is disabled by default, i wasnt thinking when i asked that i emnt alternatives, at the moment im using it as javascript src="file.php" and just wraping it with document.write(''); but i know this wont work with JS disabled

o well this is basically sorted now...

but how can i have the text change, without refreshing the page?

i would PREFER to do all my change using PHP (header refresh) but how can i do this without it refreshing the whole page?
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-29-2007, 12:54 PM Re: how to add bar at top of all sites pages?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Have you thought of using an iframe?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-29-2007, 07:15 PM Re: how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
i really dont want to. because firstly i want to try and keep pages valid and nice and it has too many problems.
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-29-2007, 10:19 PM Re: how to add bar at top of all sites pages?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
I don't think that's possible without JavaScript, frames, or iframes.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-30-2007, 01:41 AM Re: how to add bar at top of all sites pages?
Mattmaul1992's Avatar
Ultra Talker

Posts: 440
Name: Matt
Well, you're already using JavaScript so you might as well use it to its fullest extents. Ever hear of Ajax? Of course you have :S. Lol why not use it? Pretty much every browser supports Ajax JS functions. If you're worried about compatibility then stop because I think the latest IE version that doesn't support it is somewhere around four and less than 1 percent of all Internet users use less than IE 4, besides that pretty much every other browser imaginable supports it. Now, if people shut JS off. Do you realize nearly all the largest online ad-firms use JS? In other words people put billions of dollars on users having JS turned on. I think you'll be safe. Just make sure there's no way to exploit your site if JS is turned off (you have no idea how many sites I've been able to exploit thanks to JS). So honestly if you want to get fancy pay the price or go in between (i-frames). There's really honestly no other options. Also do expect problems with your forums if you're outputting info before the forum does. Bad idea. i-frames are the most common answer to your situation.
__________________
PHP Code:
$talkupation++; 
http://www.forum-front.com/ - Free IPB forum hosting (releasing today!!!), no ads, free modifications
Mattmaul1992 is offline
Reply With Quote
View Public Profile
 
Old 11-30-2007, 11:52 AM Re: how to add bar at top of all sites pages?
dansgalaxy's Avatar
Eat, Sleep, Code

Latest Blog Post:
Offending facebook ads… so?
Posts: 6,089
Name: Dan
Location: Swindon
oookay... i got over using javascript ages ago thats not a issue!

i want to know how to use javascript so that the div which contains all the banner stuff can i guess act like a iframe thats all..

yes i know Ajax, but i have yetto find a easy way to do it wher ei can copy n paste, i know i sound stupid, i am with javascript i dont have much interest in developing what i know of it at the moment, and i know very little the rest i find from snippets on the net.
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)

Last edited by dansgalaxy : 11-30-2007 at 11:53 AM.
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to how to add bar at top of all sites pages?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.19529 seconds with 13 queries