2017-05-17, 06:41 AM
Awesome plugin, I'm trying to combine it with your xThreads plugin and having some problems though.
I'm trying to call the $db from a custom thread field to get the username of the parent account creating the post, since the account switcher plugin I use only gives me the UID of the parent account.
Here is what I'm putting in the Blank Replacement Value:
I'm trying to call the $db from a custom thread field to get the username of the parent account creating the post, since the account switcher plugin I use only gives me the UID of the parent account.
Here is what I'm putting in the Blank Replacement Value:
<?php
define("IN_MYBB", 1);
require_once "./global.php";
global $mybb, $db;
if($mybb->user['as_uid']){
$query = $db->query("SELECT * FROM mybb_users WHERE uid='". $mybb->user['as_uid'] ."'");
}elseif($mybb->user['as_share']){
$query = $db->query("SELECT * FROM mybb_users WHERE uid='". $mybb->user['as_shareuid'] ."'");
}
$qresult = $db->fetch_array($query);
return $qresult['username'];
?>
The error I get is that I can't get admin/index.php from that point... which doesn't really makes sense...