Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
correct joindate when converting from phpbb! Details »»
correct joindate when converting from phpbb!
Version: 1.00, by msimonds msimonds is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 01-13-2004 Last Update: Never Installs: 0
 
No support by the author.

I have a script that will correct the user regdate from phpbb to vbulletin so you will not get the registration date of 1969 or 1970 for those of you that have had problems with this is the past. I had this problem going from the nuke/phpbb port ---->to a standalone phpbb----->to vbulletin anyone is interested so when you convert your forums the correct registration date will appear and place the unix date back into the table!. Please let me know what you think of this script! I have tested this at least 10 times:

MAKE A BACKUP OF YOUR phpbb_users table and data before you run this script!


PHP Code:
<? 
/*******************************************************************/ 
/* Place this file in the same folder as config.php                */ 
/*******************************************************************/ 
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$sql = "SELECT user_id, user_regdate FROM phpbb_users"; 
$result = $db->sql_query($sql); 
while($record = $db->sql_fetchrow($result)) { 
   extract($record); 
   $user_regdate = str_replace(',',' ',$user_regdate); 
   $date = explode(' ',$user_regdate,3); 
   switch($date[0]) { 
      case('Jan'): $m=1;  break; 
      case('Feb'): $m=2;  break; 
      case('Mar'): $m=3;  break; 
      case('Apr'): $m=4;  break; 
      case('May'): $m=5;  break; 
      case('Jun'): $m=6;  break; 
      case('Jul'): $m=7;  break; 
      case('Aug'): $m=8;  break; 
      case('Sep'): $m=9;  break; 
      case('Oct'): $m=10; break; 
      case('Nov'): $m=11; break; 
      case('Dec'): $m=12; break; 
   } 
   $newDate = mktime(0, 0, 0, $m, $date[1], $date[2]); 
   echo $user_id.' -- '.$user_regdate.' = '.$newDate.' = '.date('m d Y',$newDate).'<br />'; 
/*******************************************************************/ 
/* When you are satisfied that the code is working correctly,      */ 
/* uncomment the following 2 lines and resubmit the script.        */ 
/*******************************************************************/ 
   //$sql = "UPDATE phpbb_users set user_regdate = $newDate where user_id = $user_id"; 
   //$result1 = $db->sql_query($sql); 

?>

name it whatever you want. I named it correct.php

thanks

Mike

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-14-2004, 03:43 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

all you should need to do is update the users and such via the ACP ?
Reply With Quote
  #3  
Old 01-14-2004, 03:50 PM
msimonds msimonds is offline
 
Join Date: Aug 2003
Location: Dallas, Texas
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes but what about if you have a large board that you are converting from phpbb. I have alomst 3000 members (which is not that large) do I really want to edit each member's joindate or user_regdate. This does it automatically
Reply With Quote
  #4  
Old 01-14-2004, 04:39 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in vB2 and vB3 there is a function to update counters which updates various info which can be done via the ACP, which will update this info for you
Reply With Quote
  #5  
Old 01-15-2004, 03:53 AM
msimonds msimonds is offline
 
Join Date: Aug 2003
Location: Dallas, Texas
Posts: 157
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are not reading my hack properly. If you are switching from the phpnuke version of phpbb it does not store the date like the standalone phpbb does. Hence when you move the nukebb to phpbb before you import it into vbulletin you can run this script and it will convert the date for you in the database, so when you import it all your current members will have their correct registtration date. I am just trying to help people out that is all!!!

As far as this control panel in VB2 & VB3m, it will not correct the joindate in the users table if it is either blank or zero, that is when you get the date of 1969 or 1970
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:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03683 seconds
  • Memory Usage 2,242KB
  • Queries Executed 18 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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