Topic: Display Male/Female members in your VLD CP
Hi guys, this is a small mod i did myself to show the total male/female members that are on your site.
(No idea if this has be done before but i'll share it anyways)
1) Open up the cp.stats.php file located in the "includes/cp/" folder.
Copy and paste this code below on line 126 right below "$member_groups = array();".
//------------------------------------------------
// Get total Males/Females on the server
//------------------------------------------------
$total_musers = $total_fusers = 0;
$result = $DB->query("SELECT data_gender1, count(data_id) as totalmalemembers FROM " . DB_PREFIX . "members_data_members WHERE data_gender1='1'");
$obj = $DB->fetch_object($result);
$total_musers = $obj->totalmalemembers;
$result = $DB->query("SELECT data_gender1, count(data_id) as totalfemalemembers FROM " . DB_PREFIX . "members_data_members WHERE data_gender1='2'");
$obj = $DB->fetch_object($result);
$total_fusers = $obj->totalfemalemembers;
2) Now, scroll down to line 288 where it says "Assign template vars", and paste this codes below "$TEMPLATE->assign("total_iusers", $total_iusers);".
$TEMPLATE->assign("total_musers", $total_musers);
$TEMPLATE->assign("total_fusers", $total_fusers);
3) Now save and close this cp.stats.php file.
4) Open the stats.tpl file located in "includes/templates/".
5) Paste this codes on line 30, below the </tr> tag.
<tr>
<td class="gridHeader">Member Information</td>
<td class="gridHeader" style="width:70px;text-align: center">Male</td>
<td class="gridHeader" style="width:70px;text-align: center">Female</td>
</tr>
<tr>
<td class="gridLabels2">Total</td>
<td class="gridValue2" style="text-align: center">{total_musers}</td>
<td class="gridValue2" style="text-align: center">{total_fusers}</td>
</tr>
6) Save and close this stats.tpl file and now you can view how many male and female users u have from your vld control panel under the "Stats" tab.
Cheers:)
Last edited by Gukkie (2011-06-05 05:29:40)