PDA

View Full Version : Want to go from standalone to Vbulletin in Photopost?


Chuck S
August 11th, 2005, 06:01 PM
Okay if you just bought Vbulletin and have a standalone install of Photopost you want to integrate with photopost you will need to take the proper steps to realign Photopost to integrate with Vbulletin.

This script is written to assist users to import there Photopost users into Vbulletin user table thus enabling you to switch Photopost to a Vbulletin integration and have everyone able to use Vbulletin

1. Upload both files from the zip to your server

2. Chmod import.cnf file to 777

3. Load import.php script in your browser and fill out the database information and then run through the steps

Thats It.

Reynaldopp
December 3rd, 2005, 06:56 AM
Hey:

Thanks for the script. Unfortunately it didnt work for me until I changed the following line:

$query=mysql_query("SELECT * {$Globals['photopost']}FROM users",$vbc);


into:


$query=mysql_query("SELECT * FROM {$Globals['photopost']}users",$vbc);

Chuck S
December 3rd, 2005, 11:19 AM
yep thats a typo thanks

JacobYTG
February 7th, 2006, 12:05 PM
Hi Chuck,

I have a new vbulletin with a separate domain name from my stand alone photopost pro domain name, all of my userbase is in the photopost pro, i want to integrate all the users in the new vbulletin, Is it possible to with separate domain names? If so, how is it done?

Thanks,

Jacob

Chuck S
February 7th, 2006, 01:43 PM
As long as the vbulletin allows external mysql connection you can connect them

As far as this why not move Photopost to that domain?

JacobYTG
February 7th, 2006, 04:43 PM
As far as this why not move Photopost to that domain?
Thats a good idea, but i would need to purchase another Photopost and transfer the photos that are specific with the vbulletin domain name i plan to use, which i might do.

Thanks Chuck,

Jacob

Chuck S
February 7th, 2006, 04:46 PM
You mean your not going to get rid of this one install?

If your going to delete your current install where it is your permited to move Photopost to another url without buying a license.

You only need to get an additional license if you want a 2nd install

JacobYTG
February 7th, 2006, 05:21 PM
No, I don't want to get rid of my installed one, I have over a thousand photo's on it now, but they are various photos, I want to add a 2nd install, and just transfer the ones in that certain category that go with my new domain name, from my 1st install.

Then keep the 1st install a stand alone until i get a vbulletin forum for that one.

Too bad there couldn't be a way to integrate just a certain category into vbulletin.:)

Jacob

Chuck S
February 7th, 2006, 05:51 PM
Okay then yes you would need to purchase an install for this second site

melwade
March 15th, 2006, 12:05 AM
I get this message when I run the script:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/site1/web/vbimport/import.php on line 298
Importing 1 Users .... Please wait

Import Done!!

Any advice?

Chuck S
March 15th, 2006, 05:34 AM
You have entered the wrong info to import the users? Checked the script over it makes a connection to the photopost database and then imports the users into a clean vbulletin.

Have you checked your import.cnf.php file to check your database values?

awtyler0
March 15th, 2006, 08:48 PM
Is it possible to get an edited version of this script to copy users from PP into Invision Power Board v2.1.5? I just used the 4Images import script, and need to copy all my imported users into the forum...

Thanks!

Chuck S
March 17th, 2006, 05:46 PM
We can not into it but I can not give any timeframe on any such script.

melwade
March 19th, 2006, 04:29 PM
I'm still missing something. I've merged the users into vbulletin, but now I have two seperate user systems. photopost is not looking to vbulletin for login.

Chuck S
March 19th, 2006, 05:13 PM
well this script merely imports users. You would need to edit your photopost settings and files and such to align with vbulletin etc. Try searching on these forums as there are a few posts here about switching integrations.

melwade
March 30th, 2006, 09:15 PM
I did the import but the Birthdays came in backwords. They were written in vBulletin as 1970-12-31 instead of 12-31-1970. How can I fix this?

Its causing everyone to be listed as COPPA users.

snoopy5
September 10th, 2007, 03:27 PM
Hi

I just tried this script with an existing PP 5.62 installation (2742 users) and a fresh and clean vb3.68 installation.

All users seem to be imported. But no usergroups. It seems that all users of PP special groups are pushed into the administrator group.

