vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   correct joindate when converting from phpbb! (https://vborg.vbsupport.ru/showthread.php?t=60210)

msimonds 01-13-2004 10:00 PM

correct joindate when converting from phpbb!
 
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

Zachery 01-14-2004 03:43 PM

all you should need to do is update the users and such via the ACP ?

msimonds 01-14-2004 03:50 PM

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

Zachery 01-14-2004 04:39 PM

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

msimonds 01-15-2004 03:53 AM

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


All times are GMT. The time now is 11:17 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.00935 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete