View Single Post
  #6  
Old 03-29-2008, 06:55 PM
Mook25's Avatar
Mook25 Mook25 is offline
Brigadier General
 
Join Date: Oct 2005
Location: UK
Posts: 1,446
Default Re: Google dropped my website

RSS is a format for syndicating news and the content of news-like sites, including major news sites like bbc news, news-oriented community sites like Slashdot, and personal weblogs. It's not just for news though as pretty much anything that can be broken down into discrete items can be syndicated via RSS

Add the below code to your page where you want the RSS feed to appear either by inputing directly via dreamweaver or something similar or if i remember rightly Bluevoda has an option to input PHP code but not 100% sure. Once this has been input don't forget to change the RSS feed to what ever you want by changing the link i've highlighted as red.

You can find a whole host of RSS feeds here
PHP Code:
<?php
$insideitem 
false;
$tag "";
$title "";
$description "";
$link "";
$locations = array('http://www.worldwidewords.org/rss/updates.xml');
srand((float) microtime() * 10000000); // seed the random gen 
$random_key array_rand($locations);
function 
startElement($parser$name$attrs) {
 global 
$insideitem$tag$title$description$link;
 if (
$insideitem) {
  
$tag $name;
 } elseif (
$name == "ITEM") {
  
$insideitem true;
 }
}
function 
endElement($parser$name) {
 global 
$insideitem$tag$title$description$link;
 if (
$name == "ITEM") {
  
printf("<dt><b><a href='%s' target=new>%s</a></b></dt>",
  
trim($link),htmlspecialchars(trim($title)));
  
printf("<dt>%s</dt><br><br>",htmlspecialchars(trim($description)));
  
$title "";
  
$description "";
  
$link "";
  
$insideitem false;
 }
}
function 
characterData($parser$data) {
 global 
$insideitem$tag$title$description$link;
 if (
$insideitem) {
 switch (
$tag) {
  case 
"TITLE":
  
$title .= $data;
  break;
  case 
"DESCRIPTION":
  
$description .= $data;
  break;
  case 
"LINK":
  
$link .= $data;
  break;
 }
 }
}
$xml_parser xml_parser_create();
xml_set_element_handler($xml_parser"startElement""endElement");
xml_set_character_data_handler($xml_parser"characterData");
$fp fopen($locations[$random_key], 'r')
 or die(
"Error reading RSS data.");
while (
$data fread($fp4096))
 
xml_parse($xml_parser$datafeof($fp))
  or die(
sprintf("XML error: %s at line %d",
   
xml_error_string(xml_get_error_code($xml_parser)),    
   
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);
?>
__________________
Voda Picks >> Prices| Tutorials | BV Download | FAQ | Your First Webpage


Want a banner like above? Contact me here with details.
Reply With Quote