Quote:
Originally Posted by Alan_SP
That's strange. I just checked, I don't have empty href tag. I use version given here. Interesting is, picture is back again, so you can see how it looks like.
Anyway, maybe you did something wrong?
|
I'm not the one who actually installed the plugin, so I've no idea if the person who did it did anything funky. Since it's technically not my board that I'm helping out with, I'm worried about uninstalling the old one to install a newer version of the plugin. I'm also new to vb4 (the board that I own is still running vb3), and when I click on 'edit' next to the Product, it brings up a page I've never seen before that has uninstall and install codes.
If I wanted to do
this one without using the new .xml, do I need to uncomment one of the lines at the bottom of the code?
This is what is in this board's QAS: Handle Switch:
PHP Code:
$show['qas_switch'] = false;
if ($vbulletin->userinfo['psi_qas'])
{
// process switch
if ($_REQUEST['do'] == 'qas_switch')
{
require_once(DIR . '/includes/functions_login.php');
$switchto = $vbulletin->input->clean_gpc('r', 'userid', TYPE_UINT);
$switchable = explode(' ', $vbulletin->userinfo['psi_qas']);
if (in_array($switchto, $switchable))
{
$getuserdata = $db->query_first("
SELECT userid, username, password, salt, styleid
FROM " . TABLE_PREFIX . "user
WHERE userid = $switchto
LIMIT 1
");
if ($getuserdata)
{
// clean out the session crap...
$db->query_write("
DELETE FROM " . TABLE_PREFIX . "cpsession
WHERE userid IN ({$vbulletin->userinfo['userid']}, {$getuserdata['userid']})
");
$db->query_write("
DELETE FROM " . TABLE_PREFIX . "session
WHERE userid IN ({$vbulletin->userinfo['userid']}, {$getuserdata['userid']})
");
// set cookie...
vbsetcookie('userid', $switchto);
vbsetcookie('password', md5($getuserdata['password'] . COOKIE_SALT));
// unstrike the user...
exec_unstrike_user($getuserdata['username']);
// create new session...
$vbulletin->session =& new vB_Session($vbulletin, '', $getuserdata['userid'], '', $getuserdata['styleid']);
$vbulletin->session->set('userid', $getuserdata['userid']);
$vbulletin->session->set('loggedin', 1);
$vbulletin->session->set('bypass', 0);
$vbulletin->session->set_session_visibility(($vbulletin->superglobal_size['_COOKIE'] > 0));
if ($_SERVER['HTTP_REFERER'])
{
exec_header_redirect($_SERVER['HTTP_REFERER']);
}
}
}
// if we got up to here, something went wrong... redirect to home
exec_header_redirect($vbulletin->options['bburl']);
}
// fetch data
$getusers = $db->query_read("
SELECT userid, username
FROM " . TABLE_PREFIX . "user
WHERE userid IN (" . $db->escape_string(str_replace(' ', ',', $vbulletin->userinfo['psi_qas'])) . ")
");
// construct switchbit
if ($db->num_rows($getusers))
{
$switchbit = '';
while ($getuserdata = $db->fetch_array($getusers))
{
$templater = vB_Template::create('qas_switchbit');
$templater->register('getuserdata', $getuserdata);
$switchbit .= $templater->render();
$show['qas_switch'] = true;
}
}
// inject into the navbar template
require_once(DIR . '/includes/adminfunctions_template.php');
$add_string = vB_Template::create('qas_navbar_link');
$add_string->register('switchbit', $switchbit);
$add_string = $add_string->render();
//$template_hook['navbar_end'] .= $add_string; Line below is fix for 4.2.0
//$template_hook['navbar_after_links'] .= $add_string; Line below is fix for 4.2.1
$vbphrase['vb_navigation_link_qas_switch_text'] = $add_string;
}
Or should I just replace this with the plugin chunk in your .xml file?
Thank you, Alan for your patience!