function get_stats()
 {
     include_once "db.inc.php";
     $db = new DB();
     $db->open();
     //////////////// posts \\\\\\\\\\\\\\\\\\\\
     function currentposts()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $postcount = "SELECT * FROM posts";
         $postcount1 = $db->query($postcount);
         $posts = $db->numRows($postcount1);
         if (!isset($posts)) {
             $posts = '0';
         }
         echo 'Posts: <B>';
         echo $posts;
         echo '</B>';
     }
     //////////////// Last post \\\\\\\\\\\\\\\\\\\\
     function latestpost()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $latestpost = "SELECT * FROM posts ORDER BY postid DESC LIMIT 1";
         $latest = $db->query($latestpost);
         $postinfo = $db->fetchArray($latest);
         if ($postinfo[parentpost] < 1) {
             echo 'Latest Post: <a href=';
             echo $stcfg[RootDir];
             echo '/?action=message&forum=';
             echo $postinfo[forumname];
             echo '&postid=';
             echo $postinfo[postid];
             echo '>';
             echo $postinfo[title];
             echo '</a>';
         }
         if ($postinfo[parentpost] > 0) {
             echo 'Latest Post: <a href=';
             echo $stcfg[RootDir];
             echo '/?action=message&forum=';
             echo $postinfo[forumname];
             echo '&postid=';
             echo $postinfo[parentpost];
             echo '>';
             echo $postinfo[title];
             echo '</a>';
         }
     }
     //////////////// count members \\\\\\\\\\\\\\\\\\\\
     function currentmembers()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $membercount = "SELECT * FROM memberships";
         $membercount1 = $db->query($membercount);
         $members = $db->numRows($membercount1);
         if (!isset($members)) {
             $members = '0';
         }
         echo 'Members: <B>';
         echo $members;
         echo '</B>';
     }
     //////////////// count members \\\\\\\\\\\\\\\\\\\\
     function currentproducts()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $membercount = "SELECT * FROM products";
         $membercount1 = $db->query($membercount);
         $members = $db->numRows($membercount1);
         if (!isset($members)) {
             $members = '0';
         }
         echo 'Products: <B>';
         echo $members;
         echo '</B>';
     }
     //////////////// Last member \\\\\\\\\\\\\\\\\\\\
     function latestproduct()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $latestmember = "SELECT * FROM products ORDER BY id DESC LIMIT 1";
         $latest = $db->query($latestmember);
         $memberinfo = $db->fetchArray($result);
         echo 'Latest Product: ';
         echo ' <a href=./?action=products&cat=' . $memberinfo['category'] . '&product=' . $memberinfo['id'] . '>';
         echo $memberinfo[product_name];
         echo '</a>';
     }
     //////////////// count members \\\\\\\\\\\\\\\\\\\\
     function currentcharacters()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $charactercount = "SELECT * FROM Bios";
         $charactercount1 = $db->query($charactercount);
         $characters = $db->numRows($charactercount1);
         if (!isset($characters)) {
             $characters = '0';
         }
         echo 'Total Characters: <B>';
         echo $characters;
         echo '</B>';
     }
     //////////////// Last member \\\\\\\\\\\\\\\\\\\\
     function latestmember()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $latestmember = "SELECT * FROM memberships ORDER BY userid DESC LIMIT 1";
         $latest = $db->query($latestmember);
         $memberinfo = $db->fetchArray($result);
         echo 'Latest Member: ';
         echo ' <a href=' . $stcfg[RootDir] . '/?action=userprofile&userid=' . $memberinfo['username'] . '>';
         echo $memberinfo[username];
         echo '</a>';
     }
     //////////////// Members online \\\\\\\\\\\\\\\\\\\\
     function getusernames()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $query = "SELECT * FROM activeusers WHERE name != 'GUEST' ORDER BY lastaction";
         $result = $db->query($query);
         $num_results = $db->numRows($result);
         for ($i = 0; $i < $num_results; $i++) {
             $row = $db->fetchArray($result);
             echo '<a href=' . $stcfg[RootDir] . '/?action=userprofile&userid=' . $row['name'] . '>';
             echo $row[name];
             echo '</a> ';
         }
     }
     //////////////// guests online \\\\\\\\\\\\\\\\\\\\
     function guestcount()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $guestcount = "SELECT * FROM activeusers WHERE name = 'GUEST' ORDER BY lastaction";
         $guestcount1 = $db->query($guestcount);
         $guests = $db->numRows($guestcount1);
         if (!isset($guests)) {
             $guests = '0';
         }
         echo 'Guests Online: <B>';
         echo $guests;
         echo '</B>';
     }
     function roomcount()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $roomcount = "SELECT * FROM roomcfg";
         $roomcount1 = $db->query($roomcount);
         $rooms = $db->numRows($roomcount1);
         if (!isset($rooms)) {
             $rooms = '0';
         }
         echo 'Chat Rooms:<B>';
         echo $rooms;
         echo '</B>';
     }
     function total_count()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $query = "SELECT * FROM room_online";
         $result = $db->query($query);
         $num_results = $db->numRows($result);
         if ($num_results == '0') {
             $users = '0';
         } else {
             $users = $num_results;
         }
         echo 'Users Chatting: <B>';
         echo $users;
         echo '</B>';
     }
     function lscount()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $lscount = "SELECT * FROM login_accounts";
         $lscount1 = $db->query($lscount);
         $ls = $db->numRows($lscount1);
         if (!isset($ls)) {
             $ls = '0';
         }
         echo 'LS Accounts:<B>';
         echo $ls;
         echo '</B>';
     }
     function tooncount()
     {
         include_once "db.inc.php";
         $db = new DB();
         $db->open();
         $tooncount = "SELECT * FROM character_";
         $tooncount1 = $db->query($tooncount);
         $toons = $db->numRows($tooncountt1);
         if (!isset($toons)) {
             $toons = '0';
         }
         echo 'Eqemu Characters:<B>';
         echo $toons;
         echo '</B>';
     }
     //////////////// output \\\\\\\\\\\\\\\\\\\\
     //         echo '<b>Member Stats:</b><br>';
     //         currentmembers();
     //         echo '<BR>';
     //         latestmember();
     echo '<b>Products:</b><br>';
     currentproducts();
     echo '<BR>';
     latestproduct();
     echo '<hr>';
     echo '<b>Forum Stats:</b><br>';
     currentposts();
     echo '<BR>';
     latestpost();
     //         echo '<hr><b>Chat Stats:</b><br>';
     //         total_count();
     //         echo '<BR>';
     //         roomcount();
     //         echo '<br>';
     //         currentcharacters();
     //         if($sitetype = 'EQEMU'){
     // 	    echo '<hr>';
     //         echo 'EQEmu Server Stats';
     //         echo '<BR>';
     //         lscount();
     //         echo '<br>';
     //         tooncount();
     //}
     //         echo '<hr><b>Users Online:</b><br>';
     //         guestcount();
     //         echo '<BR> Members online:';
     //         getusernames();
     //         echo '<table width=100%><tr>';
     //         echo '<td valign=top align=center>';
     //         echo '<b>Member Stats:</b><br>';
     //         currentmembers();
     //         echo '<Br>';
     //         latestmember();
     //         echo '</td>';
     //         echo '<td valign=top align=center>';
     //         echo '<b>Forum Stats:</b><br>';
     //         currentposts();
     //         echo '<BR>';
     //         latestpost();
     //         echo '</td>';
     //         echo '<td valign=top align=center>';
     //         echo '<b>Chat Stats:</b><br>';
     //         total_count();
     // //         echo '<BR>';
     // //         roomcount();
     //         echo '<BR>';
     //         currentcharacters();
     //         echo '</td>';
     //         echo '</tr>';
     //     	echo '</table>';
 }
Exemple #2
0
	google_ad_client = "pub-7526690253327491";
	/* 200x200, created 11/26/08 */
	google_ad_slot = "0501741132";
	google_ad_width = 200;
	google_ad_height = 200;
	//-->
	</script>
	<script type="text/javascript"
	src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script>
<h5>Latest Posts</h5>
<div class="box">
				<div class="content">
					<ul>
					<?php 
latestpost();
?>
					</ul>
				</div>
			</div>
<h5>Latest Members</h5>
		<div class="box">
				<div class="content">
					<ul>
					<?php 
latestuser();
?>
					</ul>
				</div>
			</div>
	<h5>Useful Links</h5>