Location: PHPKode > projects > ZompLog > admin/members.php
<?php
ob_start();
/* Written by Gerben Schmidt, http://scripts.zomp.nl */

$_GET['message'] = str_replace('script', '', $_GET['message']);

include_once("functions.php");
include('config.php');
include("session.php");
include("header.php");

if(!$_SESSION["loggedIn"]){ echo "You are not allowed to view this page, please log in first."; exit; }

$user = loadUser($_SESSION['login'],$link,$table_users);

if($_GET[message]){ 
displayMessage($_GET[message]);
  }
  ?>
  
<div id="submenu"><a href="members.php" class="sub"><?php echo "$lang_members_area"; ?></a></div>
<div id="title">
 
</div>

<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><strong><?php echo "$lang_zomp_version $version"; ?></strong><br /><br />
<?php echo "$settings[admin_welcome]"; ?></div>
<?php if ($user[admin]){ 
$query = "SELECT * FROM $table_comments ORDER BY id DESC LIMIT 10";
$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
$entries = arrayMaker($result);
if($entries){
?>
<br />
<div class="title"><?php echo "$lang_latest_comments"; ?></div>
<div class="box">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  
<?php

foreach($entries as $entry){
$comment = substr($entry[comment], 0, 25);
	echo "<tr valign='top'><td width='22px'><a href='../index.php?content=detail&amp;id=$entry[entry_id]' target='_blank'><img src='icons/comment.png' alt='$lang_view_site' title='$lang_view_site' width='16' height='16' border='0' align='absmiddle' /></a></td>";
    echo "<td>$comment(...)</td></tr>";
}
?>
</table>
</div>  

<?php
}

}
?>
<br />
  <div class="title"><?php echo "$zomplog_elsewhere"; ?></div>
<div class="box"><img src="icons/lightbulb.png" alt="idea" width="16" height="16" /> <?php echo "$lang_check_tips_tricks"; ?> <a href="http://zomp.nl/development/zomplog/wiki/TipsAndTricks" target="_blank">Zomplog Tips and Tricks</a><br />
 </div>
 <br />
<div class="box">
<img src="icons/lightning.png" alt="question" width="16" height="16" /> <?php echo "$lang_check_forum"; ?> <a href="http://zomp.nl/forum" target="_blank">Zomplog Forum</a>
</div>

</div>


<div id="main">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="text">
      <tr>
        <td valign="top" class="text"> 
        
