Hello. I've been trying to figure out how to output the user name field for a long time and recently came across
this article, which provided the basic information I needed. I created a test PHP page and it worked on it's own with the following code:
PHP Code:
$vbpath = '/path/to/vbulletin/'; // Path to your vBulletin installation
define('CSRF_PROTECTION', false);
require_once($vbpath . '/includes/vb5/autoloader.php');
vB5_Autoloader::register($vbpath);
vB5_Frontend_Application::init('config.php');
$api = Api_InterfaceAbstract::instance();
$loginInfo = $api->callApi('user', 'login', array($_POST['username'], $_POST['password']));
$userInfo = $api->callApi('user', 'fetchProfileInfo', array($userid));
echo $userInfo['username'] . ' is logged in.';
This successfully outputs "myusername is logged in."
However, after pasting that code into a custom PHP module on the user profile page and saving the changes, the user profile page now only returns the error "Couldn't read config file config.php", with no apparent way to revert the change.
I've since figured out all I needed to include in my custom PHP module was this:
PHP Code:
$api = Api_InterfaceAbstract::instance();
$userInfo = $api->callApi('user', 'fetchProfileInfo', array($userid));
echo $userInfo['username'] . ' is logged in.';
Unfortunately my user profile page is still broken and I have no idea how to fix it. Can anyone assist, please?
--------------- Added [DATE]1463601764[/DATE] at [TIME]1463601764[/TIME] ---------------
I have found a file called vbulletin-pages.xml that refers to a page guid="vbulletin-4ecbdac82f0bb4.37025811" for the "User Profile" page, but I don't know how/where to access that actual page to manually restore an older version of it. Suggestions, anyone? Am I headed in the right direction? Thanks.