Jump to content

itsinmyhead

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

itsinmyhead's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahh, bummer! I did come across some "random quote generator" RSS feeds that do the same thing - refresh on the PHP page but not once you add them to a homepage like iGoogle. Really kind of a drag...
  2. So, I've got some RSS feeds setup. An example: http://www.adkpennysaver.com/rss/rssfeed.php If you go to that page and refresh, you'll see that the listings are displayed in a random order. However, if you add them to your iGoogle/whatever page, they aren't displayed in a random order - they're displayed in whatever order they were shown on the above page. Even with refreshing your homepage/whatever page the feed is displayed on, the results do not change order. Is there a way to get these to resort randomly each time someone accesses it on their homepage? It's pretty beneficial that the results are displayed in a random order so that all of the ads have a chance to be seen rather than just a few static ones. Thanks!
  3. I can't seem to find a way to get this to work... I either find myself winding up with the same error, or it returns telling me that the result set isn't empty. Did some Googling, of course, but haven't come across a surefire fix.
  4. I've got another question unrelated to the topic, but thought I'd post it here rather than starting a whole new one since people have already been so speed in replying here. Everything is working well, except when there are no ads in a specific category. For instance: http://adkpennysaver.com/rss/rssrea.php (Real Estate - has a decent number of ads to display) http://adkpennysaver.com/rss/rsshelp.php (Help Wanted - no ads to display) If you go to the Help Wanted page, you can see that it just gives an error. Is there any way to get it to display the regular "Subscribe to this feed" page as it does with the Real Estate example linked? I know there aren't any ads listed currently, but I would like people to be able to subscribe to them either way.
  5. Brian, you're awesome! Works like a charm. Thanks so much, everyone! (I would still be interested in knowing how the script in the blog works, Monkeh, if you have any ideas on implementing it into my existing code)
  6. I don't know how I didn't come across his blog when I searched earlier, but oh well. It looks like what I'd need, but I can't figure out how to implement it into my existing code. I tried Brian's suggestion, too, and it displayed zero results. I refreshed a couple of times to make sure and it displayed one letter followed by an ellipsis, but after another refresh it went back to displaying no results.
  7. I made a few searches and couldn't find anything that helped me out. Maybe someone here can lend some advice. I'm creating an RSS feed for our classified ad listings, and I want to limit the description of the results to a certain number of characters - let's say 20. I played around with substr() and other things, but nothing seems to have any affect on the results whatsoever. I don't want any words to be cut in half - I want the last word in a description to be displayed followed by "..." if necessary. Here's what my code looks like right now: <?php $database = "db"; $dbconnect = mysql_connect("localhost","user","pw"); mysql_select_db($database, $dbconnect); $query = "select id, category, description from classifieds order by rand()"; $result = mysql_query($query, $dbconnect); while ($line = mysql_fetch_assoc($result)) { $return[] = $line; } $now = date("D, d M Y H:i:s T"); $output = "<?xml version=\"1.0\"?> <rss version=\"2.0\"> <channel> <title>Adirondack Pennysaver Classified Listings</title> <link>http://www.adkpennysaver.com</link> <description>Classified Ad Listings for the Adirondack Pennysaver in Plattsburgh, New York.</description> <language>en-us</language> <pubDate>$now</pubDate> <lastBuildDate>$now</lastBuildDate> "; foreach ($return as $line) { $output .= "<item><title>".htmlentities($line['category'])." - ".htmlentities(strip_tags($line['description']))."</title> <link>".htmlentities($line['http://www.adkpennysaver.com'])."</link> </item>"; } $output .= "</channel></rss>"; header("Content-Type: application/rss+xml"); echo $output; ?>
  8. I think I'm kind of lost on what you're trying to explain to me here... I don't know what would be submitted as a "crawled keyword." I don't have a string or a list of keywords that are searched - people can search for anything they want. I guess the keyword that would match articles to ads would be the category - Real Estate to Real Estate, Automotive to Automotive, etc.
  9. I think I know what you're saying, but I'm not sure of how to put it into action. The thing is, I can understand how to do this if I were just displaying the information static on the page - find the matches across the two tables and display the results. However, a user can search any number of things and return any number of results in several different categories at a time. So, I'm unsure of how to pull the categories from the results and then match those to the information in my Links table.
  10. I don't remember seeing a suggestion for a UNION, but I did look that up before. I could never get it to work properly - so I was either doing it wrong or it wasn't the method I needed for this particular task. How would I go about that?
  11. Ahh, okay. From the Classifieds table, for instance: ID: 1 Category: Real Estate Description: 1 BR Apartment For Rent... ID: 2 Category: Real Estate Description: Small home for sale... ID: 3 Category: Automotive Description: 1999 Buick... In the Links table: ID: 1 Category: Real Estate Name: #1 Realty Link: http://www.number1.com ID: 2 Category: Automotive Name: Advanced Auto Link: http://www.advancedauto.com Now, as far the Classifieds table goes, I have my search working fine (as seen here: http://www.adkpennysaver.com/search.php). What I would like to do is to have a user run a search. The results will come up, and if the categories from the Classifieds table match a category from the Links table, it will display those results from the Links table (in addition to displaying the results from the search). So, if you searched real estate ads, you would come up with the first 2 results in the Classifieds table, plus the link provided in the Links table. Does that make any sense?
  12. I'm not sure what kind of examples you want, since I haven't found anything that works for me yet. Do you mean examples on other sites? If that's the case, then the easiest example I can think of is Google's ads - where they crawl your page's content and supply related ads. That's in the same realm, basically, of what I'm wanting to do.
  13. I doubt it - you seem to be the only consistent poster replying to these, haha. Let me try to explain again... We have a table for classifieds in our database. You can search the table for any term so you can find ads you want to see. We have a table for links supplied by our advertisers. These can be real estate groups, auto dealers, restaurants, etc. These aren't searchable, they are just for display. What we would like to do is have a user search the ads for an item - i.e., a house. The results will then come back to our user. Then, run another process where the actual results are searched - if there are results in the category "Real Estate" then we would like to display the links from the links table that also fit that category. I know how to call for items from the classifieds & links table that match categories - but I want to crawl the results, not just pull data straight from the tables.
  14. There are a few hundred ads going in each week. Let's say there are 75 real estate ads and the first one is item number 40 in the entire block of ads. If there are only ten links for real estate advertisers in the links table, the IDs (which auto increment) wouldn't match up. And, say they did, I still can't find a way to display matching items based only on search results and not on the entire dataset of the database & tables.
  15. Related like this: "Classifieds" Table: ID Category Description "Links" Table: ID Category Name Address Web The ID numbers aren't linkable, since they auto increment - plus the IDs for classifieds change week to week, for the most part, when the week's new data is imported. Category would match up. However, like I mentioned before, if I just do a join where I select matching categories, it would always display those categories.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.