<?
/* 
    Install:
     copy to Plugins directory, and install through nucleus Admin area.
 
    Usage:
     In your Skin file, use <%blogListAdv%> wherever you want
     the blog list to be displayed.
 
    Joseph McDermott
    http://www.faceh.com  */
 
class NP_blogListAdv extends NucleusPlugin {
 
 function getEventList() { return array(); }
 function getName() { return 'blogListAdv';    }
 function getAuthor() { return 'faceh';    }
 function getURL() { return 'http://faceh.com'; }
 function getVersion() { return '1.0'; }
 function getDescription() { return 'Displays a list of active Blogs.'; }
 
 function install() {
 }
 
 function doSkinVar($skinType) {
 
     $query = "SELECT bnumber, bshortname, burl, bdesc FROM ".sql_table('blog')." ORDER by bnumber DESC";
	 $blogInfo = mysql_query($query);
 
	 echo "<ul>";
	 while($row = mysql_fetch_object($blogInfo)) {
	   echo '<li>'; 
	   echo '<b><a href="'.$row->burl.'">'.$row->bdesc.'</a></b>';
 
	   $query = mysql_query("SELECT tmember, tblog, tadmin FROM ".sql_table('team')." WHERE tblog = ".$row->bnumber);
	   $authorInfo = mysql_fetch_object($query);
	   if ($authorInfo->tadmin=="1") {
	     $query = mysql_query("SELECT mnumber, mname, mrealname FROM ".sql_table('member')." WHERE mnumber = ".$authorInfo->tmember);
	     $memberInfo = mysql_fetch_object($query);
		 echo " by <a href='".$row->burl."/index.php?memberid=".$memberInfo->mnumber."'>".$memberInfo->mname."</a>";
		 echo '<br>';
		 echo "Name: ".$memberInfo->mrealname;
		 echo ' - ';
	   } else echo "<br>";
 
	   $query = mysql_query("SELECT inumber, iblog FROM ".sql_table('item')." WHERE iblog=".$row->bnumber);
	   $itemInfo = mysql_num_rows($query);
	   echo "Blog entries: ".$itemInfo;
	   echo ' - ';
 
	   $query = mysql_query("SELECT cnumber, cblog FROM ".sql_table('comment')." WHERE cblog=".$row->bnumber);
	   $commentInfo = mysql_num_rows($query);
	   echo "Comments: ".$commentInfo;
	   echo '</li><br>';
 
	 }
	 echo "</ul>";
 
 }  
}
?>
bloglistadv_code.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki