Jump to content


Photo

Friends Birthdays for JomSocial

joomla jomsocial plugins

  • Please log in to reply
25 replies to this topic

#1 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 31 March 2013 - 11:31 AM

A small plugin which displays your friends' birthdays for a given period. This extension is pretty useful, if you have a lot of friends in your community. Won't miss a single birthday with it!

 

Get more information and buy extension here.



#2 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 02:35 PM

Hi,

 

I've installed the plugin, but I can see only birthdays of the day 1: every friend that I see in the list has a birthday only in the day 1, with different months and years...

 

Could you help me ?

 

thanks



#3 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 02:37 PM

I didn't understand you at all. Please, be as much specific as possible about any issues.



#4 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 02:44 PM

Thank you for the fast reply:

 

I have a site with joomla 2.5.17 and Jomsocial 3.1

I just bought your plugin, wich seems very nice.

I've installed it, and then I go into my profile to see it

I have a lot of friends in my website (more then 1000), but in the birthdays area the plugin shows me only people with the birthday in the first day of the month.

so for example:

 

day-month-year (as we use in Italy)

1-1-1970 (january 1, 1970)

1-5-1968 (may 1, 1968)

1-9-1972 (september 1, 1972)

and so on...

 

the month change,

the year change, 

but the day is always the 1

 

can you help me plese ?

 

thank you very much



#5 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 02:51 PM

So you mean, that only friends with birthdays on the 1st day of month are displayed and changing days range don't help?



#6 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 02:56 PM

exactly

 

changing days range doesn't help: I've tried... I can see more people, but always and only friends with birthday on the 1st day of the month..

 

I'm in Italy, and our date format is d.m.Y and not m.d.Y.

Could this be the problem ?



#7 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 03:17 PM

That's absolutely NOT possible. Querying members with birthdays only on 1st day of month is more complex task, than query all of them. So no, this is not what you're having. Even if there was such an issue, it's been reported a dozen times already, but there weren't any similar complaints, not even close.

 

The only thing I can think of, that you either have non-standard BD field or data stored incorrectly in your database. But first try to change Date Format in options plugin. Maybe it takes data from database correctly, but DISPLAYS it in a wrong way due to improper day format. Also check name of JomSocial birth date field.



#8 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 03:54 PM

ok, this is interesting:

 

I've changed the BIRTHDAY COUNT to 300 so to see a lot of birthdays, and I've found that the problem is lightly different:

first of all I see all the birthdays of the year with the 1st day of the month... then al the birthdays with the second one and so on...

 

it seems that the sorting rule is to show first of all all the birthdays of the day 1 (for example january 1, february 1, march 1 etc.), then of the day 2 (january 2, february 2, march 2 etc.)... then of the day 3 etc....

 

instead I should see all birthdays of january, starting from today until january 31, then february etc.

 

Probably the problem is in the sorting rule used to show the avatars of my friends, according to their birthday.

 

I hope this could help you...

 

Please let me know



#9 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 04:07 PM

That's much closer, yes. There's a line ORDER BY DAYOFMONTH(bday) in plugin. Try to change it to ORDER BY MONTH(bday) and see, how it goes.



#10 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 04:40 PM

we are closer to the solution, but there is stil a problem:

 

now first I see all the people with a birthday in january, then all the people with a birthday in february etc.: CORRECT

 

but

 

