Hey does anyone know how to display the latest news published on cutenews in a box and so it auto-updates, for example www.clubhabbo.net?

Hey does anyone know how to display the latest news published on cutenews in a box and so it auto-updates, for example www.clubhabbo.net?
Yep, just use an iframe and add a refresh code at the bottom of /cutenews/show_news.php
Refresh code:
You can edit the 120 to whatever you like, but it means it refreshes every 120 seconds (recommended - don't want to use up bandwith when you could be saving it and you're not going to be having articles posted every minute)
Iframe code:HTML Code:<META HTTP-EQUIV='Refresh' CONTENT='120; URL=show_news.php'>
(Edit width/height)
HTML Code:<iframe src="/cutenews/show_news.php" name="news" width="200" height="120" frameborder="0" scrolling="no" allowtransparency="true"></iframe>
Kind Regards,
Guy__________________
Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
Tech-Hosts.co.uk.
Hey thanks, but is there a way i can make it just display the title then when they click it, it opens in main content?
Okay, IFRAMES are so OUT-dated.
I have an ajax solution to help you!
edit: you have to find and download prototype.js and you can get effects from http://simplehabbo.net/effects.js
ADD THIS TO <HEAD> section >;]
Change var url to ur cutenews/show news.phpCode:<script type="text/javascript" language="javascript" src="proto.js"></script> <script type="text/javascript" language="javascript" src="effects.js"></script> <script type="text/javascript"> function GetXmlHttpObject( ) { var xmlHttp = null; try { xmlHttp = new XMLHttpRequest(); } catch( e ) { try { xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" ); } catch( e ) { xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" ); } } return xmlHttp; } function GetNews() { xmlHttp = GetXmlHttpObject(); if( xmlHttp == null ) { alert ( "Browser does not support HTTP Request" ) return; } var url = "path/to/cutenews/show_news.php"; xmlHttp.open( "GET", url, true ); xmlHttp.onreadystatechange = function( ) { if ( xmlHttp.readyState == 4 ) { if ( xmlHttp.status == 200 ) { document.getElementById( "news" ).innerHTML = xmlHttp.responseText; } } }; xmlHttp.send( null ); } GetStats(); setInterval( "GetStats()", 30000 ); </script> </head>
You'll have to create a div called "news" have it empty where you would like the headlines to be shown
Change the 30000 in setInterval( "GetNews()", 30000 ); a period of time in which you want it to change.
Now when you start the page, you wanna get the headlines right on page load so we ddo:
ur done!Code:<body onLoad="GetNews();">
Last edited by D-Man22; 30-10-2008 at 08:15 PM.
█ PureHosts.com
█ Shared, ShoutCAST, and reseller hosting.
█ Reasonable prices, amazing support.
Views expressed by me through my HXF, CHF or any forum account, do not necessarily express the views or opinions of Pure Web Solutions.
I don't understand thatlmao
Sorry to double post, please merge.
How would I do this with php includes instead of iframes?
Please reply.
Thanks.
Put
where the iframes would be.PHP Code:<?php include('pathtocutenews/show_news.php'); ?>
I think that's right. I never know which type of quotes to use.
The extension of the page has to be .php, eg index.php not index.html.
Want to hide these adverts? Register an account for free!