1

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)

2

Re: Display Male/Female members in your VLD CP

Hi, i just tried adding this mod and i got the following error message:
Template Compile Error: Could not write compiled file.

so i removed the changes (well actually replaced the files with the originals and i'm still getting the error?? any ideas?
i've tried accessing in both firefox and IE incase the page was cached but still no joy sad

thanks

3

Re: Display Male/Female members in your VLD CP

try clearing your cache from the includes folder. If you have replaced them it should be working fine, what version of vld do u use?

4

Re: Display Male/Female members in your VLD CP

i have tried clearing the includes/cache files but still no joy sad
i'm using version 2.6

5

Re: Display Male/Female members in your VLD CP

sorted smile

thanks

6

Re: Display Male/Female members in your VLD CP

@ Gukkie

have tried your mod, but seems it does not work for me. I got the 2.7.0 and so far i followed your set of instructions. But when i check stats in backend, the results are shown like this: {total_musers} I {total_fusers}.

Do you got any idea what is wrong? hmm