Exemplo n.º 1
0
 /**
  * Creates the Event Feed of the Venue
  *
  * @since 0.9
  */
 function display()
 {
     $mainframe =& JFactory::getApplication();
     $doc =& JFactory::getDocument();
     // Get some data from the model
     JRequest::setVar('limit', $mainframe->getCfg('feed_limit'));
     $rows =& $this->get('Data');
     foreach ($rows as $row) {
         // strip html from feed item title
         $title = $this->escape($row->venue);
         $title = html_entity_decode($title);
         // url link to article
         // & used instead of & as this is converted by feed creator
         $link = RedeventHelperRoute::getVenueEventsRoute($row->slug);
         $link = JRoute::_($link);
         // strip html from feed item description text
         $description = $row->locdescription;
         @($created = $row->created ? date('r', strtotime($row->created)) : '');
         // load individual item creator class
         $item = new JFeedItem();
         $item->title = $title;
         $item->link = $link;
         $item->description = $description;
         $item->date = $created;
         // loads item info into rss array
         $doc->addItem($item);
     }
 }
Exemplo n.º 2
0
 * redEVENT can be downloaded from www.redcomponent.com
 * redEVENT is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.
 * redEVENT is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with redEVENT; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
if ($this->row->venueid != 0) {
    $venuelink = RedeventHelperRoute::getVenueEventsRoute($this->row->venueslug);
}
?>
<div id="redevent" class="event_id<?php 
echo $this->row->did;
?>
 el_details">
	<p class="buttons">
		<?php 
echo REOutput::mailbutton($this->row->slug, 'details', $this->params);
?>

		<?php 
echo REOutput::printbutton($this->print_link, $this->params);
?>
Exemplo n.º 3
0
"> <?php 
                    echo $this->escape($row->full_title);
                    ?>
</a></td>			
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'venue':
                    ?>
					<td class="re_location"
					    itemprop="location" itemscope itemtype="http://schema.org/Place">
						<?php 
                    if ($this->params->get('showlinkvenue', 1) == 1) {
                        echo $row->xref != 0 ? "<a href='" . JRoute::_(RedeventHelperRoute::getVenueEventsRoute($row->venueslug)) . "'>" . $this->escape($row->venue) . "</a>" : '-';
                    } else {
                        echo $row->xref ? $this->escape($row->venue) : '-';
                    }
                    ?>
						<?php 
                    if ($row->city) {
                        ?>
						<meta itemprop="addressLocality" content="<?php 
                        echo $row->city;
                        ?>
" />
						<?php 
                    }
                    ?>
					</td>			
Exemplo n.º 4
0
    /**
     * Creates the Venueevents View
     *
     * @since 0.9
     */
    function display()
    {
        $document =& JFactory::getDocument();
        $document->link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents');
        $upcomingevents = $this->get('UpcomingVenueEvents');
        $elsettings = redEVENTHelper::config();
        $imagepath = JURI::root() . 'administrator/components/com_redevent/assets/images/';
        foreach ((array) $upcomingevents as $key => $event) {
            $event_url = RedeventHelperRoute::getDetailsRoute($event->slug, $event->xslug);
            $venue_url = RedeventHelperRoute::getVenueEventsRoute($event->venueslug);
            $description = '<table>
			<tbody>
			<tr>
				<td width="100">Course:</td><td>' . JHTML::_('link', $event_url, $event->full_title, 'target="_blank"') . '</td>
			</tr><tr>
				<td>Where:</td><td>' . $event->location . ' &nbsp; ' . REOutput::getFlag($event->country) . '</td>
			</tr><tr>				
				<td>Date:</td><td>' . REOutput::formatdate($event->dates, $event->times) . '</td>
			</tr><tr>				
				<td>Duration:</td><td>' . $event->duration;
            if ($event->duration == 1) {
                $description .= JText::_('COM_REDEVENT_DAY');
            } else {
                if ($event->duration > 1) {
                    $description .= JText::_('COM_REDEVENT_DAYS');
                }
            }
            $description .= '</td>
			</tr><tr>			
				<td>Venue:</td><td>' . JHTML::_('link', $venue_url, $event->venue, 'target="_blank"') . '</td>
			</tr><tr>				
				<td>Price:</td><td class="re-price">' . REOutput::formatListPrices($event->prices) . '</td>
			</tr><tr>
				<td>Credits:</td><td>' . $event->course_credit . '</td>
			</tr><tr>			
				<td>Signup:</td><td>';
            /* Get the different submission types */
            $submissiontypes = explode(',', $event->submission_types);
            $venues_html = '';
            foreach ($submissiontypes as $key => $subtype) {
                switch ($subtype) {
                    case 'email':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=email&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_email_img'), JText::_($elsettings->get('signup_email_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'phone':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=phone&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_phone_img'), JText::_($elsettings->get('signup_phone_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'external':
                        $venues_html .= '&nbsp;' . JHTML::_('link', $event->submission_type_external, JHTML::_('image', $imagepath . $elsettings->get('signup_external_img'), $elsettings->get('signup_external_text'), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                    case 'webform':
                        if ($event->prices && count($event->prices)) {
                            foreach ($event->prices as $p) {
                                $img = empty($p->image) ? JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text'))) : JHTML::_('image', $imagepath . $p->image, JText::_($p->name));
                                $link = JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug, $p->slug));
                                $venues_html .= '&nbsp;' . JHTML::_('link', $link, $img) . '&nbsp; ';
                            }
                        } else {
                            $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text')))) . '&nbsp; ';
                        }
                        break;
                    case 'formaloffer':
                        $venues_html .= '&nbsp;' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&subtype=formaloffer&task=signup&xref=' . $event->xslug . '&id=' . $event->slug), JHTML::_('image', $imagepath . $elsettings->get('signup_formal_offer_img'), JText::_($elsettings->get('signup_formal_offer_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . '&nbsp; ';
                        break;
                }
            }
            $description .= $venues_html;
            $description .= '</td></tr></tbody></table>';
            $item = new JFeedItem();
            $item->title = $event->full_title;
            $item->link = $event_url;
            $item->description = $description;
            $item->date = '';
            $item->category = $event->venue;
            // loads item info into rss array
            $document->addItem($item);
        }
    }
