Kyojii
07-09-2012, 03:35 AM
I seem to run into this problem a lot and it's always a pain to fix. This is being used to make a bbcode with this mod: https://vborg.vbsupport.ru/showthread.php?p=2346244#post2346244 .
<?php
require_once('./global.php');
$query = $db->query_read("SELECT `userid`, `username` FROM " . TABLE_PREFIX . "user WHERE UPPER(`username`) = UPPER(".$value.")");
$user = $db->fetch_array($query);
$avatar = fetch_avatar_url($user['userid']);
$avatar = ($avatar['hascustom']) ? $avatar[0].'&type=thumb' : $avatar[0];
$url = fetch_seo_url('member', array('userid' => $users['userid'], 'username' => $users['username']), array(), 'userid', 'username');
$output = "<img style='height: 16px;' src='".$avatar."'><a href='".$url."</a>";
return $output;
?>
I added the require_once on global to try and fix it but it didn't work. Every time I have this problem I always find this as well: https://vborg.vbsupport.ru/showthread.php?t=235092 but that never fixed it either. Changing the query to vB::$db->query_read(" simply changes the error saying that the class vB isn't defined. also using $vbulletin->db->query_read doesn't seem to solve the problem either.
<?php
require_once('./global.php');
$query = $db->query_read("SELECT `userid`, `username` FROM " . TABLE_PREFIX . "user WHERE UPPER(`username`) = UPPER(".$value.")");
$user = $db->fetch_array($query);
$avatar = fetch_avatar_url($user['userid']);
$avatar = ($avatar['hascustom']) ? $avatar[0].'&type=thumb' : $avatar[0];
$url = fetch_seo_url('member', array('userid' => $users['userid'], 'username' => $users['username']), array(), 'userid', 'username');
$output = "<img style='height: 16px;' src='".$avatar."'><a href='".$url."</a>";
return $output;
?>
I added the require_once on global to try and fix it but it didn't work. Every time I have this problem I always find this as well: https://vborg.vbsupport.ru/showthread.php?t=235092 but that never fixed it either. Changing the query to vB::$db->query_read(" simply changes the error saying that the class vB isn't defined. also using $vbulletin->db->query_read doesn't seem to solve the problem either.