1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP does any one want a rss feed on there site?

Discussion in 'Web Development' started by bmcoll3278, Aug 11, 2009.

  1. bmcoll3278

    bmcoll3278 New Member

    if so put a yes here and I will do a post showing how along with the files to do it.
     
  2. CheapSEO

    CheapSEO New Member

    yes i want rss feed on sites but how?
     
  3. golden1949

    golden1949 Banned

    Sure why not?
     
  4. Actually, It would be nice.
    Thank You
     
  5. djwilson

    djwilson New Member

    Yes please.
     
  6. djwilson

    djwilson New Member

    Are you gonna share the RSS fun? :)
     
  7. bmcoll3278

    bmcoll3278 New Member

    add a rss feed

    Ok guys I am sorry.
    Been very ill and busy with a online course. I did not see the updates.

    Any way here we go.

    First the code that you need to add to the page where you want the feed to show
    Code:
    <?php
    $XMLFILE = "http://www.THE FEED YOU WANT.xml";
    $TEMPLATE = "http://www.WHERE YOU UPLOADED YOUR TEMPLATE FILE";
    $MAXITEMS = "4";
    include("../rss/rss2html.php");
    ?>
    
    The first line ($XMLFILE)is the feed that you want to display.
    The second line ($TEMPLATE) url to where you place the template file on your site
    The third line ($MAXITEMS)this determines the number of items from the feed.
    You can also determine the number of characters in each item that is done in the rss2html.php file
    The last line is the path to where you uploaded the file called rss2html.php on your site.

    So make the changes to the above code and save it to notepad so you can paste it into the page where you want the rss feed. (REMEMBER YOU NEED TO MAKE THE PAGE .php not .html )

    NEXT

    next the template
    template.html all I can say is try it as is then make small changes to get the look you want. in most cases you dont need to change it at all.
    Just upload it to where you said it will be in line 2 ($TEMPLATE) above.

    NEXT

    the file called rss2html.php open it in notepad and make the following changes.

    Code:
    $TEMPLATEfilename = "rss/template.html";
    Change the info between the " " to where you uploaded the (template.html file)

    Code:
    $limitItemDescriptionLength = 1000;  // Not limited, in the URL as ItemDescriptionLength=
    where it says 1000 that is how long the description of each item will be. for full description make it 0 I find that keeping it between 200 and 500 is long enough to catch attention but not get boring

    NEXT

    the file called (FeedForAll_XMLParser.inc)
    no changes should be made.

    upload the file(s) (all files should be in the same folder template,feedforall..,rss2html)
    to your server paste the code into the .php page where you want the feed. If all your paths are correct it should work.
     

    Attached Files:

  8. bmcoll3278

    bmcoll3278 New Member

    Any question PM me I will do what I can to help
     
  9. djwilson

    djwilson New Member

    so we just update the rss2template.php file as the feed?


    EDIT: Sorry I missed a bit.
     
  10. bmcoll3278

    bmcoll3278 New Member

    this is the code that you paste into your page where you want the rss feed

    Code:
    <?php
    $XMLFILE = "http://www.THE FEED YOU WANT.xml";
    $TEMPLATE = "http://www.WHERE YOU UPLOADED YOUR TEMPLATE FILE";
    $MAXITEMS = "4";
    include("../rss/rss2html.php");
    ?>
    change this line
    $XMLFILE = "http://www.THE FEED YOU WANT.xml";
    to the address of the feed like

    $XMLFILE = "http://rss.news.yahoo.com/rss/topstories";

    that is one possible example