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)

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?


All times are GMT. The time now is 08:32 AM.

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.01959 seconds
  • Memory Usage 1,740KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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