<?php
include("includes/site_info.php");
include_once __INCLUDE_CLASS_PATH."/class.Picture.php";
$picture = new Picture();

$VUserID = $_REQUEST['VUserID'];

$activity_query=mysql_query("SELECT * FROM (SELECT activityText, activityID, YEAR(datetime) as year, DATE_FORMAT(datetime, '%M %d, %Y at %h:%i%p') as wYear, DATE_FORMAT(datetime, '%M %d at %h:%i%p') as wtYear, DATE_FORMAT(datetime, '%Y%m%d') as date, mem_username, mem_profileid FROM activities_user LEFT JOIN members ON (userID=mem_userid) WHERE userID='$VUserID' order by datetime desc) data group by activityID,date order by date desc",$link) or die(mysql_error());
$activityTotal = mysql_num_rows($activity_query);

$comment=mysql_query("SELECT  COUNT(com_memid) FROM profile_comment WHERE com_memid ='$VUserID' AND com_approved = '2' ORDER BY com_time DESC",$link) or die(mysql_error());

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="white_back_t_xb">
            <tr>
              <td><div class="light_orang_h">
                  <div style="background-color:#FF0000; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10" /></div>
                Activity On The Roll </div>
                  <div class="dot_line"><img src="images/spacer.gif" width="1" height="1" /></div>
                <div class="solid_line"><img src="images/spacer.gif" width="1" height="1" /></div></td>
            </tr>
            <tr>
              <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="white_back_t_xb">
                  <tr>
                    <td><div id="activityFeed">
										<?php 
	if($activityTotal > 0) {
		$j=0;
	 while (($activity = mysql_fetch_object($activity_query)) && ($j<12)) {
	 if ($activity->mem_profileid != null) { $profile_name= $activity->mem_profileid; }
	 else { $profile_name= $activity->mem_username; }
	 if ($activity->year==date('Y')) {
	 	$date = $activity->wtYear;
	 } else {
	 	$date = $activity->wYear;
	 }
?>
										<div class="p5">
											<?=ucwords($activity->mem_username)?> <?=$activity->activityText?>
											<span class="grey_10">
											<?php /*?><?=$date?><?php */?>
											</span> </div>
										<?php $j++;
										} }else {
										?>
										<div class="p5">
											No Action yet for current!!</div>
										<?php
										}?>
									</div></td>
                  </tr>
              </table></td>
            </tr>
            

            <tr>
              <td>&nbsp;</td>
            </tr>
</table>
