PDA

View Full Version : Has this hack been mentioned?


SNA
03-14-2001, 01:45 PM
2 Boards: 1 User Table.

I have bought 2 VBulletin boards and I would like to have one constant user table for both... is this possible?

If you register on either board you can still post on both boards...

Has this been brought up before?

Thanks.

03-14-2001, 02:35 PM
The best way to do this would be to have a single vb licence, and split the board into two areas using cobranding, so that the two areas have different styles/themes etc., but the user table is the same.

Sharing a user table between two databases is going to be extraordinarily difficult, if not impossible... and that's before you start to think about the server load...

03-14-2001, 03:51 PM
Contact me if you truly want to separate boards.

03-15-2001, 01:46 AM
Ok...

Forum1 databasename - forum1
Forum2 databasename - forum2

so far so good...

what I have done is go through all the *.php files on my forum2 messageboard and changed all instances of user to forum1.user usergroup to forum1.usergroup and userfield to forum1.userfield so that forum 2 reads all user related stuff from the forum1 user, usergroup and userfield tables.

It seems to be working.

Anyone see any problems with this?

03-15-2001, 11:46 AM
If this works... contact me ASAP! :)

03-15-2001, 01:33 PM
yeah if this is sucessful release the hack.

03-15-2001, 01:52 PM
Actually it does seem that you can do just that. I don't know what versions of mysql support this but I can reference the tables in other databases (that I have access to) by appending the database name to table name.

03-15-2001, 02:00 PM
Well, you learn something new every day... https://vborg.vbsupport.ru/

03-15-2001, 02:27 PM
Originally posted by John Harrison
yeah if this is sucessful release the hack.

This is not a hack that can be released.

Nor will you acheive maximum efficiency for your efforts on a MySQL database. On large scale systems run by Oracle, SQL Server or Sybase, this would provide economics of scale and performance. Therefore it would be worth your time and money to accomplish this.

03-15-2001, 02:51 PM
...

So far I have just tested logging in and out on forum2 I havent tried posting yet... The memberlist works... and the control panel works (viewing members,groups, etc)... tonight ill go ahead and make some posts and maybe set up forum permissions and see how it reflects em on each board.

03-15-2001, 03:54 PM
I've done this before for a client and it's in use right now. It works fine, and if I recall correctly the database.table.column syntax is part of the SQL 92 standard -- all versions of MySQL should support it. Just give it a try!! :)

For FanHome I decided that 5 sets of identical PHP files was a waste so I cooked up my own version of co-branding and I'm using that (e.g. template / replacement var sets) on FanHome.

03-16-2001, 01:45 AM
All finished... I think.

I created a new user on forum2 and it was able to post and replay successfully on BOTH forums.

memberlists work on both forums...

private messages are seperate for each forum.

So id say it worked out great.

The only problem I saw was the most recent post when you are viewing a persons profile. If a more recent post was made on a different form it would show the time of that post but link it to the last post on the current forum where the memberlist is located because its taking out of different thread tables.

Woooooowww that was fun.. hehe it basically works. :)

03-16-2001, 07:04 AM
The only problem arises is with the usergroup table in vB 1.X (not sure how it's handled in 2.0) -- if you add a moderator to one forum and they try and log in to the other you get a permission denied error since usergroupID XX doesn't exist in the other forum.

03-16-2001, 08:51 AM
This shouldnt be a problem because im using the usergroup table from form1 i changed all instances of usergroup to forum1.usergroup.


:)

03-16-2001, 09:05 AM
That would give moderator status to a moderator on both forums with the same ID, no?

03-16-2001, 09:12 AM
The user will have the same group permissions on forum1 and forum2.

03-16-2001, 10:08 AM
Yes, yes they will. :D If you have identical forums I guess it won't be a problem.

03-16-2001, 07:31 PM
forgot to tell ya...

I hade to add the following modifications to forum2 functions.php


added:

if ($idname=='user') {
$idnameold = 'user';
$idname = 'forum1.user';
} else {
$idnameold = $idname;
}

if ($idname=='avatar') {
$idnameold = 'avatar';
$idname = 'forum1.avatar';
}


after:


