[RELEASED] ALTtext for textlinks

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
hellraiser
Registered User
Posts: 2
Joined: Sat Mar 23, 2002 5:13 am
Contact:

[RELEASED] ALTtext for textlinks

Post by hellraiser »

THIS MOD requires 4.x browser, older browsers will not execute the code
uses DHTML, and Javascript 1.2

TESTED on Netscape 4.+ and IE 4.+ by myself !

Code: Select all

################################################################# 
## Mod Title:   ALTtext for textlinks !!!
## Mod Version: 1.0.0 
## Created for phpBB version 2 RC-4 and up
##
## Released	 April 5th, 2002 (Kentucky, USA)
##
## Author:       Robert Hellraiser < dutchmoviez@hotmail.com > 
## Description:  Displays text on mouseover TEXT links. 
## 		
##               Just a simple DHTML script that someone was looking for
##               You can change many settings for it 
##		 I just found it on my 'old' box and touched it up for phpBB
## 
## Example Page: - 
## 
## Installation Level:  (easy) -- 2 places to add code and make 1 new file 
## Installation Time:   2-5 Minutes
## Files To Edit:       ./templates/subsilver/overall_header.tpl 
##			and whatever you want later on....
##
## Included Files:      ./templates/subsilver/addALTtxt.js
################################################################# 
## For Security Purposes, This MOD Cannot Be Posted Or Added At Any Non-Official phpBB Site 
################################################################# 
## 
## Author Note: 
##		BACKUP before you do ANYTHING to ANY file....ALWAYS !
## 		Have fun with it, you can also display the THREADS with this :) 
##		and safe a lot of bandwidth without displaying the whole posts
##		BUT ofcourse you have to play with it to make it work, its up to you !!
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 
## 
## VERSION HISTORY 
## 
## v1.0.0 
##  - Initial Release. 
## 
################################################################# 

# 
#-----[ FIND in templates/subSilver/overall_header.tpl ]---------- 

</head>

 #
 #---[ ADD BEFORE !!! ]--------------------------

<script language="JavaScript" SRC="templates/subSilver/addALTtxt.js"></script>



# 
#-----[ FIND in templates/subSilver/overall_header.tpl ]---------- 

<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}" >

 #
 #---[ ADD at the end of this line before the '>' (see example below) ]--------------------------

onload="initalt()"

#---[ EXAMPLE from above addition  ]--------------------------
 #
 # <body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}" onload="initalt()">
 #
 #---[ END example ]------------------------ 



#
#-----[ CREATE templates/subSilver/addALTtxt.js ]---------- 
# 

function initalt()
	{
		// Variables
	altback="yellow" 	// Alt-Message background color
	altborder="black"	// Alt-Message border color
	altfont="verdana"  	// Alt-Message Font
	altfontcolor="black"	// Alt-Message Font color
	altfontsize="2" 	// Alt-Message Font Size
	altoffx=5 		// Alt-Message horizontal offset from mouse-position
	altoffy=15 		// Alt-Message vertical offset from mouse-position
	altwidth=10 		// Alt-Message width, will be expanded by your message
	altheight=10 		// Alt-Message height, will be expanded by your message
		// end of Variables
	document.onmousedown = sniff
        document.onmousemove = sniff
        document.onmouseup = sniff
        if (document.layers) 
		{ // if Netscape4.x or NS6 and up
		document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
		document.layers['altmessage'] = new Layer(altwidth)
		document.layers['altmessage'].left = 0
		document.layers['altmessage'].top = 0
		document.layers['altmessage'].height = altheight
		document.layers['altmessage'].bgColor = altback
		document.layers['altmessage'].visibility = "hidden"
		document.layers['altmessage'].borderStyle = "solid"
		document.layers['altmessage'].borderColor = altborder
		document.layers['altmessage'].borderWidth = 1
		}
	else if (document.all)
		{ // if Internet Explorer 4.x and up
		document.body.insertAdjacentHTML("BeforeEnd",'<DIV ID="altmessage" STYLE="z-index:200;position:absolute;width:'+altwidth+';height:'+altheight+';left:0;top:0;visibility:hidden;background:'+altback+';border-style:solid;border-width:1;border-color:'+altborder+'"></DIV>')
		}
	}

function sniff(e) 
		{
		// GETS Mouseposition
                if (document.layers) 
                	{
                	var mousex=e.pageX; var mousey=e.pageY;document.layers['altmessage'].left = mousex+altoffx;document.layers['altmessage'].top = mousey+altoffy
                	}
                else if (document.all) 
                	{
                	var mousex=event.x; var mousey=event.y+document.body.scrollTop;altmessage.style.top=mousey+altoffy;altmessage.style.left=mousex+altoffx
                	}
		}
		
function alton(message)
		{
		//The main routine
		content='<font face="'+altfont+'" size="'+altfontsize+'" color="'+altfontcolor+'">'+message+'</FONT>'						
		if (document.layers)
			{
			with (document.layers['altmessage'].document)
                   		{
				open()
                        	write(content)
                        	close()
                		}
			document.layers['altmessage'].visibility = "show"
			}
		else if (document.all)
			{ 
			document.all['altmessage'].innerHTML = content
			document.all['altmessage'].style.visibility = "visible"
			}
		}
		
function altoff()
		{
		if (document.layers)document.layers['altmessage'].visibility = "hidden";
		else if (document.all) document.all['altmessage'].style.visibility = "hidden";
		}
		
		
# 
#-----[ SAVE & UPLOAD & DONE ]------------------------------ 
#

#--------[ EXAMPLE how this works ]--------------
# NOTE: BACKUP ALWAYS before you make changes in a file !
# 
#-----[ FIND in templates/subSilver/overall_header.tpl ]---------- 

<a href="{U_LOGIN_LOGOUT}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>

#-----[ REPLACE WITH ]--------------------------------------------
<a href="{U_LOGIN_LOGOUT}" class="mainmenu" onmouseover="alton('This is the place to enter this board when you have registered yourself.')" onmouseout="altoff()"><img src="templates/subSilver/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" hspace="3" />{L_LOGIN_LOGOUT}</a>


#-----[ HERE you ADDED this new text: ]
#
#   onmouseover="alton('This is the place to enter this board when you have registered yourself.')" onmouseout="altoff()"
#
#  you can ADD this to any mouse-over you have in ALL the files,
#
#  the basic is:
#
# USAGE:
# Insert the code as src-link or direct in the html head, 
# Call the init-routine with <BODY onload="initalt()">
# Call the alt-routine via mouseover 
# <a href="" onmouseover="alton('Greetings from Hellraiser, A.K.A. Tha Chief')" onmouseout="altoff()">Link</A>
# You can use any html you want as your message, so this could also be used for some Menus...
#
# 
NOTE: I did not write it all myself, I dont want to reinvent the wheel anymore...LOL
Yours truly...

Tha Chief Hellraiser

Locked

Return to “[2.0.x] MODs in Development”