CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Display upcoming birthdays
Pages: 1 [2]

Author Topic: Display upcoming birthdays  (Read 7967 times)

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Display upcoming birthdays
January 10, 2011, 02:42:47 am
hi

still looking for the mistake to fix the broken link

thanks a lot
conte
http://www.aidboard.com

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Display upcoming birthdays
January 10, 2011, 03:39:16 pm
Compare the complete link (URL) you're getting in your block (the one that doesn't work) to the View Contact link you get when browsing contacts (i.e. links in Find Contacts).
Protect your investment in CiviCRM by  becoming a Member!

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Display upcoming birthdays
January 11, 2011, 12:31:46 am
smart idea Dave :)

It works now, thanks a lot

conte
http://www.aidboard.com

behrang

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
  • CiviCRM version: 4.05
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5
Re: Display upcoming birthdays
November 28, 2011, 05:47:25 am
Hi
sorry for replying on an old post, but where do i actually have to put this code in when i want it to appear on dashboard?
greets

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Display upcoming birthdays
November 28, 2011, 09:51:01 am
If you mean the CiviCRM 'home page' dashboard - you'll need to use a hook in a module:
http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmdashboard

... and if you haven't used hooks before, chk out the Developer Guide:
http://en.flossmanuals.net/civicrm-developer-guide/
Protect your investment in CiviCRM by  becoming a Member!

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Display upcoming birthdays
December 04, 2013, 04:48:12 am
hey,

so i am using civicrm on another project now and wanted to use the birthday block again but it does not work anymore.

this was the code i used years ago:

Code: [Select]
<?php
// Check if CiviCRM is installed here.
if (!module_exists('civicrm')) return false;

// Initialization call is required to use CiviCRM APIs.
civicrm_initialize(true);
require_once(
'api/v2/Contact.php');

$query = "SELECT id, display_name, birth_date, CONCAT(((RIGHT(birth_date,5)
< RIGHT(CURRENT_DATE,5)) + YEAR(CURRENT_DATE)), RIGHT(birth_date,6)) AS bday,
concat(concat(month(birth_date), '/'), day(birth_date)) as displaydate, 
(TO_DAYS(CONCAT(((RIGHT(birth_date,5) < RIGHT(CURRENT_DATE,5)) + YEAR(CURRENT_DATE)),
RIGHT(birth_date,6))) - TO_DAYS(CURRENT_DATE)) AS toBday FROM civicrm_contact WHERE
(TO_DAYS(CONCAT(((RIGHT(birth_date,5) < RIGHT(CURRENT_DATE,5)) + YEAR(CURRENT_DATE)),
RIGHT(birth_date,6))) - TO_DAYS(CURRENT_DATE) < 7) ORDER BY bday, RIGHT(birth_date,5);"
;

$params = array( );

$dao =& CRM_Core_DAO::executeQuery( $query, $params );

echo 
"<div class=\"item-list\"><ul>\n";
while ( 
$dao->fetch( ) ) {

echo 
"<li><a href=\"/civicrm/contact/view?reset=1&cid=" . $dao->id . "\">" . $dao->display_name .
"</a>, " . $dao->displaydate;

echo 
"</li>\n";

}
echo 
"</div></ul>\n";

?>

can anyone tell me what to change to get this working again?

thanks
conte
http://www.aidboard.com

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Display upcoming birthdays
December 04, 2013, 01:26:52 pm
API v3 is now in use.  API v2 has been removed, so that would be the place to start.

See http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API  and http://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference

Conte01

  • I post occasionally
  • **
  • Posts: 79
  • Karma: -1
  • www.aidboard.com
    • Aidboard
  • CiviCRM version: latest
  • CMS version: Drupal
Re: Display upcoming birthdays
December 05, 2013, 02:25:16 am
Quote from: joanne on December 04, 2013, 01:26:52 pm
API v3 is now in use.  API v2 has been removed, so that would be the place to start.

See http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API  and http://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference

yea. looks right.

however I didnt do any coding or reading on civicrm for a while, so I think I wont be able to handle this atm.

Hoping, that someone is willing to invest some minutes :)

thanks
conte
http://www.aidboard.com

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Display upcoming birthdays

This forum was archived on 2017-11-26.