Jump to content

Page Credits Showing Guest


Recommended Posts

  • Retromags Curator

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


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Achievements

    • Sangus103 earned a badge
      Reacting Well
    • Rob2099 earned a badge
    • TNNIKOLI earned a badge
      Member for 7 Days
    • TNNIKOLI earned a badge
      Member for 1 Day
    • Crystalice earned a badge
      Member for 6 Months
  • Create New...