InterOcean Designs
« Add Menu Buttons »

Welcome Guest. Please Login or Register.
May 25, 2013, 4:53pm





InterOcean Designs :: ProBoards Codes :: Code Chat & Support :: Add Menu Buttons
« Page 2 of 2 Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Add Menu Buttons (Read 1,021 times)
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #15 on Feb 19, 2012, 10:48am »

Good idea RAD!
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: Add Menu Buttons
« Reply #16 on Apr 6, 2012, 1:01am »

Nice idea for a code Pebble! I'd like to see you add a couple more options to this.
   1) Option to add the link to ALL skins. Maybe "-1" for the skinid?
   2) Expanding on #1, ability to use the same line for multiple skinids.
   3) Option to use text links for forums that use text menus.
We'll keep in touch bro! ;)
« Last Edit: Apr 6, 2012, 3:29pm by SubDevo »Link to Post - Back to Top  IP: Logged

[image] [image]
[image]
Why are you looking at my signature, [ME]?
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #17 on Apr 6, 2012, 11:38am »

No problem Sub, just give me a minute.... ;)

Yep, number 1 & 2 I'll knock something up. #3, you'll have to explain when we next chat.
Link to Post - Back to Top  IP: Logged

[image]

Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #18 on Apr 7, 2012, 4:37pm »

OK, here we go!

Skinid: '0' for all skins
skinid: '2|4|5|7' for same button on multiple skin's
text button by replacing button image address with........ TEXT!

Working here on my test site: http://pebbletest2.proboards.com/index.cgi

Code:
<script type="text/javascript">
/* extra buttons if guest and if skin */
/* [a,b,'c','d','e'] */
/* [ skinid , guest viewable =1/not guest viewable = 0 , 'url to button destination' , 'url to image source' , 'hover text'] , */
/* example: [1,1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png','http://i1136.p hotobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY'] , */


