MyBB Forum Integration

Forum
Last Post
Threads / Messages
I'd thought I'd jot down some notes here, just in case I find anyone who asks in the future.

1 - You can't install MyBB with Mysidia if your Mysidia install already has more members than just you as the Admin. If you do, the user id numbers in the database will be out of sync and it'll log the wrong user in, if not just refusing to work at all.

2 - Ok, you say, but I've already uploaded lots of pets and items and I don't want to have to do that all again! Understandable. You have a few options:
  • Backup some tables and reinstall everything, then use your backups to repopulate those tables.
  • If the other users were just relatively empty test accounts made by only you - just delete them? But you also have to reset the auto increment for the user id field! You can use this SQL (be sure to put in the username where it says 'USER_TO_BE_DELETED'):
    Code:
    DELETE FROM `adopts_users_status` WHERE `username` = 'USER_TO_BE_DELETED';
    
    ALTER TABLE `adopts_users_status` DROP `uid`;
    ALTER TABLE `adopts_users_status` AUTO_INCREMENT = 1;
    ALTER TABLE `adopts_users_status` ADD `uid` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
    
    DELETE FROM `adopts_users_profile` WHERE `username` = 'USER_TO_BE_DELETED';
    
    ALTER TABLE `adopts_users_profile` DROP `uid`;
    ALTER TABLE `adopts_users_profile` AUTO_INCREMENT = 1;
    ALTER TABLE `adopts_users_profile` ADD `uid` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
    
    DELETE FROM `adopts_users_options` WHERE `username` = 'USER_TO_BE_DELETED';
    
    ALTER TABLE `adopts_users_options` DROP `uid`;
    ALTER TABLE `adopts_users_options` AUTO_INCREMENT = 1;
    ALTER TABLE `adopts_users_options` ADD `uid` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
    
    DELETE FROM `adopts_users_contacts` WHERE `username` = 'USER_TO_BE_DELETED';
    
    ALTER TABLE `adopts_users_contacts` DROP `uid`;
    ALTER TABLE `adopts_users_contacts` AUTO_INCREMENT = 1;
    ALTER TABLE `adopts_users_contacts` ADD `uid` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
    
    DELETE FROM `adopts_users` WHERE `username` = 'USER_TO_BE_DELETED';
    
    ALTER TABLE `adopts_users` DROP `uid`;
    ALTER TABLE `adopts_users` AUTO_INCREMENT = 1;
    ALTER TABLE `adopts_users` ADD `uid` int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
  • Manually create user entries in the database for MyBB by copying the Admin, changing the usergroup from 4 to 2, and copying over all the relevant data by hand - password stuff, mostly.
3 - Alright, so now you've got the forums integrated. You don't want to use the forum profile at all. You can actually change where the link goes when a user clicks on another's username in the forums. If the folder you've installed MyBB is called 'forum', then we need to go to 'forum/inc/functions.php' and find the function build_profile_link which starts at around line 5720. One of the last lines inside this function returns the link. We need to change it.

Before:
PHP:
return "<a href=\"{$mybb->settings['bburl']}/".get_profile_link($uid)."\"{$target}{$onclick}>{$username}</a>";
After:
PHP:
return "<a href=\"{$mybb->settings['homeurl']}profile/view/{$username}\"{$target}{$onclick}>{$username}</a>";

Comments

There are no comments to display.
  • Forum Contains New Posts
  • Forum Contains No New Posts

Blog entry information

Author
Kyttias
Views
288
Last update

More entries in Mysidia

More entries from Kyttias

Forum statistics

Threads
4,267
Messages
33,048
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top