if (!isset($id) or $id==0 or $id=="") {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_noid')."\");");
exit;
}
} else {
$id=intval($id);
if ($selall==1) {
$selid = '*';
} else {
$selid = $idname.'id';
}

then changed


if ($idname=='thread' and $threadcache["$id"]) {
if ($selall!=1) {
return $threadcache["$id"]["$selid"];
} else {
return $threadcache["$id"];
}
} else if ($idname=='forum' and isset($forumcache["$id"]) and $forumcache["$id"][forumid]==$id) {
if ($selall!=1) {
return $forumcache["$id"][forumid];
} else {
return $forumcache["$id"];
}
} else if (!$check=$DB_site->query_first("SELECT $selid FROM $idname WHERE $idname"."id=$id")) {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_invalidid')."\");");
exit;
}


to:


if ($idnameold=='thread' and $threadcache["$id"]) {
if ($selall!=1) {
return $threadcache["$id"]["$selid"];
} else {
return $threadcache["$id"];
}
} else if ($idnameold=='forum' and isset($forumcache["$id"]) and $forumcache["$id"][forumid]==$id) {
if ($selall!=1) {
return $forumcache["$id"][forumid];
} else {
return $forumcache["$id"];
}
} else if (!$check=$DB_site->query_first("SELECT $selid FROM $idname WHERE $idnameold"."id=$id")) {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_invalidid')."\");");
exit;
}

03-17-2001, 12:12 PM
Can someone translate this this for a newbie? :)

Nelly X
04-17-2001, 10:52 PM
Could someone please redo the code for RC1?

Wayne Luke
04-18-2001, 04:27 AM
This is a major hack and involves rewritting a lot of code. While it could be done individually, you can't release or distribute this code without violating the license agreement....

Sorry.

cipap
11-13-2001, 07:12 AM
Originally posted by
Ok...

Forum1 databasename - forum1
Forum2 databasename - forum2

so far so good...

what I have done is go through all the *.php files on my forum2 messageboard and changed all instances of user to forum1.user usergroup to forum1.usergroup and userfield to forum1.userfield so that forum 2 reads all user related stuff from the forum1 user, usergroup and userfield tables.

It seems to be working.

Anyone see any problems with this?

i still don't get you.. which php files needed to be edited?

cipap
11-21-2001, 07:06 AM
Originally posted by
forgot to tell ya...

I hade to add the following modifications to forum2 functions.php


added:

if ($idname=='user') {
$idnameold = 'user';
$idname = 'forum1.user';
} else {
$idnameold = $idname;
}

if ($idname=='avatar') {
$idnameold = 'avatar';
$idname = 'forum1.avatar';
}


after:


if (!isset($id) or $id==0 or $id=="") {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_noid')."\");");
exit;
}
} else {
$id=intval($id);
if ($selall==1) {
$selid = '*';
} else {
$selid = $idname.'id';
}

then changed


if ($idname=='thread' and $threadcache["$id"]) {
if ($selall!=1) {
return $threadcache["$id"]["$selid"];
} else {
return $threadcache["$id"];
}
} else if ($idname=='forum' and isset($forumcache["$id"]) and $forumcache["$id"][forumid]==$id) {
if ($selall!=1) {
return $forumcache["$id"][forumid];
} else {
return $forumcache["$id"];
}
} else if (!$check=$DB_site->query_first("SELECT $selid FROM $idname WHERE $idname"."id=$id")) {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_invalidid')."\");");
exit;
}


to:


if ($idnameold=='thread' and $threadcache["$id"]) {
if ($selall!=1) {
return $threadcache["$id"]["$selid"];
} else {
return $threadcache["$id"];
}
} else if ($idnameold=='forum' and isset($forumcache["$id"]) and $forumcache["$id"][forumid]==$id) {
if ($selall!=1) {
return $forumcache["$id"][forumid];
} else {
return $forumcache["$id"];
}
} else if (!$check=$DB_site->query_first("SELECT $selid FROM $idname WHERE $idnameold"."id=$id")) {
if ($alert) { // show alert?
eval("standarderror(\"".gettemplate('error_invalidid')."\");");
exit;
}


tried that, doesn't work for me... :(