Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    6
    Member #
    2102
    I want to include a news feed from some other website to webpage of mine. Problem is, that this website is on quite slow server, so I can't just use php include do the job as that would slow down loading of my whole webpage with second or two and that's too much.

    So, I put the news feed in iframe, where it can load in, when it it thinks it's ready for it. I can also autoresize height of iframe, so I'm not forced to guess the maximum possible height of contents of the page in iframe. However this seems to possible in IE, and isn't supported in latest versions of Netscape and Opera.

    So, what I'm asking is.. can I include the feed in some other way? In a way, that would'nt prevent my webpage from showing its content before everything has been loaded.

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Ok, that's not a problem with the technology so much as the design.

    The way HTML works, it displays everything it can properly render immediately. This includes everything except closed tables, because if it gets another column or row, that could change the way the table looks.

    So if you want your content to render as it's retrieved from the server, you should either not use tables at all or make each horizontal section in its own table.

    Also, don't put the entire site into one large table, because nothing will render until the whole table is closed.

    Look at the source of this site to see a good example of table-by-table page development

  4. #3
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    If you're using RSS for the news feed, I think you can cache it.

    Transio, is a page sent as it is generated in php, or is it only sent when the whole script is finished? That could make a big difference.
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  5. #4
    Junior Member
    Join Date
    Jul 2003
    Posts
    6
    Member #
    2102
    Yes, I'm using RSS feed. I parse it with piece of PHP code. Feed is normally updated once per day.

    I tried experimenting with divs and css with intention to drop table based solutions, but I see, that there's bunch of new things I need to learn. Quite easy stuff in the end, it seems, but I'm just not in the mood at the moment. For example I already bumped in trouble with placing of footer and header elements. I could easily place my 2 columns, but adding header and footer wasn't that easy. I still find using tables so much more natural for me.

    My idea was to place articles to the wide left column and a newsfeed to the right column (50 pixels between them) + something else below the newsfeed, but now as I need to quess the max height of iframe, there will sometimes be stupid look white gap between feed and that something else (let's say I add list of articles there). So yes, it's more a design issue. Sure, I could place list of articles (or something else) above the feed, but that's not what I want. Feed is more important and I want it to be at the top.

  6. #5
    Junior Member
    Join Date
    Jul 2003
    Posts
    6
    Member #
    2102
    How nice.. I finally managed to make columns, header and footer appear relatively where they should. However I don't know how to center it all. Also it will make a great looking mess in Opera.

    <html>
    <body style="margin:0px;">
    <div align="center" style="background-color: violet; float:left; position:relative; width: 700px; padding-top:50px;">TOP VIOLET NAV</div>
    <div style="background-color: red; top:0px; float:left; width: 500px; height: 200px;">LEFT RED NAV</div>
    <div style="background-color: blue; top:0px; float:left; width: 200px; height: 100px; ">RIGHT BLUE CONTENT</div>
    <div align="center" style="background-color: green; float:left; position:relative; width: 700px; clear:both;">BOTTOM GREEN NAV</div>
    <body>
    </html>

  7. #6
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    Yeah, I checked this out, and I'm not an expert on positioning with divs unfortunately. I worked in IE, but the blue div appeared tothe right of the violet div, so that ain't good.
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  8. #7
    Junior Member
    Join Date
    Jul 2003
    Posts
    6
    Member #
    2102
    Originally posted by james
    If you're using RSS for the news feed, I think you can cache it.
    I could use more information about this caching..

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Originally posted by james
    Transio, is a page sent as it is generated in php, or is it only sent when the whole script is finished? That could make a big difference. [/B]
    That depends.... there are ways in PHP of buffering the output so that you can write to the page header after outputting content (e.g. for redirects).

    However, I think PHP, like ASP, doesn't buffer output by default.

  10. #9
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    The one I tried out is MagpieRSS.

    It's dirt simple.
    PHP Code:
    define('MAGPIE_DIR''../magpierss-0.5.2/'); //Relative path to magpie
    require_once(MAGPIE_DIR.'rss_fetch.inc');
    $url "http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/front_page/rss091.xml";
    $rssData fetch_rss$url );
    echo 
    "Site: "$rssData->channel['title'], "<br>\n";
    foreach (
    $rssData->items as $item ) {
      
    $title $item['title'];
      
    $url   $item['link'];
      echo 
    "<a href=$url>$title</a><br />\n";
      if (isset(
    $item['description'])
        echo 
    $item['description'] . "</li><br />\n";

    The feeds are cached for an hour by default. To change this edit rss_cache.inc and change:
    var $MAX_AGE = 3600; //Cache age in seconds.
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com