|
|
#1 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 8 ![]() |
Greetings all,
Just bought it and so far...really like it; Developer. http://www.sandrailsonly.curbstoners.com/index.php How does the RSS show up on the website? Here is my RSS code that I changed to make all children show up in feed. Code:
<?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']<>"")
{
$arr_childs = array((int)$_REQUEST['type']);
get_ids($arr_childs);
$sSQL .= ( empty($arr_childs) ) ? '': " AND p.section IN (". implode(', '
}
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']<>"")
{
$searchtext=trim(mysql_real_escape_string($_REQUEST['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>" . $listing[title] . "</title>\r\n";
echo "\t\t\t\t<author>" . $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>";
?>
|
|
|
|
|
|
#2 |
|
Moderator
Join Date: Mar 2006
Posts: 4,108
Rep Power: 100 ![]() ![]() |
RSS feeds by default arent made to show up on a website. They are meant to be viewed with an RSS reader.
__________________
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 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
I think he's asking where the feed icon is to allow a user to subscribe to the feed.
-- hugh |
|
|
|
|
|
#4 | |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,767
Rep Power: 110 ![]() |
Quote:
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://yoursite.com/external.php" />
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 8 ![]() |
Excellent...working like a charm.... |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 8 ![]() |
Except that now...I am getting this
This feed contains code errors. Go back to the previous page. More information XML document must have a top level element. Line: 0 Character: 0 |
|
|
|
|
|
#7 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,767
Rep Power: 110 ![]() |
Can you try and upload an original external.php file. Maybe it got corrupt some how.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 8 ![]() |
That seemed to make the RSS function, but perhaps the error is happening when I add the code to make the child categories part of the feed. I entered it from another's post. See above.
Here it is exactly.... Code:
{
$arr_childs = array((int)$_REQUEST['type']);
get_ids($arr_childs);
$sSQL .= ( empty($arr_childs) ) ? '': " AND p.section IN (". implode(', '
}
|
|
|
|
|
|
#9 | |
|
Moderator
Join Date: Mar 2006
Posts: 4,108
Rep Power: 100 ![]() ![]() |
Quote:
In the above code you dont have a closing bracket on the implode statement. Even if you did, im not sure it would work. Can you provide a link where you got the code changes from?
__________________
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 |
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 8 ![]() |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Feedback on Multiple Language Website | midoplaz | v3.1 Modules & Modifications | 0 | 08-31-2007 03:11 PM |
| Show customers URL on showlistings.tpl.php | marketingsolutions | v3.1 Questions & Support | 0 | 11-01-2006 08:38 PM |
| Can you show ads on someone else's site? | cherubini | v3.1 Modules & Modifications | 14 | 06-09-2006 01:47 PM |
| Sample faq and terms? | macagent | v3.1 Questions & Support | 2 | 06-07-2006 06:03 PM |
| Not show price | garysmith | v3.1 Modules & Modifications | 10 | 05-30-2006 05:44 AM |