1){ echo '

Error: There do not appear to be any entries in the specified range. Try the previous page.

'; }elseif(($entrynum==$displaynum or $page>1)){ echo '
'; if($page>2){echo ''.$firstlink.' - ';} //First page if($page>1){echo ''.$prevlink.'';} //Previous page if($entrynum==$displaynum and $page>1){echo ' - ';} //Divider between the two links if they're both displayed if($entrynum==$displaynum){echo ''.$nextlink.'';} //Next page echo '
'; } } } //Grab the RSS file from Warwick Blogs if(@$blogrss=file($wbrssurl) and $wbrssurl){ //A couple of variables to keep track of position in an entry $inentry=0; //Set to 1 when passing an and reset to 0 when passing an $indesc=0; //Set to 1 when "within" the entry's tags to just output the lines as is $entrynum=0; //To count entries to see if it's necessary to have a next page link $blogentries=array(); //Initialise the variable // // Go through each line // foreach($blogrss as $blogline){ //Identify if we're inside an entry if(strstr($blogline, "")){$inentry=1; $entrynum++; continue;} if(strstr($blogline, "")){$inentry=0; $tagnumber=0; continue;} //Extract details for entries and the blog itself if(!$inentry){ // // Blog // if(strstr($blogline, "")){$blogtitle=trim(strip_tags($blogline));} if(strstr($blogline, "<link>")){$bloglink=trim(strip_tags($blogline));} if(strstr($blogline, "<description>")){$blogdesc=trim(strip_tags($blogline));} }else{ // // Blog entries // if(strstr($blogline, "<title>")){$title=trim(strip_tags(str_replace("&", "&", $blogline))); $blogentries["$title - $entrynum"]["title"]=str_replace(" _", " <i>", str_replace("_ ", "</i> ", $title));} if(strstr($blogline, "<link>")){$blogentries["$title - $entrynum"]["link"]=trim(strip_tags($blogline));} if(strstr($blogline, "<comments>")){$blogentries["$title - $entrynum"]["commenturl"]=trim(strip_tags($blogline));} if(strstr($blogline, "<guid isPermaLink=\"false\">")){$blogentries["$title - $entrynum"]["guid"]=trim(strip_tags($blogline));} //Identify if in the description because it's not all on one line if(strstr($blogline, "<description>")){$indesc=1; continue;} if(strstr($blogline, "</description>")){$indesc=0; continue;} if($indesc){ $blogline=trim(strip_tags($blogline)); $blogline=str_replace("<", "<", $blogline); $blogline=str_replace(">", ">", $blogline); $blogline=str_replace("'", "'", $blogline); $blogline=str_replace(""", '"', $blogline); $blogline=str_replace("’", "'", $blogline); $blogline=str_replace("‘", "'", $blogline); $blogline=str_replace("“", '"', $blogline); $blogline=str_replace("”", '"', $blogline); $blogline=str_replace("…", "...", $blogline); $blogline=str_replace("–", "-", $blogline); $blogline=str_replace("&", "&", $blogline); $blogentries["$title - $entrynum"]["desc"].=$blogline; } if(strstr($blogline, "<pubDate>")){$blogentries["$title - $entrynum"]["time"]=strtotime(trim(strip_tags($blogline)));} if(strstr($blogline, "<author>")){$blogentries["$title - $entrynum"]["author"]=trim(strip_tags($blogline));} if(strstr($blogline, "<category>")){if($tagnumber){$tagdelimiter=' ';}else{$tagdelimiter='';}$blogentries["$title - $entrynum"]["tags"].=$tagdelimiter.'<a href="'.$bloglink.'/tag/'.str_replace(" ", "_", strtolower(trim(strip_tags($blogline)))).'/" rel="tag" title="Entries tagged with "'.trim(strip_tags($blogline)).'"">'.trim(strip_tags($blogline)).'</a>'; $tagnumber++;} if(strstr($blogline, "<slash:comments>")){ $commentnum=trim(strip_tags($blogline)); if($commentnum=="0"){ $blogentries["$title - $entrynum"]["commentnum"]="No Comments"; }elseif($commentnum=="1"){ $blogentries["$title - $entrynum"]["commentnum"]="1 Comment"; }else{ $blogentries["$title - $entrynum"]["commentnum"]="$commentnum Comments"; } } } } if($blogsort==="title"){ //Sort the entries by title ksort($blogentries); }elseif($blogsort==="reverse"){ //Sort the entries in reverse order $blogentries=array_reverse($blogentries, true); }elseif($blogsort==="reverse title"){ //Sort the entries in reverse order by title krsort($blogentries); } // // Output the blog // if(!$wbmainfeed){ //Override blog details if the feed is not the main feed. if($zpagetitle){$blogtitle=$zpagetitle; $blogdesc=$zpagetitle;} $bloglink=explode("?", $wbrssurl); $bloglink=$bloglink[0]; } if($page>1){ //Append page number to main title for pages 2 and onwards $blogtitle.=' - Page '.$page.''; } if($blogdisplay=="custom"){ //Output nothing to allow external outputting }elseif($blogdisplay=="raw"){ //Dispay the "raw" $blogentries array echo '<div class="highlight"><pre><span class="variable">$blogentries</span>=<span class="array">array</span><span class="bracket">(</span> '; foreach($blogentries as $arraytitle => $blogentry){ echo ' '.$arraytitle.' => <span class="array">array</span><span class="bracket">(</span> '; foreach($blogentry as $key => $value){ echo ' <span class="key">'.$key.'</span> => <span class="value">'.str_replace("<", "<", str_replace(">", ">", $value)).'</span>, '; } echo ' <span class="bracket">)</span>, '; } echo '<span class="bracket">)</span>;</pre></div>'; //End of "raw" display }elseif($blogdisplay=="list"){ //"List" display echo '<h1 class="wbg"><a href="'.$bloglink.$blogurlsuffix.'" title="'.$blogdesc.'">'.$blogtitle.'</a></h1> <ul class="wbg"> '; foreach($blogentries as $blogentry){ echo ' <li><a href="'.$blogentry["link"].'">'.$blogentry["title"].'</a> - '.date("d M Y", $blogentry["time"]).'</li> '; } echo '</ul> '; //End of "list" display }else{ //Default display echo '<h1><a href="'.$bloglink.$blogurlsuffix.'" title="'.$blogdesc.'">'.$blogtitle.'</a></h1> '; foreach($blogentries as $blogentry){ echo ' <!-- '.$blogentry["title"].' --> <div class="section"> <h2><a href="'.$blogentry["link"].'">'.$blogentry["title"].'</a></h2> '.$blogentry["desc"].' <div class="details"> <b>Time: '.date("H:i:s", $blogentry["time"]).'</b><br /> <b>Date: '.date("D, d M Y", $blogentry["time"]).'</b><br /> <b>Tags:</b> '.$blogentry["tags"].'<br /> <b>Comments:</b> <a href="'.$blogentry["commenturl"].'">'.$blogentry["commentnum"].'</a> </div> </div> '; } blognextprev($entrynum, $page, $displaynum, $firstlink, $prevlink, $nextlink); //End of default display } } elseif(!$wbrssurl){ echo '<p><b>Error:</b> The URL for an RSS feed has not been specified; cannot display feed.</p>'; } elseif(!@$blogrss=file($wbrssurl)){ echo '<p><b>Error:</b> The RSS feed required to generate this page could not be accessed; it is possible that the remote server is down. Please try again later.</p>'; } else { echo '<p><b>Error:</b> An unknown error has occured; the cause cannot be identified.</p>'; } //Copyright notice and WBG image if(!($blogdisplay=="custom")){ echo '<div id="warwickblogsgrabber" style="text-align: right;" title="Powered by Warwick Blogs Grabber"><a href="http://www.6times9.com/wbg/"><img src="/warwickblogsgrabber.png" alt="Powered by Warwick Blogs Grabber" style="border: 0;" width="350" height="19" /></a></div>'; }else{ echo '<!-- '.$blogcopyright.' --> '; } $variable=array( key => "value", ); ?>