Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Export Users to DB doesn't give full nuke list

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
ambaxter

Beginner
Beginner


Joined: Jan 01, 2004
Posts: 19

PostPosted: Sun Sep 18, 2005 1:57 pm    Post subject: Export Users to DB doesn't give full nuke list Reply with quote

When I export my users, it gets all the way to a certain point and then it stops. The user that it stops changes based on how many users I have in my DB.

For instance, when I delete a user from my nuke database, G2 exports one less user. It reports a number of users exported successfully, but upon review, i notice that there are around 30+ users at the tail end that were not brought over.

Further, when I EMPTied the user table in phpmyadmin, G2 still says they exported successfully, but when I check the table, it's completely empty. Even after several exports.

Does anyone have info on why either of these two things might be happening? Specifically, the first issue.

Thanks
Back to top
Offline View user's profile Send private message
AdBot
   Post subject: Export Users to DB doesn't give full nuke list  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Tue Sep 20, 2005 6:57 am    Post subject: Re: Export Users to DB doesn Reply with quote

do you get any error messages?
Back to top
Offline View user's profile Send private message Visit poster's website
ambaxter

Beginner
Beginner


Joined: Jan 01, 2004
Posts: 19

PostPosted: Sun Oct 02, 2005 4:22 pm    Post subject: Reply with quote

I wrote: › It reports a number of users exported successfully, but upon review, i notice that there are around 30+ users at the tail end that were not brought over.


No, there are no errors. It reports a complete import of all X users in the Nuke database.

I think I see what's happening. If G2 sees that your Nuke installation has X number of users, it will go and get users (excluding anonymous) and count up to the user who's ID matches the last of the number of users you have and that's what gets imported into your Gallery installation.

The reason this is not a good method of calculating how many users should be pulled into the DB. Someone correct me if I don't get this right. Example: You have 10 users in your Nuke DB. You delete user #3 and are left with 9, right? When your 11th user signs up, he's assigned ID 11, but you have a total of 10 users. If G2 sees you have 10 users, it's only gonna count from ID #1 up to ID #10, which would leave out any whose IDs are above the total number of users.


Is this hypothesis on the right track?


Last edited by ambaxter on Sun Oct 02, 2005 9:44 pm; edited 1 time in total
Back to top
Offline View user's profile Send private message
daltoniko

Novice
Novice


Joined: Feb 16, 2004
Posts: 24

PostPosted: Sun Oct 02, 2005 5:41 pm    Post subject: Re: Export Users to DB doesn Reply with quote

you got it.
I had the same proble....
but after I had try to reinstall all... and gallery give me one kind of error...one of the a lot. Maybe some problem with user id 905.
So I had try to delete this user... and gallery give me an other kind of error... Maybe some problem ...sounds like exceding data ...with another user.. id 930... and so.

Now. ?
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6287
Location: Washington Township, NJ, USA

PostPosted: Mon Oct 03, 2005 6:55 am    Post subject: Re: Export Users to DB doesn Reply with quote

heeey..good eyes. instead of counting the num_rows for the query, i should have it check the max user_id instead. hmm...but that might foul things up too....

let's take your example...you have user_id's in phpnuke of 1,2,3,4,5,6,8,9,10,11 (skipping user_id 7). using the num_rows result for 1 -> num_rows, it will only go from 1 to 10 (possibly throwing an error on 7, since it's not there), and skipping 11. but, if the max user_id is used, it will go from 1 -> 11, possibly erroring on 7, and then again at the end, since there are really only 10 users. hmm....but this is really the only viable option. to prevent the error when no user of the user_id exists, a simple check can be made...ok, adding this to the todo Smile
Back to top
Offline View user's profile Send private message Visit poster's website
tguless

Beginner
Beginner


Joined: Sep 16, 2004
Posts: 4

PostPosted: Tue Nov 01, 2005 1:39 pm    Post subject: Re: Export Users to DB doesn Reply with quote

This was an easy fix:

Line 167 of /modules/gallery2/admin/index.php
replaced:
$sql = "SELECT max(*) AS ucount FROM ".$user_prefix."_users";
with:
$sql = "SELECT max(user_id) AS ucount FROM ".$user_prefix."_users";

It did the trick for me.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 2 Integration View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPseo packagesSEO CompanyNew York Yellow PagesFind LocationsVOIP Phone ServiceNeckermannOnline internetSEORestaurant Locator • Get great HP coupons from CouponSnapshot • Search for great dell coupons at CouponSnapshot.com.au • Graduation DressesAndroid TabletSEO IndiaBuy Phen375fuel filter

8th year online! 2003-2011
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia