PDA

View Full Version : Gender Stats on Forumhome Addon


Renee
11-02-2005, 10:00 PM
This Hack based on the Gender Image In Postbit (https://vborg.vbsupport.ru/showthread.php?t=97663) from tnguy3n (https://vborg.vbsupport.ru/member.php?u=35159) 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.
UPDATE `userfield` SET `fieldX` = 'Male' WHERE `fieldX` = ''

On User Profile Field Manager the ProfileField "gender" must be "Set Default:" to Yes.

Boofo
11-03-2005, 07:08 AM
Nice idea. ;)

SnowBot
11-03-2005, 07:53 AM
Looks nice, will have a look later :)

DJ XtAzY
11-03-2005, 08:56 AM
looks great XD

lairnoc
11-03-2005, 09:01 AM
what do you mean with your fieldID in the install instructions?

Renee
11-03-2005, 09:08 AM
If you going into your admincp ==> User Profile Field Manager

Replace all fieldX with the field where on my picture is field6

lairnoc
11-03-2005, 09:13 AM
ah ok i think i get it first you install the original hack :)

Renee
11-03-2005, 09:18 AM
No, that I link in first of the post the Original :)

You need to have a Gender Profile field from Gender Image In Postbit.

Snake
11-03-2005, 11:58 AM
Good idea! :)

GrendelKhan{TSU
11-03-2005, 12:04 PM
fun!!

* GrendelKhan{TSU clicks install. :)

folkish
11-04-2005, 02:00 AM
Hey, Renee! Installed and working fine. Thanks. :)

rb290
11-04-2005, 02:39 AM
can you make the text file with each instruction on 1 line cause im having trouble with it i gotta keep scrolling to the right

Otikeu
11-04-2005, 04:41 AM
Very nice. My members are always making a gender poll threadf, but now they can see the results better and easier lol.

Lea Verou
11-04-2005, 05:29 AM
Thanks, I really needed something like this!
You saved me time :D

Renee
11-04-2005, 07:02 AM
can you make the text file with each instruction on 1 line cause im having trouble with it i gotta keep scrolling to the right
What did you mean with the first line?
Did you have these hack? (https://vborg.vbsupport.ru/showthread.php?t=97663)

Boofo
11-04-2005, 07:13 AM
can you make the text file with each instruction on 1 line cause im having trouble with it i gotta keep scrolling to the right

What program are you using to read the file?

lsgworldl
11-04-2005, 08:00 AM
I tried to do this I uploaded it edited the template, and it didnt work, I then removed the plugin and my forum worked agin I dont know what I ddi wrong?

it is showing the icons with sex male femlae etc, but no info, www.tipstersforum.com

I am installing mods before the forum goes live

lsgworldl
11-04-2005, 08:08 AM
where to add this?

Step 3)

Go in your admincp.
Add 1 new phrase:

Name: ==> Description:
gender_on_board ==> Gender on board:

Boofo
11-04-2005, 08:09 AM
where to add this?

Step 3)

Go in your admincp.
Add 1 new phrase:

Name: ==> Description:
gender_on_board ==> Gender on board:

In the phrase manager. ;)

lsgworldl
11-04-2005, 08:16 AM
In the phrase manager. ;)
where is that?

Boofo
11-04-2005, 08:17 AM
where is that?

Under Languages & Phrases on the left. ;)

lsgworldl
11-04-2005, 08:23 AM
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

Renee
11-04-2005, 09:48 AM
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
https://vborg.vbsupport.ru/external/2005/11/1.php?attachmentid=36944
You find the fieldID in your admincp ==> profilefields

lsgworldl
11-04-2005, 09:50 AM
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
https://vborg.vbsupport.ru/attachment.php?attachmentid=36944
You find the fieldID in your admincp ==> profilefields

and what is the feild ID?

Renee
11-04-2005, 09:58 AM
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

lsgworldl
11-04-2005, 10:03 AM
<?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>

Lea Verou
11-04-2005, 02:18 PM
This plugin has a query for getting boys, another for getting girls, another for getting undisclosed and another for getting the total (!!) :confused:
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...

Flow Fusion
11-06-2005, 08:55 PM
Thanks great hack.

Loki12
11-12-2005, 04:49 PM
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.

redspider
11-13-2005, 01:51 PM
is there any way to show this on my vBadvanced portal page like a module?

Bounce
11-13-2005, 06:26 PM
Pretty good, is there a hack that makes them fill in there gender in there usercp ??

StarBuG
11-13-2005, 07:58 PM
Pretty good, is there a hack that makes them fill in there gender in there usercp ??

Hi

Thank you for this hack.

2 Things though

In your install instructions (both) you forgot class="smallfont" for the femail div tag.

And a question.

Would it be possible to make this hack fully phrased?
I use a multilanguage forum and I would like to have the gender option in the profile also phrased so I can offer a german description for my german users.

Would be nice

* StarBuG clicks install

cooltechie
11-13-2005, 08:59 PM
*clicks install*

I have an existing test user, but it doesn't include the stat. Does each user have to select it before it appears? Also, how can I put it all in one row instead of three rows? Thanks!!

Bounce
11-14-2005, 03:54 PM
Does each user have to select it before it appears? yes they do, althou they are now required at registration

Loki12
11-14-2005, 05:46 PM
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.

Bump

Renee
11-14-2005, 06:45 PM
In your install instructions (both) you forgot class="smallfont" for the femail div tag.

Changed :)


Would it be possible to make this hack fully phrased?
I use a multilanguage forum and I would like to have the gender option in the profile also phrased so I can offer a german description for my german users.

If you mean the "Female" "Male" Description, that can unfortunately just be in one language, have a multilingual board too :ermm:

Renee
11-14-2005, 06:49 PM
I have an existing test user, but it doesn't include the stat. Does each user have to select it before it appears?
The Gender profilefield must be set to default!
Goto AdminCP => User Profile Field Manager => Gender => Set Default: Yes

Also, how can I put it all in one row instead of three rows? Thanks!!
Set the code on FORUMHOME Template to this:


<div class="smallfont">$vbphrase[gender_on_board]&nbsp;
<img src="images/gender/Female.gif"> $allgirls_prozent % ($allgirls)&nbsp;
<img src="images/gender/Male.gif"> $allboys_prozent % ($allboys)&nbsp;
<img src="images/gender/Undisclosed.gif"> $allzwitter_prozent % ($allzwitter)</div>

Lea Verou
11-14-2005, 07:30 PM
If you mean the "Female" "Male" Description, that can unfortunately just be in one language, have a multilingual board too :ermm:


Nope, that's not correct. Just add 3 phrases: gender_male, gender_female, gender_undisclosed. Then in the template put instead of the words $vphrase[gender_male], $vbphrase[gender_male], $vbphrase[gender_undisclosed] ;)

edit: Oh you mean in the profile fields? In that case you're right :(

Lea Verou
11-14-2005, 07:32 PM
Nope, that's not correct. Just add 3 phrases: gender_male, gender_female, gender_undisclosed. Then in the template put instead of the words $vphrase[gender_male], $vbphrase[gender_male], $vbphrase[gender_undisclosed] ;)

edit: Oh you mean in the profile fields? In that case you're right :(

BTW Renee I just saw your site!!!!!
I love it!!!!! w00t!!!
Those kitties are soooo cute!

Renee
11-14-2005, 07:48 PM
edit: Oh you mean in the profile fields? In that case you're right :(
Yes, this I mean.
But I seen now it gives a hack for that you can use phrases in profilefields:
https://vborg.vbsupport.ru/showthread.php?t=98904

BTW Renee I just saw your site!!!!!
I love it!!!!! w00t!!!
Those kitties are soooo cute!
Thank you :) That's my babies :D

edit: You have a nice signature :D

cooltechie
11-14-2005, 08:49 PM
The Gender profilefield must be set to default!
Goto AdminCP => User Profile Field Manager => Gender => Set Default: Yes

I set it to: Yes, but No First Blank Option
Female, Male, Undisclosed are all list on the main page, but test user not included for Undisclosed. If I choose male/female, it works, but not when I change it back to Undisclosed.


Set the code on FORUMHOME Template to this:


<div class="smallfont">$vbphrase[gender_on_board]&nbsp;
<img src="images/gender/Female.gif"> $allgirls_prozent % ($allgirls)&nbsp;
<img src="images/gender/Male.gif"> $allboys_prozent % ($allboys)&nbsp;
<img src="images/gender/Undisclosed.gif"> $allzwitter_prozent % ($allzwitter)</div>


That did it!! Thanks for your help.

funinthesun
11-17-2005, 10:05 PM
Stats are showing up but it still says 0 for the undisclosed option? Any ideas?

Renee
11-18-2005, 07:19 AM
Stats are showing up but it still says 0 for the undisclosed option? Any ideas?
How did you called the undisclosed option?
undisclosed or Undisclosed?

The Chief
11-21-2005, 04:27 PM
nice hack!

WNxWakko
12-18-2005, 05:44 AM
After install, it seems to show those who selected female and then it shows the count of my remaining members as males. Basically it is assuming of not selected if must be male????

interceptor
12-19-2005, 09:33 PM
Great,I like it!!

bada_bing
03-23-2006, 06:53 PM
Will this work on vb 3.5.4 ?

Harry72
03-25-2006, 06:43 AM
<-- Klicked install. Thx a lot for this cool hack. :banana:

@ bada bing: It works without any error on 3.5.3. It should also work with 3.5.4.

Hornstar
03-25-2006, 07:03 AM
cool, thats something interesting.

does this add many queries? if so how many, Thanks

Invalid ID
05-03-2006, 04:51 PM
I created a Multiple-Selection Checkbox for male, female and Undisclosed.

Acted upon the steps given in the gender_stats_english, but still there's no result.

May I know why?

Thanks

Invalid ID
05-03-2006, 05:07 PM
It gave me the following error, My forum disappeared, so I immediately deleted the plugin to restore my forum:

Database error in vBulletin 3.5.4:

Invalid SQL:

SELECT COUNT( * ) as field7
FROM userfield WHERE field7 = 'Female';

MySQL Error : Unknown column 'field7' in 'where clause'
Error Number : 1054

SLY LS1
06-01-2007, 10:54 AM
It gave me the following error, My forum disappeared, so I immediately deleted the plugin to restore my forum:


Database error in vBulletin 3.5.4:

Invalid SQL:

SELECT COUNT( * ) as field7
FROM userfield WHERE field7 = 'Female';

MySQL Error : Unknown column 'field7' in 'where clause'
Error Number : 1054


thats because you didnt create a new field and change the field7 to the new field number like field52 ect etc

geevest.com
06-17-2007, 12:18 PM
how to insert gender in registration?

ckgb
02-15-2014, 05:38 AM
Would be nice to have it ported to 4.2.2