In the frontend statistics of vb, the numebr of users displayed is still only 1 though.

Is there a way to also import the usergroups of PP? Or how does it interact then with PP to show the same userlevel on both sides for teh same user?

Chuck S
September 10th, 2007, 03:35 PM
Usergroups are not imported, Your users should be imported into vb with the usergroupid of 2 and admin 6 to match you can create usergroups in vb. We dont import our groups into vb since all user management is in vb and this script is just concerned with adding users and the admin to vb.

snoopy5
September 10th, 2007, 03:46 PM
Usergroups are not imported, Your users should be imported into vb with the usergroupid of 2 and admin 6 to match you can create usergroups in vb. We dont import our groups into vb since all user management is in vb and this script is just concerned with adding users and the admin to vb.

o.k.

what would then be the next appropriate step to have a shared userregistration of vb and PP after using this script?

my idea would be:

-------------

1. creating usergroups in vb with the same name then the ones in PP

2. distributing the users in the appropriate usergroup within vb

3. Edit the settings table of Photopost settings 41,83,171-173 and set to the proper integration type forum mysql table prefix and cookie settings.

4. Edit my config-inc.php file of Photopost and enter in user database the proper vbulletin mysql info and the proper vbulletin license in the $vblicense variable line.

5. In my usergroups table of Photopost delete all entries except Administrators where that one you want to edit it and change the groupid from 2 to 6

6. synchronise within PP with the link in ACP/usergroup the usegroups now with vb usergroups

7. Recheck all settings (upload rights etc.) for each usergroup within PP

---------------

Would that work? Would all userids be correct between the 2 software and all albums etc.?

snoopy5
September 10th, 2007, 07:03 PM
mmmhhh,

I did all that now. The most work was within vbulletin the manual move of the imported users into their newly created usergroups.

But it seems that the usergroup ID is somehow hardcoded to the username with the import script.

Even after I changed the usergroup for a user within vbulletin, the usergroup ID stays in the db of vbulletin and of PP the old one. If I look in the ACP within vbulletin, I see the name of the new (and correct) usergroup, but the db field and PP tells me a different story with teh ID#.

If I click within PP on the user profile, it shows me the wrong usergroup. But all images are correctly linked to that User.

I do think that has something to do with how vb is numbering the pre-default usergroups and vs. PP usergroup ID.

#8 for example is the ID for banned users. A specific usergroup of PP (moderators) was automatically imported with this script into this usergroup. Although I moved those users out of banned into a newly created group, it still shows in the db the ID of the group "banned". And PP seems to take the same group obviously as vb for that user.

Maybe I have to delete first all usergroups before I use this script. But then I also do not know which user belongs to which group.

before using this import script, I had the following group IDs:

---------
5 Administrator
1 Banned
3 unregistered Visitor
4 Registered /Guest
2 COPPA
6 Bronze
7 Gold
8 Moderator
9 Silver
10 Dealer
--------------------



After the import script I had:

---------
6 Administrator
8 Banned
1 unregistered Visitor
2 Registered /Guest
4 COPPA
9 Bronze
12 Gold
7 Moderator
11 Silver
13 Dealer

3 User who are waiting for E-Mail notification (new group of vb)
5 Super Moderator (new group from vb)
--------------------

So it seems that i.e. ID#8 (moderators) do not change their ID after import. Although I moved them to "Gold" (ID 12) within vb, they still show ID 8

Do I have then to fix this then directly in database or is there an easier solution possible?

Chuck S
September 10th, 2007, 07:11 PM
If you use the script I made to import your vb users yes the userid's should be the same and yes the steps outlined above seem to be the same as what I have posted elsewhere and linked for you.

Chuck S
September 10th, 2007, 07:14 PM
I see you posted while I was formulating a response. Yes you must use a fully new vb with no special groups or if want you can create those vb groups with the same id number as the ones in photopost and just remove the code in the import script that renumbers the user's usergroup and let the import script import that groupid in its normal format. Remember the script I wrote is designed to import into a clean vb format which has no custom usergroups so this is your issue.

snoopy5
September 11th, 2007, 02:50 AM
Yes you must use a fully new vb with no special groups

I did that. Only the usergroups that are part of the standard install of a fresh vb 3.68 have been there.



