PDA

View Full Version : need help "adjusting" how the member number is displayed:


jacobsen1
12-25-2007, 12:22 PM
OK, I messed up the import from SMF. Somehow the member numbers ended up being a little too high, and our members want their numbers displayed in the area under their username...

Here's the code I have in the postbit_legacy now to do this:

<b>Member#:</b> $post[userid]our member numbers are off if they're over 175 by 338... So if it could be written something like this:

if userid < 176
<b>Member#:</b> $post[userid]
else
<b>Member#:</b> $post[userid-338]it should work. Can anyone here show me how to write that in php so it would work? Basically I just need to know how to write an if statement, and how to subtract 338 from the userid to get the displayed number... It should be possible, and will save me doing a fresh install and import to a new db.

Thanks,
Ben

Marco van Herwaarden
12-26-2007, 06:37 AM
How do you mean that your numbers are off?

The userid is a number internally used to identify a member, but has no meaning at all. There is no reason to change it.

GPVB
12-26-2007, 05:16 PM
$post is a named array.
"userid" is an index.

So, if you want to do this in templates, you cannot.
You need to change showthread.php before userid was been used. Use hooks.

jacobsen1
12-27-2007, 03:37 PM
How do you mean that your numbers are off?

The userid is a number internally used to identify a member, but has no meaning at all. There is no reason to change it.


We display the userid as a member number in each post. It's something our members want to have displayed, so it needs to be sorted out. What happened is that when we imported the db for the test, that brought in 170 members. Then when we did it again, somehow those first 170 weren't removed (they were gone, but the numbers picked up at 170) so everyone was 170 higher than they should have been. Then I shut down the forum and redid it again to get everyone correct by doing the import twice and that reset everyone back down to their original numbers... But then each new member would cause a db error because they were overwriting old locations. This would lock them out of their new account but it had the right member number. To fix the db errors the guys at vB reset the pointers, but they reset them to ~510... So all the original members are coming up correct, but all the new members are coming in above 500... Basically we're missing 330 member numbers the way it's displayed.

I know I can reinstall vB, make a new db, and do a fresh import to cure it, but if I can just subtract a given number from anyone with a userid above 170 then this way would work w/o having to close the forum down again. I know the actual userid doesn't matter, but my members want to have their member number displayed, so I need it just for that reason. Purely cosmetic. That's why I'd prefer to do some math on the number as it's displayed over doing an entire install/import again as I'll have to set everything up all over again which will take me a few days...

Thanks,
Ben

SEOvB
12-27-2007, 07:44 PM
Your best bet is to redo it again.

Did you try using the Maintence tools to rebuild userinfo and all that stuff?

Marco van Herwaarden
12-28-2007, 07:44 AM
You should never be messing with the id's that are automatically generated. This is a sure way to mess things up beyond repair.

As i see it you only have the following options:
- Just display the (new) userid. Who cares if there are numbers missing.
- Substract a fix number from the userid and display this as some kind of membernumber.
- Create a User Profile Field to hold an admin set number and display this.

jacobsen1
12-29-2007, 01:30 PM
You should never be messing with the id's that are automatically generated. This is a sure way to mess things up beyond repair.


this is EXACTLY why I'm not messing with them, and just want to DISPLAY the number as something lower... I DO NOT WANT TO CHANGE MY DB, JUST THE WAY THE userid IS DISPLAYED!!!!

Y
- Substract a fix number from the userid and display this as some kind of membernumber.

That's exactly what I want to do, and I'm asking for help with implementing. I have it displaying the userid right now. I need to implement and if statement on that display that says if the userid is <175, then display, else display userid-338... I don't want to actually subtract 338 from the userid, just display it as if it was 338 lower than it is...

Make sense?

Marco van Herwaarden
12-30-2007, 02:45 PM
Not really makes sense yet.
- There is no way of knowing if the members on your old board are loaded in the same order. So old userid 1 could now be 339, but old if 2 can now be 400.
- you are teaching your members to use numbers that are not used anymore. This could lead to confusion (link to member profile with userid = 1, will not give the expected member with userid=339).

jacobsen1
01-04-2008, 03:12 PM
all the usersids are in order. Everyone that was there before the switch to vB has their correct number, it's just that any new user is 338 higher than they should be. In every case so far, that's how it's working.

and it's just to display Member #:1
on their profiles in their posts.... These guys love to have that so they feel like an original member... IE the guys in the 50s feel cooler than the n00bs coming in at 18x now... It's very superficial, but it's what they want so I'm going to have it there.

I just finished uploading a fresh vB install with a new db and I put impex in there too. So I'm all set to go at this point. I just have to double check all the settings, then import it w/o "testing" it first this time. I figure if it works (vB -> vB should be cake) then I'm all set. If it doesn't, I just turn the old version back on and figure out what I did wrong.