[2.0.13] Custom Right Click Mod

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
1
50%
Very Good
0
No votes
Good
0
No votes
Fair
1
50%
Poor
0
No votes
 
Total votes: 2

saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Post by saabirsa » Thu Apr 14, 2005 5:10 pm

Have you got a link to your board?

blinddruid
Registered User
Posts: 52
Joined: Thu Apr 15, 2004 3:17 pm

Post by blinddruid » Thu Apr 14, 2005 5:15 pm


saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Post by saabirsa » Thu Apr 14, 2005 5:33 pm

An Admin Test Login Avaliable?
Also, would you please PM me,
templates/***/overall_header.tpl

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Sat Apr 23, 2005 4:37 pm

Why is this MOD browser specific? I just checked the Demo board and it doesn't seem to work with Opera either. Unless this can work with most browsers, it isn't of much use on boards like mine where most members use alternative browswers to IE...

:cry:

saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Post by saabirsa » Sat Apr 23, 2005 5:24 pm

I am still finding ways of making this mod browser specific :D .

Saabir Salim
(PS I'm not a programmer, just an average 13 yr old boy 8) )
(PSS If anyone could help with the help with the coding, it would be gratefully appreciated :) )

User avatar
M.O.B.
Registered User
Posts: 927
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Post by M.O.B. » Wed May 11, 2005 7:52 am

Biggest problem I find with this MOD is that once you activate the right click to open the box menu. You can't use the right click function to copy a picture or a link on any post or reply.
Image

saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Post by saabirsa » Wed May 11, 2005 3:16 pm

True, but that can be an advantage when you don't want people to "steal" your customized pictures ETC. :-D

Saabir Salim

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

This mod is good, but

Post by tomythius » Sun May 29, 2005 12:47 pm

This mod is good, but:
~ The default one I downloaded from here didn't actually use the database values, just the default ones.
~ The menu stopped the page from being html 4.01 compliant.
I've fixed both of these and have added several features:
~ If an ISUA_name contains PM it now affixes a message informing the user of any new messages.
~ If the user is site-admin a link is added to the bottom to the admin panel.
~ If the user is in a forum and has moderator powers a link is added to the moderator control panel.
You can see all this on my site: tom.whaletattoo.com/talk.
If anyone wants the code, implement the original first, then let me know which bits you want.

Tom
Tom says so, QED.

saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Re: This mod is good, but

Post by saabirsa » Sun May 29, 2005 1:20 pm

tomythius wrote: This mod is good, but:
~ The default one I downloaded from here didn't actually use the database values, just the default ones.
~ The menu stopped the page from being html 4.01 compliant.
I've fixed both of these and have added several features:
~ If an ISUA_name contains PM it now affixes a message informing the user of any new messages.
~ If the user is site-admin a link is added to the bottom to the admin panel.
~ If the user is in a forum and has moderator powers a link is added to the moderator control panel.
You can see all this on my site: tom.whaletattoo.com/talk.
If anyone wants the code, implement the original first, then let me know which bits you want.

Tom


Hey Nice Coding M8 :-D, ya got the code, ill try to implamate it into this code.

Saabir Salim

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

My new code changes this.

Post by tomythius » Wed Jun 01, 2005 12:46 am

blinddruid:
Thanks. That works. The only other little problem is that the right click menu does not reflect the changes I made in the ACP. eg I replaced the FAQ link with a Fantasy Sports mod link but the FAQ is still showing up and linking to the FAQ page instead of going to the sports page.

My new code changes this.

Code: Select all

{ISUA_RCOF1} <script type="text/javascript" src="headerJS.js"></script> {ISUA_RCOF2}
</head>
<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}">
<!-- Begin ISUA --> 
{ISUA_RCOF1}
<div id="ie5menu" class="skin{ISUA_SKIN1}" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)">
<div class="menuitems" id="A">{ISUA_NAME1}</div> {ISUA_DIVD1} 
<div class="menuitems" id="B">{ISUA_NAME2}</div> {ISUA_DIVD2} 
<div class="menuitems" id="C">{ISUA_NAME3}</div> {ISUA_DIVD3} 
<div class="menuitems" id="D">{ISUA_NAME4}</div> {ISUA_DIVD4}
<div class="menuitems" id="E">{ISUA_NAME5}</div> {ISUA_DIVD5} 
<div class="menuitems" id="F">{ISUA_NAME6}</div> {ISUA_DIVD6}
<div class="menuitems" id="G">{ISUA_NAME7}</div> {ISUA_DIVD7} 
<div class="menuitems" id="H">{ISUA_NAME8}</div> {ISUA_DIVD8}
<div class="menuitems" id="I">{ISUA_NAME9}</div> {ISUA_DIVD9}
{ISUA_MODMENU_DIV}
{ISUA_ADMINMENU_DIV}
</div> 
<script type="text/javascript">
function geturl (id)
{
	switch(id){										// This to make the menu W3C compliant.
		case 'A': {return '{RCLICK_LINK1}'; break;}	// Can't use numbers in ID
		case 'B': {return '{RCLICK_LINK2}'; break;}	// Can't have non-ID attributes in a div tag
		case 'C': {return '{RCLICK_LINK3}'; break;}	// Ergo we can't place the urls inline.
		case 'D': {return '{RCLICK_LINK4}'; break;}	// And we can't use numbers to reference the correct url.
		case 'E': {return '{RCLICK_LINK5}'; break;}	// This simple switch works fine though.
		case 'F': {return '{RCLICK_LINK6}'; break;}
		case 'G': {return '{RCLICK_LINK7}'; break;}
		case 'H': {return '{RCLICK_LINK8}'; break;}
		case 'I': {return '{RCLICK_LINK9}'; break;}
		case 'MOD': {return '{RCLICK_MODMENU_LINK}'; break;}
		case 'ADMIN': {return '{RCLICK_ADMINMENU_LINK}'; break;}
	}
}
// Parts of this code thanks to http://www.dynamicdrive.com/
var display_url={ISUA_STAT1}
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById("ie5menu")

