Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
RSS Event How To call specific band info.
megaplatinum



Joined: 26 Aug 2009
Posts: 88

Posted: 12/19/09 17:40 
I wanted to pass a variable to modify the current RSS Event Example so I can call custom RSS Event feeds for different bands on my system by their ID.

Here's the mod i did of the original rss event code.

rss_event.php


Code
<?php
//----------------------------------------
// Jamroom RSS Feed Creator Wrapper module
//----------------------------------------
require('include/jamroom-include.inc.php');

// These header calls are required to get the browser to see this as an RSS Feed
header('Expires: '. gmdate('D, d M Y H:i:s', time()) .' GMT');
header('Last-Modified: '. gmdate('D, d M Y H:i:s') .' GMT');
header('Content-Type: application/xml; charset=utf-8');

// The $base_url variable holds the URL to the ranking system
$base_url = $jamroom['jm_htm'] .'/ranking.php?mode=event&show=10&band_id='. $_GET['band_id'];

// now we define which templates we will use for each part
$head_tpl = 'rss_event_header.tpl';
$row_tpl  = 'rss_event_row.tpl';
$foot_tpl = 'rss_common_footer.tpl';

// Now run jrCallUrl to actually run the ranking system call
echo jrCallUrl($base_url .'&header_template='. $head_tpl .'&row_template='. $row_tpl .'&footer_template='. $foot_tpl);
?>


rss_event_row.rpl


Code
<item>
  <title>{$EVENT_WDAY_SHORT} {$EVENT_MONTH}/{$EVENT_DAY}/{$EVENT_YEAR} - {$EVENT_LOCATION}</title>
  <link>{$ARTIST_URL}</link>
  <description>{$EVENT_TITLE|jr_strip_html} - {$EVENT_DESCRIPTION|jr_strip_html}</description>
</item>


rss_event_header.tpl


Code
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>{$system_name} - Upcoming Gigs</title>
<description>A list of the next upcoming Gigs</description>
<language>en-us</language>
<link>{$JAMROOM_URL}</link>
<lastBuildDate>{$smarty.now|jr_date_format:"%a, %d %b %Y %T %Z"}</lastBuildDate>
<generator>Jamroom {$version}</generator>


Call it with:

http://yoursite.com/rss_event.php?band_id=xxx

Also include the footer file with the original example code. Mod to suit. Enjoy!



Last edited by megaplatinum on 12/19/09 18:18; edited 1 time in total
Back to top
Mrmeme



Joined: 28 Mar 2011
Posts: 26

Posted: 06/02/12 03:00 
thank man.
i wanted to just filter one artists events for their personal website and i used what you said here Smile

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.