</td>
      </tr>
      
      <tr>
        <td valign="top" class="text">
		 <fieldset id="titlediv">
      <legend><?php echo "$lang_site_statistics"; ?></legend>	  
		<table width="511"  border="0" cellspacing="0" cellpadding="0" class="text">
          <tr>
            <td colspan="3" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td width="12%" rowspan="2" valign="top"><img src="icons/stats.jpg" width="33" height="40"></td>
            <td width="44%" valign="top"><span class="title"><?php echo "$lang_site_statistics"; ?></span>			</td>
            <td width="44%" valign="top"><span class="title"><?php echo "$lang_your_statistics"; ?></span></td>
          </tr>
          <tr>
            <td valign="top"><?php 	
	
	$query = "SELECT * FROM $table ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numposts = mysql_num_rows($result);
	
	$query = "SELECT * FROM $table_pages ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numpages = mysql_num_rows($result);
	
	$query = "SELECT * FROM $table_cat ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numcat = mysql_num_rows($result);
	
	$query = "SELECT * FROM $table_users ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numusers = mysql_num_rows($result);
	
	$query = "SELECT * FROM $table_comments ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numcomments = mysql_num_rows($result);
	
	echo "$lang_total_number_posts: $numposts<br />";
	echo "$lang_total_number_pages: $numpages<br />";
	echo "$lang_total_number_users: $numusers<br />";
	if($settings[categories]){
	echo "$lang_total_number_categories: $numcat<br />";
	}
	if($settings[comments]){
	echo "$lang_total_number_comments: $numcomments<br />";
	}
	
	?></td>
            <td valign="top"><?php 	
	
	$query = "SELECT * FROM $table WHERE username = '$user[login]' ORDER BY id DESC";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$numposts = mysql_num_rows($result);
	
	$query = "SELECT * FROM $table WHERE username = '$user[login]' ORDER BY id DESC LIMIT 1";
	$result = mysql_query ($query, $link) or die("Died getting info from db.  Error returned if any: ".mysql_error());
	$lastpost = mysql_fetch_array($result);
	
	
	echo "$lang_total_number_posts: $numposts<br />";
	if($numposts){

// converting timestamp to current user-formatted date
$q = mysql_query("SELECT date, UNIX_TIMESTAMP(date) AS timestamp FROM $table WHERE id = '$lastpost[id]'");
$row = mysql_fetch_array($q);

// then use PHP's date() function :
$postdate = date("$userdate", $row['timestamp']);

	echo "$lang_lastpost: <br /> <a href='editor.php?id=$lastpost[id]'>$lastpost[title]</a> $lang_on $postdate<br />";
	}
	?></td>
          </tr>

          <tr>
            <td valign="top">&nbsp;</td>
            <td colspan="2" valign="top"><?php $hook = 'dashboard';
			include("loadplugins.php"); ?></td>
          </tr>
		
        </table></fieldset></td>
      </tr>
      <tr>
        <td valign="top" class="text"><br /><fieldset id="titlediv">
      <legend><?php echo "$lang_zompnews"; ?></legend>	  
		<table width="502"  border="0" cellspacing="0" cellpadding="0" class="text">
          <tr>
            <td colspan="2" valign="top">&nbsp;</td>
          </tr>
			
			
          <tr>
            <td width="10%" rowspan="2" valign="top"><img src="icons/feed.jpg" width="33" height="40"></td>
            <td width="87%" valign="top">
			
<?php 

function ShowOneRSS($url,$lang_message017,$lang_message018) { 
    global $rss, $lang_message017, $lang_message018; 

    if ($rs = $rss->get($url)) { 
        echo "<div class=\"title\"><a href=\"http://www.zomp.nl/zomplog\">Zomplog News</a></div>\n"; 
        

            foreach ($rs['items'] as $item) { 
                echo "\t<a href=\"$item[link]\">$item[title]</a><br />\n"; 
            } 
            if ($rs['items_count'] <= 0) { echo "$lang_message017"; } 
    } 
    else { 
        echo "<div class=\"title\"><a href=\"http://www.zomp.nl/zomplog/news\" target=\"_blank\"><img src=\"icons/link.png\" border=\"0\" align=\"absbottom\" /> Zomplog News</a></div>\n"; 
    } 
} 

// =============================================================================== 

// include lastRSS 
include "includes/lastRSS.php"; 

// List of RSS URLs 
$rss_left = array( 
    'http://www.zomp.nl/api/rss/index/zomplog/news'
); 
$rss_right = array( 
    'http://www.freshfolder.com/rss.php'
); 

// Create lastRSS object 
$rss = new lastRSS; 

// Set cache dir and cache time limit (5 seconds) 
// (don't forget to chmod cahce dir to 777 to allow writing) 
$rss->cache_dir = ''; 
$rss->cache_time = 1200; 


// Show all rss files 
echo "<table cellpadding=\"10\" border=\"0\"><tr><td valign=\"top\">"; 
foreach ($rss_left as $url) { 
    ShowOneRSS($url); 
} 
echo "</td></tr></table>"; 
?> 			
          <tr>
            <td valign="top">&nbsp;</td>
            <td width="3%" valign="top">&nbsp;</td>
          </tr>
		
        </table>
        </fieldset>
	
		</td>
      </tr>
    </table>
</div>
<?php
ob_end_flush();
include('footer.php');

?>
Return current item: ZompLog