SoCal
« Add Link to Full Profile Page »

Welcome Guest. Please Login or Register.
Sept 6, 2010, 4:43pm




SoCal :: SoCal Codes :: ProBoards Codes :: Add Link to Full Profile Page
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Add Link to Full Profile Page (Read 2,010 times)
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Add Link to Full Profile Page
« Thread Started on Feb 13, 2006, 3:46am »

This code allows you to add in another link to the bar that has:

Member's Bio - Modify Profile - Bookmarks

or perhaps

Member's Bio - Modify Profile - Ban Member - Send Private Message

on the view profile page, depending on who's profile it is and who's viewing it. It provides two modes: one for adding a link that appears for everyone in everyone's profile, and one that only appears if the user is viewing their own profile.

Code:
<script type="text/javascript">
<!--
/* add link to profile next to "Member's Bio etc." by california */

var mode = 1; // see instructions
var linkURL = "URL OF NEW LINK";
var linkText = "TEXT FOR NEW LINK";

var iBold = document.getElementsByTagName("b");
var rePatterns = [/=viewprofile/, new RegExp("=viewprofile(&user="+pb_username+")?$", "")];
if(location.href.match(rePatterns[mode-1])){
&nbsp; &nbsp; for(b=0; b<iBold.length; b++){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; if(iBold[b].nextSibling && iBold[b].nextSibling.nodeName == "HR" && iBold[b].innerHTML.match(/member's bio/i)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var newLink = document.createElement("a");
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;newLink.href = linkURL;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;newLink.appendChild(document.createTextNode(linkText));
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;iBold[b].appendChild(document.createTextNode(" - "));
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;iBold[b].appendChild(newLink);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;break;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; }
&nbsp; &nbsp; }
}

// -->
</script>


Main Footer

mode 1 = the link always appears in everyone's profile no matter who's viewing
mode 2 = the link only appears if the user is viewing their own profile

What you actually use this for is up to you. You could add in a "Check PMs" link there, or a "Manage Bookmarks" link, or maybe it can link to an external site that's of some significance or maybe it can be used in combination with some other code.
« Last Edit: Feb 13, 2006, 3:49am by california »Link to Post - Back to Top  IP: Logged

[image]
Stinky666
[image]
member is offline

[avatar]

[msn] [aim]
[homepage]

Joined: Jan 2006
Gender: Male
Posts: 2,107
Location: England
 Re: Add Link to Full Profile Page
« Reply #1 on Feb 14, 2006, 1:06am »

w00t... It works great.. Thanks ;D
Link to Post - Back to Top  IP: Logged

Extreme Data Join Today!
[image]

[image]
|~.::Omen::.~|
[image]
member is offline





Joined: Nov 2006
Posts: 10
 Re: Add Link to Full Profile Page
« Reply #2 on Feb 15, 2007, 6:41am »

AwEs0mE..........totally used it. Great code
Link to Post - Back to Top  IP: Logged
   [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile