Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-25-2007, 12:22 PM
jacobsen1 jacobsen1 is offline
 
Join Date: Dec 2007
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default need help "adjusting" how the member number is displayed:

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:

Code:
<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:

Code:
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
Reply With Quote
  #2  
Old 12-26-2007, 06:37 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-26-2007, 05:16 PM
GPVB GPVB is offline
 
Join Date: Aug 2007
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$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.
Reply With Quote
  #4  
Old 12-27-2007, 03:37 PM
jacobsen1 jacobsen1 is offline
 
Join Date: Dec 2007
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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
Reply With Quote
  #5  
Old 12-27-2007, 07:44 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your best bet is to redo it again.

Did you try using the Maintence tools to rebuild userinfo and all that stuff?
Reply With Quote
  #6  
Old 12-28-2007, 07:44 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-29-2007, 01:30 PM
jacobsen1 jacobsen1 is offline
 
Join Date: Dec 2007
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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!!!!

Quote:
Originally Posted by Marco van Herwaarden View Post
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?
Reply With Quote
  #8  
Old 12-30-2007, 02:45 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #9  
Old 01-04-2008, 03:12 PM
jacobsen1 jacobsen1 is offline
 
Join Date: Dec 2007
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:10 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11067 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete