I think it would be nice to have a vB style profile link, the one that's in a post.
So basicly that when you click my profile in this post (on my username) a dropdown menu appears with the same links as in vBulletin.
Go here, go to a post and click on a profile to see what I mean:
http://www.vbulletin.com/forum/
Hi Kikkerking,
This can be mostly done with template edits.
I'm not going to bother with the fancy popup effect, but here's how to use MyBB's popup menu to achieve a similar effect. Modify the following templates like follows:
postbit
Find:
Add under:
HTML Code
<div id="profilelink_{$post['uid']}_popup" class="popup_menu" style="display: none;">
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/member.php?action=profile&uid={$post['uid']}" class="popup_item">View this user's public profile</a>
</div>
{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
</div>
<script language="javascript" type="text/javascript">
new PopupMenu("profilelink_{$post['uid']}");
</script>
|
Also find:
HTML Code
<span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span>
|
Replace with:
postbit_pm
Replace entire template with:
HTML Code
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/private.php?action=send&uid={$post['uid']}" class="popup_item">{$lang->postbit_pm}</a>
</div>
|
postbit_www
Replace entire template with:
HTML Code
<div class="popup_item_container">
<a href="{$post['website']}" class="popup_item">{$lang->postbit_website}</a>
</div>
|
postbit_find
Replace entire template with:
HTML Code
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/search.php?action=finduser&uid={$post['uid']}" class="popup_item">{$lang->postbit_find}</a>
</div>
|
postbit_email
Replace template with:
HTML Code
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/member.php?action=emailuser&uid={$post['uid']}" class="popup_item">{$lang->postbit_email}</a>
</div>
|
Also, open up /inc/functions_post.php,
Find:
PHP Code:
$post['profilelink'] = "<a href=\"".str_replace("{uid}", $post['uid'], PROFILE_URL)."\">".format_name($post['username'], $post['usergroup'], $post['displaygroup'])."</a>";
|
Replace with:
PHP Code:
$post['profilelink'] = "<a href=\"".str_replace("{uid}", $post['uid'], PROFILE_URL)."\" id=\"profilelink_{$post['uid']}\">".format_name($post['username'], $post['usergroup'], $post['displaygroup'])."</a>";
|
That's pretty much it.
If you have MyPlaza installed, and want a fade effect, in the above code for postbit, replace:
with
Note that, since this removes the buttons from the bottom of the post, it has the side effect that if a user has Javascript disabled, they can't directly access the links from the post. Meh, vBulletin does that anyway, so it shouldn't be an issue
Hope that helps.
Wow, thank you so much. It worked great. You're awesome at coding I must say.
Incredibly.
No worries - glad to help
Thanks this is real cool hack .. Does this works with the coming MyBB 1.4 also?
I haven't tried this with MyBB 1.4.
However, it'll still have a similar principle - ie, mostly a template edit.
anyway to add this feature to the toplinks?
Depends what you want and how you want it implemented...
It doesn't work... Here's a example:
http://forum.spotendo.uni.cc/showthread....http://forum.spotendo.uni.cc/showthread.php?tid=1&
This is my postbit template code:
Code:
<tr>
<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div id="profilelink_{$post['uid']}_popup" class="popup_menu" style="display: none;">
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/member.php?action=profile&uid={$post['uid']}" class="popup_item">View this user's public profile</a>
</div>
{$post['button_email']}{$post['button_pm']}{$post['button_find']}
</div>
<script language="javascript" type="text/javascript">
new MyPlazaPopupMenu("profilelink_{$post['uid']}");
</script>
<span class="smalltext"><a href="{$mybb->settings['bburl']}/plaza.php">{$lang->money}</a>: <span id="postmoney_{$post['pid']}">{$post[MYPLAZA_MONEY_COLUMN]}{$post['donate_postbit']}</span></span><br />{$post['invitems']}{$post['fws_w_level']}
</td>
<td class="{$altbg}" width="85%" valign="top">
<table width="100%">
<tr><td>{$post['posturl']}{$post['icon']}<span class="smalltext"><strong> {$post['subject']}</strong></span>
<br />
<div id="pid_{$post['pid']}">
<p>
{$post['message']}
</p>
</div>
{$post['attachments']}
{$post['signature']}
<div style="text-align: right; vertical-align: bottom;">
{$post['editedmsg']}
{$post['iplogged']}
</div>
</td></tr>
</table>
</td>
</tr>
<tr>
<td class="{$altbg}" height="18" style="white-space: nowrap; text-align: center;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
<td class="{$altbg}" width="100%" valign="middle" height="18">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td align="left" > </td>
<td align="right"><span class="smalltext">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['fws_warnlink']}</span></td>
</tr>
</table>
</td>
</tr>
{$seperator}
|
I can't even see my name now...