... or if want you can create those vb groups with the same id number as the ones in photopost and just remove the code in the import script that renumbers the user's usergroup...

How do I do this?


Remember the script I wrote is designed to import into a clean vb format which has no custom usergroups so this is your issue.

There have been no custom usergroups in this fresh vb install. Only the UG, that are part of a clean install by default. And I think this is the problem. It seem I really have to delete/change first the standard vb usergroups or their ID.

Do you know how to do that?

snoopy5
September 11th, 2007, 03:39 AM
o.k., I looked into the code of your script.

In "import.php" I see in the second half this code. I guess this is where I have to add something to reflect the PP usergroups and their IDs. So over the next 2 hours I will do the following:

1. I will add some lines in the code of the import script below (the part I marked in bold is according the UG-ID numbers I posted earlier in this thread).

2. I will then again make a fresh install, create additional usergroups within vb (to have something to import to for the code addition in bold), check again their UG-ID and put the numbers accordingly in the lines in bold below.

3. Then I start the importscript.




// ============================================================================



if ($action == "import_users") {



if (phpversion() >= "4.1.0") {

$start = $_GET["start"];

}



mysql_select_db("$udb",$u3t);





$query=mysql_query("SELECT * FROM {$Globals['photopost']}users",$u3t);

$members=mysql_num_rows($query);



$members=$members+1; // +1

$end=$start+500;



echo "Importing $members Users .... Please wait<p>";



if ($start >= $members) {

echo "Import Done!!";

exit;

}



while ($line=mysql_fetch_array($query)) {



for ( $x=0; $x < count($members); $x++ ) {



$userid = $line['userid'];

$usergroupid = $line['usergroupid'];

$username = addslashes($line['username']);

$password = $line['password'];

$email = addslashes($line['email']);

$homepage = addslashes($line['homepage']);

$date = $line['joindate'];

$posts = $line['posts'];

$ipaddress = addslashes($line['ipaddress']);

$location = addslashes($line['location']);

$offset = addslashes($line['offset']);

$icq = addslashes($line['icq']);

$aim = addslashes($line['aim']);

$yahoo = addslashes($line['yahoo']);

$birthday = addslashes($line['birthday']);





if ( $usergroupid == 5 ) $usergroupid=6;

if ( $usergroupid == 4 ) $usergroupid=2;

if ( $usergroupid == 1 ) $usergroupid=8;

if ( $usergroupid == 3 ) $usergroupid=1;

if ( $usergroupid == 2 ) $usergroupid=4;

if ( $usergroupid == 6 ) $usergroupid=9;

if ( $usergroupid == 7 ) $usergroupid=12;

if ( $usergroupid == 8 ) $usergroupid=5;

if ( $usergroupid == 9 ) $usergroupid=11;

if ( $usergroupid == 10 ) $usergroupid=13;





$salt = fetch_user_salt(3);



$hashedpassword = md5($password . $salt);



if ( $usergroupid == 6 ) $title = "Administrator";

if ( $usergroupid == 2 ) $title = "Member";



echo "Importing $username ($userid)<br />";



mysql_select_db("$vdb",$vbc);



mysql_query("INSERT INTO {$Globals['vbulletin']}user (userid,usergroupid,username,password,passworddate,email,homepage,usertitle,joindate,posts,timezoneoffset,birthday,ipaddress,salt) VALUES ($userid, $usergroupid, '$username', '$hashedpassword', NOW(), '$email', '$homepage', '$title', '$date', '$posts', '$offset', '$birthday', '$ipaddress', '$salt')",$vbc);



mysql_query("INSERT INTO {$Globals['vbulletin']}userfield (userid,field2) VALUES ($userid, '$location')",$vbc);



mysql_query("INSERT INTO {$Globals['vbulletin']}usertextfield (userid) VALUES ($userid)",$vbc);





mysql_select_db("$vdb",$vbc);

}



}



$start = $start + 250;

echo "<script language=\"javascript\">window.location=\"import.php?action=import_users&start=$start\";</script>";

exit;



echo "<p>Import complete!";



$cf = fopen("import.cnf.php", "w");

fputs ($cf,"<? \$status = \"complete\"; ?>");

fclose($cf);



exit;

}




Theoretically, the UG-ID-Problem should then be solved, or do I oversee here something?

