MyBB Community Forums

Full Version: PHP link
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How to properly arrange this link in PHP?
$mybb->something = '<a href="{$mybb->settings['bburl']}/{$user['profilelink_plain']}">$user['username']</a>';
$mybb->something = "<a href=\"{$mybb->settings['bburl']}/{$user['profilelink_plain']}\">{$user['username']}</a>"; 

http://www.php.net/manual/en/language.ty...tax.double

Something like this is probably better asked on a site like Stackoverflow.com as it relates to programming in general.
@Nathan Malcolm thanks very much man. Listen for some reason {$user['profilelink_plain']} doesn't work any idea please???
Alternate approach:

$mybb->something = '<a href="'.$mybb->settings['bburl'].'/'.$user['profilelink_plain'].'">'.$user['username'].'</a>';
I guess you're looking for this: https://github.com/mybb/mybb/blob/0c25f6...t.php#L237

It isn't defined anywhere else.
Yeah that's what I use in my postbit how to make it work in my home page???
$mybb->something = "<a href=\"{$mybb->settings['bburl']}/member.php?action=profile&uid={$user['uid']}\">{$user['username']}</a>"; 
Thanks very much that is what I had initially, I am using SEO plugin and I would like show: something.com/user-marcus and if SEO plugin stops working it should show default MYBB URL
Further reference, using inbuilt function:

$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
$profile_link = get_profile_link($user['uid']);
$mybb->something = "<a href=\"{$profile_link}\">{$user['username']}</a>"; 
Pages: 1 2