Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Gender Stats on Forumhome Addon Details »»
Gender Stats on Forumhome Addon
Version: 1.2, by Renee Renee is offline
Developer Last Online: Jul 2007 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 11-02-2005 Last Update: 11-13-2005 Installs: 60
Uses Plugins Template Edits
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 11-04-2005, 08:17 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lsgworldl
where is that?
Under Languages & Phrases on the left.
Reply With Quote
  #23  
Old 11-04-2005, 08:23 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #24  
Old 11-04-2005, 09:48 AM
Renee's Avatar
Renee Renee is offline
 
Join Date: May 2004
Location: Hungary
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #25  
Old 11-04-2005, 09:50 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

You find the fieldID in your admincp ==> profilefields
and what is the feild ID?
Reply With Quote
  #26  
Old 11-04-2005, 09:58 AM
Renee's Avatar
Renee Renee is offline
 
Join Date: May 2004
Location: Hungary
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #27  
Old 11-04-2005, 10:03 AM
lsgworldl lsgworldl is offline
 
Join Date: Sep 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<?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>
Reply With Quote
  #28  
Old 11-04-2005, 02:18 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #29  
Old 11-06-2005, 08:55 PM
Flow Fusion Flow Fusion is offline
 
Join Date: Jul 2003
Location: Georgia
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks great hack.
Reply With Quote
  #30  
Old 11-12-2005, 04:49 PM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #31  
Old 11-13-2005, 01:51 PM
redspider's Avatar
redspider redspider is offline
 
Join Date: Jul 2005
Posts: 225
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there any way to show this on my vBadvanced portal page like a module?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05170 seconds
  • Memory Usage 2,303KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete