473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Rotating URL website Code

Hi all,

I've searched this to death but didn't find much.

Basically we have a plasma screen in our office which has to look at
about 4 different websites (bbc news etc) on a regular basis.

I wrote a nice little array which half works but doesn't load the
pages properly. Code is:

<?
$pages = array(
'http://nerws.google.co.uk','http://www.sky.com/news','http://
www.bbc.co.uk/news');
shuffle($pages);
include($pages[0]);
?>
Basically after 60 seconds I'd like to randomly show one of the news
websites.

If anyone can help point out where I'm going wrong or a better way to
do this it would be excellent. I'd like to learn how to fix this, as
well as find a solution so anyone willing to offer a little tutorial
would be most appreciated.

Thanks

Si.
Jan 16 '08 #1
6 1725
I've done some further work on this and realise that its loading the
URLs in the same page and thus thats why CSS and some images don't
work as it looks for them on my server (which they obviously aren;t).

I guess the best way is to have this page running and basically it
auto changes another IE window by setting it to load it in a different
target?

Obviously I need to add the header reload/refresh so the script
continues to run, but I'm still trying to work that out too!

Jan 16 '08 #2
Sibine wrote:
If anyone can help point out where I'm going wrong or a better way to do
this it would be excellent.
Using Javascript and frames. Two frames. Very thin one at the top. Very
big one underneath. In the top frame, call a Javascript function every 60
seconds, that loads a URL into the bottom frame. Easy.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 5:21.]

Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/0...llamatriciana/
Jan 16 '08 #3
If any of the sites have some sort of anti-frame javascript, you may
have problems - but worth trying. Another option may be to have four
(or however many) browser windows open to the correct pages, and some
sort of code on the actual computer to shuffle through them somehow...

---
www.NEXCESS.NET - Shared/Reseller Hosting
www.EliteRax.com - Dedicated Servers, Server Clusters
www.MaxVPS.com - Virtual Private Servers
- Great prices, Great service - check us out!
On Jan 16, 1:09 pm, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
Sibine wrote:
If anyone can help point out where I'm going wrong or a better way to do
this it would be excellent.

Using Javascript and frames. Two frames. Very thin one at the top. Very
big one underneath. In the top frame, call a Javascript function every 60
seconds, that loads a URL into the bottom frame. Easy.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 17 days, 5:21.]

Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/0...llamatriciana/
Jan 16 '08 #4
adwatson wrote:
If any of the sites have some sort of anti-frame javascript, you may
have problems - but worth trying. Another option may be to have four
(or however many) browser windows open to the correct pages, and some
sort of code on the actual computer to shuffle through them somehow...
There might be some browser plugins/addons as well.

-thib
Jan 16 '08 #5
Thanks very much for all your help. I'll try the frames out later and
see how it goes :)
Jan 17 '08 #6
On 17 י*ואר, 12:26, Sibine <simon.jes...@gmail.com>wrote:
Thanks very much for all your help. I'll try the frames out later and
see how it goes :)


try this one that I amended specially for you to work with Iframe...
You can drop the top menue and autostart the script.
================================================== =================
<html>
<html>
<head>
<script language="JavaScript">
<!-- Begin
var repeatshow = 1; // 1 = yes, 0 = no
var timedelay = 10000; // time in milliseconds, 5000 = 5 secs

var page = new Array(
"http://cafe.themarker.com/view.php?u=70158",
"http://www.ynet.co.il/",
"http://www.google.com/advanced_search?hl=en&num=100",
"http://www.morfix.co.il/",
"http://www.tamir.co.il/",
"http://www.i-property.co.il/",
"http://www.ymap.co.il/",
"http://cafe.themarker.com/"
); // note no comma after last page!

// your "the end" page. Necessary if repeatshow = 0;
var endpage = "http://www.sharatim.co.il";

var slidenum = 0;
var slidecount = page.length;
var timerID = 0;
var win2;
function showSlideShow() {
slidenum++;
if (slidenum < slidecount+1) {
parent.main.location.href = page[slidenum-1];
}
if (slidenum == slidecount+1) { // if finished
if (repeatshow) {
slidenum = 0;
timerID = setTimeout('showSlideShow()', timedelay)
}
else parent.main.location.href = endpage;
}
else timerID = setTimeout('showSlideShow()', timedelay);
}
// End -->
</script>
</HEAD>

<BODY onload="timerID=setTimeout('showSlideShow()',timed elay)">
<center>

<a href="javascript:showSlideShow();"
onClick="clearTimeout(timerID)">Cycle Pages</a ..........
<a href="#" onClick="clearTimeout(timerID)">STOP</
a ..........
<a href="http://www.tamir.co.il" target="main"
onClick="clearTimeout(timerID)"><B>Stop @ My PAGE </B></A>

<IFRAME SRC="main.html" name="main" WIDTH=100% HEIGHT=95%>

</center>
</div></BODY>

</HTML>
============================

Good luck
Jan 23 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ian Hubling | last post by:
I'm trying to complete a rotating banner ad within a page I have. The rotating add has four images that rotate in three-second increments. I've got the images to rotate ok - but now I want to go...
1
by: Sandy Bremmer | last post by:
I have seen many Javascripts that rotate images with each load or refresh of the page but so far all I've found require hard coding the image filename into the script. Does anyone know of a script...
1
by: Grunt | last post by:
Hi, I have been trying to put together a rotating banner. the code works but I am having a problem with the caching of the banner images. no matter what I try the page is constantly reloading the...
31
by: Royal Denning | last post by:
I am designing a table with 2 columns and 20 rows. I want to insert small images (each with a link) and a text title in each cell of the table. On refresh of the page, I would like to have the...
2
by: mistral | last post by:
I want place custom text rotating around analogue clock. Here is javascript that is clise to my task: http://javascript.internet.com/time-date/mousetrailclock.html But it have a few...
4
by: Chris Shenton | last post by:
I set this up 3 days ago and have not seen any of the logs I've created this way being rotated. I expected them to rotate every midnight. I'm calling the code that uses this logger many times,...
9
by: Kraken | last post by:
Hi, i have an assignment to open PPM images and prompt the user for either brightening, flipping or rotating the image. Ive done the brightening and flipping, but i cant get the rotating to work....
3
by: avalence | last post by:
Hello, I am trying to create a nice rotating earth globe (on mouse) on my web site, in order to display my professional relationships all over the world. The best way seems to be a javascript. In...
1
by: AR123 | last post by:
Hi I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.