Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2004, 08:48 AM
yakusasc yakusasc is offline
 
Join Date: Apr 2004
Location: France
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Partnership : multiple styles

Hi the team !

I'm currently running a vB3 forum and I'm very happy of it ! I'd like to make partnership with other web sites and to offer them the possibility to display our forum on their web site BUT with a style adapted to their web site (header ...). It's a way to develop more our forum.

The web sites could be on the same server. How could I do that ? Their would be a text indicated that this is our forum. Maybe could we use the URL ?

thank you for your help

Yakusa
Reply With Quote
  #2  
Old 04-08-2004, 06:40 PM
LancerForums's Avatar
LancerForums LancerForums is offline
 
Join Date: Nov 2001
Location: CA
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yakusasc
Hi the team !

I'm currently running a vB3 forum and I'm very happy of it ! I'd like to make partnership with other web sites and to offer them the possibility to display our forum on their web site BUT with a style adapted to their web site (header ...). It's a way to develop more our forum.

The web sites could be on the same server. How could I do that ? Their would be a text indicated that this is our forum. Maybe could we use the URL ?

thank you for your help

Yakusa
You could be to use subdomains like partner.mydomain.com or partner.forums.mydomain.com, etc for each partner that you sign up. Then a script can pull the partner name from the subdomain and find a style match in the database and select it.

Ex. partner.mydomain.com would then strip to partner and then the style named partner would be selected for the forums to use.

Mark
Reply With Quote
  #3  
Old 04-08-2004, 07:13 PM
yakusasc yakusasc is offline
 
Join Date: Apr 2004
Location: France
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Mark !

but I don't know how I could make this script which would extract the name of the partner and impose the style. Could you help me ?

Yakusa
Reply With Quote
  #4  
Old 04-08-2004, 09:35 PM
LancerForums's Avatar
LancerForums LancerForums is offline
 
Join Date: Nov 2001
Location: CA
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yakusasc
Thanks Mark !

but I don't know how I could make this script which would extract the name of the partner and impose the style. Could you help me ?

Yakusa
Yakusa,

I think this should work for you. Make sure to update the subdomain selections to match your own:
  1. Open the file 'global.php' from your main forums folder.

  2. Search for this line:
    $userselect = false;

  3. Directly above that line, add the following code listed below:
Code:
// #############################################
// ########### START PARTNER HACK ##############
// #############################################
//
// Place all forum-related subdomains that are used for partners in here.
// Each subdomain should be separated by a comma.
// 
// Ex. To ignore www.mysite.com we would list 'www' in the field below. 
// For www2.mysite.com we would list 'www2', etc. To ignore both, we 
// would list 'www,www2'.
//
// NOTE: In order for the correct style to be found, you must create
// the style name exactly as it appears in the domain.
//
// Ex. www.mysite.com's style would be named 'www'
//	  www2.mysite.com's style would be named 'www2'
//
// MAKE SURE THAT ALL STYLES HAVE A UNIQUE NAME!!!
//
$partner_ignore_list = 'www,www2';
$partner_ignore_arr = explode(',', $partner_ignore_list);
$partner_url = explode('.', $_SERVER[HTTP_HOST]);
$partner_subdomain = $partner_url[0];
// If the subdomain is not in the ignore list, then continue
// searching for a style.
if(!in_array($partner_subdomain, $partner_ignore_arr)) {
  // Find the correct style for this partner
  $style_info = $DB_site->query_first("SELECT styleid FROM " . TABLE_PREFIX . "style WHERE title = '$partner_subdomain' ORDER BY displayorder DESC LIMIT 1");
  
  // If the style is found, then force the style to display for the user.
  if($style_info) {
	$codestyleid = $style_info[styleid];
  }
}
// ###########################################
// ########### END PARTNER HACK ##############
// ###########################################
I didn't really test this out, but I think it should work for you. The subdomains would have to be setup yourself or by your host. I would setup a test.mysite.com subdomain that points to the forums folder, then create a style named 'test' and alter it so you know what it is. Then you can test out the code and see if it works. I believe the way this is written, it will override any style for any forum or user preference.

Mark
Reply With Quote
  #5  
Old 04-09-2004, 04:59 AM
yakusasc yakusasc is offline
 
Join Date: Apr 2004
Location: France
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wahou Mark you are very cool ! Thank you very much ! Do you think it's possible to adapt it for domains ?

forum.site1.com
forum.site2.com

Thanks in advance ! This way it would be the perfection ! The different domain will be host on the same server.
Reply With Quote
  #6  
Old 04-11-2004, 04:46 PM
LancerForums's Avatar
LancerForums LancerForums is offline
 
Join Date: Nov 2001
Location: CA
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yakusasc
Wahou Mark you are very cool ! Thank you very much ! Do you think it's possible to adapt it for domains ?

forum.site1.com
forum.site2.com

Thanks in advance ! This way it would be the perfection ! The different domain will be host on the same server.
That should be possible as long as you setup the web server to point all those domains to the same forum as the original forum you have. I think you would just need to do the following:

Find the line below:
$partner_subdomain = $partner_url[0];

and replace it with this line:
$partner_subdomain = $partner_url[1];

Then the partner names in the variable $partner_ignore_list would have to be the domains like site1 and site2 instead of listing www, www2, etc. The style name will have also have to match the domain name.

If you ever need to alter that more, here's a brief explanation on what that line is. Basically it's looking for a certain part of the domain. If you have a domain like http://forum.site1.com, then it would break down like this:
$partner_url[0] -> 'forum'
$partner_url[1] -> 'site1'
$partner_url[2] -> 'com'

Mark
Reply With Quote
  #7  
Old 04-12-2004, 11:35 AM
yakusasc yakusasc is offline
 
Join Date: Apr 2004
Location: France
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much Marck ! The idea is very good ! I'll will test it very soon. Do u think it's possible to do something for the screen resolution in the same time ?

site 1 and 800*600 : style_site1_800
site 1 and 1024*768 (or more) : style_site1_1024
...

thank you ! because we've made 2 styles for these resolution and the problem with your script is that the visitor couldn't adapt it to its resolution anymore.
Reply With Quote
  #8  
Old 04-17-2005, 12:54 PM
jcr jcr is offline
 
Join Date: Apr 2004
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh.. this was exactly what I was looking for Thanks a bunch!
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 10:38 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.04530 seconds
  • Memory Usage 2,235KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete