Topic: Total number of Males and Femlas in account Cp stats
i did this myself the other day
and it works for me
so first u will have to edit these files so make sure u make a backup of them
i added my code in the files to look estethical
includes/cp/cp.stats.php
includes/languages/english/lang.cp.stats.php
includes/templates/stats.tpl
First one we edit is: cp.stats.php
search for:
// Get total members on the serverafter the last "}" in that block of code add this code:
//------------------------------------------------
// Get members on the server females/males
//------------------------------------------------
// Males
$result = $DB->query("SELECT count(*) as totalmembersm FROM " . DB_PREFIX . "members_data WHERE data_gender1='1'");
$obj = $DB->fetch_object($result);
$total_male_users = $obj->totalmembersm ? $obj->totalmembersm : 0;
// Females
$result = $DB->query("SELECT count(*) as totalmembersf FROM " . DB_PREFIX . "members_data WHERE data_gender1='2'");
$obj = $DB->fetch_object($result);
$total_female_users = $obj->totalmembersf ? $obj->totalmembersf : 0;search for:
Assign template varsadd these at the end:
$TEMPLATE->assign("total_male_users", $total_male_users);
$TEMPLATE->assign("total_female_users", $total_female_users);save the file
Next one is: lang.cp.stats.php
open the file and add these rows before the closing of the array:
"males_females1"=>
"Total males/females",
"males_females2"=>
"Site males/females",
"total_male_users"=>
"Total male users",
"total_female_users"=>
"Total female users",
"males"=>
"Males",
"females"=>
"Females",save the file and close it
No the stats.tpl file
Open it and search for:
<td class="gridHeader">{lang:"stats","total_server_messages"}</td>should be the last row in that table code
add under it:
<tr>
<td class="gridHeader">{lang:"stats","males_females1"}</td>
<td class="gridHeader" style="text-align: center">{lang:"stats","males"}</td>
<td class="gridHeader" style="text-align: center">{lang:"stats","females"}</td>
</tr>
<tr>
<td class="gridLabels1">{lang:"stats","males_females2"}</td>
<td class="gridValue1" style="text-align: center">{total_male_users}</td>
<td class="gridValue1" style="text-align: center">{total_female_users}</td>
</tr>save the file and close it
upload the edited files and check your admin cp -> stats
and look in the right side at the bottom of the stats right under: Total messages
Cheers
Last edited by jwysocki73 (2009-07-22 08:14:30)