inside the group of people with a birthday in the same month, the sorting seems to be randomic... could you please modify the query (unfortunately I'm not a developer) in a way that:

 

1. inside the same group (same month) the second sorting key is the dayofmonth ?

2. it is possible to see all the birthdays starting from today (and not tomorrow) ?

 

thanks again



#11 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 04:59 PM

1. Try to use ORDER BY DAYOFYEAR(bday).

2. Try to change this line:

 

$period = abs(date('z', strtotime($item['bday'])) - date('z') + 1);

 

To this one:

 

$period = abs(date('z', strtotime($item['bday'])) - date('z'));



#12 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 05:12 PM

1. Now the sorting works perfectly... great ! thank you very very much !!!!

 

2. with or without changing the line, always the birthdays that I see start from january, 1 (not today, nor tomorrow)

 

It remains only to fix the point 2: I don't need to see the birthdays in the past (even if in this month) but only in the present (today) and future

 

Please let me know...



#13 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 05:17 PM

2. No, it shows only birth dates from the given period in the future. So if you set it to 30 days, only upcoming birthdays for this period (e.g.: from 15.01 to 15.02) will be displayed.



#14 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 05:20 PM

yes... that's exactly what I would like to see: only upcoming birthdays...

 

but on my website right now I see all the birthdays of my friends, starting from january 1, and that's wrong.

If you want I can give you the website link with admin account/password...



#15 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 05:26 PM

If you've set your period to 365 days, then all birthdays will be displayed.

 

This line counts the days from birth date to today:

 

$period = abs(date('z', strtotime($item['bday'])) - date('z'));

 

So if birthday is 13 February, it's a 44th day of the year and today is 15th day of the year. 15-44 equals 29 in absolute value.

 

The next one checks, whether it equals or lower, than period set in module settings (e.g.: 30):

 

if ($period <= $this->params->get('period'))

 

29 is less or equal, than 30.



#16 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 05:44 PM

but I see birthdays starting from january 1, so I see birthdays starting from the first day of this month, and not from today.

 

How can it be possible ?

My period is set to 30...



#17 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 05:47 PM

Try changing these 2 lines:

 

$period = abs(date('z', strtotime($item['bday'])) - date('z') + 1);

if ($period <= $this->params->get('period'))

 

To these ones:

 

$period = date('z', strtotime($item['bday'])) - date('z') + 1;

if (($period <= 0) && (abs($period) <= $this->params->get('period')))



#18 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 05:56 PM

nothing change, same as before...



#19 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 05:57 PM

If you want I can give you my website link, and admin password to check by yourself...



#20 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 15 January 2014 - 06:25 PM

$period = date('z', strtotime($item['bday'])) - date('z');

if (($period <= 0) && (abs($period) <= $this->params->get('period')))

 
Example 1: Birth date is 13th February
 
15th January (15) - 13 February (44) = -29
 
-29 is less, than zero and 29 is less than 30 => Birthday IS displayed.
 
Example 2: Birth date is 1st January
 
15th January (15) - 1st January (1) = 14
 
14 is higher than zero => Birthday NOT displayed.
 
Example 3: Birth date is 14th January
 
15th January (15) - 14th January (14)  = 1
 
1 is higher than zero => Birthday NOT displayed.

 

Example 4: Birth date is 15th January

 
15th January (15) - 15th January (15)  = 0
 
0 equals zero and 0 is less than 30 => Birthday IS displayed.

 

All is good.



#21 bruno.aiazzi2

bruno.aiazzi2

    Member

  • Members
  • PipPip
  • 11 posts

Posted 15 January 2014 - 06:40 PM

ok...finally we got it !

 

I changed this:

 

if (($period <= 0) && (abs($period) <= $this->params->get('period')))

 

with this:

 

if (($period >= 0) && (abs($period) <= $this->params->get('period')))

 

and now all works perfectly !!!!!!!!!!!!!

 

Thank you very much for your help: your support service has been super fast and great !!!!

:)  :)  :)



#22 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 16 January 2014 - 04:56 AM

There IS one small flaw in formula above:

 

Example 5: Birth date is 5th January, today is 20th December
 
20th December (353) - 5th January (5) = 348
 
348 is higher, than zero => Birthday NOT displayed, but it SHOULD.

 

As you can see, problem occurs, when today's day of the year is higher, than birthday's, but birthday is UPCOMING. The correct formula should be like this:

$period = $this->params->get('period');
							
if (date('L')) $year = 366;
else $year = 365;
							
if (($year - date('z')) > $period) $days = date('z', strtotime($item['bday'])) - date('z');
else $days = $year - date('z') + date('z', strtotime($item['bday']));

if (($days >= 0) && ($days <= $period)) {

In all examples below:

 

Period is 30 days.

2013 is NOT a leap year, so there're 365 days in it.

 

Example 5: Birth date is 5th January, today is 20th December

 

365 - 20th December (353) = 12 and it's LESS than Period; days between today and birth date: 365 - 353 + 5th January (5) = 17

17 is HIGHER than zero and 17 is LESS than Period => Birthday IS displayed.

 

Example 6: Birth date is 20th December, today is 5th January

 

365 - 5th January (5) = 360 and it's HIGHER than Period; days between today and birth date: 20th December (353) - 5th January (5) = 348

348 is HIGHER than zero and 348 is DAMN HIGHER than Period => Birthday NOT displayed.

 

Example 7: Birth date is 1th January, today is 15th January

 

65 - 15th January (15) = 350 and it's HIGHER than Period; days between today and birth date: 1th January (1) - 15th January (15) = -14

-14 is LESS than zero => Birthday NOT displayed.

 

NOW it looks legit! Change the well know lines to ones above and see how it works.



#23 Javi

Javi

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 September 2014 - 08:23 PM

Hello,

 

Could be possible to stick the Birthay module outside the activity? I mean I want to display the plugin on the sidebar, but seems impossible.

 

Screenshot attached:

 

http://i.imgur.com/tUcNauM.jpg

 

Thank you,



#24 The Krotek

The Krotek

    Administrator

  • Administrators
  • 423 posts

Posted 13 September 2014 - 09:43 PM

Javi, you can put it in any place on sidebar as any other JomSocial module.



#25 Sergio

Sergio

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 16 November 2014 - 07:06 PM

Hi,
I have 2 errors:
- Module won't load in sidebar
- In application list in customize my page option, a lot of code is displayed




Also tagged with one or more of these keywords: joomla, jomsocial, plugins

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users