Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!

Creating a YouTube clone using Jamroom Index Jamroom Play Script

Using the Jamroom Event Calendar

The Jamroom Calendar gives you and your artists an easy way to enter events, shows, gigs, etc. so they can share this information with their online viewers and fans. As the system owner, the Jamroom calendar is very flexible in displaying the information you want, and is easily modifiable in its appearance to suit your needs.

Configuration

The Jamroom Calendar consists of a central script (calendar.php) that reads its information from the Jamroom Database. The Artists in Jamroom will enter their event information through an interface in the Artist Menu, which gives them control over everything related to that event: Event Title Event Location Event Start Time Event Date Event Description Event Image

Note: The calendar interface will only be available to Artists that have the “Allow Calendar” setting set to “Yes” in the "Site Features" section of their Jamroom Quota.

There is 1 configuration option available in the Jamroom Config that relates to the Jamroom Calendar:

  • Hour Selection Format - This option allows you to define how Hours of the Day will be displayed when used in pick lists withing the Jamroom Artist Menu (i.e. in the Create Event form). Default is 12 for a 12 hour am/pm configuration.
     

Creating a Calendar or List of Events

The Jamroom Artist Calendar has 2 "modes" that it can work in to display events.  These 2 modes are used depending on the type of output you would like to see - i.e. use the "display" mode to create and display an actual calendar, and use the "show_event" mode to create a listing of events.

  • Creating a displayable calendar

If you would like to create a calendar of events (for example to embed into a page), you will use the "display" option:

calendar.php?mode=display&template=calendar_big.tpl

Note that the script requires that a template name be passed to it in the URL - this is the template that will be used (and can be customized) to display the actual calendar.  The template files for the calendar output are all stored in the jamroom/templates/calendar directory.  By default, Jamroom ships with 2 displayable calendars:  a "big" calendar (calendar_big.tpl) and a "small" calendar (calendar_small.tpl) that are suitable for full page display, and embedding into another page (respectively).
  • Creating a tabular List of Events

If instead of creating a viewable calendar, you would rather create a list of events, you can use the "show_event" mode to the calendar.php.  This mode uses templates located in the jamroom/templates/calendar directory to format and display the events.
calendar.php?mode=show_event&header_template=header.tpl&row_template=entry.tpl&footer_template=footer.tpl

Parameters and Options

Both the "display" and "show_event"  modes can also accept many other variables and options, which either restrict or change the type of events that are returned.  The following options are available:
URL Variable Required Description
mode=display/show_event yes The "mode" option to the calendar.php script tells the script what type of output you want to create - "display" is used for creating an actual calendar, and "show_event" is used for generating a listing of events in tabular format.
year=(year) no This argument will limit the events it shows to the given year - i.e. &year=2004
month=(month) no This argument will limit the events it shows to the given month in the current year - i.e. &month=05 (for May)
day=(day) no This argument will limit the events it shows to the given day in the current month in the current year - i.e. &day=10 (for the 10th day of the current month)
hour=(hour) no This argument will limit the events it shows to the given hour in the current day in the current month in the current year - i.e. &hour=12 (for the 12th hour in the current day, i.e. noon)
artist_id=(artist_id) no This numeric argument is the artist_id (band_id) you want to show the events for. Default is ALL artists who are eligible via their quota.
event_id=(event_id) no This numeric argument is the event_id of the Event you want to show. Default is all events with a start time LATER than the current time.
limit=(limit) no This numeric argument will limit the number of events shown in the output.
old_events=1 no If the "old_events=1" option is set on the URL, then events that have already passed will still be shown.  The default behavior is to only show events that have not already passed.
header_template=header.tpl no This is the header template file to use when creating the output. Note: this Smarty template MUST be located in the jamroom/templates/calendar directory, and must have a “.tpl” extension. Default is to use the “default_header.tpl”
row_template=entry.tpl no This is the entry template file to use when creating the output (it will be used once for each calendar entry). Note: this Smarty template MUST be located in the jamroom/templates/calendar directory, and must have a “.tpl” extension. Default is to use the “default_entry.tpl”
footer_template=footer.tpl no This is the footer template file to use when creating the output. Note: this Smarty template MUST be located in the jamroom/templates/calendar directory, and must have a “.tpl” extension. Default is to use the “default_footer.tpl”

