Monday, 14 September 2015
  12 Replies
  2K Visits
0
Votes
Undo
Is it possebly to include the "category" in the RSS feed

I need it to be like this
Time | Category | Event

I have been trying to modify this, but with no luck
com_jevents/views/modlatest/tmpl/rss.php

Anyone out there, knowing what/how to do this?
Monday, 14 September 2015 09:06
·
#156090
0
Votes
Undo
1. You should copy this file to templates/YOURTEMPLATE/html/com_jevents/modlatest/rss.php and make your customisation there

2. what you need to do is change the item->title and include the category name in this output - the variable is already fetched for you via
$item_type = $row->getCategoryName();

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

Monday, 14 September 2015 09:38
·
#156091
0
Votes
Undo
Hmm - $item_type = $row->getCategoryName(); is allready included.
See the code below. What need to be changed ?

<?php
/**
* JEvents Component for Joomla 1.5.x
*
* @version $Id: rss.php 3575 2012-05-01 14:06:28Z geraintedwards $
* @package JEvents
* @copyright Copyright (C) 2008-2015 GWE Systems Ltd
* @license GNU/GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html
* @link http://www.jevents.net
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

// setup document
$doc = JFactory::getDocument();

$doc->setLink($this->info['link']);
$doc->setBase($this->info['base']);
$doc->setTitle($this->info['title']);

$doc->setDescription($this->info['description']);

$docimage =new JFeedImage();
$docimage->description= $this->info['description'];
$docimage->title=$this->info['title'];
$docimage->url= $this->info['image_url'];
$docimage->link= $this->info['imagelink'];
$doc->image = $docimage;

foreach ($this->eventsByRelDay as $relDay => $ebrd) {
foreach ($ebrd as $row) {
// title for particular item
$item_title = htmlspecialchars( $row->title() );
$item_title = html_entity_decode( $item_title );

// url link to article
$startDate = $row->publish_up();
//$eventDate = JevDate::mktime(JString::substr($startDate,11,2),JString::substr($startDate,14,2), JString::substr($startDate,17,2),$this->jeventCalObject->now_m,$this->jeventCalObject->now_d + $relDay,$this->jeventCalObject->now_Y);
$eventDate = JevDate::strtotime($startDate);
$datenow = JEVHelper::getNow();
if ($relDay > 0)
{
$eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $eventDate) . " +$relDay days";);
}
else
{
$eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $eventDate) . " $relDay days";);
}


$targetid = $this->modparams->get("target_itemid",0);
$link = $row->viewDetailLink(date("Y", $eventDate),date("m", $eventDate),date("d", $eventDate),false,$targetid);
$link = str_replace("&tmpl=component","",$link );
$item_link = JRoute::_($link.$this->jeventCalObject->datamodel->getCatidsOutLink());

// removes all formating from the intro text for the description text
$item_description = $row->content();

// remove dodgy border e.g. "diamond/question mark"
$item_description = preg_replace('#border=[\"\'][^0-9]*[\"\']#i', '', $item_description);

if ( $this->info[ 'limit_text' ] ) {
if ( $this->info[ 'text_length' ] ) {
$item_description = JFilterOutput::cleanText( $item_description );
// limits description text to x words
$item_description_array = explode( ' ', $item_description );
$count = count( $item_description_array );
if ( $count > $this->info[ 'text_length' ] ) {
$item_description = '';
for ( $a = 0; $a < $this->info[ 'text_length' ]; $a++ ) {
$item_description .= $item_description_array[$a]. ' ';
}
$item_description = trim( $item_description );
$item_description .= '...';
}
} else {
// do not include description when text_length = 0
$item_description = NULL;
}
}
else {
// this can lead to double CDATA wrapping which is a problem in Firefox 13+
//$item_description = "<![CDATA[$item_description]]>" ;
}

// type for particular item - category name
$item_type = $row->getCategoryName();
/*
// You could incorporate these fields into the description for the RSS output
// organizer for particular item
$item_organizer = htmlspecialchars( $row->contact_info() );
$item_organizer = html_entity_decode( $item_organizer );
// location for particular item
$item_location = htmlspecialchars( $row->location() );
$item_location = html_entity_decode( $item_location );
// start date for particular item
$item_startdate = htmlspecialchars( $row->publish_up());
// end date for particular item
$item_enddate = htmlspecialchars( $row->publish_down() );
if (isset($row->_thumbimg1) && $row->_thumbimg1!="";){
$item_description = $row->_thumbimg1. "<br/>".$item_description;
}
*/

