Location: PHPKode > projects > Write2Left > Base/Log.php
<?php
/*
+------------------------------------------------------
| Write2Left
| (c) timdorr
| http://www.write2left.com
| hide@address.com
| See License.txt for license info
|------------------------------------------------------
| Script: Log.php
| Description:
|   The main page for a specific log
| Created Jun-28-2003
+------------------------------------------------------
*/

/* Class: Log
 * Description:
 *   Driver for our log main page
 */
class Log
{
	var $skin = "";
	var $menu = true;
	
	function run()
	{
		global $W2L, $userinfo, $output, $db;
		
		// Do skin related stuff
		require( "./Skin/Log.php" );
		$this->skin = new Skin_log();
		$output->page_title = "$userinfo->log_name";
		
		$output->add( $this->skin->body_top( $userinfo->log_name ) );
		
		// Show the log stats		
		$authors  = $db->query_fetch( "SELECT COUNT(*) FROM w2l_editors  WHERE log_id = $userinfo->log_id AND can_post = '1'" );
		$posts    = $db->query_fetch( "SELECT COUNT(*) FROM w2l_posts    WHERE log_id = $userinfo->log_id" );
		$comments = $db->query_fetch( "SELECT COUNT(*) FROM w2l_comments WHERE log_id = $userinfo->log_id" );

		$output->add( $this->skin->stats( $authors[0], $posts[0], $comments[0] ) );
		
		// Show the recent comments
		$db->query( "SELECT * FROM w2l_comments 
							 WHERE log_id = $userinfo->log_id
							 ORDER BY time DESC
							 LIMIT 5" );
		$output->add( $this->skin->comments_head() );
		while( $com = $db->fetch_array() )
			$output->add( $this->skin->comments_row( $com['author_name'], date( 'm-d-Y', $com['time'] ), $com['post_id'] ) );
		$output->add( $this->skin->comments_foot() );
		
		$output->add( $this->skin->body_bottom() );
	}
	
}

$driver = new Log();
?>
Return current item: Write2Left