Here is an example of using the Jamroom Calendar embedded in another Jamroom Template:

{jr_calendar mode="show_event" year="2005"}

 

Template Variables

The templates that are used by the calendar.php are “Smarty” templates, so you are free to use any of the Smarty template logic in your templates, as well as the following Jamroom variables:

The following 2 variables are available in ALL templates (header and footer included)

Variable Description
{$JAMROOM_DIR} The full path to the Jamroom directory as defined in the jamroom/config/settings.cfg.php file.
{$JAMROOM_URL} The URL to the Jamroom installation as defined in the jamroom/config/settings.cfg.php file.


The following variables are ONLY available in the “row” templates:

Variable Description
{$EVENT_ID} The ID number of the Event
{$EVENT_CREATED} The UNIX epoch timestamp of the data and time the Event entry was created
{$EVENT_TIME} This is the COMPOSITE data/time stamp that is used internally by Jamroom. It will be in the format: YYYYMMDDHH
{$EVENT_HOUR12} This is the HOUR of the event in 12 hour format (i.e. 8pm would be 8)
{$EVENT_HOUR24} This is the HOUR of the event in 24 hour format (i.e. 8pm would be 20)
{$EVENT_DAY} This is the DAY of the event in numerical format
{$EVENT_WDAY_SHORT} This is the DAY of the event in SHORT string format (i.e. “Wed”)
{$EVENT_WDAY_LONG} This is the DAY of the event in LONG string format (i.e. “Wednesday”)
{$EVENT_MONTH} This is the MONTH of the event in numerical format (i.e. May is 5)
{$EVENT_YEAR} This is the YEAR of the event in numerical format (i.e. 2004)
{$EVENT_EPOCH_TIME} This is the time of the event represented as Epoch Time (the number of seconds elapsed since Jan 01, 1970).
{$EVENT_TITLE} This is the TITLE of the event as entered by the Jamroom Artist
{$EVENT_DESCRIPTION} This is the DESCRIPTION of the event as entered by the Jamroom Artist
{$EVENT_LOCATION} This is the LOCATION of the event as entered by the Jamroom Artist
{$EVENT_IMAGE} link to image.php script to generate Event Image
{$EVENT_IMAGE_NAME} This is the NAME of the Event image file
{$EVENT_IMAGE_TYPE} This is the file MIME TYPE of the Event image (i.e. image/jpeg)
{$EVENT_IMAGE_SIZE} This is the file SIZE (in bytes) of the Event image
{$EVENT_IMAGE_EXTENSION} This is the file EXTENSION of the Event image (i.e. jpg, png)
{$BAND_ID} This is the Artist ID of the artist who’s calendar entry the loop is currently on
{$BAND_NAME} This is the Artist Name of the artist who’s calendar entry the loop is currently on
{$BAND_INFO} This is the Artist Information of the artist who’s calendar entry the loop is currently on
{$BAND_LOCATION} This is the Artist Location of the artist who’s calendar entry the loop is currently on
{$BAND_WEBSITE} This is the Artist Website of the artist who’s calendar entry the loop is currently on
{$BAND_INFLUENCE} This is the Artist Influence of the artist who’s calendar entry the loop is currently on
{$BAND_SOUNDLIKE} This is the Artist Soundlike of the artist who’s calendar entry the loop is currently on
{$BAND_IMAGE} link to image.php script to generate Band Image
{$BAND_RATING_FORM} This is the URL link to the Artist rating form for rating the artist
{$BAND_URL} This is the Jamroom URL for the artist
1) Note: Jamroom does not show events on the Artist Events page that are in the past - it only shows current and future events.

Creating a YouTube clone using Jamroom page 49 of 171 Jamroom Play Script
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network