YAY that worked...kinda.
For some reason not all of the fields display properly.
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 = $vbulletin->db->query("
SELECT COUNT(p.postid) AS total, p.userid, u.username, u.joindate, f.field7
FROM " . TABLE_PREFIX . "post AS p
LEFT JOIN " . TABLE_PREFIX . "user AS u USING (userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS f USING (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);
//Let's define those variables
if ($auinfo['field7'] == "I don\'t have a package")
{
$conditional = 0;
} else if ($auinfo['field7'] == "SHARED A")
{
$conditional = 5;
} else if ($auinfo['field7'] == "SHARED B")
{
$conditional = 15;
} else if ($auinfo['field7'] == "SHARED C")
{
$conditional = 20;
} else if ($auinfo['field7'] == "SHARED D")
{
$conditional = 20;
} else if ($auinfo['field7'] == "RESELLER A")
{
$conditional = 25;
}
else if ($auinfo['field7'] == "RESELLER B")
{
$conditional == 75;
} else if ($auinfo['field7'] == "RESELLER C")
{
$conditional == 200;
}
else if ($auinfo['field7'] == "RESELLER D")
{
$conditional = 200;
} else if ($auinfo['field7'] == "Custom/Other")
{
$conditional = 00;
}
eval('$userbits .= "' . fetch_template('ACTIVITY_bits') . '";');
}
$navbits = construct_navbits(array('' => 'Activity Statistics'));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$aufield7 = "' . fetch_template('postbit') . '";');
eval('print_output("' . fetch_template('ACTIVITY') . '");');
}
?>
Screenshot of errors:-
http://i41.tinypic.com/5kg1tx.jpg