InterOcean Designs
« Nav Tree Ultimate Customize Combo »

Welcome Guest. Please Login or Register.
May 19, 2013, 10:28pm




InterOcean Designs :: ProBoards Codes :: ProBoard Code Database :: Nav Tree Ultimate Customize Combo
Page 1 of 7 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Nav Tree Ultimate Customize Combo (Read 5,344 times)
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Nav Tree Ultimate Customize Combo
« Thread Started on Jun 23, 2009, 3:35am »

Nav Tree Ultimate Customize Combo by SubDevo
Tested in IE, FF, Opera and Safari

Preview (animated gif) Live preview is above this post! ;)

What can you do with this code?
Give your nav tree a background image or color with borders.
Custom divider (text or image)
Replace forum name with whatever you wish.
Option to Remove nav tree from main page. (or all, but why do that? lol)
Option to clone nav tree and put a copy under the forum jump.
Doubles as a PM bar with Quick links to: Inbox, Outbox, PM preferences, Modify Profile, Bookmarks and most Recent forum posts.
You choose the text (with color option) or image to be displayed when you get a new PM.
Hover over "Inbox" or "New Message" gives you a tooltip with number of old and new messages.
To the far right of the nav tree, you have options to display the time/date, text or an image. This is a link to toggle the nav tree to see the Quick Links at any time in any thread.

Any image used in this code can be transparent and/or animated!
This code is compatible with Smangii Side Table Code!


There is also a CSS portion for this code.
This is explained below, AFTER the variable descriptions.

Enjoy!!!
SubDevo :)

Variable Descriptions:

var remNav=0; // 0=Don't Remove, 1=Remove from Main Page, 2=Remove from all pages
Options to display Nav Tree on all pages (PB default), Remove from the Main Page only or completely remove Nav Tree.(why?)

var divider=""; // Your desired nav tree separator. ( - / > | » • → ● ○ ► ◊ ║ ▪ )
This can be any text character(s) or a URL to an image.
If using an image, bottom of text lines up with image bottom.
Best results are obtained if divider image height is less than or equal to font height.
(8px height is a good starting point for default Nav Tree font size).

var fName="Home"; // Replaces your Forum Name with this Name.
If you wish to keep your original forum name here, replace "Home" with "".

var fjClone=0; // Place a copy of Nav Tree under Forum Jump? 1=Yes, 0=No
Option to give you a second Nav Tree under your Forum Jump at the bottom of your forum.

var showTime=1; // Display Date-Time in Nav Tree? 1=Yes, 0=No
Option to display the time and date to the far right of Nav Tree. This doubles as a Nav/Quick Links toggle link.

var swapNav="◄►"; // If showTime=0, this is used to toggle Nav/Quick Links
If showTime=0, this is used for the Nav/Quick Links toggle link. This can be text or a URL to an image.

var memLinks=1; // Display Quick Links on Main Page? (Only works if remNav="0")
This displays some handy links on the main page instead of the "normal" Nav Tree.
New PM's or No New PM's, Outbox, PM preferences, Modify Profile, Bookmarks and most Recent forum posts.
If you are a guest, this is replaced by "Welcome Guest! Please Login or Register" links.

var newMess="NEW MESSAGE!"; // New Message text or image URL.
Enter Text or a URL to image to be used for new message alert.
var newMessColor="E00000"; // New Message text color.
If newMess is text, it will be this color. Ignored if newMess is an image.

var indent=6; // Number of Pixels to Indent.
Indent text inside Nav Tree from the left (and right) by this amount. Also shifts "Nav/Quick Links toggle link", by this amount, from the right.

var imgSrc="URL to Background Image";
Enter full URL to a background image if desired. Transparent images are supported.
Nav Tree will be transparent without it.(unless you set a backcolor in navcombo CSS)

var bgRepeat=0; // Repeat background image? 1=Yes, 0=No
Set this to "1" if you are using a repeating gradient for your background image.

var navWidth=777; // (px) Desired Width of Nav Tree.
If this is less than your forum width, it will be centered on your forum.

var navHeight=18; // (px) Desired Nav Tree Height.
Normally this is set to your background image height. But, you may enter any height.

var oRide=0; // Show Quick Links on Every Page? 1=Yes, 0=No
This forces Quick Links to be displayed on every page, instead of the normal nav tree. Members will have to click the toggle link to see the nav tree.

CSS Instructions:

This CSS MUST be above the script.
You may also place it with the rest of your forum global CSS.


