vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Gender Stats on Forumhome Addon (https://vborg.vbsupport.ru/showthread.php?t=99974)

Renee 11-02-2005 10:00 PM

Gender Stats on Forumhome Addon
 
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` = ''
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 :)

Quote:

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!!

[high]* GrendelKhan{TSU clicks install. :)[/high]

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

Quote:

Originally Posted by rb290
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?

Boofo 11-04-2005 07:13 AM

Quote:

Originally Posted by rb290
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

Quote:

Originally Posted by lsgworldl
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

Quote:

Originally Posted by Boofo
In the phrase manager. ;)

where is that?

Boofo 11-04-2005 08:17 AM

Quote:

Originally Posted by lsgworldl
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/...chmentid=36944
You find the fieldID in your admincp ==> profilefields

lsgworldl 11-04-2005 09:50 AM

Quote:

Originally Posted by Renee
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/attachmen...chmentid=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

Quote:

Originally Posted by hIBEES
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

[high]* StarBuG clicks install[/high]

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

Quote:

Originally Posted by cooltechie
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

Quote:

Originally Posted by Loki12
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

Quote:

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

Changed :)

Quote:

Originally Posted by StarBuG
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

Quote:

Originally Posted by cooltechie
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

Quote:

Originally Posted by cooltechie
Also, how can I put it all in one row instead of three rows? Thanks!!

Set the code on FORUMHOME Template to this:

Code:

<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

Quote:

Originally Posted by Renee
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

Quote:

Originally Posted by Michelle
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

Quote:

Originally Posted by Michelle
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

Quote:

Originally Posted by Michelle
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


All times are GMT. The time now is 04:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01364 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete