1

Topic: Hardcover Release: Birthdays 2

What makes {members:} extension almost perfect?
Absence of  parameter birthday=1 to be able display members celebrating birthday today!

Open your ext.members.php and find line:

    if ( isset($params['events']) && $params['events'] ) {
        $wheresql[] = "m.totalevents>0";
    }

Paste this code below:

if ( isset($params['birthday']) && $params['birthday'] ) {
$datenow = time();
$monthday = date("m"."d", $datenow);

$wheresql[] = "d.data_age LIKE '%$monthday'";
}

So simple and so useful modification!

Now just add parameter birthday=1 to your members extension call and you'll have todays birthdays!

Note: if you have changed 'age' label to something else - change it in the above query also.

Best practice: pass also new template as parameter value and make a best look and feel of your birthday members. With cakes and baloons!

Last edited by radioact (2008-12-13 02:56:41)

2

Re: Hardcover Release: Birthdays 2

thank you very much!

Last edited by NetID (2009-05-21 05:04:01)

3

Re: Hardcover Release: Birthdays 2

How would I go about getting it to display the birthdays for the month or a week ?

Would I remove the ."d" from this line
$monthday = date("m"."d", $datenow);

Last edited by Garry (2008-12-30 14:15:03)

4

Re: Hardcover Release: Birthdays 2

No, that line is only for visual formatting.
You have to create an array of dates and pass it to query.

... (date_age LIKE '%0101' OR date_age LIKE '%0102' OR date_age LIKE '%0103') ... etc

5

Re: Hardcover Release: Birthdays 2

Hi,

2 More questions and that should be it.

1. I am right in thinking I do this for every day and every month, or is it just the months ?

2. Do I put the new could in place of d.date_age LIKE '%monthday'  ?

Thanks for your help big_smile and have a happy new year.


radioact wrote

No, that line is only for visual formatting.
You have to create an array of dates and pass it to query.

... (date_age LIKE '%0101' OR date_age LIKE '%0102' OR date_age LIKE '%0103') ... etc

6

Re: Hardcover Release: Birthdays 2

radioact wrote

Now just add parameter birthday=1 to your members extension call and you'll have todays birthdays!

Can you specify how I can add a listview on my homepage with that?

7

Re: Hardcover Release: Birthdays 2

You need to make copy of ext.members.tpl and edit it's html code to suit your needs, then call extension:
{members:bla-bla, birthday=1,template="ext.members_birthdays.tpl"}

8

Re: Hardcover Release: Birthdays 2

Thanks for you quick reply.
So you mean I have to copy ext.members.tpl and create ext.members_birthdays.tpl
Your first topic says I should alter the php file (wich I did and found that code)

9

Re: Hardcover Release: Birthdays 2

You have to edit copy/rename .tpl file in case if you need other view of results than you usually have, running {members:} extension. But if you satisfied with default look, just leave it as is.

10

Re: Hardcover Release: Birthdays 2

yepyep, thanks radioact !!!! :-D

11

Re: Hardcover Release: Birthdays 2

A little prob with my couples profile, the script doesn't count the birthday from the second member. (label: age2)
But in the code I cannot find that field.
How can I change this?

12

Re: Hardcover Release: Birthdays 2

if ( isset($params['birthday']) && $params['birthday'] ) {
$datenow = time();
$monthday = date("m"."d", $datenow);

$wheresql[] = "(d.data_age LIKE '%$monthday' OR d.data_age2 LIKE '%$monthday')";

}

Try this, Sven

13

Re: Hardcover Release: Birthdays 2

A M A Z I N G !
and lightning fast
you are !

14

Re: Hardcover Release: Birthdays 2

Thanks go to my parents, Gmail and vldPersonals

15

Re: Hardcover Release: Birthdays 2

So what's that variable to use in the template? For example if I want to show a header with balloons??? (nice idea ;-) btw

<!-- if birthday="1" -->
balloons.jpg
<!-- ENDIF -->

16

Re: Hardcover Release: Birthdays 2

Put birthdays to separate custom page.
Or use template="ext.members_birthdays.tpl" for different birthday celebrating members design.

17

Re: Hardcover Release: Birthdays 2

yep, I'm using that :-)
but I want to have a header or image on a members page with balloons :-D

18

Re: Hardcover Release: Birthdays 2

Hello!
Is anybody know does this mod work with 2.5.5?
For me it doesn't:(

19

Re: Hardcover Release: Birthdays 2

for me on ver 2.5.6 doesn't work

php code i put on includes/ext/ext.members.php

and this code on templates/mytemplate/homapage.tpl

{members:limit=20,photos=1,cache_time=0,birthday=1,cache_name="birthday"}

anybody to help?

20

Re: Hardcover Release: Birthdays 2

It's doesn't work on my site for some reason. I did everything correctly but for some reason an error is displayed:

MySQL ERROR
Error Number: 1054
Description: Unknown column 'd.data_age' in 'where clause'

I've tried to search "data_age" in phpMyAdmin panel and I found it in vld_search_queries, but why it is not work?

P.S.: vldP 2.6

Last edited by artnik (2011-01-28 07:27:37)

21

Re: Hardcover Release: Birthdays 2

Can anybody plz update birthday parameter for vld 2.6 .

Thank you .

22

Re: Hardcover Release: Birthdays 2

Radioact left a comment on vldcrowd with a suggestion to get this working and so far it appears to work correctly in 2.7.

1) Follow the steps outlined in post #1

2) make sure to add the following to the member extension call: birthday=1,types=1

The change that made this start working on my 2.7 site was the addition of: types=1

My call looks like this:

{members:limit=22,birthday=1,types=1,cache_time=0,cache_name="birthday"}

Thanks Radioact!!

23

Re: Hardcover Release: Birthdays 2

DDNY wrote

Radioact left a comment on vldcrowd with a suggestion to get this working and so far it appears to work correctly in 2.7.

1) Follow the steps outlined in post #1

2) make sure to add the following to the member extension call: birthday=1,types=1

The change that made this start working on my 2.7 site was the addition of: types=1

My call looks like this:

{members:limit=22,birthday=1,types=1,cache_time=0,cache_name="birthday"}

Thanks Radioact!!

So, do I understand correctly after following the instructions outlined in step 1) I need to add the following code

{members:limit=22,birthday=1,types=1,cache_time=0,cache_name="birthday"}

  My question is: to which file do I add the "call" code?

24

Re: Hardcover Release: Birthdays 2

You can put it in any .tpl file you want it to display.
Usually they put it to sidebar.tpl or to homepage.tpl

25

Re: Hardcover Release: Birthdays 2

Thank you so much for your help! I got it to work and it looks really nice on my site. I do have one more question, the font color looks dark, is there a way to make it white so it will look better against the background?