View Full Version : Retrieve musername (with markup)
vBNinja
04-07-2013, 05:26 PM
Solution: https://vborg.vbsupport.ru/showpost.php?p=2415127&postcount=9
Scanu
04-07-2013, 06:45 PM
$musername = fetch_musername($userid);
echo '<a href="profile.php?'.$userid.'">'.$musername.'</a>';
I did this without seeing vbulletin, so i don't remember if the profile link is correct and if fetch_musername returns the link or just the coloured name
vBNinja
04-07-2013, 06:52 PM
Thanks ill give it a try :)
Scanu
04-07-2013, 07:01 PM
You're welcome :) and remember that you have to replace the variable $userid with the one you're using for it
vBNinja
04-08-2013, 04:28 AM
Unfortunately it didn't work, the output just shows the ID number as a link with no username
Scanu
04-08-2013, 12:48 PM
Can you post your code?
vBNinja
04-08-2013, 02:39 PM
Can you post your code?
//Retrieving users
while ($row = $vbulletin->db->fetch_array($result))
{
$userid = $row['userid'];
$musername = fetch_musername($userid);
//More code
}
echo '<a href="profile.php?'.$userid.'">'.$musername.'</a>';
Lynne
04-08-2013, 03:10 PM
That can't be all of your code - where is the initial query to fetch the users?
vBNinja
04-08-2013, 03:30 PM
Got it working
This did the trick:
$musername = fetch_musername(fetch_userinfo($id));
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.