Exemplo n.º 5
0
 /**
  * Saves the submitted venue to the database
  *
  * @since 0.5
  */
 function savevenue()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('Invalid Token');
     $acl = UserAcl::getInstance();
     //Sanitize
     $post = JRequest::get('post');
     $post['locdescription'] = JRequest::getVar('locdescription', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $isNew = $post['id'] ? false : true;
     if (!$isNew && !$acl->canEditVenue($post['id'])) {
         $msg = JText::_('COM_REDEVENT_USER_NOT_ALLOWED_TO_EDIT_THIS_VENUE');
         $this->setRedirect(JRoute::_(RedeventHelperRoute::getVenueEventsRoute($post['id'])), $msg, 'error');
         return;
     } else {
         if ($isNew && !$acl->canAddVenue()) {
             $msg = JText::_('COM_REDEVENT_USER_NOT_ALLOWED_TO_ADD_VENUE');
             $link = JRequest::getString('referer', JURI::base(), 'post');
             $this->setRedirect($link, $msg, 'error');
             return;
         }
     }
     $file = JRequest::getVar('userfile', '', 'files', 'array');
     $model = $this->getModel('editvenue');
     if ($returnid = $model->store($post, $file)) {
         $msg = JText::_('COM_REDEVENT_VENUE_SAVED');
         JPluginHelper::importPlugin('redevent');
         $dispatcher =& JDispatcher::getInstance();
         $res = $dispatcher->trigger('onVenueEdited', array($returnid, $isNew));
         $cache =& JFactory::getCache('com_redevent');
         $cache->clean();
     } else {
         $msg = '';
         RedeventError::raiseWarning('REDEVENT_GENERIC_ERROR', $model->getError());
     }
     $model->checkin();
     $link = JRequest::getString('referer', RedeventHelperRoute::getMyeventsRoute());
     $this->setRedirect($link, $msg);
 }
