TinyPortal

Development => Block Codes => Topic started by: Michiko on February 26, 2006, 01:27:20 AM

Title: Fading Block of Php-Nuke
Post by: Michiko on February 26, 2006, 01:27:20 AM
Hello all,

I had been desperately looking for a block for my partner sites but found nothing. I remember Php-Nuke had this before so I searched google and found "Fading Block".

I would like to know if someone can help me port this block to TP. It would be of a great help :) Attached is the php file and below is the copy of JS.
<!--
//Gradual-Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=30
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
//-->







Thank you so much in advance.

[attachment deleted by admin]
Title: Re: Fading Block of Php-Nuke
Post by: IchBin on February 26, 2006, 02:11:19 AM
Try including this one in a phpbox block type. BTW, I think this javascript effect only works in IE.

[attachment deleted by admin]
Title: Re: Fading Block of Php-Nuke
Post by: Michiko on February 26, 2006, 02:56:34 PM
Hi IchBin,

Thank you so very much for your kind and quick reply  :). It's working perfectly. Hmm, you know what? I found a scrolling one from php-nuke as well.

I know it's too much if I'm to ask you again to port it to TP...but I'd rather risk loosing my head than not to ask you. Would you be so kind to do it for me  :-\ I really really appreciate your efforts and time whole heartedly. Please  :-*

[attachment deleted by admin]
Title: Re: Fading Block of Php-Nuke
Post by: IchBin on February 26, 2006, 07:25:45 PM
I think this will do the trick.

[attachment deleted by admin]
Title: Re: Fading Block of Php-Nuke
Post by: IchBin on February 26, 2006, 07:26:30 PM
BTW, thanks for posting those! :) I'm going to have to use the last one myself.
Title: Re: Fading Block of Php-Nuke
Post by: Michiko on February 26, 2006, 07:50:35 PM
Oh my how nice of you :). Thank you sooooo much! The last one is a lot better right? And by the way, you don't have to thank me. It is you who made the job.
Title: Re: Fading Block of Php-Nuke
Post by: gerrymo on February 26, 2006, 07:58:07 PM
Quote from: IchBinâââ,¬Å¾Ã,¢ on February 26, 2006, 02:11:19 AM
I think this javascript effect only works in IE.

Yes thats right, IE only.
Title: Re: Fading Block of Php-Nuke
Post by: yjobcreations on February 14, 2007, 09:24:26 PM
Quote from: gerrymo on February 26, 2006, 07:58:07 PM
Quote from: IchBinâÃ,„Ã,¢ on February 26, 2006, 02:11:19 AM
I think this javascript effect only works in IE.

Yes thats right, IE only.

so, how will it behave in FF or Opera?

thanks.
Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 21, 2007, 12:17:26 AM
Quote from: IchBinâ,,¢ on February 26, 2006, 07:25:45 PM
I think this will do the trick.

Ichbin,

How do you add more than one link to this script.  Sorry for the dumb question, but I'm very new to all this.

I have one image, and links to the correct site when you click it.  But if I add any more links, it only displays the last one.  Any help would be appreciated, as this script is just what I'm after.
Title: Re: Fading Block of Php-Nuke
Post by: IchBin on November 21, 2007, 01:16:18 AM
You'll see that there are three lines that start with $scroll. Copy one of the lines and make the necessary changes for your own images.
Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 21, 2007, 10:14:15 AM
Quote from: IchBinâ,,¢ on November 21, 2007, 01:16:18 AM
You'll see that there are three lines that start with $scroll. Copy one of the lines and make the necessary changes for your own images.

IchBin, thanks very much for the reply.

OK, that was what I did in the first place, except I edited the links already there.   Which ever one I edit last is the one that shows up on my page.  I can't get the others to display.   

I'm pretty thick when it comes to this stuff, so any help on this would be appreciated.  Here's a link to my site, so you can see it working.  It's in a left block. http://cameracraniums.com
Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 21, 2007, 01:47:45 PM


