Phillyman

Page Credits Showing Guest

Recommended Posts

Phillyman    415

When we upgraded from IPB 3.x to 4.x, the databases got a few new field types. Where as the Scanned By, Edited By, Uploaded By and Page Credits fields on the old version were just plain text, this upgrade gave us a field type called "Member". Very simply put, rather than typing in "Phillyman ," you could just type "Phil" and a drop down box with all matching members would be shown. This also had the added benefit of when viewing a record, you could hover over the word "Phillyman" and my member card would appear and you could click directly to my profile, see if I am online, or start a PM with me.

All in all it was a nice little tweak. However this change is not a simple "change field type". Nope.....when you change the field type the data does not convert, rather it wipes it all out! But before I made that change I ran a backup of the existing data in those fields. Now for the Scanned, Edited and Uploaded By fields, it was pretty easy to convert. I had maybe 40 unique members who had filled in those fields. The old way stored plain text "Phillyman" in the database field, however the Member field stores my name as "1"....because that is my member ID number. So I converted everyone and I was done for those 3 fields.

Now the Page Credits, many many many more people actually added their usernames into that field. So I started redoing the conversion of Username to MemberID.......and then when I was about 50% done, I realized I was doing it ass backwards! How? Well because every time any member makes an edit to any of our databases, it stores a revision of how that data looked before they made the change. What does it store?

  • The MemberID of who made the change
  • The Database of the record they changed
  • The Record ID to which the change was made
  • The Changes made

Thats when I realized that I could simply extract THAT information (which already uses Member ID's) and then format it out in Excel and reimport it all back in with one shot. Why do it this way? Well because people make mistakes! Sometimes people misspelled their usernames, sometimes they forgot to add their name to the credits. So by changing the field to a Member type, we avoid any misspellings, and by extracting the revision data and reimporting it back into the credits field, I will make sure that every record in our databases has credited any user who has added information into that record. This also means when a member changes their display name on the forums, that the Member fields in our database will reflect their new names....without them having to manually go change all the records.

At the moment I am working on a script to take this format of data....

 

2017-02-25 19_25_03-Untitled - Notepad.png

 

and format it this way.....

 

2017-02-25 19_25_10-Untitled - Notepad.png

 

Once I know how to do that with a script or from inside of Excel, I can run monthly cleanups to quickly fix any credit issues across all the databases :P

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now