FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


VBulletin in two domains





ginny2689
hello to all
i have one question about VBulletin or any other forum script.

letme explain you by example
suppose i have two domains & i want to install the VBulletin on both the forums
does i need two licenced VBulletin?

2ndly is it can be possible that only after certain number of posts in one domain of forum then only that user can access the other domain of forum .

i know it seems to be funny that why do i wanna two forums on two domains
just because of any particular reason i wanna this lol

please if this function is available please do let me know.

Thanks
Diablosblizz
vBulletin is not permitted on Frihost due to it being a paid bulletin board. Although if you have paid for vBulletin and you have it allowed by an administrator then it should be fine. You should send a private message to Bondings requesting to be able to host them. Please refer to the TOS if you are unsure of something.

Hope this helps.
ginny2689
nope i don't wanna host it on frihost.
i just ask this general question
rvec
I think you'd need 2 licenses, and that modification should be possible (in the registration process add a check).

I don't know what you exactly want, but wouldn't it be easier to somehow add users to a usergroup when they have over a certain amount of posts, and give that usergroup permissions to some extra forums?
ginny2689
@Rvec you are right
but this function can be applied on one domain of forum

but i was mean to say that if this is also applicable that like we have two domain
1. www.ginny.com
2.www.rvec.com

& suppose when user have 100 posts on www.ginny.com forum then he can access the forum which are in www.rvec.com otherwise not.

Now i hope u got what i mean.
sonam
Maybe you can install one or more hidden forums for users with less then 100 posts on the same domain.

Sonam
ginny2689
ginny2689 wrote:
@Rvec you are right
but this function can be applied on one domain of forum

but i was mean to say that if this is also applicable that like we have two domain
1. www.ginny.com
2.www.rvec.com

& suppose when user have 100 posts on www.ginny.com forum then he can access the forum which are in www.rvec.com otherwise not.

Now i hope u got what i mean.


@Sonam what about the above quoted query?

it can be done within one domain but what about other ? is it or not?
sonam
Quote:
& suppose when user have 100 posts on www.ginny.com forum then he can access the forum which are in www.rvec.com otherwise not.


Sorry, I didn't get your idea.

Sonam
rvec
yeah it's possible, but you'd need some scripting. I think 20 lines or something like that on the domain where you want to restrict access should do the job.

I'd say make a simple function to open a direct database connection to the database of the other forum, check if the username provided is registered and has ... or more points and return true or false. Then call that function in the registration process and throw an error if the function returns false (check how the captcha is handled and you can probably use some code from that).
ginny2689
k
so u mean it does need if else function
& on what's files?
rvec
I don't know on what files, I don't have vbulletin, but you'd need some extra code in the pages where the registration is done (probably register.php).
takashiro
If you'd like to set up a forum in Chinese, Discuz! Board may be the best choice. Unfortunately, Discuz! Board has no English version since version 5.5.0. And now, two Discuz! Board 6.1.0 on different domains can be connected by a Ucenter. Very Happy
ginny2689
rvec wrote:
I don't know on what files, I don't have vbulletin, but you'd need some extra code in the pages where the registration is done (probably register.php).


k
thanks you
is there any default option in VB to connect two forum domains
rvec
you'd have to ask on the vbulletin forums for info like that, I only used it once and didn't try out all the functions.
ginny2689
k
rvec
I downloaded a nulled version and it wasn't too hard to add this option. It's not the nicest looking way, but it does work. I used vbulletin 3.7.1.

Open register.php
find
Code:
($hook = vBulletinHook::fetch_hook('register_start')) ? eval($hook) : false;

and after it add:
Code:
//################################ make custom function############################
function allowed_to_register($nick) {
   $link = mysql_connect('localhost', 'root', 'pass');
   if (!$link) {
       die('Database of first forum is down, can\'t register users for now. Please try again later.');
   }
   $db_selected = mysql_select_db('database', $link);
   if (!$db_selected) {
       die ('Database of first forum couldn\'t be found. Please report this problem.');
   }
   $result = mysql_query("SELECT username, posts FROM user WHERE username='".mysql_real_escape_string($nick)."'");
   $user = mysql_fetch_array($result, MYSQL_ASSOC);
   
   mysql_close($link);
   if ($user['posts'] > 5) {
      return true;
   }
   return false;
}

