Celebrations (before: List user celebrations like birthday and others) v1.2

Release Notes

This plugin is to see the users celebrations like birthdays, anniversaries,....

This version runs under elgg v1.6 and don't need another plugins to work. (new in this version)
It use the core profile fields (not the core custom profile fields), and add automatically the necessary fields. You can see it in start.php

You can select, in plugin configuration, the fields that you want to use.

At the moment I have defined the field type:

- "day_anniversary" with three pulldowns for the day, month and year to avoid the use of calendar input for old dates.
This is used for the specific dates that has celebrations every year, like birthday, wedding day, etc...
- "yearly" a particular date with two pulldowns with day and month (in some countries like spain you celebrate the date of your name's saint). This is use for celebrations that repeat yearly, but not have an origin or specific date

Then the system create the next profile fields like "celebrations_birthdate", "celebrations_dieday" and "celebrations_feastdate".
I have added the prefix "celebrations_" to avoid confusions with the original core fields.
If you want to add some field, you must use the prefix (with underscore) before the field name, and use the defined types of field.

At the moment you can add fields in the file start.php (is easy but you need to copy some code) and in edit.php under settings folder

In your "tools" menu appears a "view celebrations" option where you select the month, then you obtain a list with all the celebrations for this month

Added one filter. You can see two type of celebrations. "All" celebrations or only "friends" celebrations

You can put the two widgets in your profile page with:

  1. celebrations of the day
  2. next celebrations

I haven't defined css specific styles for this plugin, you can see it with your theme and improve it. I apreciates if you send me css examples.

I'm not a code generator, I'm a user with certain php knowledge. This plugin works for me but maybe it's not the best code.

Any suggestions, bugs, improvements and comments are welcome.

 

Installation: (It's more easy and simple in this version)

YOU MUST APPLY THE CORRECTION NAMED BELOW IN THE COMMENTS TO USE THE FILTERS

1. intall the folder celebrations inside mod directory
2. IMPORTANT: enable the plugin below the core profile plugin
3. config plugin settings in "tools administration" (you can define if you want a reminder in login with next celebrations, the date type, the fields to use, the celebrations filter)
4. use the widget "today_celebrations" (optional)
5. use the widget "next_celebrations" (optional)
6. edit settings in "next_celebrations" widget (the days left, and if you want to see today celebrations inside this plugin)

NOTE: Test this plugin in development servers if you are using another profiles plugins (change the order between them, but you must put this one below the core profile plugin)

Todo list

- Test this plugin together with another profile plugins
- Email reminders for the next celebrations

Changes for release 1.2
- Add selects in settings because We had problems with checkboxes in plugins settings

Changes for release 1.1

- Correct some date type to strftime
- Added "friends filter"
- Now you can select fields to add from the plugin default

Changes for release 1.0

- Full code rewrite to improve the files and let it to grow up
- Now is very easy (with a few code) to add new fields types (as periodical events) and profile fields
- Tested in elgg v1.6
- Independent from other profile plugins (in this version you don't need the flexprofile plugin)
- Added a field for the wedding date

Changes for release 0.4

- problem in date dropdown with firefox fixed
- Added two languages files (spanish and catalan)

Changes for release 0.3

-
Added a new widget to see the next celebrations (you can edit the widget setting in the edit button on the widget)
- Added a reminder when you login with the next celebrations (you can edit teh settings in the admin plugin settings)
- Added the possibility to send a message in the today celebrations widget

Changes for release 0.2

- Change date by gmdate
- Correct some errors with feast celebrations
- Improve user experience with less screens
- Submenu added with the month's list
- Corrected some language errors
- Added icon and profile link for every user
- Corrected a double closed of select tag

 

A screenshot with the two widgets activated

View of two widgets i dashboard

A picture in the moment of login with one reminder

Login reminder

  • Fernando, I have been following the updates of your plug-in, and it seems that it is getting better and better. Thanks for sharing again this great lug-in. It is working fine with Elgg 1.6.1.

  • Hi, Fernando
    Great plugin!!!

    Got a few problems.
    1- when i select a date ( 18 november 1970 ) for all fields got back after saving on:
    Birthdate: November 17, 1970
    Date of death: November 17, 1970
    Feastday: 18 of November
    Wedding date: November 17, 1970

    2- Sent a message to my friend and the message image doesn't appear on Today celebrations.

    3- When i choose just Friends in Admin doesn't appear any celebrations, got to go back to All ( sugestion let the user select between All and Friends).

    Using:
    Elgg 1.6.1 with ColdTrick "custom_profile_fields"
    Moved your plugin arround and got same problems back.

  • @ Jose Martinho

    1.- Is your server in different country that you? I have headaches with this, I'm using strftime to avoid this problems, but maybe I should rewrite the javascript that save dates

    2.-It works for me in the widgets. Except for dieday anniversaries and for yourself

    3.-I will check it.

  • Fernando I'm located in Brazil and my server is DreamHost.

  • @ Jose Martinho

    I have detect a problem with the friends filter.

    In the file models>lib.php in line 82 there is a call function as:

    if(get_plugin_setting("filterusers","celebrations") == 'friends'){
            $users = get_user_friends(get_loggedin_user()->guid,"",0);

    that you must replace by:

    if(get_plugin_setting("filterusers","celebrations") == 'friends'){
            $users = get_user_friends(get_loggedin_user()->guid,"",1000000);

    With this you put a limit for the friends in 1000000, I hope that you haven't more than this number of users ;-)

    I will study a pagination for the next version

    For the other problems that you have I need more information, because I am not able to reproduce them

  • @fernando: I'm having the same problem as Jose's where I choose like Nov 13 and it saves Nov 12. 

    @Jose: have you found a solution to this yet?  

  • @chombian We have been testing the Jose's test site. The date are right in database, the problem is when the dates are showed.

  • @Jose, Chombian

    I can't reproduce it in my server.

    But this seems that works:

    In file views>defauls>input>day_anniversary.php

    replace in lines 26,27 and 28 strftime for gmstrftime

  • It also needs to be fixed in views/defaults/output/day_anniversary.php

    On line 16 change strftime to gmstrftime

    Thanks for the information, I wouldn't have figured it out with the hint.

  • HI Fernando. I want to show age of user beside a username.

    Like this: Fernando (87)

    can you give me some hints?

  • @Fernando

    Your plugin is amazing and it should really be an elgg core plugin!

    But unfortunately I have a problem with it. When I, or someone else performes a login, then this person gets redirected to http://"myelggpage"/action/login with a white and empty screen...

    Without the plugin logging in works great...

     

    Please help me! My community really wants to use this important plugin!!!

  • @alfalive if you aren't in hurry I could add it in a week, for the next version

    @SuperS A lot of people are working fine with this plugin, if you have followed the correct order, then it could be an incompatibility issue, can you try to diable the other plugins until you find which plugin is incompatible with celebrations plugin? Then you can explain it us to know which plugin is incompatible and then try to study it. Thanks

     

  • @Fernando:

    I disabled every plugin exept the profile and the celebrations plugin (which are in the following order: profile, celebrations) and the error still occured.

    So there has to be a bug in your plugin... I think it is because it tries to notify you what celebration is next when you performe a login, maybe there is some kind of problematic code which leads me to the wrong page... Could you tell me which lines in which file I could try to delete? Caus I dont really need that popup notifications...

    Thx in advance!

  • @superS What core version of elgg are you using?

    You can config with "no" in the plugin setting to avoid that plugin shows the next celebrations in login or you can commment the line 104 in the file start.php

    register_elgg_event_handler('login','user','show_next_celebrations');

    This is the line that execute the function for the login reminder

  • Hi, Fernando

    Sorry the delay, was out for a couple of weeks.

    Tried:

    1- when i select a date ( 18 november 1970 ) for all fields got back after saving on:
    Birthdate: November 17, 1970
    Date of death: November 17, 1970
    Feastday: 18 of November
    Wedding date: November 17, 1970

    Replacing:

    lines 26,27 and 28 strftime for gmstrftime

    It doesn't change it anymore in Edit profile, but when I save it, what appears is the previous date.

    2- Sent a message to my friend and the message image doesn't appear on Today celebrations.

    Changed css file to:

    background:transparent url(<?php echo $vars['url']; ?>mod/celebrations/graphic/messages_icon.gif) no-repeat left 2px;

    It works now!!!

    3- When i choose just Friends in Admin doesn't appear any celebrations, got to go back to All ( sugestion let the user select between All and Friends).

    It works now!!!

  • @Jose Martinho

    It also needs to be fixed in views/defaults/output/day_anniversary.php

    On line 16 change strftime to gmstrftime

  • @Fernando

    I have disabled the line 104 and now your plugin works like a charm for me!

    Thank you very much!!!

  • @Fernando I am not in hurry. Thanks.

  • Looking forward to the next version. 

  • @Fernando On my test envirenment Release - 1.6.1, Version - 2009072201

    Birthdate is not shown. It looks like this

    Brief description: brief

    Location: kier

    Interests: many

    Skills: more

    Contact email: mai@mai.de

    Telephone: 55575757575

    Birthdate:

  • And when I enable cutom profile fields plugin

    It disappears completely

     

  • @alfalive I have no test it with custom profile fields, but I supose that it doesn't work because of field declaration in start.php.

    custom profile fields  works different than core fields. As I don't use custom profile fields I haven't addapt the plugin for this possibility, it's on my todo list but I haven't free time at the moment.

    - Have you tested this plugin below custom profile fields?

    - If custom profile fields plugin is disable you don't see the birthdate in profile? in edit profile?

    - Are you using another profile plugin with custom profile fields plugin like flexprofile,....?

  • @alfalive I have study the plugin custom profile fields. It redeclare the config fields as in the standard installation of elgg.

    Then when you put custom profile fields plugin below celebrations it delete the celebrations_birthday field.

    I will send a piece of code tho the plugin developer to avoid this.

    I upload the code here (in http://community.elgg.org/pg/plugins/ferg/read/358110/celebrations-before-list-user-celebrations-like-birthday-and-others) until it could be inside custom profile fields plugin

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 7672
  • Recommendations: 5

Other Projects

View Fernando's plugins