Announcement

Collapse
No announcement yet.

Rss Feed - Php - Fragment

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rss Feed - Php - Fragment

    Hi,

    I've downloaded some RSS feed software.

    The software is designed to automatically load subscribed rss feeds to your site.

    The problem im having is when i create the feed they suggest you put the code into a seperate php e.g rssfeeds.php and call it in to your html page.

    The code they use for calling the page is

    <!--#include virtual="/rssfeeds.php" -->

    I've tried to put this in a fragment as the following

    !!<<!--#include virtual="/rssfeeds.php" -->>!!

    However, it dont work

    Any ideas

    #2
    When you say it doesn't work do you mean online or offline? You will need to upload to get includes to work.
    Cheers

    David
    Located in Edinburgh UK

    http://twitter.com/mcfinster

    Comment


      #3
      Also how are you uploading rssfeeds.php, if it's through Actinic then the path will be "/acatalog (or your shop directory)/rssfeeds.php".

      AND, I may be wrong but I think you may have to parse all your pages as PHP via a .htaccess to get this to work online.
      Cheers

      David
      Located in Edinburgh UK

      http://twitter.com/mcfinster

      Comment


        #4
        Two things

        Is your server parsing html as php, it will be required to use php in html, you could add this to your htaccess file AddHandler application/x-httpd-php5 .html .php .htm

        there are variations on this line depending on the php version on your server.

        alternative save the page you have the php code on as a .php file not a .html
        then you wont need to edit the htaccess

        Comment


          #5
          it doesnt work off line or online.

          These are the instructions they supply

          #1 Instructions for adding PHP code to an HTML site;
          PHP scripts do not automatically work on html pages. If you have an HTML or (.HTM) based site, in order for PHP scripts to run on your .htm or .html pages you have a 2 options;

          For Apache Servers Edit your .htacess with AddType application/x-httpd-php .htm .html Then Add the php code from the reader directly to your html pages


          For Apache Servers Edit your .htacess with either .htm server parsed .html server parsed or
          Addhandler application/x-httpd-php .html .php Then follow the directions below to use the php code from the reader with SSI Includes.
          ***NOTE: For Windows or IIS servers - You do not have an .htaccess file. Windows IIS servers also cannot run php on html pages. Your only option for windows IIS servers is to use .shtml or .php pages with the php option from the reader. Or add Javascript to your html pages. For .shtml pages check your setup options and make sure the option for SSI inlcudes is checked, then follow the directions below for creating the SSI include and file.

          http://rssfeedreader.com/php.html#HTML

          Im also on a linux server had dont have a .htacess file.

          I have run the javascript option but i really would like the php option as it is SE friendly...

          Comment


            #6
            Originally posted by dave_finlayson View Post
            AND, I may be wrong but I think you may have to parse all your pages as PHP via a .htaccess to get this to work online.

            Ermmm yer as Dave has already said sorry

            Comment


              #7
              Originally posted by Faulkds View Post
              Im also on a linux server had dont have a .htacess file.
              All you need to do is create a htaccess file and upload it.

              Comment


                #8
                This might not work, some hosts dont allow parsing, it increases server load slightly. I cant recall them but i thought one was fasthosts

                Comment


                  #9
                  Originally posted by Darren B View Post
                  Two things

                  Is you server parsing html as php, it will be required to use php in html, you could add this to your htaccess file AddHandler application/x-httpd-php5 .html .php .htm

                  there are variations on this line depending on the php version on your server.

                  alternative save the page you have the php code on as a .php file not a .html
                  then you wont need to edit the htaccess
                  Hi,

                  What i have done is saved the php code in to a file called rssfeed.php

                  <?php
                  $olderror_reporting =error_reporting(0);
                  include ("http://www.motocc.co.uk/RSSCB2.5/rss.php?url=http%3A%2F%2Fwww.motorcyclenews.com%2FMCN%2FOther%2FRSS%2FRSSData%2F%3FN%3D346%26Rpp%3D100&newpage=1&chead=&atl=1&desc=1&owncss=&eleminate=&auth=1&dts=1&width=600&max=5&maxfrom=10&maxto=25&tlen=0&rnd=&bt=3&bs=None&nmb=1&ntb=1&naf=1&nst=1&nwd=0&nht=0&initime=1224073017&dlttime=0&dlen=0&bg=%23FFFFFF&bc=BLUE&tc=BLACK&ts=09&spc=&ims=&lc=%23333333&lstyle=1&rel=1&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1");
                  error_reporting($olderror_reporting);
                  ?>


                  Im now trying to call that page into my catalog using the code

                  !!<<!--#include virtual="/rssfeed.php" -->>!!

                  Ive added this code into a fragment but it wont display

                  Comment


                    #10
                    Darren,

                    As Darren (the other one) says, you will need to create and upload an .htaccess file to your web server with the text as described above. You will then have to add rssfeed.php to the additional files in Actinic AND change the path to read
                    Code:
                    !!<<!--#include virtual="/acatalog/rssfeed.php" -->>!!
                    If you host allows parsing then it should work. It will not however work within Actinic regardless of what you do.
                    Cheers

                    David
                    Located in Edinburgh UK

                    http://twitter.com/mcfinster

                    Comment


                      #11
                      There ya go all as clear as mud.

                      Comment


                        #12
                        Can you just rename the html file in actinic to php?

                        Comment


                          #13
                          To be fair Darren, if you are only using it on one page, that will probably work! No point using an include then though surely, just paste all the code into the fragment!
                          Cheers

                          David
                          Located in Edinburgh UK

                          http://twitter.com/mcfinster

                          Comment


                            #14
                            Ill give it ago... Thanks

                            Comment


                              #15
                              Actinic pages can be renamed to php yes.

                              Comment

                              Working...
                              X