PDA

View Full Version : Show user ages in CP


the_sisko
12-28-2001, 10:00 PM
SHOW AGE HACK 1.0

This small addon for your CP shows a statistic of your users age.
You're also able to download a CSV version of the statistic.

Install instruction are in the ZIP file. Thanks to Streicher for testing.

Update: Small AddOn for user output here (https://vborg.vbsupport.ru/showthread.php?postid=209952#post209952)

the_sisko
12-29-2001, 05:28 PM
Screenshot:

Streicher
12-29-2001, 05:31 PM
Very nice hack. I don't need the help of excel anymore. Thanks, you saved me a lot of time. :up:

DelusionalMind
12-29-2001, 05:32 PM
nice :)

good job man :p

Twig Deez
12-29-2001, 07:06 PM
simple but useful.

thanks!

djr
12-29-2001, 07:30 PM
Just what I was looking for! Very nicely done, cool output and .csv output as the cream on top!

Thanks!

Lesane
12-29-2001, 08:03 PM
Great hack, i luv it ;). Thanks

Psychdrone
12-29-2001, 09:49 PM
yes two thumbs up!

Bedhead
12-29-2001, 10:19 PM
Very useful and informative hack.

Is there any way to modify this so that everyone can see the average ages such as this?

XiXora
12-29-2001, 10:59 PM
whats csv neway?

MarkB
12-30-2001, 11:28 AM
Nice :)

the_sisko
12-30-2001, 02:39 PM
Originally posted by Bedhead
Very useful and informative hack.

Is there any way to modify this so that everyone can see the average ages such as this?

I created a user output of the hack as well ;)
Here is the Add On, which can be installed as a stand alone hack, only for user output.

the_sisko
12-30-2001, 02:39 PM
And as well a screenshot for it ;)

Lesane
12-30-2001, 04:12 PM
Cool :cool: Thanks Again

Bedhead
12-30-2001, 06:01 PM
Thanks buddy!:)

the_sisko
01-04-2002, 08:15 AM
Originally posted by XiXora
whats csv neway?

CommaSeperatedVersion (Version not sure ;))

You get a file like:

15,45
16,4
21,117

And can open this file e.g. with MS Excel and work with the data. Very nice for persentation or statistics ;)

Freddie Bingham
01-04-2002, 05:52 PM
Values.

djr
01-04-2002, 11:49 PM
I wrote a small 'more information' add-on for 'User ages in CP' and posting it here with approval of the_sisko.

The idea is:
Registered member information
There are 382 members with complete birthday information, out of 2,664 registered members. 2,282 members have decided to not provide their birthday details.

before

// ###################### get birthdays #######################


add this:

// ###################### get total registered members #######################
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbersmembers=$numbersmembers['users'];


then before:

// start output on site || edit this text in echo ""; if you like to


add this:

// calculate $nobirthday
$nobirthday = $numbersmembers - $usercount;
$nobirthday = number_format($nobirthday);
$numbersmembers = number_format($numbersmembers);


then after:

doformheader("showage","show");


add this:

maketableheader("Registered member information","",0,3);
echo "<tr class='".getrowbg()."' valign='top'><td>There are $usercount members with complete birthday information, out of $numbersmembers registered members. $nobirthday members have decided to not provide their birthday details</td>\n</tr>\n";
restarttable();


then change:

maketableheader("How old are your users ($usercount with complete birthday)","",0,3);


in:

maketableheader("How old are your users","",0,3);



todo:
in the user version of 'user ages' put the same information, and provide users with no birthday information set with a link to their profile to do so.

Have fun and a big thank you goes out to the_sisko for making this wonderfull hack!

- djr

Action-N
01-06-2002, 06:38 AM
Hi the_sisko,

Great hack went in with very little effort (once I realized the showage.php went in admin directory). But I do have a negative comment to report, the darn thing said I was 30! Now I accept that I am getting older, but I'm not that old yet, not until this November. Apparently you are only using the year to do your calculations and should definitely figure in the months at least.

