|
|
#1 |
|
Member
Join Date: May 2007
Posts: 37
Rep Power: 8 ![]() |
I'm obviously missing something here, or maybe I'm trying to do something that just can't be done.
I have purchased, downloaded, installed, activated the RSS Mod from Mods.aucity. I want the front page of my site to display featured listings for only one category. It's my understanding that I can use an RSS feed to do that. I reviewed Eric's post in the KB about generating an RSS feed (string), but mine keeps throwing errors. In order to display featured listings in only one category I've used this URL: http://www.mydomain.com/external.php...d&category=109 and entered that as a feed URL into the admin area on the Module Manager. I also inserted the following code into the home.tpl.php page: {assign var="rssbody" value=$smarty.const.FILESYSTEM_PATH} {include file="$rssbody/modules/rss_mod/templates/rss_mod/rss.tpl.php"} But this throws an error on every page of the site stating that "the file could not be found - 404." What's wrong with the way I've formed the RSS feed string? Can anyone please help me with this? Thanks,
__________________
private signature 68Classifieds - Developer Edition, v.3.1.7 Last edited by abkeller; 09-15-2007 at 05:31 PM. Reason: hide domain from search engines |
|
|
|
|
|
#2 | |
|
Moderator
Join Date: Mar 2006
Posts: 4,158
Rep Power: 102 ![]() ![]() |
Quote:
http://www.gunmountain.com/classifieds/external.php However, there is still an error in the feed. RSS doesnt like certain characters and your one title in the feed is "S&W Model 60". Aus city should be able to modify the script to properly handle the special chars for you.
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
|
#3 |
|
Member
Join Date: May 2007
Posts: 37
Rep Power: 8 ![]() |
Thanks, Larry.
I spent all night ruminating about this error in my sleep, and then when I woke up this morning it hit me about the full path on my server to the 68 Classifieds installation to call up the external.php file. "DOH!" Sometimes we don't see those small things at 1:00am ![]() Before logging in to the support forum this morning, I corrected the path error in my RSS string and I still got an error: "Warning: MagpieRSS: Failed to parse RSS file. (Invalid document end at line 2, column 1) in /home/gunmount/public_html/classifieds/modules/rss_mod/includes/rss_fetch.inc.php on line 239" I will contact support at Mods.auscity and and alert them to the special character problem and link to this thread. Hopefully, they can help me sort this out shortly. Thanks for your help!
__________________
private signature 68Classifieds - Developer Edition, v.3.1.7 |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 732
Rep Power: 27 ![]() |
Elizabeth,
You might also like to PM juven14 (ie: mods.auscity.com)
__________________
Chaslie V4.1 dev 68 Classifieds Important Links Customer Area | Issue Tracker | User Manuals & Documentation HTML Help W3 Schools |
|
|
|
|
|
#5 |
|
Moderator
|
Okay, open external.php:
Find this section: PHP Code:
PHP Code:
|
|
|
|
|
|
#6 |
|
Member
Join Date: May 2007
Posts: 37
Rep Power: 8 ![]() |
Thanks, John. I already spent many hours combing through the entire support forum and found your post with this fix in another thread. I implemented the "htmlspecialchars" in the external.php file and it still does not work.
I also found another thread with a post from Eric abouting putting the following into the the external.php file for an RSS string that will display "Featured" ads; if (isset($_REQUEST['featured'])&& $_REQUEST['featured']<>"") { $sSQL .= " AND p.featured = ".$_REQUEST['featured']; } It's still not working. When I enter this URL string (http://www.mydomain.com/classifieds/...d&category=109) for the RSS Feed URL field in the admin area of the RSS Mod it throws this error on my ENTIRE website; "Warning: MagpieRSS: Failed to parse RSS file. (Invalid document end at line 2, column 1) in /home/gunmount/public_html/classifieds/modules/rss_mod/includes/rss_fetch.inc.php on line 239" I looked at line 239 in rss_fetch.inc.php and this is the code (before and after included for context); function error ($errormsg, $lvl=E_USER_WARNING) { global $MAGPIE_ERROR; // append PHP's error message if track_errors enabled if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } if ( $errormsg ) { $errormsg = "MagpieRSS: $errormsg"; $MAGPIE_ERROR = $errormsg; trigger_error( $errormsg, $lvl); <----line 239 here } } Is there something wrong with the syntax on that line, is this a blind alley and there's an error somewhere else? Please help!
__________________
private signature 68Classifieds - Developer Edition, v.3.1.7 Last edited by abkeller; 09-15-2007 at 05:32 PM. Reason: hiding domain |
|
|
|
|
|
#7 |
|
Moderator
|
Yes, about 60 other people are using this mod with out problems, so it has to be feed related. I'll take a look at your feed and see if I can come up with an answer.
|
|
|
|
|
|
#8 |
|
Moderator
|
The feed is broken, take a look at it, nothing after the channel information is being displayed. Can you copy/paste the external.php source here so I can take a look at what is different.
|
|
|
|
|
|
#9 |
|
Member
Join Date: May 2007
Posts: 37
Rep Power: 8 ![]() |
Hi John,
Here's the ENTIRE contents of the external.php file; <?php /* * 68 Classifieds * * All source code & content (c) Copyright 2006, 68 Classifieds * unless specifically noted otherwise. * * @Author $Author: Eric $ (68 Classifieds) * @copyright 68 Classifieds * @link http://www.68classifieds.com * @version 3.1 * @$Revision: 1.2 $ * @Updated: $Date: 2006/06/21 12:45:41 $ * @package 68 Classifieds * */ require_once('includes/init.php'); //now setup the search query $count=""; $sSQL="SELECT p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration, p.pBold, p.pHighlighted, u.state, u.city, u.country, u.username FROM ".PREFIX."products AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' "; //now get the search fields if (isset($_REQUEST['type'])&& $_REQUEST['type']<>"") { $sSQL .= " AND p.section = ".(int)$_REQUEST['type']; } if (isset($_REQUEST['state'])&& $_REQUEST['state']<>"") { $sSQL .= " AND u.state = '".mysql_real_escape_string($_REQUEST['state'])."'"; } if (isset($_REQUEST['city'])&& $_REQUEST['city']<>"") { $sSQL .= " AND u.city = '".mysql_real_escape_string($_REQUEST['city'])."'"; } if (isset($_REQUEST['country'])&& $_REQUEST['country']<>"") { $sSQL .= " AND u.country = '".mysql_real_escape_string($_REQUEST['country'])."'"; } if (isset($_REQUEST['owner'])&& $_REQUEST['owner']<>"") { $sSQL .= " AND p.owner = ".(int)$_REQUEST['owner']; } if (isset($_REQUEST['searchtext'])&& $_REQUEST['searchtext']<>"") { if (isset($_REQUEST['featured'])&& $_REQUEST['featured']<>"") { $sSQL .= " AND p.featured = ".$_REQUEST['featured']; } $searchtext=trim(mysql_real_escape_string($_REQUES T['searchtext'])); $sSQL .= " AND (p.title LIKE '%".$searchtext."%' OR p.description LIKE '%".$searchtext."%')"; } //search price// $minprice=(int)trim(@$_REQUEST['minprice']); $maxprice=(int)trim(@$_REQUEST['maxprice']); if($minprice == "") $minprice=0; if($maxprice == "") $maxprice=9999999; $sSQL .= " AND p.price BETWEEN ". $minprice ." AND ". $maxprice; //now group by $sSQL .= " GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration ,u.state, u.city, u.country"; if($count>0) { $sSQL.=" HAVING count(sValue) = ".$count; } $sSQL .= " ORDER BY p.dateadded DESC"; //now limit if(isset($_GET['limit']) && $_GET['limit']<>"") { $sSQL .= " LIMIT ". (int)$_GET['limit']; } else { $sSQL .= " LIMIT 15"; } //buld array of listings $ads = array(); $result = $db->query($sSQL); while ($rs=$result->fetch()) { $ads[] = $rs; } // set XML type and nocache headers header('Content-Type: text/xml'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); // print out the page header echo '<rss version="0.92">' . "\r\n"; echo "<channel>\r\n"; echo "\t<title>" . htmlspecialchars($title) . "</title>\r\n"; echo "\t<link>".URL."</link>\r\n"; echo "\t<description>" . htmlspecialchars(DESCRIPTION). "</description>\r\n"; echo "\t<docs>http://backend.userland.com/rss092</docs>\r\n"; echo "\t<language>en</language>\r\n"; // list returned threads if (!empty($ads)) { foreach ($ads AS $listing) { echo "\t\t\t<item>\r\n"; echo "\t\t\t\t<link>". URL ."/viewlisting.php?view=".$listing['id']."</link>\r\n"; echo "\t\t\t\t<title>" . addslashes(htmlspecialchars($listing[title])) . "</title>\r\n"; echo "\t\t\t\t<author>" . addslashes(htmlspecialchars($listing[username])) . "</author>\r\n"; echo "\t\t\t\t<date>" . $listing['dateadded'] . "</date>\r\n"; echo "\t\t\t</item>\r\n"; } } //close the feed echo "</channel>\r\n"; echo "</rss>"; ?> Thanks,
__________________
private signature 68Classifieds - Developer Edition, v.3.1.7 |
|
|
|
|
|
#10 |
|
Moderator
|
Ok, there was a parse error, I fixed in your pasted code. I also noticed the link for you feed provides no listings because there are no featured ads. Can you pm me your ftp details, I'll take a look at how the rss mod is installed and upload a fixed version of the external.php file.
I'm guessing it is a bug in the module system that prevents you from running more than 1 module, it isn't handling the feed properly when its listings are empty, or the feed is still not right some place. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can my Rss feed? | garysr | v3.1 Questions & Support | 6 | 11-10-2007 06:54 PM |
| Special Character in Listings stops feed! | garysr | v3.1 Questions & Support | 6 | 01-09-2007 10:29 PM |
| RSS feed to HTML page | SkGold | v3.1 Modules & Modifications | 10 | 12-29-2006 05:39 PM |
| RSS Feed Error | Scooter | v3.1 Questions & Support | 3 | 10-05-2006 06:58 PM |
| Oodle Feed XML | CB | v3.1 Questions & Support | 8 | 09-25-2006 05:50 AM |