<style type="text/css">
<!--
.navcombo {color: #000000; position: relative; text-align: left; padding-top: 2px; top: -5px; border: 0px solid #000000;}
-->
</style>


color: #000000;
Color of all text that are NOT links. This includes the divider if it is text.
top: -5px;
Adjust vertical position of nav tree. Negative moves up, positive moves down.
In this case nav tree is moved up 5px.
border: 0px solid #000000;
Border width and color. Keep at "0px" to remove border.

If you do not use a nav tree background image, the nav tree will be transparent unless you put this in your navcombo CSS:
background-color: #D9D941;
Do NOT put this in CSS if you are using a transparent background image. This color will show through it.

Location: Global Footer (near top)
Code:
<script type="text/javascript">
/* Nav Tree Ultimate Customize Combo by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* [url]http://interoceandesigns.proboards.com[/url] or [url]http://lsdp.proboards.com[/url] */

var remNav=0; // 0=Don't Remove, 1=Remove from Main Page, 2=Remove from all pages
var divider="&#9658;"; // Your desired nav tree separator. ( - / > | » • &#8594; &#9679; &#9675; &#9658; &#9674; &#9553; &#9642; )
var fName="Home"; // Replaces your Forum Name with this Name.
var fjClone=0; // Place a copy of Nav Tree under Forum Jump? 1=Yes, 0=No
var showTime=1; // Display Date-Time in Nav Tree? 1=Yes, 0=No
var swapNav="&#9668;&#9658;"; // If showTime=0, this is used to toggle Nav/Quick Links
var memLinks=1; // Display Quick Links on Main Page? (Only works if remNav="0")
var newMess="NEW MESSAGE!"; // New Message text or image URL.
var newMessColor="E00000"; // New Message text color.
var indent=7; // Number of Pixels from Left to Indent
var imgSrc="URL TO IMAGE"; // Nav tree background image.
var bgRepeat=0; // Repeat background image? 1=Yes, 0=No
var navWidth=777; // (px) Desired Width of Nav Tree.
var navHeight=18; // (px) Desired Nav Tree Height.
var oRide=0; // Show Quick Links on Every Page? 1=Yes, 0=No

// DO NOT EDIT BELOW
var backImg=new Image(); backImg.src=imgSrc;
var n=document.getElementsByTagName("font"); var x=0; var n_C="navcombo";
while(!(n[x].parentNode.nodeName.match(/p/i)&&n[x].innerHTML.match(/Hey,\s|Welcome\s/))&&x<n.length){x++;}
welMess=n[x].innerHTML; n=document.links; x=0;
while(n[x].className!="nav"&&x<n.length){x++;}
if(fName){n[x].innerHTML=fName;}
var timeDiv=document.createElement("div"); var td=n[x].parentNode;
with(welMess){
&nbsp;&nbsp;&nbsp;if(pb_username!="Guest"){var pMs=slice(indexOf('pm">')+4,match(/(is|are)\snew/i).index).replace(/<\/a>\,/i," |")+"new";}
&nbsp;&nbsp;&nbsp;divider=" "+cImg(divider,0)+" "; swapNav=cImg(swapNav,0); newMess=cImg(newMess,1);
&nbsp;&nbsp;&nbsp;var datetime=(showTime)?slice(match(/<br>/i).index+4):swapNav;
} var navDiv=timeDiv.cloneNode(false);
with(timeDiv.style){ styleFloat="right"; cssFloat="right"; marginRight=indent+"px"; marginTop="1px";}
with(timeDiv){innerHTML="<a href='javascript:swapIt()' class='nav'>"+datetime+"<\/a>";}
with(navDiv.style){ backgroundImage=(imgSrc.match(/^http:\/\//i))?"url("+imgSrc+")":"none";
&nbsp;&nbsp;&nbsp;width=navWidth+"px"; height=navHeight+"px"; paddingLeft=indent+"px";
&nbsp;&nbsp;&nbsp;if(!bgRepeat){backgroundRepeat="no-repeat";}}
with(navDiv){ id=n_C; className=id;
&nbsp;&nbsp;&nbsp;for(x=0;x<td.childNodes.length;x++){ var nc=td.childNodes[x];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((nc.nodeType==3&&nc.data.match(/(::|\s)/))||nc.nodeName.match(/^(font|a)$/i)){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;appendChild(nc); x--;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else if(nc.nodeName.match(/table|form|script/i)){break;}
&nbsp;&nbsp;&nbsp;} var y=x;
&nbsp;&nbsp;&nbsp;var iH=innerHTML; iH=iH.replace(/^\W+(?=<)|&(?=nbsp;)|nbsp;/gi,"").replace(/::/g,divider);
&nbsp;&nbsp;&nbsp;var st='<a href="/index.cgi?action='; var sx='" class="nav">'; var sm=divider+st;
&nbsp;&nbsp;&nbsp;var iM="Welcome Guest!"+divider+"Please "+st+'login'+sx+'Login<\/a> or '+st+'register'+sx+'Register<\/a>.';
&nbsp;&nbsp;&nbsp;if(pb_username!="Guest"){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iM="Hi "+pb_displayname+"!"+sm+'pm"'+' title="'+pMs+sx;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iM+=(welMess.match(/,\s0\sar/i))?"Inbox":newMess;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iM+="<\/a>"+sm+'pm&view=2'+sx+'Outbox<\/a>'+sm+'pmprefs'+sx+'PM Prefs<\/a>';
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iM+=sm+'modifyprofile&user='+pb_username+sx+'Modify Profile<\/a>';
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iM+=sm+'bookmarks'+sx+'Bookmarks<\/a>'+sm+'recent'+sx+'Recent<\/a>';
&nbsp;&nbsp;&nbsp;} innerHTML=(oRide||(memLinks&& !remNav&&pb_action=="home"))?iM:iH;
&nbsp;&nbsp;&nbsp;insertBefore(timeDiv,childNodes[0]); var cd=document.createElement("center");
&nbsp;&nbsp;&nbsp;td.insertBefore(cd,td.childNodes[y]); cd.appendChild(navDiv);
&nbsp;&nbsp;&nbsp;style.width=navWidth-(offsetWidth-navWidth)+"px";
} var ts=((remNav==1&& !location.href.match(/\?/))|remNav==2)?0:1;
if(ts&&fjClone){ var nFj=cd.cloneNode(true);
&nbsp;&nbsp;&nbsp;with(nFj.firstChild){id=n_C+"2"; className=n_C; style.top="0px";}
&nbsp;&nbsp;&nbsp;td.appendChild(document.createElement("br")); td.appendChild(nFj);
} if(!ts){cd.style.display="none";}
function cImg(sT,nM){
&nbsp;&nbsp;&nbsp;if(sT.match(/^http:\/\//i)){ sT='<img style="border: none;"'+' src="'+sT+'" alt="'+pMs+'" \/>';
&nbsp;&nbsp;&nbsp;}else if(nM){sT="<font color='#"+newMessColor+"'>"+sT+"<\/font>";} return sT;
}
function swapIt(){ x=0; var nPr=/PM\sPrefs/;
&nbsp;&nbsp;&nbsp;while(x<fjClone+1){ var pB=document.getElementById((x)?n_C+"2":n_C); x++;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with(pB.innerHTML){pB.innerHTML=slice(0,(match(/v\>/i).index)+2)+(((match(nPr))?0 :1)?iM:iH)}
&nbsp;&nbsp;&nbsp;}
}
</script>
NOTE:
This code has been updated. In previous code, when fjClone=1 (second nav tree under forum jump), the bottom nav tree would not switch to the pm bar.
This is now fixed. Also the CSS name has been changed from #navcombo to .navcombo. And an extra variable has been added for user selectable background image repeat for use with repeating gradients. Enjoy!!!
« Last Edit: Aug 23, 2011, 1:02pm by SubDevo »Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Mac
Senior Member
member is offline

[avatar]


[homepage]

Joined: Apr 2009
Gender: Male
Posts: 828
Location: Wales
Karma: 22
 Re: Nav Tree Ultimate Customize Combo
« Reply #1 on Jun 23, 2009, 4:19pm »

Quality SubDevo
Link to Post - Back to Top  IP: Logged

[image]


GFX Support
GFX Designer
member is offline

[avatar]

Off duty



Joined: Apr 2009
Gender: Male
Posts: 1,962
Karma: 75
 Re: Nav Tree Ultimate Customize Combo
« Reply #2 on Jun 24, 2009, 1:32pm »

Hate to say this (no I don't, just kidding), but your codes are just getting better by the day, Sub. 8-)

---> Exalt Sub +1
« Last Edit: Jun 24, 2009, 1:34pm by GFX Support »Link to Post - Back to Top  IP: Logged

I'm off duty! For questions or support please contact RADesign or Speed Demon.
ManGoneMad
Full Member
member is offline

[avatar]

[yim] [aim]
[homepage]

Joined: May 2009
Gender: Male
Posts: 229
Location: west coast of Michigan
Karma: 20
 Re: Nav Tree Ultimate Customize Combo
« Reply #3 on Jun 24, 2009, 7:21pm »

I've been looking forward to this one, really great work SubDevo! :)

Link to Post - Back to Top  IP: Logged


[image]
[image]
Super Dave
Junior Member
member is offline

[avatar]

I'm on a boat!



Joined: Apr 2009
Gender: Male
Posts: 77
Location: Toledo,Ohio
Karma: 2
 Re: Nav Tree Ultimate Customize Combo
« Reply #4 on Jun 24, 2009, 10:39pm »


Jun 24, 2009, 7:21pm, ManGoneMad wrote:
I've been looking forward to this one, really great work SubDevo! :)

Same here..I cant wait to check it out..Your a helluva coder Sub!
Link to Post - Back to Top  IP: Logged

I'm Dave.... an all around cool guy! lol..
SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Nav Tree Ultimate Customize Combo
« Reply #5 on Jun 25, 2009, 6:47pm »

Thank you! Thank you! Thank you! (one for each of the previous posts) :)

I aim to please. And if any of you need any help adjusting or other issues, let me know. I would be glad to help!

Got another big code coming out soon "Proboard Forum Customize v1.0".
(Yes, this one competes with Mad Max's "Proboard Forum Remodel v2.0".
Currently in use here at IOD!) ;)

Hope you enjoy!
SubDevo
« Last Edit: Jul 3, 2009, 2:34am by SubDevo »Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
RADesign
Administrator
member is offline

[avatar]


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 1,601
Location: IOD
Karma: 136
 Re: Nav Tree Ultimate Customize Combo
« Reply #6 on Jun 27, 2009, 9:44pm »

OMG ... it's about damn time you finished this code! Whatcha been doing all this time?!?! Talking to your fave fucktard?? heehee

Good job Sub! You come up with the most original/practical codes out there.
Link to Post - Back to Top  IP: Logged

[image]
Paige
Senior Member
IOD's Music/Drama Queen
member is offline

[avatar]

On Hiatus, to RPG world

[yim] [msn]

Joined: Apr 2009
Gender: Female
Posts: 547
Location: Malaysia
Karma: 6
 Re: Nav Tree Ultimate Customize Combo
« Reply #7 on Jul 1, 2009, 11:01pm »

Really nice,thanks!
Link to Post - Back to Top  IP: Logged


[image]
Mac
Senior Member
member is offline

[avatar]


[homepage]

Joined: Apr 2009
Gender: Male
Posts: 828
Location: Wales
Karma: 22
 Re: Nav Tree Ultimate Customize Combo
« Reply #8 on Jul 11, 2009, 2:16pm »

Hi friends, I just can't quite work out how to seperate the date from the rest of the bar like your example shows.

Can you advise please ?

Thanks very much.

Macc
Link to Post - Back to Top  IP: Logged

[image]


SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Nav Tree Ultimate Customize Combo
« Reply #9 on Jul 11, 2009, 2:50pm »


Jul 11, 2009, 2:16pm, Mac wrote:
Hi friends, I just can't quite work out how to seperate the date from the rest of the bar like your example shows.

Can you advise please ?

Thanks very much.

Macc


Hi Macc,
Well, it's not really separated. It is the background image that gives it the appearance of it being separate.
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Mac
Senior Member
member is offline

[avatar]


[homepage]

Joined: Apr 2009
Gender: Male
Posts: 828
Location: Wales
Karma: 22
 Re: Nav Tree Ultimate Customize Combo
« Reply #10 on Jul 12, 2009, 8:01am »

OK, thanks
Macc
Link to Post - Back to Top  IP: Logged

[image]


Mac
Senior Member
member is offline

[avatar]


[homepage]

Joined: Apr 2009
Gender: Male
Posts: 828
Location: Wales
Karma: 22
 Re: Nav Tree Ultimate Customize Combo
« Reply #11 on Jul 17, 2009, 5:33pm »

It's working fantastically well now, thanks SubDevo,

Is it possible to add and extra line/space Below the bar ?

Thanks.

Macc
Link to Post - Back to Top  IP: Logged

[image]


SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Nav Tree Ultimate Customize Combo
« Reply #12 on Jul 17, 2009, 6:35pm »

You already have that power! In the navcombo CSS...

top: -5px;

Use negative numbers to move it up. Try "-25". ;)

Does this do the trick for you?

SubDevo
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Mac
Senior Member
member is offline

[avatar]


[homepage]

Joined: Apr 2009
Gender: Male
Posts: 828
Location: Wales
Karma: 22
 Re: Nav Tree Ultimate Customize Combo
« Reply #13 on Jul 19, 2009, 1:41pm »

Top tip as usual my friend, thanks.

Macc
Link to Post - Back to Top  IP: Logged

[image]


SubDevo
Co-Admin
Code Support
member is offline

[avatar]

Creator of LSD...


[homepage]

Joined: Mar 2009
Gender: Male
Posts: 2,594
Location: MI, USA
Karma: 102
 Re: Nav Tree Ultimate Customize Combo
« Reply #14 on Jul 19, 2009, 5:43pm »


Jul 19, 2009, 1:41pm, Mac wrote:
Top tip as usual my friend, thanks.

Macc


No problem Macc! Glad it worked for you. :)
Give me something harder next time ok? lmao

SubDevo
Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Page 1 of 7 » Jump to page   Go    [Search This Thread] [Share Topic] [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 | Notice | FTC Disclosure | Report Abuse | Mobile