the_sisko
01-06-2002, 06:01 PM
@Action-N: You are right ;) I forgot to check the month. I'll will take a look at it in the next days. Got some truble with my database at the moment so don't have much time, but after it, I'll take a look at it.

djr
01-06-2002, 09:08 PM
This is the attachment with all the neccesary modifications as posted above. I also fixed the year calculation to include checking for current month and day. So I'm now 30 again instead of 31 as what was originally calculated :D (man, I get old :eek: )

the_sisko: hope the database trouble is minor, take care fiddling with it!

- djr

GrphicImprssion
01-14-2002, 03:54 PM
can anyone modify this to draw its imformation from a "custom field"? I made an additional field on my bb for "date of birth (admin)" that is a required field and is hidden from the public profile. The users are asked to input the information in a 10 character field in this format "mm-dd-yyyy" The "-" is not automatic, they must input it as well ( i could not find how to modify a custom fields input variables). So it would be really great to have this hack pull its info from that field!!! any ideas?

GrphicImprssion
01-15-2002, 02:05 AM
no ideas? :(

Lucky
01-15-2002, 04:33 AM
Originally posted by djr
This is the attachment with all the neccesary modifications as posted above. I also fixed the year calculation to include checking for current month and day. So I'm now 30 again instead of 31 as what was originally calculated :D (man, I get old :eek: )

the_sisko: hope the database trouble is minor, take care fiddling with it!

- djr

Thanks for that.


Just wondering now that you have changed the showage.php for the admin side of things if you would be able to post the showuserage.php for the user side of things.

TIA:)

Lucky
01-15-2002, 09:47 PM
Anybody?

Lucky
01-22-2002, 11:54 AM
UP

djr
01-22-2002, 09:12 PM
Today I fixed and finished the user side of 'Show user age' and also added a (hopefully) nice bonus.
You have to install one extra template though!


Install Useroutput AddOn Version 1.1:
"Will work without the hack for the CP"

original version by - the sisko -
with modifications by djr
--------------------------------------------------------------

[modified by djr]
* fixed age calculation
* extra template: userage_nobirthday
* extra twist: if a user has not provided a birthday, he/she is
taken to the different userage_nobirthday template with a
request to update his/her profile.
--------------------------------------------------------------


screenshots in next posts.

djr
01-22-2002, 09:13 PM
screenshot 1: user has set his/her birthday

djr
01-22-2002, 09:14 PM
screenshot 2: user has NOT set his/her birthday

Lucky
01-22-2002, 10:31 PM
I am still a year older than what I really am in the user age area.

More problems though...
I have the user age area in the memberlist section.
Where it says there are (555) members with complete birthdays, out of (missing) registed members.
(missing) members have decided not to give their birthday information.
What is up with the variables as those numbers are not popping up and are (missing)?

djr
01-22-2002, 10:40 PM
Lucky,

Entirerly my fault :cry: I zipped the old version of showuserage.php instead of the fixed one. Please download the attachment again and upload the (newer) showuserage.php.

My sincere apologies! Hope you like the fixes and improvements!

- djr

Lucky
01-22-2002, 11:23 PM
NP Buddy,

Right on, this works awesome.

Keep up the great work! :)

Heineken77
07-15-2002, 01:14 AM
Hi :)

I installed the showage hack, however don't understand what exactly the user output addon does.

Also, seeing as I installed the showage hack, do I have to change anything or reupload the showage.php file, or just add the extra 2 templates?

Finally, where do I place the following:

Place a link to:

showuserage.php?action=show&s=$session[sessionhash]

to link to the site.

Thanks!
Heineken :)

Boofo
07-15-2002, 05:35 AM
I think I might have found a small bug here. If the user only puts in the birth month and day (sans the year), it doesn't show the right template to update their profile. :)

Boofo
07-24-2002, 04:29 PM
Is this hack still being supported? :)

Ordovicium
09-10-2002, 08:49 PM
Thanks for this nice Hack :D

mini2
02-25-2003, 08:02 PM
Thanks, quick easy and painless hack, perfect.

:)

agiacosa
09-10-2006, 10:37 AM
Can anyone convert this to 3.5? PLEASE!