PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Classifieds Installation & Upgrades (http://www.photopost.com/forum/classifieds-installation-upgrades/)
-   -   How to use Userfix.php for Classifieds & RP? (http://www.photopost.com/forum/classifieds-installation-upgrades/125731-how-use-userfix-php-classifieds-rp.html)

creativepart June 24th, 2006 04:35 PM

How to use Userfix.php for Classifieds & RP?
 
I've got all three PP, PPC and RP. I switched forums today from PHPBB to vB and I'm starting to work on the PP products.

I've started with PP Classified and got the database changed for integration, but need to update the users IDs now.

I've got userfix.php but it seems to be just for PP. What should I do for Classifieds and ReviewPost?

Thanks

Chuck S June 24th, 2006 05:00 PM

There are specific scripts in the import forum also for reviewpost and classifieds

creativepart June 24th, 2006 05:40 PM

1 Attachment(s)
Thanks I got em.

But I'm running classfix.php and it seems to be doing something weird so I can't tell if it's an error or not.

It's using the vB header and footer. It says, "PhotoPost Classifieds Upgrade
Preparing to update ads userids..." Above the vb header. Then in the middle of the page it says: Guitars and Gear For Sale Message
We're sorry, but the system experienced an unrecoverable error. Please try again later."

then there is a lot of white space followed by the vB footer.

I can't imagine that this is correct?

Chuck S June 24th, 2006 06:06 PM

You would have to say in your pp-inc.php remove this in bold to see your mysql error. I don't see anything wrong with the script

Code:

Content visible to verified customers only.

creativepart June 24th, 2006 06:11 PM

Chuck,
You lost me? "You would have to say in your pp-inc.php remove this in bold..."

I'm not understanding this. First, I see nothing in bold at all. Just a code box.

Could you take another shot at telling me what to do?

Paul

Chuck S June 24th, 2006 09:07 PM

The line I posted above is right in pp-inc.php and you can remove the part in bold from that line. That will make the error show up on upgrade to see what your issue is.

creativepart June 25th, 2006 03:04 PM

OK got that. (Though on my system the "bold" part is only ever so slightly bold, if at all. Not really enough to tell a difference but I got an idea of what you meant. You've told me to look at the bold part in one of your posts before and then I couldn't see anything bolder then the other, as well.)

Here's what I got in return after making that change in pp-inc.php:

Quote:

Script: classfix

Query: SELECT userid,username,email,password,usergroupid,timezoneoffset,salt,membergroupids FROM vB_user WHERE username='Ramblin' Ray'

Result: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Ray'' at line 1

Database handle: Resource id #5
I know that I have some members with apostrophes, ampersands, and quotes around their usernames. It seems that this is the problem. However, I tried changing his username to exclude the apostrophe and it still gave the same error -- as if the apostrophe was still there.

I made his username Ramblin Ray yet the error still came back as Ramblin' Ray.

Huh? How could that be?

Chuck S June 25th, 2006 03:52 PM

How about simply doing this in userfix.php Add the code in bold here

Code:

Content visible to verified customers only.

creativepart June 25th, 2006 05:57 PM

That seemed to do it.

But when I look at the Classifieds (the application) all the users are user=0 at least in the application they are. Do I need to do a Scan Database Resync Users and Comments or something?

I looked in the db at the class_ user table looks like it has userids, not zero's. The usergroupid is 0 on them all, though.

When I installed PP Classifieds I was userid=2 in my PHPBB forum. I made the first test ad and tested it sold, etc. In my new vB3 forum I am userid=3. If I look in my vB3 user table I see me as userid=3 and the importuserid=2. I ran the classfix.php now after your change and it went through all the steps. But when I look in the PP Classifieds user table I see userid=2 as the very first entry that should be me. Shouldn't it show userid=3 or am I missunderstanding how it works?

Paul

Chuck S June 25th, 2006 06:43 PM

Did you properly integrate with vb3?

This script will update the userid for the based on their username after you properly integrate with vb3

creativepart June 25th, 2006 11:10 PM

1 Attachment(s)
Yes I did integrate it with vB3. Every step was followed and the application reflects that in every way including the Admin CP. But, now, after running classfix.php, if I put my mouse over the username on ANY random ad it shows and links to:
"http://www.mydomain.com/classifieds/member.php?uid=0". It's this way on every one of the ads.

If I click on "memberlist" inside Classifieds I see ALL of the usernames of folks with ads... but all of the links link to uid=0

Should I try the "resync" in scandatabase or rerun the classfix.php?

It's obviously putting usernames with ads -- whether it's correct or not I have no idea. I've attached a screenshot of the "memberlist" first page from PP Classifieds and here is the link info shown in the links for every username in the screenshot:

http://www.domain.com/classifieds/member.php/uid/0
http://www.domain.com/classifieds/sh...t/500/ppuser/0

creativepart June 25th, 2006 11:42 PM

1 Attachment(s)
I do have one question about vB3 integration. In the user registration admin entry. Before switching I used phpbb2 for that field. Now I'm using vb3.

I wasn't 100% sure what I should use there, but since that was the name of the integration file in the classifieds "forums" directory I figured it was correct. And, I'm able to log on and stay logged on with it set that way.

I was not 100% sure what, exactly, that should be. So you could confirm that.

But as I said. I'm recognized by PP Classifieds as logged in and as Admin with that setting.

ALSO, I did give my vBulletin database tables a prefix (vB_) and that is non-standard. I think the vB3 standard is no prefix. I have it set up that way in PP Classifieds -- that my vB tables are all prefixed with vB_. I do see that classfix.php factors in the pp classifieds db prefix.

Is it possible that the classfix.php assumes that the vB3 tables have no prefix -- and it doesn't pick up that setting from the "forum settings" field in Admin???

I've attached a screenshot of my Classifieds Products table from phpmyadmin. You'll see the usernames... and the userid is zero on all of them.

Chuck S June 26th, 2006 07:40 AM

Try running the script again I do not see a thing wrong with the script itself. Clearly we grab the userid from the and issue an update command. I would need phpmyadmin login info and login info to assist if you wish.

creativepart June 26th, 2006 11:17 AM

Re-ran the script but no joy. I checked and the userids are updated and correct for everything else but "products". The "products" table shows ALL users with a uid of 0.

However, I checked the "comments" table and the UIDs are there and I checked them against the VB user table and they appear to be correct. Feedback has UIDs too, but I didn't check them for accuracy. I don't have any bids.

Could the "add slashes" line you had me add to classfix.php have an effect on products only? And, as I asked before... could the vB_ prefix effect the process in any way?

Maybe I should reapply a backup of the Classifieds db and start from scratch.

I need to get this solved so that I can reopen PP, RP and PP C.

Thanks for your help.
Paul

Chuck S June 26th, 2006 11:47 AM

Well remember your usernames should never be stored with a slash so this could yes be an issue for those names but not all. Addslashes are only added to make the query work. They are removed by mysql. Now if you have a larger database issue where Slammin' Sam's is stored as Slammin\' Sam\'s then thats an issue that should not be there.

I do not see any issues in the script by it would not work. Try downloading the script. I did addslashes on every part and see if things work.

creativepart June 26th, 2006 11:50 AM

It is classfix.php that's changing all the userids in the "Products" table to zero.

I restored the products table from my pre-migration backup. All the items in the Products tables had user IDs (the old PHPBB uids). I ran Cleaner.php and they were all changed to zero.

Could it be anything BUT the "Add Slashes" routine you had me add to the script?

Chuck S June 26th, 2006 11:53 AM

I see no issue as stated and it seems to work fine on my site so redownload and try it again. I already offered to help a few posts up

creativepart June 26th, 2006 12:02 PM

Thanks Chuck, I keep thinking we've just about got it.

I'll try the redownload and if all else fails take you up on your kind offer.

creativepart June 26th, 2006 12:32 PM

OK Here's what happened:

I downloaded the classifix.zip again, and replaced the php file on my server.

I ran classfix.php and got the original error on "Ramblin' Ray". Which was surprising. But it was the identical error. I didn't expect to get that error because you said you had added the 'add_slashes" commets all the way through the script. Did I misunderstand?

Anyway, after running classfix and getting the error, I checked the database for "Products". All the userids had been correctly changed up to the user BEFORE Ramblin' Ray. From that point on none of the userid were changed at all.

So it seems that this one record from Ramblin' Ray -- which is smack in the middle of all records in the products table is stopping the process.

Why don't I simply delete this guy's ad in the product table and run classfix again. That should fix it.

But you should also know that your script doesn't allow for apostrophe's in the username.

Let me know what you think I should do.
Paul

creativepart June 26th, 2006 12:47 PM

I went ahead and changed Ramblin' Ray's username in both the Products table and vb_users to Ramblin Ray without the apostrophe. I did a search to be sure he was only listed once in Classifieds and he was.

That fixed it.

The program ran, changed the Uids just fine.

But still your import script doesn't work with apostrophe's in the username. I would guess it will be the same with quotes.

I'll certainly do some checking of my database before I work on Review Post and PhotoPost.

Thanks for all your help. Don't know if we "fixed" anything be we learned a lot.

Paul


All times are GMT -5. The time now is 12:30 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97