WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2006, 06:09 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: Spain
Posts: 184
randelld RepRank 0
Default Different headers depending on incoming link.

Hi All.
I have a forum running on my site. I would like to include it in a couple of other sites but would like each site to use a different header for the forum in order to appear as part of each site.

The forum is php
I was thinking of using a simple iframe to insert the forum but would really like to each serve a different header or no header at all.

Does anybody have any suggestions for doing this??

Thank you
__________________
Spain Forum
Yecla
Reply With Quote
  #2 (permalink)  
Old 07-19-2006, 05:45 PM
wige's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jun 2006
Location: United States
Posts: 1,782
wige RepRank 4wige RepRank 4wige RepRank 4wige RepRank 4
Default

Iframes can be problematic, as search engines don't often index framed content correctly, and most likely a user following a SERP link to the forum would be taken to the iframe content page. In addition, there are browser differences that could make that approach problematic.

My suggestion would be to use a php command to import a header and footer based on some get variable. Something along the lines of:
if ($_GET['site'] == 'site1') {
require("site1header.php");
}


That way, if your forum is at www.myforum.com/page.php, if the visitor comes to www.myforum.com/page.php?site=site1 they would see the header. Otherwise, no header would display.
Reply With Quote
  #3 (permalink)  
Old 07-19-2006, 07:43 PM
incrediblehelp's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,654
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default

Does anyone see any SEO problems with doing this?
Reply With Quote
  #4 (permalink)  
Old 07-20-2006, 02:37 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: United Kingdom
Posts: 1,766
TrafficProducer RepRank 1
Default each serve a different header or no header at all.

Code:
each serve a different header or no header at all
.

SEO problems

Seach Engins may see this as Cloaking be careful.
__________________
Videos to Watch and Video Publishing
Affiliate Program! Our Affiliate Program Pays 50.00% Business Support
Reply With Quote
  #5 (permalink)  
Old 07-20-2006, 08:30 AM
Vectorman211's Avatar
WebProWorld Member
 

Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

IFRAME=SEO Death, Accessibility Death and will generaly get you laughed at in many cases.

The SEO issue is irrelevant as he is talking about completely different web sites. The simple way would be to deploy the forum software on each individual website and have them share the same database. That way you can completely customize the forum code to integrate into your main site's look and feel.

If you want a central code base for your forums it get's a little trickier. You could as you stated yourself include a different header and/or footer for each site depending on which site is being used to access the forums. This can easily be determined using the $_SERVER['HTTP_HOST'] predefined variable.
Reply With Quote
  #6 (permalink)  
Old 07-23-2006, 03:33 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: Spain
Posts: 184
randelld RepRank 0
Default Thanks

Thanks for the suggestions guys.
Vectorman:
Can you give me an example of how I would use the $_SERVER['HTTP_HOST'] predefined variable.

Thanks
__________________
Spain Forum
Yecla
Reply With Quote
  #7 (permalink)  
Old 07-23-2006, 04:31 PM
Vectorman211's Avatar
WebProWorld Member
 

Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

Certainly:

Code:
//Determine which header to call
switch($_SERVER['HTTP_HOST']){
   case "www.domain1.com":
      require("domain1/header/file");
   break;
   case "www.domain2.com":
      require("domain2/header/file");
   break;
   default:
      require("default/header/file");
}
Reply With Quote
  #8 (permalink)  
Old 07-23-2006, 04:55 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: Spain
Posts: 184
randelld RepRank 0
Default Wow

Wow, is that it?
I'll be happy a play with that tomorrow.
Thanks very much
__________________
Spain Forum
Yecla
Reply With Quote
  #9 (permalink)  
Old 07-23-2006, 07:42 PM
Vectorman211's Avatar
WebProWorld Member
 

Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

Yep, no problem! :D
Reply With Quote
  #10 (permalink)  
Old 07-27-2006, 03:45 PM
WebProWorld Pro
 

Join Date: Jun 2004
Location: Spain
Posts: 184
randelld RepRank 0
Default I'm stuck

Hi Vectorman,
Thanks for your help. I've been trying with the snippet but I keep getting an error. Can you take a quick look at it for me.

****** Begin Code*******
include "func.inc.php";
//Determine which header to call
switch($_SERVER['HTTP_HOST']){
case "www.domain1.com":
require("www.domain1.com/exchange/header.php");
break;
case "www.domain2.com":
require("www.domain1.com/exchange/header2.php");
break;
default:
require("www.domain1.com/exchange/header.php");
}
//include "header.php";
********* End Code******
Here is the error that it is giving

Warning: main(www.mydomain.com/exchange/header.php): failed to open stream: No such file or directory in /home/fhlinux194/m/mydomain.com/user/htdocs/exchange/index1.php on line 25

Warning: main(www.mydomain.com/exchange/header.php): failed to open stream: No such file or directory in /home/fhlinux194/m/mydomain.com/user/htdocs/exchange/index1.php on line 25

Warning: main(www.mydomain.com/exchange/header.php): failed to open stream: No such file or directory in /home/fhlinux194/m/mydomain.com/user/htdocs/exchange/index1.php on line 25

Fatal error: main(): Failed opening required 'www.mydomain.com/exchange/header.php' (include_path='.:/usr/share/pear') in /home/fhlinux194/m/mydomain.com/user/htdocs/exchange/index1.php on line 25

Thank you for your time guys.
__________________
Spain Forum
Yecla
Reply With Quote
  #11 (permalink)  
Old 08-02-2006, 06:23 PM
Vectorman211's Avatar
WebProWorld Member
 

Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

You can't require a php file via HTTP because it will be parsed by the PHP interpreter before being sent. The websites must reside on the same server and have read permission of the PHPBB code base. Or as I said before the simplest way would be to install duplicate code of PHPBB on each website and have them share the same database. Then you can fully customize the look and feel of PHPBB to match your website's.
Reply With Quote
  #12 (permalink)  
Old 08-05-2006, 01:36 AM
chadhaajay's Avatar
WebProWorld Pro
 

Join Date: Dec 2003
Location: INDIA
Posts: 165
chadhaajay RepRank 1
Default

I fully agree with the suggestions of Vectorman !

Sincerely,

Ajay Chadha
(Director)
Chadha Software Technologies
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0