I think you know how to make that part work (change database connect info only).

find
Code:
$userdata->set('parentemail', $vbulletin->GPC['parentemail']);
and after it add
Code:
if(!allowed_to_register($vbulletin->GPC['username'])) {
      $userdata->error('not_enough_posts');
   }


close register.php


login to your admin panel and find the phrase manager(lanugeages and phrases). There add a new phrase of the type "Error Messages" for the product "VBulletin".
Varname should be 'not_enough_posts' and the text and English Translation should be 'You do not have enough posts on the first forum to register here.' or something like that. Also translate that to any other languages you might have installed.

I hope that works, post here if you get any errors.
ginny2689
looks good
i will look on it & ask you for furthur help

thanks
appreciated work
chonghua
you do upload to vbulletin. but different versions.. some host do allow to forums like that of vbulletin and phpbb.. Smile enjoy!
ginny2689
chonghua wrote:
you do upload to vbulletin. but different versions.. some host do allow to forums like that of vbulletin and phpbb.. Smile enjoy!


hows?

procedure have any official addon? in VBulletin to connect VB from two sites?
rvec
didn't my thing work?
ginny2689
I do need some help on this sorry

Code:
I think you know how to make that part work (change database connect info only).
rvec
Code:
   $link = mysql_connect('localhost', 'root', 'pass');//replace localhost, root and pass here
   if (!$link) {
       die('Database of first forum is down, can\'t register users for now. Please try again later.');
   }
   $db_selected = mysql_select_db('database', $link); //replace database here

in that part replace localhost with the host of the other vbulletin installation (localhost if on the same server, else an ip).
replace root with the username to login to the database and pass with the password

replace database with the name of the database (on frihost this starts with your username).

No need to say sorry, I'd rather have you working it then you not asking any questions.
ginny2689
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [path]\register.php on line 93


Have a look at this @RVEC

i'm getting this warning at the top

& can you tell me how do i set the number of posts in first forum after that the user won't get this error.

Thanks
rvec
this code should do the same, but without the error and with 4 vars at the beginning to make configuration a bit easier. You can replace the big block of code in the post above by this block.

Code:
//################################ make custom function############################
function allowed_to_register($nick) {
$database = 'database';//database ip of the second forum
$db_user = 'root';//database user of the second forum
$db_pass = 'pass';//database password of the second forum
$min_posts = 5;//minimum number of posts

   $link = mysql_connect($database, $db_user, $db_pass);
   if (!$link) {
       die('Database of first forum is down, can\'t register users for now. Please try again later.');
   }
   $db_selected = mysql_select_db('database', $link);
   if (!$db_selected) {
       die ('Database of first forum couldn\'t be found. Please report this problem.');
   }
   $result = mysql_query("SELECT username, posts FROM user WHERE username='".mysql_real_escape_string($nick)."' AND posts>$min_posts");
   
   mysql_close($link);
   if ($result===false)
      return false;
   else
      return true;
}
ginny2689
One problem

I don't want this function & can it be stopped?

user posts on first forum automatically posted on 2nd forum also

i want that user posts on 1st forum won't be on 2nd forum. Rolling Eyes

does this could be done?
rvec
to stop the function simply remove the code.

and userposts aren't posted on both forums, this just logs in to the database of the other forum and searches for the username. If the username is found and has enough posts the function will return true, else false (and give the error).
Related topics
Security (Alert)
phpBB Services
:?: IP's from ns1.frihost.net and ns2.frihost.net
[*READ THIS FIRST!*] Commonly asked questions
CHEAP DOMAIN FOR YOUR SITE!
Addon Domains?
Bug in DirectAdmin...
Using a personal domain name
two domains and a doubt
TWO Domains ???
Two Domains
two domains to one
AUCTION OVER!
[Resolved] Can't get two domains working
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.