The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Gender Stats on Forumhome Addon Details »» | |||||||||||||||||||||||||
This Hack based on the Gender Image In Postbit from tnguy3n but it can change to your Gender Options.
Instructions todo are in the gender_stats_language.txt. Before install the plugin.xml read the gender_stats_language.txt! For members which have 2 gender-options (like: Female + Male) take the 2_options.zip Seen on the first picture. For members which have 3 gender-options (like: Female + Male + Undisclosed) take the 3_options.zip. Seen on the second picture. For members which havn't a gender hack from first boardinstalltime get this query: Replace fieldX with you fieldID fo gender. Code:
UPDATE `userfield` SET `fieldX` = 'Male' WHERE `fieldX` = '' Show Your Support
|
Comments |
#22
|
||||
|
||||
Quote:
|
#23
|
|||
|
|||
I dont understand what I have to edit????
Open plugin.xml and replace all field7 with your fieldID! There are 11 points with field7. If you have another Options in your Profile Field you have to change to your options: field7 = 'Female' ==> fieldX = 'Your Female Option' field7 = 'Male' ==> fieldX = 'Your Male Option' field7 = 'Undisclosed' ==> fieldX = 'Your Undisclosed Option' If you havn't an Undisclosed Option, leave it blank fieldX = '' After then uploud the plugin.xml |
#24
|
||||
|
||||
field7 = 'Female'
field7 = 'Male' field7 = 'Undisclosed' You must edit the red words if you have other called Options in the gender field Open plugin.xml and replace all field7 with your fieldID If you have another fieldID you must this edit in the plugin.xml You find the fieldID in your admincp ==> profilefields |
#25
|
|||
|
|||
Quote:
|
#26
|
||||
|
||||
Look at the picture on the third column Name field6 that is the fieldID.
Now go in your admincp ==> User Profile Fields ==> User Profile Field Manager Look to your genderfield and copy your fieldID and replace all in the plugin.xml |
#27
|
|||
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins> <plugin active="1" product="vBulletin"> <title>Gender Stats on Forumhome Statistics</title> <hookname>forumhome_complete</hookname> <phpcode><![CDATA[// Gender Stats on Forumhome Statistics $girls= $db->query_first(" SELECT COUNT( * ) as field6 FROM " . TABLE_PREFIX . "userfield WHERE field6 = 'Female' "); $allgirls = intval($girls[field6]); $boys= $db->query_first(" SELECT COUNT( * ) as field6 FROM " . TABLE_PREFIX . "userfield WHERE field6 = 'Male' "); $allboys = intval($boys[field6]); $zwitter= $db->query_first(" SELECT COUNT( * ) as field6 FROM " . TABLE_PREFIX . "userfield WHERE field6 = 'Undisclosed' "); $allzwitter = intval($zwitter[field6]); $gender= $db->query_first(" SELECT COUNT( * ) as field6 FROM " . TABLE_PREFIX . "userfield "); $allgender = intval($gender[field6]); $c_allgirls = ($allgender - $allboys - $allzwitter); $c_allboys = ($allgender - $allgirls - $allzwitter); $c_allzwitter = ($allgender - $allboys - $allgirls); $allgirls_prozent = @substr(100 * $allgirls / $allgender , 0, 5); $allboys_prozent = @substr(100 * $allboys / $allgender , 0, 5); $allzwitter_prozent = @substr(100 * $allzwitter / $allgender , 0, 5); $allgirls_picbar = $allgirls_prozent * 2; $allboys_picbar = $allboys_prozent * 2; $allzwitter_picbar = $allzwitter_prozent * 2;]]></phpcode> </plugin> </plugins> |
#28
|
|||
|
|||
This plugin has a query for getting boys, another for getting girls, another for getting undisclosed and another for getting the total (!!)
Why doing that? The total is the number of users which I think is already there for you to use it and the undisclosed is total users minus girls+boys! You don't need all these queries I think... |
#29
|
|||
|
|||
Thanks great hack.
|
#30
|
|||
|
|||
How can I get the female percentage on the forumhome to show only 2 decimals? Currently it is showing 3, whilst the other two show 2 decimals.
|
#31
|
||||
|
||||
is there any way to show this on my vBadvanced portal page like a module?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|