TinyPortal

Development => Support => Topic started by: joyboy2001 on May 08, 2007, 07:35:25 PM

Title: How do I refresh the Home Page only when using a script I have?
Post by: joyboy2001 on May 08, 2007, 07:35:25 PM
Ok, how about this ??

I have a script to refresh pages automatically after a set time. The script runs fine. How do I make sure that it only refreshes the front page and nothing else ? If I let all the options at the bottom show -none- then it refreshes after a set time on any page.
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: Zetan on May 08, 2007, 07:44:21 PM
I have split this into a new Topic and have given it a new title as it is totally unrelated to the Topic you posted in.

Where is the script currently located? Inside a block?
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: IchBin on May 09, 2007, 01:06:13 AM
if the script is in a php block or article you can add a bit of php to make this happen.


global $context;

if ($context['TPortal']['is_front']){
echo 'your script code goes here';
}
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: joyboy2001 on May 11, 2007, 06:30:40 PM
It's Javascript and I have put it in a block ...
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: IchBin on May 11, 2007, 10:58:18 PM
Well did my code work for you? Did you try it? Did you get an error? What did you do? How did you do it? Please... for the love of Pete, give us a bone to chew on.
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: joyboy2001 on May 16, 2007, 04:36:25 AM
Well it's Javascript, so no use putting it in a php script block ... right ??

Anyways, I have the right blocks enabled on the front page and disabled by default in all other section. I put the script in a right scriptbox ... Works fine but I still don't have an answer in case I have more scripts which I want to run only on the front page and not be limited to using right blocks ... There's got to be a way !!
Title: Re: How do I refresh the Home Page only when using a script I have?
Post by: IchBin on May 18, 2007, 06:59:53 AM
Well if you want to have this type of feature you'll have to do it the "hacked" way until TP 1.0 comes out with more features.