function showmenuie5(e){
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX

//same concept with the vertical position
if (bottomedge<menuobj.offsetHeight)
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
else
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY

menuobj.style.visibility="visible"
return false
}

function hidemenuie5(e){
menuobj.style.visibility="hidden"
}

function highlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor="highlight"
firingobj.style.color="white"
if (display_url==1) window.status=geturl(event.srcElement.id)
}
}

function lowlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor=""
firingobj.style.color="black"
window.status=''
}
}

function jumptoie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(geturl(firingobj.getAttribute("id")),firingobj.getAttribute("target"))
else
window.location=geturl(firingobj.getAttribute("id"))
}
}
//NetscapeRCS
if (ie5||ns6){
menuobj.style.display=''
document.oncontextmenu=showmenuie5
document.onclick=hidemenuie5
}

</script>
{ISUA_RCOF2}
<!-- End ISUA -->
Hope this helps, although I've changed the original code extensively, so this may need tinkering.
For example you'll want to remove the references to the Admin and Mod links, unless you include my other functions in page_header.php.
I've also added the ability for individual users to now enable/disable the mod and to choose their own styles.
Am now working on third and forth styles, this is easy to acheive with this mod, just add .style2 and .style3 to the CSS, which I prefer in an external sheet.
Any objections to me updating your mod Saabir? I think it's great and you'd get original credit of course.
Tom says so, QED.

PoCUK
Registered User
Posts: 101
Joined: Sun Oct 12, 2003 10:41 pm
Location: UK
Contact:

Post by PoCUK » Sun Jun 05, 2005 6:57 am

Saabir & Tom ...

this is a great mod ... you two should get your heads together and polish off all the edges ...

I single source download will be much nicer than installing the original then patching it up ;)

I'll be keeping an eye on this thread ...

Keep up the good work guys!

Simon

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Integrated all my changes.

Post by tomythius » Sun Jun 05, 2005 12:35 pm

I've integrated all my changes.
Available for download from http://tom.whaletattoo.com/RCLICK_v3.0.0.zip.
I'm also submitting it for validation, so it should be on the DB soon.
Tom says so, QED.

saabirsa
Registered User
Posts: 359
Joined: Thu Nov 04, 2004 12:38 am
Contact:

Re: Integrated all my changes.

Post by saabirsa » Sun Jun 05, 2005 5:58 pm

PoCUK wrote: Saabir & Tom ...

this is a great mod ... you two should get your heads together and polish off all the edges ...

I single source download will be much nicer than installing the original then patching it up ;)

I'll be keeping an eye on this thread ...

Keep up the good work guys!

Simon


Hopefully we'll be working together soon :-D

hondaforumscouk
Registered User
Posts: 39
Joined: Sat Feb 26, 2005 4:59 pm

Post by hondaforumscouk » Tue Jun 07, 2005 10:37 pm

is there a code string to still allow the open in new window feature?

tomythius
Registered User
Posts: 74
Joined: Sat May 28, 2005 3:05 pm
Location: Queniborough - Leicester - UK
Contact:

Post by tomythius » Tue Jun 07, 2005 10:49 pm

hondaforumscouk wrote: is there a code string to still allow the open in new window feature?

There certainly is.
In overallheader_tpl change:

Code: Select all

function jumptoie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(geturl(firingobj.getAttribute("id")),firingobj.getAttribute("target"))
else
window.location=geturl(firingobj.getAttribute("id"))
}
to

Code: Select all

function jumptoie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
window.open(geturl(firingobj.getAttribute("id")),firingobj.getAttribute("target"))
}
Tom says so, QED.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”