Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
tangoman
Involved
Involved



Joined: Aug 06, 2005
Posts: 301

PostPosted: Tue Aug 30, 2005 5:23 am Reply with quote

I want two links on my website to flash from one color to another.

One link is in a module and the other is in a block.

The solution I have found is Javascript and requires that the following code be placed in the Header section of an HTML web Page:

Code:
<scr ipt language="JavaScript1.2" type="text/javascript">

 
/***********************************************
* Flashing Link Script- � Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
 
var flashlinks=new Array()
 
function changelinkcolor(){
for (i=0; i< flashlinks.length; i++){
var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1
var flashcolor=document.getElementById? flashlinks[i].getAttribute("flashcolor") : flashlinks[i].flashcolor
if (flashtype==0){
if (flashlinks[i].style.color!=flashcolor)
flashlinks[i].style.color=flashcolor
else
flashlinks[i].style.color=''
}
else if (flashtype==1){
if (flashlinks[i].style.backgroundColor!=flashcolor)
flashlinks[i].style.backgroundColor=flashcolor
else
flashlinks[i].style.backgroundColor=''
}
}
}
 
function init(){
var i=0
if (document.all){
while (eval("document.all.flashlink"+i)!=null){
flashlinks[i]= eval("document.all.flashlink"+i)
i++
}
}
else if (document.getElementById){
while (document.getElementById("flashlink"+i)!=null){
flashlinks[i]= document.getElementById("flashlink"+i)
i++
}
}
setInterval("changelinkcolor()", 1000)
}
 
if (window.addEventListener)
window.addEventListener("load", init, false)
else if (window.attachEvent)
window.attachEvent("onload", init)
else if (document.all)
window.onload=init
 
</scr ipt>


Additionally, you must then set the attributes in your link HTML as follows:
Code:
<a href="test.htm" id="flashlink0" flashtype=0 flashcolor="green">Example 1</a>

 
OR
 
<a href="test.htm" id="flashlink1" flashtype=1 flashcolor="lime">Example 2</a>


My fundamental question is, how do I use this code, moreover where does the code that is supposed to be placed in the header section go, in relation to the module or block I am working on?

_________________
I am using PHPNuke Version 7.6 with patch 3.0, CNB YA 4.4.2, NukeSentinel(tm) 2.3.2 and Nuke Royal. 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Aug 30, 2005 6:39 am Reply with quote

includes/custom_files/custom_head.php
or
includes/custom_files/custom_header.php

From what I can tell, includes/custom_files/custom_head.php is meant to replace includes/my_header.php and includes/custom_files/custom_header.php is new. From the logic there is no difference so you'd have to ask FB why, in his infinite nuke wisdom, there are 2 ROTFL

As to the use of the script, you will need to refer to any instructions that came with it.
 
View user's profile Send private message
tangoman







PostPosted: Tue Aug 30, 2005 6:51 am Reply with quote

Raven,

(After PMing one another as to how to post this question, I find it an irony and quite hilarious, that you yourself have now replied to this posting!!!.... ROTFL

However, I am not able to understand what you are explaining exactly. Embarassed Crying or Very sad

Specifically, I am only used to placing such code, (as directed with this codes instructions), between the <head> and </head> tags in a single, static, HTML page. Shocked

The <head> and </head> tags do not feature when I create a Block or Module, so I am really unsure where to place this code. Sad

Please advise.
 
Raven







PostPosted: Tue Aug 30, 2005 6:58 am Reply with quote

header.php is called for all blocks which in turn calles the other 2 files. Modules, however, have to explicitly call it with
Code:
include("header.php");
. Look at other modules, in the index.php file, and you will see it.
 
tangoman







PostPosted: Tue Aug 30, 2005 7:06 am Reply with quote

Raven,

I now understand.....I think!... Shocked

When you explain '...header.php is called for..., by 'called for', you mean that when a block loads, it 'asks for/takes' the header information from the header.php file then, in turn, when this header.php file receives a 'request' for this information (from a block the user is trying to load into their browser), it in turn 'asks for/takes' information from the includes/custom_files/custom_head.php file or the
includes/custom_files/custom_header.php file ...Does my brain compute this logic correctly now? Shocked
 
Raven







PostPosted: Tue Aug 30, 2005 7:17 am Reply with quote

I make absolutely no claim to understand how your brain computes logic ROTFL
[ Only registered users can see links on this board! Get registered or login! ] initially calls mainfile.php and header.php which sets up the framework, so to speak, for all blocks. So, the <head></head> are setup at that point.
 
tangoman







PostPosted: Tue Aug 30, 2005 7:35 am Reply with quote

OK Raven,

Let me ask this instead then...

Does the explaination I last posted compute perfectly with YOUR brain?... Dance-Y


RavensScripts
 
Raven







PostPosted: Tue Aug 30, 2005 1:28 pm Reply with quote

PHP generates HTML, JavaScript, CSS, etc. code, in the end, for your browser because that's all it understands. So, when the index.php script is called, it loads header.php which constructs the <head></head> tags, in addition to other things of course. Now, in header.php are the 2 include calls to include any custom header code that you need. You could just as easily have added that code to header.php but this way it is more accomodating to upgrades. So, when the blocks are built, all javascript (in this case) is already loaded into the "construction" buffer by PHP.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©