snoopy5
September 11th, 2007, 05:19 AM
update:

My fresh vb368 install used slightly different usergroupids than my installation before. I changed the numbers above in bold to the following numbers:



if ( $usergroupid == 3 ) $usergroupid=1;
if ( $usergroupid == 2 ) $usergroupid=4;
if ( $usergroupid == 6 ) $usergroupid=9;
if ( $usergroupid == 7 ) $usergroupid=11;
if ( $usergroupid == 8 ) $usergroupid=5;
if ( $usergroupid == 9 ) $usergroupid=10;
if ( $usergroupid == 10 ) $usergroupid=12;


I also wanted to have my PP moderators to be in vb "super-moderators".

snoopy5
September 11th, 2007, 06:22 AM
update2:

my modification in the script does not work. The PP users get imported in totally different vb-usergroups, but I do not understand why. Did I hack the wrong place in the code? Did I use the wrong numbers? I took the numbers from the PP database and the vb numbers from the ACP of vb.

So where in the code of this script do I have to put the ID numbers for changing PP usergroups in the appropriate vb usergroup?

snoopy5
September 11th, 2007, 07:49 AM
Those are the usergroups vbulletin 3.68 has by definition wehn I do a fresh installation:

Chuck S
September 11th, 2007, 08:33 AM
Correct there are 7 default vb usergroups and this script as explained will import your users into the usergroup 2 and the admin to usergroup 6. No script is going to import users how you want them nor can I support any changes made to my script. If you use the scripts as they are designed you will be able to integrate vb and photopost and the userid's will be correct so the issue you had with using vb impex script is gone. What you do with usergroups or what groups you make and distribute users after you finish things are of little concern to the scripts or the integration as long as the exact groups exist in both apps and you set permissions accordingly.

Your code you post above should work and those groups better exist in vb with the same id but sorry I can not support any changes you make to my script.

snoopy5
September 11th, 2007, 08:58 AM
o.k.

so let's check another idea.

a) does it make a difference whether the vb forum and/or PP is in maintainence mode while I use the script or do the sync for the usergroups?



b) What happens with PP usergroups if I would use the import script as delivered by you and change afterwards the UG-ID in the PP-Database to match the UG-ID in vbulletin?

Would this crash my PP install or bring out wrong results?

Chuck S
September 11th, 2007, 09:12 AM
maintenence mode? You lost me there as we dont have something like that. My script will place all users with a usergroup id of 2 except admin which is 6 you can safely update any other fields to match anywhere else. This script just imports users into vb users table.

snoopy5
September 11th, 2007, 09:17 AM
maintenence mode? You lost me there as we dont have something like that.

In PP ACP I can "close" the gallery. If I do this a message is appearing for all suers that the gallery in in maintenence mode. Allthough I do all the stuff on a test-install, I have always this maintenence mode on while working on it. This is what I meant.

o.k., I will try to change the UG-ID in PP Database after the sync with vb forum and report back...

Chuck S
September 11th, 2007, 09:28 AM
yeah having a gallery closed has no bearing with anything you do in admin or any external scripts you run ;)

snoopy5
September 11th, 2007, 10:06 AM
mmmhhh I am confused now. Maybe I did install to many installations and imported to much, but it seems that the UG-ID is now teh same in both, the vb database and the pp database.

But if I click on a users profile within PP, it shows the wrong UG-name. How can this be?

Could there be something wrong with the feature in PP within ACP/usergroups "Refresh usergroups from your forum software?"

I have integration stylesheets to "off". I only wnat to use the shared userregistration, not the layout stuff.

Chuck S
September 11th, 2007, 10:48 AM
The usergroup they belong to in vbulletin must match the groupid in photopost users table and verify the groupnames are correct in photopost usergroups. Remember one step in the switch usergroups is for you to delete all photopost usergroups except admin change that to group 6 and then go to admin and resync your groups and set permissions accordingly.

snoopy5
September 11th, 2007, 11:20 AM
The usergroup they belong to in vbulletin must match the groupid in photopost users table and verify the groupnames are correct in photopost usergroups.

I did check this. It is correct.

Remember one step in the switch usergroups is for you to delete all photopost usergroups except admin change that to group 6 and then go to admin and resync your groups and set permissions accordingly.

