cono1717 |
06-21-2009 05:33 PM |
1) yes 7 is the correct number.
2) My template is the following.
ACTIVITY
HTML Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - Activity Statistics</title>
</head>
<body$onload>
$header
$navbar
<div align="center">
<form action="activity.php" method="get">
<strong>Choose another timeframe:</strong><br />
<select name="m">$mbits</select> <select name="y">$ybits</select> <input type="submit" name="submit" value="Go" />
</form>
</div>
<br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="6">
Activity Statistics for $monthliteral
</td>
</tr>
<tbody>
<tr>
<td class="thead">Rank</td>
<td class="thead">Username</td>
<td class="thead">Current Package</td>
<td class="thead">Posts This Month</td>
<td class="thead">Posts Required</td>
<td class="thead">Action Needed?</td>
</tr>
$userbits
</tbody>
</table>
$footer
</body>
</html>
ACTIVITY_bits
HTML Code:
<tr>
<td class="alt1">$c</td>
<td class="alt2"><a href="member.php?$session[sessionurl]u=$auinfo[userid]">$auinfo[username]</a>
<td class="alt1">$auinfo[field5]</td>
<td class="alt2">$auinfo[total]</td>
<td class="alt2">30</td>
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
<if condition="$auinfo[total] == 30">
<td class="alt1">No Action Required</td>
<else />
<td class="alt1"><font color="#FF0000"><b>Action Required</b></font></td>
</if></if>
</tr>
3)I am not sure what you mean here so I here is the PHP file.
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'activity');
// ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array();
// get special data templates from the datastore $specialtemplates = array();
// pre-cache templates used by all actions $globaltemplates = array('ACTIVITY','ACTIVITY_bits', 'ACTIVITY_mbits', 'ACTIVITY_ybits', 'MEMBERINFO', 'memberinfo_profilefield');
// pre-cache templates used by specific actions $actiontemplates = array();
// ######################### REQUIRE BACK-END ############################ require_once('./global.php');
// ####################################################################### // ######################## START MAIN SCRIPT ############################ // #######################################################################
if(empty($_REQUEST['do'])) {
// sanitize the variables myself if(empty($_REQUEST['m'])) { $month = vbdate('n'); $monthliteral = vbdate('F'); } else { $month = intval($_REQUEST['m']); $monthliteral = $months["$_REQUEST[m]"]; } if(empty($_REQUEST['y'])) { $year = vbdate('Y'); } else { $year = intval($_REQUEST['y']); }
// generate months dropdown $months = array( 1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December' ); foreach($months AS $mkey => $mval) { if($mkey == $month) { $checked = ' selected="selected"'; } eval('$mbits .= "' . fetch_template('ACTIVITY_mbits') . '";'); unset($checked); } // generate years dropdown for($i = intval(vbdate('Y')); $i < intval(vbdate('Y')) + 4; $i++) { if($i == $year) { $checked2 = ' selected="selected"'; } eval('$ybits .= "' . fetch_template('ACTIVITY_ybits') . '";'); unset($checked2); } // important cutoff data $cutoffstart = gmmktime(0, 0, 0, $month, 1, $year); $cutoffend = gmmktime(0, 0, 0, $month, vbdate('t', $cutoffstart), $year); //echo $cutoffstart . '=' . TIMENOW; if($cutoffstart > TIMENOW) { eval(standard_error('This date is in the future. You cannot select it. Go back and select antoher.')); } // limit our records $limit = 30000;
// run query $getusers = $db->query(" SELECT COUNT(p.postid) AS total ,p.userid ,u.username ,u.joindate FROM " . TABLE_PREFIX . "post AS p LEFT JOIN " . TABLE_PREFIX . "user as u ON u.userid = p.userid WHERE p.dateline > $cutoffstart AND p.dateline < $cutoffend GROUP BY userid ORDER BY total DESC LIMIT $limit "); $c = 0; while($auinfo = $db->fetch_array($getusers)) { $c++; $auinfo['joindate'] = vbdate($vbulletin->options['dateformat'], $auinfo['joindate'], true); eval('$userbits .= "' . fetch_template('ACTIVITY_bits') . '";'); } $navbits = construct_navbits(array('' => 'Activity Statistics')); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('ACTIVITY') . '");'); }
?>
4) Don't get what you mean so probably not, someone else built this system I am just revamping it, only I can't find the guy that built it (non vBulletin member btw)
Thanks in advance,
C
|