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 CiviEvent (Moderator: Yashodha Chaku) »
  • List of upcoming events via CiviEvent in Drupal ...
Pages: [1]

Author Topic: List of upcoming events via CiviEvent in Drupal ...  (Read 1975 times)

backdrifting

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 2
List of upcoming events via CiviEvent in Drupal ...
April 17, 2008, 07:58:29 am
I'm working on an events listing page per this documentation on the CiviCRM site:
http://wiki.civicrm.org/confluence/display/CRMDOC/List+of+Upcoming+CiviEvents+or+Feed+of+Events

It's working beautifully but I have some additional questions I'm hoping the CiviCRM PHP gurus might help me out with:

Questions:

 1) How do you tweak the PHP so that if the event just occurs on one day and not from a date to a date, you can output the date header to just show that one day ... but still have the string of start to end date for those events that run over a period of time.

2) Additionally how do you delete the second month (for end date) if the month is the same as the start date.  So instead of:

 Apr 17 - Apr 20 2008

 
it would be:

Apr 17-20 2008

3) How do you output the month to be spelled out "April" vs. "Apr"

4) Finally how would I output the City, State/Province, and Country location data?  Should I add those variables to this line:
$display .= l($title_place.' '.$title_desc, 'civicrm/event/info', array(), 'reset=1&id='.$event['id']).'<br />';
      echo $display;


Thanks in advance@  :)
« Last Edit: April 17, 2008, 08:06:51 am by backdrifting »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: List of upcoming events via CiviEvent in Drupal ...
April 17, 2008, 05:08:05 pm
You can check out some logic for doing some of these things - like only showing End Time if the End Date is same as Start Date - by looking the the code in the Event Info page template:

templates/CRM/Event/Page/EventInfo.tpl

(it's smarty code, not PHP - so syntax is different - but good reference for "logic").

Then I would add some echo statements inside the foreach loop to verify what the data coming from the API looks like....
Code: [Select]
echo $event['end_date'] . '<br />';

... and then review the PHP doc on the date function to see how you can manipulate the date output:

http://www.php.net/manual/en/function.date.php

Hope that helps :-) Assuming you get something you like - post back your results to the wiki page (or post back here if you're not quite there yet).
Protect your investment in CiviCRM by  becoming a Member!

fyhllj

  • Guest
Re: List of upcoming events via CiviEvent in Drupal ...
September 17, 2008, 05:44:07 pm
Use those codes to build a block and put it in the front page. Everything seems to work great until I click those events' links, which all link to one url:http://localhost:8888/oiaevents/?q=civicrm/event/info

Any clues, what's going on here. My civicrm version is 2.06.

Thanks in advance!

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: List of upcoming events via CiviEvent in Drupal ...
September 17, 2008, 09:43:46 pm
Check http://forum.civicrm.org/index.php/topic,4857.msg21214.html#msg21214

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • List of upcoming events via CiviEvent in Drupal ...

This forum was archived on 2017-11-26.