I also did this everytime. But the problem persist. In both db the UG-ID is the exact same, but when I click on the suer's profile within PP, users are sometimes admins, somtimes banned etc. The suernames affectes are totally wrong in those groups.

IMHO this has nothing to do with the script, since all users are now in the database of vb. And within vb they are all in the correct group. also the UG-ID of vb are teh exact same like in PP after the delete/sync process.

So where does PP get the information, that although according to vb a user is member of usergroup A, it shows online usergroup B?

in the database of vb, one user has UG-ID 9 (which is correct) the same user in PP database has UG-ID 6 (which is wrong).

There seems to be a step in the code of PP, where it does not take 100% the information provided in the database of vb.

Wait a moment...

The UG-ID 6 in PP was formerly (before the import) the correct UG-ID for that user. It is usergrouplevel Bronze.

The UG-ID for Bronze is in vb 9, not 6. In the database of PP after the sync, is the UG-ID for Bronze also 9.

So it seems that PP does not "update" the UG-ID for each user after the sync! It just leaves the users with their old UG-ID from the time before the sync!

Hope that information helps to find the solution.

Chuck S
September 11th, 2007, 11:42 AM
You know if everything works then you should be fine. Try running 562 files and does everything work. You should have a bug in beta 6 maybe.

snoopy5
September 11th, 2007, 12:14 PM
You know if everything works then you should be fine. Try running 562 files and does everything work. You should have a bug in beta 6 maybe.


I am only working with pp 562, not with beta 6 - although it is very appealing :)

snoopy5
September 11th, 2007, 12:58 PM
update:

I overwrite all fiels now with fresh PP 562 files of a donwload of yesterday. So very recent :)

After that I deleted again the usergroups in PP database except admin and did the sync in ACP. But still in the db of PP the users are part of the old UG-ID.

What else could it be?

Shall I now do a fresh import into a fresh vb forum withy your script again and try the sync afterwards again?

Chuck S
September 11th, 2007, 01:06 PM
You can send url and sing in information to support@photopost.com

snoopy5
September 11th, 2007, 01:29 PM
... I just sent the information...

snoopy5
September 14th, 2007, 04:25 PM
ok, everything seems fine now. Just a small problem:

When someone registers newly and did not upload an image yet and access within PP his profile (of PP), then an error occcurs:

--------

We're sorry, but the system experienced an unrecoverable error. Please try again later.

-----------

Everytime. I tested this with different new testaccounts. Links to the vb profile are o.k.

BUT when the same user uploads one image and clicks later on on the same link for his profile (in navigation bar on top of PP), no error occurs anymore. Never again.

What could be the reason for this?

P.S. No old user has this problem

Chuck S
September 14th, 2007, 05:05 PM
I will have to setup a new test standalone and see thanks.

snoopy5
September 20th, 2007, 02:55 PM
Hi

were you able to find the same mistake in your testinstall?

Chuck S
September 20th, 2007, 03:07 PM
No I see no errors here. I would suggest you set debug option in global options to display errors. You have a script error that you need to see what your error is to know how to deal with it.

Poldigit
June 9th, 2014, 08:07 AM
when running the script vbimport i receive following warnings: What should I do ?
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 281

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 282

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 294

Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 297

Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 298
Importing 1 Users .... Please wait
Import Done!!

Chuck S
June 9th, 2014, 09:49 AM
You most likely may have multiple issues but I would suggest you first check the access information given as well as table prefixes etc. I would also myself have to even see if this script is even compatible with the newest software. we are talking a script released what eight-nine years ago or so.

Poldigit
June 9th, 2014, 09:55 AM
I don't see any access information?

I directly see the issues...

Chuck S
June 9th, 2014, 11:22 AM
It is a self contained script look at your errors. These are simple queries.


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/admin/domains/wfcfotobeeld.eu/public_html/vbimport-2/import.php on line 281


You are not inputting the correct information when asked to be able to connect. Check the database information and table prefixes etc your. Look at the import config file. The information you should be using should be in your vb and photopost settings and config you must use the right info.

Chuck S
June 9th, 2014, 11:34 AM
I am wondering here why your using this nine year script which is suppose to import photopost users into vbulletin. I would suggest you use the vb impex importer which can import photopost users into vb.