Exemplo n.º 6
0
 /**
  * Creates the Venueevents View
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $option = JRequest::getCmd('option');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $elsettings =& redEVENTHelper::config();
     $item = $menu->getActive();
     $params =& $mainframe->getParams('com_redevent');
     $uri =& JFactory::getURI();
     $acl = UserAcl::getInstance();
     //add css file
     if (!$params->get('custom_css')) {
         $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css');
     } else {
         $document->addStyleSheet($params->get('custom_css'));
     }
     $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->');
     // add js
     JHTML::_('behavior.mootools');
     // for filter hint
     $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js');
     // Request variables
     $limitstart = JRequest::getInt('limitstart');
     $limit = $mainframe->getUserStateFromRequest('com_redevent.venueevents.limit', 'limit', $params->def('display_num', 0), 'int');
     $pop = JRequest::getBool('pop');
     $task = JRequest::getWord('task');
     //get data from model
     $rows =& $this->get('Data');
     $venue =& $this->get('Venue');
     $total =& $this->get('Total');
     $customs =& $this->get('ListCustomFields');
     $customsfilters =& $this->get('CustomFilters');
     //does the venue exist?
     if ($venue->id == 0) {
         return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Venue_d_not_found', $venue->id));
     }
     //are events available?
     if (!$rows) {
         $noevents = 1;
     } else {
         $noevents = 0;
     }
     // Add needed scripts if the lightbox effect is enabled
     JHTML::_('behavior.modal');
     //add alternate feed link
     $link = 'index.php?option=com_redevent&view=venueevents&format=feed&id=' . $venue->id;
     $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
     $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
     $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
     $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     //pathway
     $pathway =& $mainframe->getPathWay();
     //create the pathway
     if ($task == 'archive') {
         $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug, 'archive'));
         $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $venue->venue, $link);
         $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&task=archive&pop=1&tmpl=component');
         $pagetitle = $venue->venue . ' - ' . JText::_('COM_REDEVENT_ARCHIVE');
     } else {
         $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug));
         $pathway->addItem($venue->venue, $link);
         $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&pop=1&tmpl=component');
         $pagetitle = $venue->venue;
     }
     $thumb_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'thumb');
     $list_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'default');
     //set Page title
     $this->document->setTitle($pagetitle);
     $document->setMetadata('keywords', $venue->meta_keywords);
     $document->setDescription(strip_tags($venue->meta_description));
     //Printfunction
     $params->def('print', !$mainframe->getCfg('hidePrint'));
     $params->def('icons', $mainframe->getCfg('icons'));
     if ($pop) {
         $params->set('popup', 1);
     }
     //Check if the user has access to the form
     $maintainer = $acl->canEditVenue($venue->id);
     //Generate Venuedescription
     if (!empty($venue->locdescription)) {
         //execute plugins
         $venuedescription = JHTML::_('content.prepare', $venue->locdescription);
     }
     //build the url
     if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") {
         $venue->url = 'http://' . $venue->url;
     }
     //prepare the url for output
     if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) {
         $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...';
     } else {
         $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES);
     }
     //create flag
     if ($venue->country) {
         $venue->countryimg = REOutput::getFlag($venue->country);
     }
     // Create the pagination object
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     //create select lists
     $lists = $this->_buildSortLists($elsettings);
     $state =& $this->get('state');
     $filter_customs = $state->get('filter_customs');
     $this->assign('lists', $lists);
     $this->assign('action', JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug)));
     $this->assignRef('rows', $rows);
     $this->assignRef('customs', $customs);
     $this->assignRef('noevents', $noevents);
     $this->assignRef('venue', $venue);
     $this->assignRef('print_link', $print_link);
     $this->assignRef('params', $params);
     $this->assignRef('editlink', $maintainer);
     $this->assignRef('venuedescription', $venuedescription);
     $this->assignRef('pageNav', $pageNav);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('item', $item);
     $this->assignRef('pagetitle', $pagetitle);
     $this->assignRef('task', $task);
     $this->assignRef('config', $elsettings);
     $this->assignRef('thumb_link', $thumb_link);
     $this->assignRef('list_link', $list_link);
     $this->assignRef('customsfilters', $customsfilters);
     $this->assign('filter_customs', $filter_customs);
     $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category'));
     $cols = redEVENTHelper::validateColumns($cols);
     $this->assign('columns', $cols);
     parent::display($tpl);
 }
Exemplo n.º 7
0
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with redEVENT; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
defined('_JEXEC') or die('Restricted access');
?>
<ul class="rf_thumbevents vcalendar">
	<?php 
foreach ($this->rows as $row) {
    ?>
	<?php 
    $img = redEVENTImage::getThumbUrl($row->datimage);
    $img = $img ? JHTML::image($img, $row->full_title) : false;
    $detaillink = JRoute::_(RedeventHelperRoute::getDetailsRoute($row->slug, $row->xslug));
    $venuelink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($row->venueslug));
    ?>
	<li class="rf_thumbevent vevent<?php 
    echo $row->featured ? ' featured' : '';
    ?>
">
		<?php 
    if ($img) {
        ?>
		<?php 
        echo JHTML::_('link', JRoute::_($detaillink), $img, array('class' => 'rf_img'));
        ?>
		<?php 
    } else {
        ?>
		<div class="rf_img"></div>
Exemplo n.º 8
0
" itemprop="url"><?php 
                    echo $this->escape($row->full_title);
                    ?>
</a></td>			
				<?php 
                    break;
                    ?>
				
				<?php 
                case 'venue':
                    ?>
					<td class="re_location" 
					    itemprop="location" itemscope itemtype="http://schema.org/Place">
						<?php 
                    if ($this->params->get('showlinkvenue', 1) == 1) {
                        echo $row->xref != 0 ? JHTML::link(JRoute::_(RedeventHelperRoute::getVenueEventsRoute($row->venueslug)), $this->escape($row->venue), 'itemprop="url"') : '-';
                    } else {
                        echo $row->xref ? $this->escape($row->venue) : '-';
                    }
                    ?>
						<?php 
                    if ($row->street) {
                        ?>
						<meta itemprop="streetAddress" content="<?php 
                        echo $row->street;
                        ?>
" />
						<?php 
                    }
                    ?>
						<?php 
Exemplo n.º 9
0
 function _getTag_venueimage()
 {
     if (!$this->getEvent()->getData()->locimage) {
         return '';
     }
     $venueimage = JHTML::image(JURI::root() . $this->getEvent()->getData()->locimage, $this->getEvent()->getData()->venue, array('title' => $this->getEvent()->getData()->venue));
     $venueimage = JHTML::link($this->absoluteUrls(RedeventHelperRoute::getVenueEventsRoute($this->getEvent()->getData()->venueslug)), $venueimage);
     return $venueimage;
 }
Exemplo n.º 10
0
 /**
  * Method to store the venue
  *
  * @access	public
  * @return	id
  * @since	0.9
  */
 function store($data, $file)
 {
     $mainframe =& JFactory::getApplication();
     $user =& JFactory::getUser();
     $elsettings =& redEVENTHelper::config();
     //Get mailinformation
     $SiteName = $mainframe->getCfg('sitename');
     $MailFrom = $mainframe->getCfg('mailfrom');
     $FromName = $mainframe->getCfg('fromname');
     $tzoffset = $mainframe->getCfg('offset');
     $params = $mainframe->getParams('com_redevent');
     $row =& JTable::getInstance('redevent_venues', '');
     //bind it to the table
     if (!$row->bind($data)) {
         RedeventError::raiseError(500, $this->_db->stderr());
         return false;
     }
     //Are we saving from an item edit?
     if ($row->id) {
         $row->modified = gmdate('Y-m-d H:i:s');
         $row->modified_by = $user->get('id');
     } else {
         //get IP, time and userid
         $row->created = gmdate('Y-m-d H:i:s');
         $row->author_ip = $elsettings->get('storeip', '1') ? getenv('REMOTE_ADDR') : 'DISABLED';
         $row->created_by = $user->get('id');
     }
     //Image upload
     //If image upload is required we will stop here if no file was attached
     if (empty($file['name']) && $params->get('edit_image', 1) == 2) {
         $this->setError(JText::_('COM_REDEVENT_IMAGE_EMPTY'));
         return false;
     }
     if (($params->get('edit_image', 1) == 2 || $params->get('edit_image', 1) == 1) && !empty($file['name'])) {
         jimport('joomla.filesystem.file');
         if ($params->get('default_image_path', 'redevent')) {
             $reldirpath = $params->get('default_image_path', 'redevent') . DS . 'venues' . DS;
         } else {
             $reldirpath = '';
         }
         $base_Dir = JPATH_SITE . DS . 'images' . DS . $reldirpath;
         //check the image
         $check = redEVENTImage::check($file, $elsettings);
         if ($check === false) {
             $mainframe->redirect($_SERVER['HTTP_REFERER']);
         }
         //sanitize the image filename
         $filename = redEVENTImage::sanitize($base_Dir, $file['name']);
         $filepath = $base_Dir . $filename;
         if (!JFile::upload($file['tmp_name'], $filepath)) {
             $this->setError(JText::_('COM_REDEVENT_UPLOAD_FAILED'));
             return false;
         } else {
             $row->locimage = 'images' . DS . $reldirpath . $filename;
         }
     } else {
         //keep image if edited and left blank
         $row->locimage = $row->curimage;
     }
     //end image upload if
     //Check description
     $editoruser = ELUser::editoruser();
     if (!$editoruser) {
         //check description --> wipe out code
         $row->locdescription = strip_tags($row->locdescription, '<br><br/>');
         //convert the linux \n (Mac \r, Win \r\n) to <br /> linebreaks
         $row->locdescription = str_replace(array("\r\n", "\r", "\n"), "<br />", $row->locdescription);
         //cut too long words
         $row->locdescription = wordwrap($row->locdescription, 75, " ", 1);
         //check length
         $length = JString::strlen($row->locdescription);
         if ($length > $params->get('max_description', 1000)) {
             // if required shorten it
             $row->locdescription = JString::substr($row->locdescription, 0, $params->get('max_description', 1000));
             //if shortened add ...
             $row->locdescription = $row->locdescription . '...';
         }
     }
     $row->venue = trim(JFilterOutput::ampReplace($row->venue));
     //Make sure the data is valid
     if (!$row->check($elsettings)) {
         $this->setError($row->getError());
         return false;
     }
     //is this an edited venue or not?
     //after store we allways have an id
     $edited = $row->id ? $row->id : false;
     //store it in the db
     if (!$row->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // update the event category xref
     // first, delete current rows for this event
     $query = ' DELETE FROM #__redevent_venue_category_xref WHERE venue_id = ' . $this->_db->Quote($row->id);
     $this->_db->setQuery($query);
     if (!$this->_db->query()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // insert new ref
     foreach ((array) $data['categories'] as $cat_id) {
         $query = ' INSERT INTO #__redevent_venue_category_xref (venue_id, category_id) VALUES (' . $this->_db->Quote($row->id) . ', ' . $this->_db->Quote($cat_id) . ')';
         $this->_db->setQuery($query);
         if (!$this->_db->query()) {
             $this->setError($this->_db->getErrorMsg());
             return false;
         }
     }
     // attachments
     if ($params->get('allow_attachments', 1)) {
         REAttach::store('venue' . $row->id);
     }
     jimport('joomla.utilities.mail');
     $link = JRoute::_(JURI::base() . RedeventHelperRoute::getVenueEventsRoute($row->id), false);
     //create mail
     if ($params->get('mailinform') == 2 || $params->get('mailinform') == 3) {
         $mail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('COM_REDEVENT_MAIL_VENUE_PUBLISHED', $link) : JText::_('COM_REDEVENT_MAIL_VENUE_UNPUBLISHED');
         if ($edited) {
             $modified_ip = getenv('REMOTE_ADDR');
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('COM_REDEVENT_MAIL_EDIT_VENUE', $user->name, $user->username, $user->email, $modified_ip, $edited, $row->venue, $row->url, $row->street, $row->plz, $row->city, $row->country, $row->locdescription, $state);
             $mail->setSubject($SiteName . JText::_('COM_REDEVENT_EDIT_VENUE_MAIL'));
         } else {
             $created = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('COM_REDEVENT_MAIL_NEW_VENUE', $user->name, $user->username, $user->email, $row->author_ip, $created, $row->venue, $row->url, $row->street, $row->plz, $row->city, $row->country, $row->locdescription, $state);
             $mail->setSubject($SiteName . JText::_('COM_REDEVENT_NEW_VENUE_MAIL'));
         }
         $receivers = explode(',', trim($params->get('mailinformrec')));
         $mail->addRecipient($receivers);
         $mail->setSender(array($MailFrom, $FromName));
         $mail->setBody($mailbody);
         if (!$mail->Send()) {
             RedeventHelperLog::simpleLog('Error sending created/edited venue notification to site owner');
         }
     }
     //create the mail for the user
     if ($params->get('mailinformuser') == 2 || $params->get('mailinformuser') == 3) {
         $usermail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('COM_REDEVENT_USER_MAIL_VENUE_PUBLISHED', $link) : JText::_('COM_REDEVENT_USER_MAIL_VENUE_UNPUBLISHED');
         if ($edited) {
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('COM_REDEVENT_USER_MAIL_EDIT_VENUE', $user->name, $user->username, $edited, $row->venue, $row->url, $row->street, $row->plz, $row->city, $row->country, $row->locdescription, $state);
             $usermail->setSubject($SiteName . JText::_('COM_REDEVENT_EDIT_USER_VENUE_MAIL'));
         } else {
             $created = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('COM_REDEVENT_USER_MAIL_NEW_VENUE', $user->name, $user->username, $created, $row->venue, $row->url, $row->street, $row->plz, $row->city, $row->country, $row->locdescription, $state);
             $usermail->setSubject($SiteName . JText::_('COM_REDEVENT_NEW_USER_VENUE_MAIL'));
         }
         $usermail->addRecipient($user->email);
         $usermail->setSender(array($MailFrom, $FromName));
         $usermail->setBody($mailbody);
         if (!$usermail->Send()) {
             RedeventHelperLog::simpleLog('Error sending created/edited venue notification to venue owner');
         }
     }
     //update item order
     $row->reorder();
     return $row->id;
 }
Exemplo n.º 11
0
 /**
  * Logic to get the venue
  *
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     if (empty($this->_venue)) {
         if ($this->_id) {
             // Load the Event data
             $query = ' SELECT v.id, v.venue, v.url, v.street, v.plz, v.city, v.state, v.country, v.locdescription, v.locimage, v.latitude, v.longitude, v.company, ' . ' COUNT( a.id ) AS assignedevents,' . ' CASE WHEN CHAR_LENGTH(v.alias) THEN CONCAT_WS(\':\', v.id, v.alias) ELSE v.id END as slug' . ' FROM #__redevent_venues as v' . ' LEFT JOIN #__redevent_event_venue_xref AS a ON a.venueid = v.id AND a.published = 1' . ' WHERE v.id = ' . $this->_db->Quote($this->_id) . ' GROUP BY v.id ';
             $this->_db->setQuery($query);
             $venue = $this->_db->loadObject();
             //Create image information
             $venue->limage = redEVENTImage::flyercreator($venue->locimage);
             //Generate Venuedescription
             if (!empty($venue->locdescription)) {
                 //execute plugins
                 $venue->locdescription = JHTML::_('content.prepare', $venue->locdescription);
             }
             //build the url
             if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") {
                 $venue->url = 'http://' . $venue->url;
             }
             //prepare the url for output
             if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) {
                 $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...';
             } else {
                 $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES);
             }
             //create flag
             if ($venue->country) {
                 $venue->countryimg = REOutput::getFlag($venue->country);
             }
             //create target link
             $venue->targetlink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug));
             $venue->categories = $this->_getVenueCategories($this->_id);
             $this->_venue = $venue;
         }
     }
     return $this->_venue;
 }
Exemplo n.º 12
0
 /**
  * Method to get the Venues
  *
  * @access public
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $menu->getParams($item->id);
     $elsettings =& redEVENTHelper::config();
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         // Get a reference to the global cache object.
         $cache =& JFactory::getCache('redevent');
         $this->_data = $cache->call(array('RedeventModelVenuesmap', '_getResultList'), $query);
         $k = 0;
         for ($i = 0; $i < count($this->_data); $i++) {
             $venue =& $this->_data[$i];
             //Create image information
             $venue->limage = redEVENTImage::flyercreator($venue->locimage);
             //Generate Venuedescription
             if (!empty($venue->locdescription)) {
                 //execute plugins
                 $venue->locdescription = JHTML::_('content.prepare', $venue->locdescription);
             }
             //build the url
             if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") {
                 $venue->url = 'http://' . $venue->url;
             }
             //prepare the url for output
             if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) {
                 $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...';
             } else {
                 $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES);
             }
             //create flag
             if ($venue->country) {
                 $venue->countryimg = REOutput::getFlag($venue->country);
             }
             //create target link
             $venue->targetlink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug));
             $k = 1 - $k;
         }
     }
     return $this->_data;
 }
Exemplo n.º 13
0
<?php 
    if ($this->params->get('events_rsscal', 0)) {
        ?>
<span class="events-rsscal">
	<?php 
        echo JHTML::link(JRoute::_(RedeventHelperRoute::getVenueEventsRoute($this->venue->id, null, 'rsscal') . '&format=feed'), JHTML::image('components/com_redevent/assets/images/rsscal2.0.png', JText::_('COM_REDEVENT_EXPORT_RSSCAL')));
        ?>
</span>
<?php 
    }
    ?>

<?php 
    if ($this->params->get('events_ical', 1)) {
        ?>
<span class="events-ical">
	<?php 
        echo JHTML::link(JRoute::_(RedeventHelperRoute::getVenueEventsRoute($this->venue->id, null) . '&format=raw&layout=ics'), JHTML::image('components/com_redevent/assets/images/iCal2.0.png', JText::_('COM_REDEVENT_EXPORT_ICS')));
        ?>
</span>
<?php 
    }
    ?>
</div>
<!-- end: exports -->
<?php 
}
?>

</div>