Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Different Domain, Different Style Details »»
Different Domain, Different Style
Version: 1.0.1, by dartho dartho is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.7.0 Rating:
Released: 03-27-2008 Last Update: 05-18-2008 Installs: 189
Uses Plugins
Re-useable Code Translations  
No support by the author.

This is a simple add-on which will force users to a specific style based on the url the user visited.

I wrote this with the idea of being able to create a subdomain of mobile.domainname.com and have visitirs to that URL forced to a mobile style whilst visitors to my normal site (domainname.com or www.domainname.com) would be rpesented with my regular style.

Alternatively if you have 2 domain names which point to the same forum, you can have a customized style based on the domain name visited. You can do what you want, but it may be as simple as only having a different banner reflecting the host name visited, or if you have merged 2 forums - users could still get the same skin they always have had if they continue to visit the same URL.

With the HOST matching be aware that if the URL specified in the add-on matches anywhere in the url visited, the add-on will be triggered.

e.g. if URL specified in add-on = domainname.com, any subdomains of domainname.com will match this.

Version Information
1.0.0 - Initial release ported from 3.6 version
1.0.1 - Fixed missing Setting Group Name


product-ddds37.xml supports a single additional domain
product-ddds37_5-domain-version.xml supports one to five additional domains


To upgrade, simply import and allow overwrite.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
CrashPush, Relientk

Comments
  #32  
Old 05-23-2008, 03:52 AM
Slacker Slacker is offline
 
Join Date: Apr 2002
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked great for me, dartho. Awesome work!

http://mobile.slackercentral.com
Reply With Quote
  #33  
Old 05-26-2008, 02:18 AM
wpeloquin wpeloquin is offline
 
Join Date: May 2006
Location: Behind you...
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lighti View Post
Just a slight question - Does this do anything different from just adding on a domain and using it as a redirect domain pointing to the styleid?
Quote:
Originally Posted by dartho View Post
This doesn't add domains - you'll need to register any additional domains or set up sub-domains and configure them to point to the same webspace as your primary domain. Redirects will not work with this add-on as they simply redirect one url to your primary domain.

Once you have your domain names setup and visiting these domain names takes you to the same content as your primary domain you can then install and configure this add-on.

What it then does is checks the URL that was used to get to your site, and if this matches one configured with this add-on it will override the default style with the configured style.

For example, if your sites primary domain is "domain.com" and you use the default vBulletin style, all visitors to your domain will be presented with this default style.

If you then register say "pinkdomain.com" and configure it to use the same webspace as your primary domain, all visitors to "pinkdomain.com" will also be presented with the same default style. If you were to install a new style - lets say with a pink colour scheme called "Pink" and installed this addon, you could configure it such that all visitors to "pinkdomain.com" will be presented with the "Pink" style whilst visitors to "domain.com" will continue to be presented with the default style. The same could be done if you configured a subdomain of "pink.domain.com"

The user/visitor can not override the style with this addon, even if you allow them to change styles, this will force the visitor to what ever style you configure.

Hope this helps..
dartho, i think what he meant was this:

what this addon does it makes "pinkdomain.com" use the pink style, as opposed to the default style.

what would be the difference between this addon, and setting up "pinkdomain.com" to redirect to "domain.com?styleid=2"
Reply With Quote
  #34  
Old 05-26-2008, 02:50 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@wpeloquin - The two scenarios are similar in many ways however a redirect is a redirect - it will send your visitor to a different page with a different URL. This add-on will leave your visitor at the page they landed on and with the same URL and all page activity will be relative to the landing URL. This Add-On allows you to Force a style on a user and not allow the user to change the style.
Reply With Quote
  #35  
Old 05-30-2008, 04:26 PM
tekguru tekguru is offline
 
Join Date: May 2007
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I give up completely....

1) I've set up my sub-domain correctly so that:

mobile.4winmobile.com goes to www.4winmobile.com

2) The Mod is set to use the Mobile Style 0.06

3) I've modified functions_vbseo.php as per:

PHP Code:
if(
VBSEO_BASEDEPTH &&
defined('VBSEO_PREPROCESSED')
&& (
$_SERVER['HTTP_HOST'] != 'mobile.4winmobile.com')

Yet still no redirection.

Any ideas guys as this is driving me nuts!
Reply With Quote
  #36  
Old 05-30-2008, 05:08 PM
Slacker Slacker is offline
 
Join Date: Apr 2002
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tekguru View Post
Well I give up completely....

1) I've set up my sub-domain correctly so that:

mobile.4winmobile.com goes to www.4winmobile.com

Any ideas guys as this is driving me nuts!
Actually you don't have that part right yet. You need to park that other domain, not redirect it. Like this:

http://mobile.slackercentral.com/

Notice that the URL doesn't change to my standard URL. The mod needs that to stay in the address bar to work. Delete the redirection and see if you can figure out how to park it.
Reply With Quote
  #37  
Old 05-30-2008, 06:52 PM
tekguru tekguru is offline
 
Join Date: May 2007
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like I'm stuck then as this is using WHM / cPanel to add a standard subdomain.

The problem with it failing are caused by me having:

1) .htaccess

redirect 301 /index.html http://www.4winmobile.com/forums/portal.php

in my .htaccess file.

2) index.html reading as per:

HTML Code:
<html>
<head>
<title>Redirecting to the main site...........</title>
<META HTTP-EQUIV="Refresh"
CONTENT="0; URL=http://www.4winmobile.com/forums/portal.php">
</head>
<body>
</body>
</html>
Bu if I don't have these in there then there is no way to redirect folks from www.4winmobile.com to the portal at: http://www.4winmobile.com/forums/portal.php - Unless of course you can say otherwise?

Help!!
Reply With Quote
  #38  
Old 05-30-2008, 07:30 PM
Slacker Slacker is offline
 
Join Date: Apr 2002
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't do it as a subdomain in cPanel. If you have access to WHM you can park the domain there. Can you find that option? It should be under DNS Options -> Park a domain. Tell it to park your mobile URL on top of your forums URL and you should be all set.
Reply With Quote
  #39  
Old 05-30-2008, 08:32 PM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@tekguru - making your htaccess entry something like this would do the same thing assuming you have modrewrite on your server:
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ ./forums/portal.php [R=301,L]
Reply With Quote
  #40  
Old 05-30-2008, 09:23 PM
tekguru tekguru is offline
 
Join Date: May 2007
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay this is starting to get there......

Firstly thanks to Dartho if I use the code he kindly provided in .htaccess then one of my alternative true domains (www.tekguru.co.uk) does indeed remap correctly on top of the main site and retains the original URL.

1) First of all I do not own the mobile.4winmobile.com domain, no need to acording to ServInt as this is a valid subdomain of www.4winmobile.com. According to them the correct way of setting it up is as a subdomain.

Are they wrong here?

If I delete mobile.4winmobile.com as a sub domain I can ......

Try to park mobile.4winmobile.com on www.4winmobile.com. I fI try this I get an error.....

Argh I don't believe it - 5 times it blinking errors, I try it now and it parks! Argh!!!!

And the Mod has kicked in as well and is working.

God knows what the problem was!

Cheers for the advise guys Very happy now!
Reply With Quote
  #41  
Old 05-30-2008, 09:35 PM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Parking is just a way of saying make the [sub]domain point the the same document root as your primary domain.

Glad it is working for you!
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05240 seconds
  • Memory Usage 2,326KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete