Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 vB style profile link
Kikkerking Offline
Junior Member
**
Posts: 31
Joined: Jan 2008
Post: #1
vB style profile link
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/
01-30-2008 11:48 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: vB style profile link
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:

HTML Code
{$post['user_details']}

Add under:

HTML Code
1
2
3
4
5
6
7
8
9
<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&amp;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:

HTML Code
&nbsp;


postbit_pm
Replace entire template with:

HTML Code
<div class="popup_item_container">
<a href="{$mybb->settings['bburl']}/private.php?action=send&amp;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&amp;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&amp;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:

Javascript Code
new PopupMenu

with

Javascript Code
new MyPlazaPopupMenu



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 Tongue
Hope that helps.


My Blog
(This post was last modified: 01-31-2008 06:48 PM by ZiNgA BuRgA.)
01-31-2008 06:46 PM
Find all posts by this user
Kikkerking Offline
Junior Member
**
Posts: 31
Joined: Jan 2008
Post: #3
RE: vB style profile link
Wow, thank you so much. It worked great. You're awesome at coding I must say. Shocked Incredibly. Wink
01-31-2008 11:46 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: vB style profile link
No worries - glad to help Smile

My Blog
02-01-2008 06:22 PM
Find all posts by this user
AjEe Offline
Junior Member
**
Posts: 1
Joined: Mar 2008
Post: #5
RE: vB style profile link
Thanks this is real cool hack .. Does this works with the coming MyBB 1.4 also?
03-26-2008 03:49 PM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: vB style profile link
I haven't tried this with MyBB 1.4.

However, it'll still have a similar principle - ie, mostly a template edit.

My Blog
03-27-2008 10:13 AM
Find all posts by this user
incadude Offline
Member
***
Posts: 52
Joined: Jan 2008
Post: #7
RE: RE: vB style profile link
anyway to add this feature to the toplinks?
06-09-2008 11:37 AM
Find all posts by this user
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: vB style profile link
Depends what you want and how you want it implemented...

My Blog
06-09-2008 03:42 PM
Find all posts by this user
Guest
Unregistered
 
Post: #9
RE: vB style profile link
Wheres inc/functions?
06-19-2008 02:27 AM
Guest
Unregistered
 
Post: #10
RE: vB style profile link
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<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&amp;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" >&nbsp;</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...

06-27-2008 09:27 AM

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: