Tommy
Member
Hi,
i had a script made a while back, which is not working anymore, the query goes like this:
This is supposed to get a custom user field, but looks like something changed after it was made, and how do i make it work again?
This is the error i get:
Line 73 is:
i had a script made a while back, which is not working anymore, the query goes like this:
PHP:
// Setup a new instance of XenForo so we can use the XenForo-database
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
$xenDb = XenForo_Application::get('db');
// Get members from XenForo database along
$reservedSlotsQuery = $xenDb->select();
$reservedSlotsQuery->from(array('ua' => 'xf_user_upgrade_active'), 'user_id')->from('xf_user_group', '')
->join('xf_user_upgrade', 'xf_user_upgrade.user_upgrade_id = ua.user_upgrade_id', 'title')
->join(array('u' => 'xf_user'), 'u.user_id = ua.user_id', array('username'))
->join(array('up' => 'xf_user_profile'), 'up.user_id = ua.user_id', array('custom_fields'))
->where('xf_user_group.user_group_id in (?)', $upgradeIdsToAllow);
$reservedSlotsStmt = $reservedSlotsQuery->query();
$reservedSlotsStmt->setFetchMode(Zend_Db::FETCH_OBJ);
$data = $reservedSlotsStmt->fetchAll();
// extract the data from the XenForoDB
foreach($data as $player)
{
$fields = @unserialize($player->custom_fields);
$playerInXenForo[$player->user_id]['originid'] = $fields['originid'];
$playerInXenForo[$player->user_id]['platform'] = $fields['platform'];
}
This is supposed to get a custom user field, but looks like something changed after it was made, and how do i make it work again?
This is the error i get:
An exception occurred: Undefined index: originid in /home/****/public_html/*****_xenforo.php on line 73
XenForo_Application::handlePhpError() in /home/****/public_html/*****_xenforo.php at line 73
Line 73 is:
PHP:
$playerInXenForo[$player->user_id]['originid'] = $fields['originid'];
Last edited: