Log in

View Full Version : Skin Displayed Based on REFERER


Sketch
01-19-2003, 10:00 PM
I run a support forum for a company that is now 2 companies merged. In order to provide customer peace of mind and offer a sense of stability and familiarity, we wanted implement a familiar skin for each set of customers. As of version 1 if you visit through remote sites and are redirected then you will not be able to change the style. However if you log straight in you can. This is a bug I need to fix as I want all users to be able to select other skins should they want.


DEMO LINKS:
Default site: http://www.hostingtechs.com
http://forum.hostareus.com
http://forums.barefooting.com

I am not offering support for this, but I am entertaining suggestions, comments and feedback.

This can be used with no credit (I don't believe in tooting my horn), but if you enhance it I'd like to know so that I can consider using an enhanced vesion for myself.

Cheers, people. Now play nice.

Aaron Brazell

Jeremy W.
01-20-2003, 08:42 PM
Yeah, we love this hack :)

Da`Nacho
01-20-2003, 11:10 PM
This could DEFINATELY be useful! :D

Destee
01-21-2003, 01:43 AM
Thank You Sketch ! :)

Clicking Installed!

Destee

nuno
01-21-2003, 01:55 AM
What if i fire up my browser and go to http://forum.hostareus.com/forumdisplay.php?&forumid=6 ?
Or this one http://forums.barefooting.com/forumdisplay.php?&forumid=6 ?

Sketch
01-21-2003, 02:00 AM
well unfortunately we got some DNS wires crossed right now that we're trying to sort. I'll address that when we get back online with our forum....

Sketch
01-21-2003, 01:09 PM
hmmm, yeah, you've got a point. Unless I wanted to do a redirect of all pages or unless mod_rewrite was installed at every redirect location. That's way too many if's.

I guess the next release is going to putt all the detection in global.php like I had originally intended. I was just going to do a:
if ( stristr ( $_SERVER['HTTP_REFERER'], 'forums.barefooting.com' ) ) {

$bbuserinfo['styleid'] = 3;

}

if ( stristr ( $_SERVER['HTTP_REFERER'], 'forum.hostareus.com' ) ) {

$bbuserinfo['styleid'] = 1;

} but that didn't seem to work effectivley. (It would not detect the style on the first load, but refresh and it would....)

So anyways, thanks for the tip...

Aaron

Dean C
01-21-2003, 05:45 PM
Nice idea buddy :)

- miSt

alkatraz
01-23-2003, 01:34 PM
Wow fantastic idea!

Sketch
01-25-2003, 04:35 AM
Completely altered code. Now there is only one bit of code to paste into ./global.php

Much easier. Much more reliable.

Cheers.
Aaron

gmarik
11-09-2003, 01:52 PM
Is it ok on 2.3.2? Could another feature be added:
Predefined forums (id 13, 45, 2, for example) be shown coming from a referrer page or a hyperlink?!