// load individual item creator class
$item =new JFeedItem();
// item info
if ($row->alldayevent()) {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) ." : " .$item_title;
} else {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) ." : " .$item_title;
}
$item->link = $item_link;
$item->description = $item_description;
$item->category = $item_type;

$eventcreated = new JevDate($row->created());
$item->date= $eventcreated->toUnix(true);

// add item info to RSS document
$doc->addItem( $item );
}
}
Monday, 14 September 2015 11:03
·
#156092
0
Votes
Undo
the lines setting $item->title

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

Monday, 14 September 2015 11:35
·
#156093
0
Votes
Undo
OK - i'm clueless
Hope you can/will help me some more!

This has to be changed into what?

if ($row->alldayevent()) {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) ." : " .$item_title;
} else {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) ." : " .$item_title;
}
Monday, 14 September 2015 17:06
·
#156094
0
Votes
Undo
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) ." : " .$item_title;

to
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) ." | " .$item_type." | " .$item_title;

etc.

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

Monday, 14 September 2015 17:38
·
#156095
0
Votes
Undo
Brilliant - thanx !!!
Wednesday, 14 October 2015 05:42
·
#156096
0
Votes
Undo
I have made the changes you suggested but I still do not get the output I am looking for.

Here is the feed link: [url:mwm5y8ur]http://holisticevents.com.au/index.php?option=com_jevents&;task=modlatest.rss&format=feed&type=rss&modid=207[/url:mwm5y8ur] (Note: by default the link begins with feed:// but I had to change it to http:// in order to work properly)

Here is the code which I copied to template/html/com_jevents/views/modlatest/rss.php in order to customise:

// load individual item creator class
$item =new JFeedItem();
// item info
if ($row->alldayevent()) {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATE')) ." | " .$item_type." | " .$item_title." | " .$item_location;
} else {
$temptime = new JevDate($eventDate);
$item->title = $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) ." | " .$item_type." | " .$item_title." | " .$item_location;
}

Am I missing something? Thank you
Wednesday, 14 October 2015 10:13
·
#156097
0
Votes
Undo
None of the events currently in the feed are all day events so I can't look at them. What are they outputting for these events?

What are you translations for JEV_RSS_DATE and JEV_RSS_DATETIME ?

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

Wednesday, 14 October 2015 10:26
·
#156098
0
Votes
Undo
This is how they display as imported feed in Mailchimp:
[attachment=0:3i2a5ckl]<!-- ia0 -->feed.jpg<!-- ia0 -->[/attachment:3i2a5ckl]

The separators show : where in the rss.php I am using | which indicates to me that the file is not accessed somehow.
Wednesday, 14 October 2015 10:43
·
#156099
0
Votes
Undo
Ok - now I understand.

You need to put your file in templates/YOURTEMPLATE/html/com_jevents/modlatest/rss.php
and not template/html/com_jevents/views/modlatest/rss.php which is where you say you have placed the file. i.e. you need your template name path and to remove 'views'

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

Wednesday, 14 October 2015 12:28
·
#156100
0
Votes
Undo
Brilliant, it works now. Thank you.
Wednesday, 14 October 2015 23:47
·
#156101
0
Votes
Undo
Great! Thanks for letting us know.

Many thanks
Tony

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

  • Page :
  • 1
There are no replies made for this post yet.

Members Area

Show your support

Unlike many Joomla calendars we do not charge to download JEvents - please show your support for this project by becoming a member of the JEvents Club Club members get access to early releases, exclusive member support forums, and Silver and Gold members can use many exciting JEvents addons

Your membership will ensure that JEvents continues to be the best events calendar for Joomla.