var eb=[
['0',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png','http://i1136 .photobucket.com/albums/n494/pebbleleague/headerGlobal.png','99er'] ,
['1|3|4',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/headerMain.png','TEST'] ,
['2',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY'] ,
['2',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY'] ,
['1',0,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'EXTRA TEXT BUTTON','TESTEROOONY']
];

/* DON'T TOUCH BELOW HERE */
for (var i=0;i<eb.length;i++){
var sV = new RegExp("^"+eb[i][0]+"$","g"), lI='<a href="'+eb[i][2]+'">';
&nbsp; &nbsp;if (sV.test(pb_skinid)||eb[i][0]==0){
&nbsp; &nbsp;if((pb_username!=="Guest")||((pb_username=="Guest")&&(eb[i][1]==1))){
var patt=/http/g;
&nbsp; &nbsp;if (patt.test(eb[i][3])){lI+= '<img src="'+eb[i][3]+'" border="0" alt="'+eb[i][4]+'" /></a> '} else {lI+=eb[i][3]+'</a> '};
document.getElementsByTagName("font" )[3].innerHTML+=lI;
}}}
</script>


blummin internet >:( now on 3rd 4th try to post, giving up when this send untilI get back on a decent connection...

EDIT: 8/4/2012 - Slight code mod.
« Last Edit: Apr 8, 2012, 12:02pm by Pebble »Link to Post - Back to Top  IP: Logged

[image]

Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #19 on Apr 14, 2012, 12:47am »

Pebble could you please modify the code to where the link opens into a new window?
Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #20 on Apr 14, 2012, 5:32am »

Hi Speed,
Is it one extra button you want to open in a new window ? Or all extra buttons ?
I have another slight mod to do to the code so I could do this one at the same time.

EDIT: I'm going to put it in as a choice in the vars. Soon as I get some free time (super busy at the moment) I'll update this code with the added option.
« Last Edit: Apr 14, 2012, 5:36am by Pebble »Link to Post - Back to Top  IP: Logged

[image]

Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #21 on Apr 14, 2012, 9:20am »


Apr 14, 2012, 5:32am, Pebble wrote:
Hi Speed,
Is it one extra button you want to open in a new window ? Or all extra buttons ?
I have another slight mod to do to the code so I could do this one at the same time.

EDIT: I'm going to put it in as a choice in the vars. Soon as I get some free time (super busy at the moment) I'll update this code with the added option.


Cheers Pebble
All of them yes a choice for those that do not want to it would be great!!!

PS Check your skype requests it you already have'nt
« Last Edit: Apr 14, 2012, 9:23am by Speed »Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #22 on Apr 15, 2012, 4:30pm »

Give this a whirl Speed,
You need to add one of these to the end of the var statements:   (they are already in the vars in this code so just change them, or add , '_blank' to the end of each var you already have and replace the code section.

_blank : Opens in a new window or tab
_self : Opens in the same window or tab as it was clicked
_parent : Opens in the parent frame
_top : Opens in the full body of the window




Code:
<script type="text/javascript">
/* Extra buttons If Guest And If Skin */
/* Written By Pebble - DO NOT REPOST */
/* [ skinid , guest viewable =1/not guest viewable = 0 , 'url to button destination' , 'url to image source' , 'hover text','window open'] , */
/* example: [1,1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png','http://i1136.p hotobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_blank'] , */


var eb=[
['0',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png','http://i1136 .photobucket.com/albums/n494/pebbleleague/headerGlobal.png','99er','_blank'] ,
['1|3|4',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/headerMain.png','TEST','_self'] ,
['2',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_parent'] ,
['2',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_top'] ,
['1',0,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'EXTRA TEXT BUTTON','TESTEROOONY','_blank']
];

/* DON'T TOUCH BELOW HERE */
for (var i=0;i<eb.length;i++){
var sV = new RegExp("^"+eb[i][0]+"$","g"), lI='<a href="'+eb[i][2]+'target="'+eb[i][5]+'">';
&nbsp; &nbsp;if (sV.test(pb_skinid)||eb[i][0]==0){
&nbsp; &nbsp;if((pb_username!=="Guest")||((pb_username=="Guest")&&(eb[i][1]==1))){
var patt=/http/g;
&nbsp; &nbsp;if (patt.test(eb[i][3])){lI+= '<img src="'+eb[i][3]+'" border="0" alt="'+eb[i][4]+'" /></a> '} else {lI+=eb[i][3]+'</a> '};
document.getElementsByTagName("font" )[3].innerHTML+=lI;
}}}
</script>



Let me know how it goes. Cheers.
Link to Post - Back to Top  IP: Logged

[image]

Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #23 on Apr 15, 2012, 4:32pm »

Ok I will do here in a little bit
"maybe after the apprentice" You know that comes on tonight

:P :P :P
Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #24 on Apr 17, 2012, 2:42pm »

Pebble
the code doesnt seem to be working, it wont go to a new tab and also it wont go to the web site. You might want to check the links in the code as I did, something doesnt seem right.
Speed


when one clicks on the "extra text button"

this is what comes up:


The action that you were trying to perform has failed.



photobucket logo



Click here to go back to what you were doing.
« Last Edit: Apr 17, 2012, 2:44pm by Speed »Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #25 on Apr 17, 2012, 2:56pm »

Ok, just as a suggestion so I can put it through the loops how about adding a few common web sites such as google ect... to the list replacing a couple of the ones you have now and put them at 1,0
sound like a plan?

just use text button to click if it easier
Thanks
« Last Edit: Apr 17, 2012, 2:56pm by Speed »Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
Pebble
Code Helper
IOD Supporter
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 1,190
Location: Here & There
Karma: 155
 Re: Add Menu Buttons
« Reply #26 on Apr 17, 2012, 3:08pm »

Ah - you're here !   Try this , I just tested it and I made a boo boo ! Should be working now.

Code:
<script type="text/javascript">
/* Extra buttons If Guest And If Skin */
/* Written By Pebble - DO NOT REPOST */
/* [ skinid , guest viewable =1/not guest viewable = 0 , 'url to button destination' , 'url to image source' , 'hover text','window open'] , */
/* example: [1,1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png','http://i1136.p hotobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_blank'] , */


var eb=[
['0',1 ,'http://msn.com', 'http://i1136.photobucket.com/albums/n494/pebbleleague/headerGlobal.png','99er','_blank'] ,
['1|3|4',1 ,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/headerMain.png','TEST','_self'] ,
['2',1 ,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_parent'] ,
['2',1,'http://s1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/?action=view¤t=5members_off.png', 'http://i1136.photobucket.com/albums/n494/pebbleleague/menubuttons2/5members_off.png','TESTEROOONY','_top'] ,
['1',0,'http://google.com', 'EXTRA TEXT BUTTON','TESTEROOONY','_blank']
];

/* DON'T TOUCH BELOW HERE */
for (var i=0;i<eb.length;i++){
var sV = new RegExp("^"+eb[i][0]+"$","g"), lI='<a href="'+eb[i][2]+'" target="'+eb[i][5]+'">';
&nbsp; &nbsp;if (sV.test(pb_skinid)||eb[i][0]==0){
&nbsp; &nbsp;if((pb_username!=="Guest")||((pb_username=="Guest")&&(eb[i][1]==1))){
var patt=/http/g;
&nbsp; &nbsp;if (patt.test(eb[i][3])){lI+= '<img src="'+eb[i][3]+'" border="0" alt="'+eb[i][4]+'" /></a> '} else {lI+=eb[i][3]+'</a> '};
document.getElementsByTagName("font" )[3].innerHTML+=lI;
}}}
</script>

« Last Edit: Apr 17, 2012, 3:35pm by Pebble »Link to Post - Back to Top  IP: Logged

[image]

Speed
Moderator
v5 Theme Support
member is offline

[avatar]

The Vortex


[homepage]

Joined: Apr 2011
Gender: Male
Posts: 5,572
Location: In The Vortex Of IOD
Karma: 215
 Re: Add Menu Buttons
« Reply #27 on Apr 17, 2012, 9:52pm »

The code works great for me! Thank you!!!
Link to Post - Back to Top  IP: Logged

[image]
[image]
WARNING FOR [ME]! DO NOT CLICK HERE!
« Page 2 of 2 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