Not Solved PHP in Templates and Template Conditionals
Not Solved
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:

<?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...
Reply


Messages In This Thread
RE: PHP in Templates and Template Conditionals - by Fenrir Wolf - 2017-05-17, 06:41 AM
RE: Template conditionals - by expat - 2015-01-31, 05:28 AM

Forum Jump:


Users browsing this thread: 5 Guest(s)