• Resolved cowpie

    (@cowpie)


    Before I explain the technical problems, let me explain what I want to do first. I set up wordpress without problems. I also have a website I am creating. I want to display my wordpress blog entries on the website I created. The only way I can think to do something like this is to read the rss file.

    As a result, I tried using carp and that didn’t work. After that I tried CG Feedread and that didn’t work either. For each, I could read feed from other rss feeds, but not my own blog. It is getting extremely frustrating. The code I am using for feedread:

    in the head section:
    <?php require(‘https://[mydomain].com/blog/wp-blog-header.php&#8217;); ?>

    where I want the feed to display:
    <?php
    $feedUrl = “https://www.[mydomain].com/blog/wp-rss2.php&#8221;;
    $feedOut = getSomeFeed($feedUrl, 4, false, “feed-realfeed”, ”, 36, false);
    if ($feedOut)
    echo $feedOut;
    ?>

    I can access the rss feed when I type it in the browser so I know it is there. Does anyone have a clue ?

Viewing 15 replies - 16 through 30 (of 30 total)
  • Thread Starter cowpie

    (@cowpie)

    frustratingly, using the HTML you pasted on pastebin did not work either. I get a 500 internal server error if I wait long enough.

    Well it is frustrating and I am stumped. I just copied the source from the link, created a test.php file and ran it just fine on my site (changing “blog” to “wordpress” to match my WP location).

    Maybe David will have an idea when he checks in.

    Thread Starter cowpie

    (@cowpie)

    Ok thanks Beel. I truly appreciate your help.

    Just out of curiosity, is the cg-feedread cache folder writable?

    -tg

    Thread Starter cowpie

    (@cowpie)

    Yes, I had the permissions at 755 and 777, neither worked

    Umm, even if the cache directory isn’t writeable, I think feedread should still output properly. If it doesn’t, I should fix that (it’s supposed to output the error somewhere, AND output the feed).

    I looked at Beel’s last pastebin entry, and it looks pretty good to me. If the require() statement is failing, you have to get that path correct — ANY script you try to use will have that as an issue…

    However, I also just looked at the SOURCE OUTPUT of your index2.php, and if you get halfway down the page it ‘restarts’ the output (i.e., DOCTYPE, etc., starts all over again). So it is likely that your index2.php has something else wrong with it…

    BTW, if you want this to be on the front page of your blog, obviously the theme system will already have all plugins setup/included by the time it gets to wp-content/themes/yourtheme/index.php, and as long as you’ve activated the feedread plugin ‘stub’, you can call getSomeFeed within index or any other wp php file(s). if you want a front page that ISN’T the main index.php of WP, but is a level ABOVE the blog, then you do need to include either wp-config.php or cg-feedread.php to get the ball rolling.

    So, to start with, make sure you are trying to set up the site with WP at the top level (using the standard/included index.php and ONLY modifying the >theme< index.php file), or not at the top level (with a custom top level index.php). Then, take a long hard look through your index2.php code, as you are likely somehow re-including something setup-wise twice, or had a copy-and-paste error.

    -d

    Thread Starter cowpie

    (@cowpie)

    Thanks for the thorough post. However, what I’m afraid of is that I’m too much of a newbie to follow your language.

    How can I look at “source output”?

    Does a level above the blog mean, in the wordpress (in my case “blog”) folder where wordpress’ components are contained?

    I also tried getting the feed to read in a separate https://www.realivy.com/test.php file and that did not work.

    depending on your browser, View -> Source or View -> Page Source. If you are making custom pages in HTML, you have to know that functionality…

    a level above the blog means IF you have WP installed in {site}/blog/, and not at the root of {site}.

    you’d have to post the code to test.php. without code, we can’t tell a thing if the page isn’t working. ??

    -d

    Thread Starter cowpie

    (@cowpie)

    oh you just meant the source, I thought “SOURCE OUTPUT” was something different. In my source, the doctype stuff doesn’t happen twice, I’m not sure where you see that it does. I’m making the site in dreamweaver, and it is acting oddly sluggish there.

    https://pastebin.com/397602

    I have WP installed in the /blog folder. I’m trying to implement it in pages in my root folder.

    There is a second doc type in the source of index2.php (I just checked).

    Get rid of everything but the head and cg-feedread call. Once working you can add back in the other stuff (sans the second doc type).

    Thread Starter cowpie

    (@cowpie)

    I found out that the second doc type is from when I called in menu.php, I solved that issue, but that still was not the problem. the test.php is barebones and doesn’t work.

    The only other thing I can offer is to have you get me ftp access to your account, so I can live upload-and-debug what’s occurring.

    Since CG-Feedread uses ‘fallback’ code to ensure functionality, it should work on most any server installation. However, it is possible that your server has particular quirks in its configuration. Feel free to drop me an email offline at cgcode at chait dot net, and I’ll be happy to try and give it a look directly.

    -d

    Okay, so here’s the solution (I might post a bigger post so more folks know…).

    cowpie is hosted on PowWeb. PowWeb, in their infinite wisdom, has implemented some kind of load-balancing solution for all websites. This has the side effect of basically locking-up any internal fopen/etc. of a powweb page using ‘normal’ URL conventions.

    The solution (spent 10 minutes in the powweb forums looking at PHP Q&A) is to rewrite internal requests to use ‘localhost’. So:
    https://www.realivy.com/blog/wp-rss2.php
    MUST INSTEAD BE
    https://localhost.realivy.com/blog/wp-rss2.php
    … when trying to fopen/fsockopen/etc. that web page from within a powweb site. (I’m not sure if it is only the case of a powweb site trying to fopen its OWN http URL, or all powweb URLs… I could see both being potential problems).

    When I replaced www with localhost in the getSomeFeed call, everything IMMEDIATELY works.

    -d

    Thread Starter cowpie

    (@cowpie)

    david, you are the man. I would also like to thank Beel for his efforts. I will not forget the excellent help you guys provided.

    Now this is a minor question that I’m sure I can find somewhere else, when getting hte feed for certain categories, the cmd is just like …wp-rss2.php?s=2 or something right?

    Figured it had to be something server specific but didn’t see that coming. The link will be the same as with the current cat, just with the ID of the cat (unless you use custom permalinks)…

    https://www.realivy.com/blog/?cat=1&feed=rss2

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘CG feed read not working’ is closed to new replies.