No announcement yet.

Users module not working

  • Filter
  • Time
  • Show
Clear All
new posts

  • Users module not working

    Hello, I'm trying to import a forum from InstantForum to vBulletin, but any time I try to run the users module, it acts like it's starting, but then just says 0 out of 0 users imported.

    I know all the database connections and what not are correct, because I was able to run other modules, including the associate users module, which was able to pull all the users.

    Any suggestions on what I can do to fix this?
    Attached Files
    Ken Iovino
    Full Time PHP, Ruby and iOS Developer

  • #2
    Go into the source database and physically look at the users table. I seen something like that (minus the associate users because I skipped that) and I realized I didn't bring that table over to my new database.

    I'm having other problems, but hopefully that can fix yours.


    • #3
      Okay, I believe I have found the issue here. Unfortunately, vBulletin's Impex doesn't support the latest version of InstantForum -- which I believe is version 4.2.0 -- they [vBulletin] only supports up to version 4.1.4. I noticed that a lot of user fields were moved around when compairing the older version vs the newer one, so I went ahead and tracked them down and updated the queries to reflect these new changes.

      So far the changes seem to be working. I'm currently importing all the users now using the user module. For those who feel comfortable enough with php, and are experiencing this issue with InstantForum, you can replace the following function (get_InstantForum_user_details) in /system/InstantForum/000.php with the following code.

      This is at your own risk of course.

      PHP Code:
      function get_InstantForum_user_details(&$Db_object, &$databasetype, &$tableprefix$start_at$per_page)
      $return_array = array();

      // Check that there is not a empty value
      if(empty($per_page)) { return $return_array; }

          if (
      $databasetype == 'mssql')
      $count $Db_object->query_first("SELECT count(*) FROM {$tableprefix}InstantForum_Users");

      $internal   $start_at $per_page;

      $internal intval($count[0]))
      $per_page abs($start_at intval($count[0]));
      $internal intval($count[0]);

      $user_list $Db_object->query("
                  SELECT UserID
                       , PermissionID
                       , CAST([Interests] as TEXT) as Interests
                       , CAST([Biography] as TEXT) as Biography
                       , PostCount
                       , Occupation
                       , Post
                   WHERE UserID IN (SELECT TOP 
      {$per_page} UserID
                              FROM (SELECT TOP 
      {$internal} UserID FROM {$tableprefix}InstantForum_Users ORDER BY UserID)
                                 A ORDER BY UserID DESC)
                      BY UserID

              while (
      $user $Db_object->fetch_array($user_list))
      $return_array["$user[UserID]"] = $user;

      $core_user $Db_object->query_first("
                      SELECT EmailAddress
                           , Password
                           , Username
                           , IPAddress
                           , TimeZoneOffset
                           , CreatedDate
                           , LastLoginDate
                           , WebAddress
                           , MSN
                           , YIM
                           , ICQ
                           , AIM
                           , DOBDay
                           , DOBMonth
                           , DOBYear
                           , PhotoImage

                       WHERE UserID = '" 
      $user['UserID'] . "'

      $return_array["$user[UserID]"]['EmailAddress']      = $core_user['EmailAddress'];
      $return_array["$user[UserID]"]['Password']          = $core_user['Password'];
      $return_array["$user[UserID]"]['Username']          = $core_user['Username'];
      $return_array["$user[UserID]"]['IPAddress']         = $core_user['IPAddress'];
      $return_array["$user[UserID]"]['TimeZoneOffset']    = $core_user['TimeZoneOffset'];
      $return_array["$user[UserID]"]['CreatedDate']       = $core_user['CreatedDate'];
      $return_array["$user[UserID]"]['LastLoginDate']     = $core_user['LastLoginDate'];

      $return_array["$user[UserID]"]['WebAddress']        = $core_user['WebAddress'];
      $return_array["$user[UserID]"]['MSN']               = $core_user['LastLoginDate'];
      $return_array["$user[UserID]"]['YIM']               = $core_user['YIM'];
      $return_array["$user[UserID]"]['ICQ']               = $core_user['ICQ'];
      $return_array["$user[UserID]"]['AIM']               = $core_user['AIM'];
      $return_array["$user[UserID]"]['DOBDay']            = $core_user['DOBDay'];
      $return_array["$user[UserID]"]['DOBMonth']          = $core_user['DOBMonth'];
      $return_array["$user[UserID]"]['DOBYear']           = $core_user['DOBYear'];
      $return_array["$user[UserID]"]['AvatarURL']         = $core_user['PhotoImage'];


      Last edited by Ken Iovino; Thu 20 May '10, 10:41am.
      Ken Iovino
      Full Time PHP, Ruby and iOS Developer


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.