$scroll = "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=72\"><img src=\"tp-images/arpeng.gif\" border=\"0\"   title=\"Penguin Life\"alt=\"Go Get It \"></a></center><br>";

$scroll = "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=62\"><img src=\"tp-images/arap.gif\" border=\"0\"   title=\"Animal Portraits\"alt=\"Go Get It \"></a></center><br>";

$scroll = "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=11\"><img src=\"tp-images/arlpg.gif\" border=\"0\"   title=\"The Lonely Planet Guide\"alt=\"Go Get It \"></a></center><br>";

$scroll = "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=81\"><img src=\"tp-images/arraw.gif\" border=\"0\"   title=\"Understanding RAW\"alt=\"Go Get It \"></a></center><br>";



This is how I have my links set up, and as you can see it's only displaying the last one on my site.
Title: Re: Fading Block of Php-Nuke
Post by: IchBin on November 21, 2007, 07:02:11 PM
Yes, because what you forgot was to put the period before each equal sign. Putting a period appends it to the variable $scroll. Where as if you don't use the period, $scroll will only be set to the last line where it was set. Hence, your problem. Try this:
$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=72\"><img src=\"tp-images/arpeng.gif\" border=\"0\"   title=\"Penguin Life\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=62\"><img src=\"tp-images/arap.gif\" border=\"0\"   title=\"Animal Portraits\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=11\"><img src=\"tp-images/arlpg.gif\" border=\"0\"   title=\"The Lonely Planet Guide\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=81\"><img src=\"tp-images/arraw.gif\" border=\"0\"   title=\"Understanding RAW\"alt=\"Go Get It \"></a></center><br>";
Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 21, 2007, 07:18:19 PM
Thank you so much, that works perfectly.   

Such a simple fix too.   Told you I was thick.  :idiot2:

Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 26, 2007, 09:00:26 AM
IchBin,

As I said all seems to work perfectly, and thanks again.   But.  I've just checked my error log, and I'm getting this error popping up on a regular basis.

8: Undefined variable: scroll
File: /home/cameracr/public_html/forum/Themes/default/TPortal.template.php (eval?)
Line: 33

Seems to be the slinks block that's causing it, as when I turn the block off, the error no longer occurs.

Any ideas how to fix it? Please.   Sorry to be a pain. ;)
Title: Re: Fading Block of Php-Nuke
Post by: Dragooon on November 26, 2007, 09:58:19 AM
$scroll is described in only these lines right?
$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=72\"><img src=\"tp-images/arpeng.gif\" border=\"0\"   title=\"Penguin Life\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=62\"><img src=\"tp-images/arap.gif\" border=\"0\"   title=\"Animal Portraits\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=11\"><img src=\"tp-images/arlpg.gif\" border=\"0\"   title=\"The Lonely Planet Guide\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=81\"><img src=\"tp-images/arraw.gif\" border=\"0\"   title=\"Understanding RAW\"alt=\"Go Get It \"></a></center><br>";

if so try this
$scroll = "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=72\"><img src=\"tp-images/arpeng.gif\" border=\"0\"   title=\"Penguin Life\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=62\"><img src=\"tp-images/arap.gif\" border=\"0\"   title=\"Animal Portraits\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=11\"><img src=\"tp-images/arlpg.gif\" border=\"0\"   title=\"The Lonely Planet Guide\"alt=\"Go Get It \"></a></center><br>";

$scroll .= "<center><a target=\"_blank\" href=\" http://www.andyrouse.co.uk/shop_specific.asp?IDproduct=81\"><img src=\"tp-images/arraw.gif\" border=\"0\"   title=\"Understanding RAW\"alt=\"Go Get It \"></a></center><br>";
Title: Re: Fading Block of Php-Nuke
Post by: lurkalot on November 26, 2007, 10:27:26 AM
Thanks Dragooon.

That seems to have fixed it.   Cheers. ;)

Thanks to you both, I got there in the end.  :)
Title: Re: Fading Block of Php-Nuke
Post by: Dragooon on November 26, 2007, 10:40:39 AM
Glad I could Help :)