Uridium Posted September 23, 2009 Posted September 23, 2009 This Plugin will allow your users to right click on a page and instantly get to where they want to be SCRIPT not written by me i just thought it would be useful open up header.php find [css]a:hover {color: blue;text-decoration: underline; }[/css] and underneath add [css].link{ cursor:default; text-decoration:none; color:black; font-size:8pt; font-family:verdana; padding:3px; } .normtext{ color:black; font-size:8pt; font-family:verdana; font-weight:bold; padding:3; } #conmenu { cursor:default; position:absolute; top:0px; left:0px; visibility:hidden; background-color:lightgrey; layer-background-color:lightgrey; border:outset 2px; font-size:8pt; font-family:verdana; font-weight:normal; color:#000000; width:200px; padding:1 2 0 2; z-index:2; } #conshadow{ position:absolute; top:0px; left:0px; visibility:hidden; background-color:black; layer-background-color:black; z-index:0; }[/css] In the same section just below the <body> tag add underneath.. [js]<script language="javascript"> /***************************************************** TITLE: CONTEXT MENU V1.2 AUTHOR: Brian Gosselin SITE: http://HTTP://SCRIPTASYLUM.COM EMAIL: [email protected] SUPPORT: WORKS IN NETSCAPE 4+ AND 6+. WORKS IN IE4+ KNOWN BUGS: BOX DOES NOT APPEAR CORRECTLY WHEN OVER FORM ELEMENTS IN NETSCAPE4.X. AS A RESULT, I HAVE CREATED PROVISIONS FOR THIS. SEE BELOW. ******************************************************/ var menuNormColor="black"; //NORMAL COLOR OF THE MENU ITEMS var menuHoverColor="#0084d8"; //COLOR OF THE MENU ITEMS ONMOUSEOVER var enableShadow=true; //SET TO "true" TO ENABLE SHADOW, "false" TO DISABLE IT. var enableShadowTransparency=true; //SET TO "true" TO ENABLE SHADOW SEMI-TRANSPARENCY (ie4+, ns6+ ONLY), "false" TO DISABLE IT. var disableNS4=true; // BECAUSE THE MENU DOESNT LOOK RIGHT WHEN THE PAGE CONTAINS FORMS IN NS4, SET THIS VALUE TO // "true" TO DISABLE THIS CONTEXT MENU AND USE THE DEFAULT ONE. THIS EFFECTS NS4.X ONLY. // THE ARRAY BELOW CONTAINS THE MENU ITEMS. FORMAT: // [ 'LINK TEXT TO APPEAR IN MENU' , 'LINK HREF' , 'TARGET WINDOW/FRAME' ]; // JUST ADD ARRAY ITEMS AS NEEDED KEEPING NUMBER SEQUENCE // TO ADD REGULAR (NON-LINK) HTML/TEXT, USE THE FOLLOWING FORMAT: // [ 'REGULAR TEXT/HTML HERE' ]; var menu=new Array(); menu[0]=['<center>- Quick Menu -</center>']; menu[1]=['Inventory' , 'inventory.php' , '_parent']; menu[2]=['Home' , 'index.php' , '_parent']; menu[3]=['Mail Box' , 'mailbox.php' , '_parent']; menu[4]=['Events' , 'events.php' , '_parent']; menu[5]=['Inventory' , 'inventory.php' , '_parent']; menu[6]=['Explore' , 'explore.php' , '_parent']; menu[7]=['Log Out' , 'logout.php' , '_parent']; menu[8]=['Your Settings' , 'preferences.php' , '_parent']; menu[9]=['Your Profile' , 'viewuser.php?u={$ir['userid']}' , '_parent']; menu[10]=['<center>- EXPLORE AREAS -</center>']; menu[11]=['Users Online' , 'usersonline.php' , '_parent']; menu[12]=['Shops' , 'shops.php' , '_parent']; menu[13]=['Item Market' , 'itemmarket.php' , '_parent']; menu[14]=['Your Bank' , 'bank.php' , '_parent']; menu[15]=['Deposit Cash $ {$ir['money']}' , 'bank.php?action=deposit' , '_parent']; menu[16]=['Withdraw Cash $ {$ir['bankmoney']}' , 'bank.php?action=withdraw' , '_parent']; menu[17]=['Gender = {$ir['gender']} [change]' , 'preferences.php?action=sexchange2' , '_parent']; menu[18]=['Right-click the mouse again to dismiss...']; //****************** NO NEED TO EDIT BEYOND HERE ******************** ns4 = (navigator.appName.indexOf("Netscape")>=0 && document.layers)? true : false; ie4 = (document.all && !document.getElementById)? true : false; ie5 = (document.all && document.getElementById)? true : false; ns6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false; w3c = (document.getElementById)? true : false; var mx=0; var my=0; var conmenu; var conshadow; var windowloaded=false; var opened=false; var ch=0; var cw=0; function setc(ref,c){ if(ns4)ref.bgColor=c; else ref.style.backgroundColor=c; } var txt='<div id="conshadow"> </div>'; txt+='<div id="conmenu">'; for(i=0;i<menu.length;i++){ if(menu.length<3){ txt+='<ilayer><div class="normtext">'+menu[0]+'</div></ilayer>'; }else{ txt+=(ns4)?'<ilayer width="100%" bgcolor="'+menuNormColor+'"><layer width="100%" onmouseover="setc(this,\''+menuHoverColor+'\')" onmouseout="setc(this,\''+menuNormColor+'\')">':'<div class="link" style="background-color:'+menuNormColor+'" onmouseover="setc(this,\''+menuHoverColor+'\')" onmouseout="setc(this,\''+menuNormColor+'\')">'; txt+='[1]+'"]'+menu[0]+''; txt+=(ns4)?'</layer></ilayer>':'</div>'; }} txt+='</div>'; document.write(txt); function ns4trap(evt){ if(evt.which==2||evt.which==3){ showmenu(); return false; }} function showmenu(){ if(windowloaded){ if(opened){ if(ns4){ conmenu.visibility="hide"; conshadow.visibility="hide"; conmenu.moveTo(0,0); conshadow.moveTo(0,0); }else{ conmenu.style.visibility="hidden"; conshadow.style.visibility="hidden"; conmenu.style.left='0px'; conmenu.style.top='0px'; conshadow.style.left='0px'; conshadow.style.top='0px'; } opened=false; }else{ opened=true; var wh=(ie4||ie5)?document.body.clientHeight:window.innerHeight; var ww=(ie4||ie5)?document.body.clientWidth:window.innerWidth; var sx=(ie4||ie5)?document.body.scrollLeft:pageXOffset; var sy=(ie4||ie5)?document.body.scrollTop:pageYOffset; if(ie4||ie5){ if(mx+cw+13>=ww)mx=mx-cw-13; if(my+ch+13>=wh)my=my-ch-13; }else{ if(mx+cw-sx+13>=ww)mx=mx-cw-13; if(my+ch-sy+13>=wh)my=my-ch-13; } if(ns4){ conmenu.moveTo(mx,my); conmenu.visibility="show"; conshadow.moveTo(mx+8,my+8); if(enableShadow)conshadow.visibility="show"; }else{ conmenu.style.left=mx+((ie4||ie5)?sx:0)+'px'; conmenu.style.top=my+((ie4||ie5)?sy:0)+'px'; conshadow.style.left=mx+10+((ie4||ie5)?sx:0)+'px'; conshadow.style.top=my+10+((ie4||ie5)?sy:0)+'px'; setTimeout('conmenu.style.visibility="visible"; if(enableShadow)conshadow.style.visibility="visible"; ',50); }}}} if(ns4&&!disableNS4){ document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE); document.onmousedown=ns4trap; }else{ document.oncontextmenu=function(){ showmenu(); return false; }} document.onmousemove=function(evt){ mx=(ie4||ie5)?event.clientX:evt.pageX; my=(ie4||ie5)?event.clientY:evt.pageY; } window.onload=function(){ windowloaded=true; conmenu=(ns4)?document.layers['conmenu']:(ie4)?document.all['conmenu']:document.getElementById('conmenu'); conshadow=(ns4)?document.layers['conshadow']:(ie4)?document.all['conshadow']:document.getElementById('conshadow'); ch=(ns4)?conmenu.document.height:(ie4||ie5)?conmenu.clientHeight:conmenu.offsetHeight; cw=(ns4)?conmenu.document.width:(ie4||ie5)?conmenu.clientWidth:conmenu.offsetWidth; if(ns4){ conshadow.clip.height=conmenu.document.height; conshadow.clip.width=conmenu.document.width; conmenu.clip.bottom=conmenu.document.height; }else{ if(enableShadowTransparency){ if(ie4||ie5)conshadow.style.filter="alpha(opacity=50)"; if(ns6||!ie4||!ie5)conshadow.style.MozOpacity=.5; } conshadow.style.height=ch+((ie4||ie5)?4:0); conshadow.style.width=cw+((ie4||ie5)?4:0); } //ADD OTHER WINDOW ONLOAD EVENT HANDLER SCRIPTS/COMMANDS HERE } window.onresize=function(){ if(ns4)setTimeout('history.go(0)',200); //ADD OTHER WINDOW RESIZE HANDLER COMMANDS/SCRIPTS HERE } </script>[/js] Reupload your header.php work on all browsers Quote
Uridium Posted September 23, 2009 Author Posted September 23, 2009 If you want your mail and event count to be added to the menu add this to header.php near top You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now when altering your menu links create them like so You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Cntinue the same process for other Counts you want to add. You dont have to send a donation i just thought id put one here to test it ;) [paypal][email protected][/paypal] Quote
$k!nNy Posted September 27, 2009 Posted September 27, 2009 looks good m8 keep up the good work :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.