Exemplo n.º 1
1
 function export()
 {
     global $mainframe;
     $model = $this->getModel('attendees');
     $datas = $model->getData();
     header('Content-Type: text/x-csv');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     header('Content-Disposition: attachment; filename=attendees.csv');
     header('Pragma: no-cache');
     $k = 0;
     $export = '';
     $col = array();
     for ($i = 0, $n = count($datas); $i < $n; $i++) {
         $data =& $datas[$i];
         $col[] = str_replace("\"", "\"\"", $data->name);
         $col[] = str_replace("\"", "\"\"", $data->username);
         $col[] = str_replace("\"", "\"\"", $data->email);
         $col[] = str_replace("\"", "\"\"", JHTML::Date($data->uregdate, JText::_('DATE_FORMAT_LC2')));
         $col[] = str_replace("\"", "\"\"", $data->uid);
         for ($j = 0; $j < count($col); $j++) {
             $export .= "\"" . $col[$j] . "\"";
             if ($j != count($col) - 1) {
                 $export .= ";";
             }
         }
         $export .= "\r\n";
         $col = '';
         $k = 1 - $k;
     }
     echo $export;
     $mainframe->close();
 }
Exemplo n.º 2
0
     $number = "{$num}. ";
 }
 // add description in tooltip
 if ($view_tooltip && $files[$i]->description != '') {
     $link_text = '<a href="' . $link . '">' . JHTML::tooltip(strip_tags(substr($files[$i]->description, 0, $view_tooltip_length)) . $short_char, JText::_('MOD_JDOWNLOADS_LAST_UPDATED_DESCRIPTION_TITLE'), $files[$i]->file_title . ' ' . $version . $files[$i]->release, $files[$i]->file_title . ' ' . $version . $files[$i]->release) . '</a>';
 } else {
     $link_text = '<a href="' . $link . '">' . $files[$i]->file_title . ' ' . $version . $files[$i]->release . '</a>';
 }
 $html .= '<tr style="vertical-align:top;"><td style="text-align:' . $alignment . ';">' . $number . $files_pic . $link_text . '</td>';
 // add the modified date
 if ($view_date) {
     if ($files[$i]->modified_date) {
         if ($view_date_same_line) {
             $html .= '<td style="text-align:' . $date_alignment . ';"><small>' . $view_date_text . '&nbsp;' . substr(JHTML::Date($files[$i]->modified_date, $date_format), 0, 10) . '</small></td>';
         } else {
             $html .= '</tr><tr><td style="text-align:' . $date_alignment . ';"><small>' . $view_date_text . '&nbsp;' . substr(JHTML::Date($files[$i]->modified_date, $date_format), 0, 10) . '</small></td>';
         }
     }
 }
 $html .= '</tr>';
 // add the first download screenshot when exists and activated in options
 if ($view_thumbnails) {
     if ($first_image) {
         $thumbnail = '<img class="img" src="' . $thumbfolder . $first_image . '" style="text-align:top;padding:5px;border:' . $border . ';" width="' . $view_thumbnails_size . '" height="' . $view_thumbnails_size . '" alt="' . $files[$i]->file_title . '" />';
     } else {
         // use placeholder
         if ($view_thumbnails_dummy) {
             $thumbnail = '<img class="img" src="' . $thumbfolder . 'no_pic.gif" style="text-align:top;padding:5px;border:' . $border . ';" width="' . $view_thumbnails_size . '" height="' . $view_thumbnails_size . '" alt="" />';
         }
     }
     if ($thumbnail) {
Exemplo n.º 3
0
 /**
  * Method to store the venue
  *
  * @access	public
  * @return	id
  * @since	0.9
  */
 function store($data, $file)
 {
     global $mainframe;
     jimport('joomla.utilities.date');
     $user =& JFactory::getUser();
     $elsettings = ELHelper::config();
     //Get mailinformation
     $SiteName = $mainframe->getCfg('sitename');
     $MailFrom = $mainframe->getCfg('mailfrom');
     $FromName = $mainframe->getCfg('fromname');
     $tzoffset = $mainframe->getCfg('offset');
     $row =& JTable::getInstance('eventlist_venues', '');
     //bind it to the table
     if (!$row->bind($data)) {
         JError::raiseError(500, $this->_db->stderr());
         return false;
     }
     //Are we saving from an item edit?
     if ($row->id) {
         $owner = ELUser::isOwner($row->id, 'venues');
         //check if user is allowed to edit venues
         $allowedtoeditvenue = ELUser::editaccess($elsettings->venueowner, $owner, $elsettings->venueeditrec, $elsettings->venueedit);
         if ($allowedtoeditvenue == 0) {
             $row->checkin();
             $mainframe->enqueueMessage(JText::_('NO ACCESS'));
             return false;
         }
         $date = new JDate($row->modified, $tzoffset);
         $row->modified = $date->toMySQL();
         $row->modified_by = $user->get('id');
         //Is editor the owner of the venue
         //This extra Check is needed to make it possible
         //that the venue is published after an edit from an owner
         if ($elsettings->venueowner == 1 && $owner == $user->get('id')) {
             $owneredit = 1;
         } else {
             $owneredit = 0;
         }
     } else {
         //check if user is allowed to submit new venues
         $delloclink = ELUser::validate_user($elsettings->locdelrec, $elsettings->deliverlocsyes);
         if ($delloclink == 0) {
             $mainframe->enqueueMessage(JText::_('NO ACCESS'));
             return false;
         }
         //get IP, time and userid
         $date = new JDate($row->created, $tzoffset);
         $row->created = $date->toMySQL();
         $row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED';
         $row->created_by = $user->get('id');
         //set owneredit to false
         $owneredit = 0;
     }
     //Image upload
     //If image upload is required we will stop here if no file was attached
     if (empty($file['name']) && $elsettings->imageenabled == 2) {
         $this->setError(JText::_('IMAGE EMPTY'));
         return false;
     }
     if (($elsettings->imageenabled == 2 || $elsettings->imageenabled == 1) && !empty($file['name'])) {
         jimport('joomla.filesystem.file');
         $base_Dir = JPATH_SITE . '/images/eventlist/venues/';
         //check the image
         $check = ELImage::check($file, $elsettings);
         if ($check === false) {
             $mainframe->redirect($_SERVER['HTTP_REFERER']);
         }
         //sanitize the image filename
         $filename = ELImage::sanitize($base_Dir, $file['name']);
         $filepath = $base_Dir . $filename;
         if (!JFile::upload($file['tmp_name'], $filepath)) {
             $this->setError(JText::_('UPLOAD FAILED'));
             return false;
         } else {
             $row->locimage = $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 datdescription --> wipe out code
         $row->locdescription = strip_tags($row->locdescription, '<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 > $elsettings->datdesclimit) {
             // if required shorten it
             $row->locdescription = JString::substr($row->locdescription, 0, $elsettings->datdesclimit);
             //if shortened add ...
             $row->locdescription = $row->locdescription . '...';
         }
     }
     $row->venue = trim(JFilterOutput::ampReplace($row->venue));
     //Autopublish
     //check if the user has the required rank for autopublish
     $autopublloc = ELUser::validate_user($elsettings->locpubrec, $elsettings->autopublocate);
     //Check if user is the owner of the venue
     //If yes enable autopublish
     if ($autopublloc || $owneredit) {
         $row->published = 1;
     } else {
         $row->published = 0;
     }
     //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;
     }
     jimport('joomla.utilities.mail');
     $link = JURI::base() . JRoute::_('index.php?view=details&id=' . $row->id, false);
     //create mail
     if ($elsettings->mailinform == 2 || $elsettings->mailinform == 3) {
         $mail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('MAIL VENUE PUBLISHED', $link) : JText::_('MAIL VENUE UNPUBLISHED');
         if ($edited) {
             $modified_ip = getenv('REMOTE_ADDR');
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('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::_('EDIT VENUE MAIL'));
         } else {
             $created = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('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::_('NEW VENUE MAIL'));
         }
         $receivers = explode(',', trim($elsettings->mailinformrec));
         $mail->addRecipient($receivers);
         $mail->setSender(array($MailFrom, $FromName));
         $mail->setBody($mailbody);
         $sent = $mail->Send();
     }
     //create the mail for the user
     if ($elsettings->mailinformuser == 2 || $elsettings->mailinformuser == 3) {
         $usermail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('USER MAIL VENUE PUBLISHED', $link) : JText::_('USER MAIL VENUE UNPUBLISHED');
         if ($edited) {
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('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::_('EDIT USER VENUE MAIL'));
         } else {
             $created = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('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::_('NEW USER VENUE MAIL'));
         }
         $usermail->addRecipient($user->email);
         $usermail->setSender(array($MailFrom, $FromName));
         $usermail->setBody($mailbody);
         $sent = $usermail->Send();
     }
     //update item order
     $row->reorder();
     return $row->id;
 }
Exemplo n.º 4
0
 /**
  * This method handles any mailings triggered by an venue store action
  *
  * @access	public
  * @param   int 	$venue_id 	 Integer Venue identifier
  * @param   int 	$edited 	 Integer Venue new or edited
  * @return	boolean
  * @since 1.0
  */
 public function onVenueEdited($venue_id, $edited)
 {
     //simple, skip if processing not needed
     if (!$this->params->get('newvenue_mail_user', '1') && !$this->params->get('newvenue_mail_admin', '0') && !$this->params->get('editvenue_mail_user', '1') && !$this->params->get('editvenue_mail_admin', '0')) {
         return true;
     }
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $query = ' SELECT v.id, v.published, v.venue, v.city, v.street, v.plz, v.url, v.country, v.locdescription, v.created, v.modified,' . ' CASE WHEN CHAR_LENGTH(v.alias) THEN CONCAT_WS(\':\', v.id, v.alias) ELSE v.id END as slug' . ' FROM #__eventlist_venues AS v' . ' WHERE v.id = ' . (int) $venue_id;
     $db->setQuery($query);
     if (!($venue = $db->loadObject())) {
         if ($db->getErrorNum()) {
             JError::raiseWarning('0', $db->getErrorMsg());
         }
         return false;
     }
     //link for event
     $link = JRoute::_(JURI::base() . 'index.php?option=com_eventlist&view=venueevents&id=' . $venue->slug, false);
     //strip description from tags / scripts, etc...
     $text_description = JFilterOutput::cleanText($venue->locdescription);
     $modified_ip = getenv('REMOTE_ADDR');
     $edited = JHTML::Date($venue->modified, JText::_('DATE_FORMAT_LC2'));
     $state = $venue->published ? JText::sprintf('MAIL VENUE PUBLISHED', $link) : JText::_('MAIL VENUE UNPUBLISHED');
     if (edited) {
         if ($this->params->get('editvenue_mail_admin', '0')) {
             $data = new stdClass();
             $edited = JHTML::Date($venue->modified, JText::_('DATE_FORMAT_LC2'));
             $data->subject = JText::sprintf('EDIT VENUE MAIL', $this->_SiteName);
             $data->body = JText::sprintf('MAIL EDIT VENUE', $user->name, $user->username, $user->email, $modified_ip, $edited, $venue->venue, $venue->url, $venue->street, $venue->plz, $venue->city, $venue->country, $text_description, $state);
             $data->receivers = $this->_receivers;
             $this->_mailer($data);
         }
     } else {
         if ($this->params->get('newvenue_mail_admin', '0')) {
             $data = new stdClass();
             $created = JHTML::Date($venue->created, JText::_('DATE_FORMAT_LC2'));
             $data->subject = JText::sprintf('NEW VENUE MAIL', $this->_SiteName);
             $data->body = JText::sprintf('MAIL NEW VENUE', $user->name, $user->username, $user->email, $venue->author_ip, $created, $venue->venue, $venue->url, $venue->street, $venue->plz, $venue->city, $venue->country, $text_description, $state);
             $data->receivers = $this->_receivers;
             $this->_mailer($data);
         }
     }
     //overwrite $state with usermail text
     $state = $venue->published ? JText::sprintf('USER MAIL VENUE PUBLISHED', $link) : JText::_('USER MAIL VENUE UNPUBLISHED');
     if (edited) {
         if ($this->params->get('editvenue_mail_user', '1')) {
             $data = new stdClass();
             $edited = JHTML::Date($venue->modified, JText::_('DATE_FORMAT_LC2'));
             $data->body = JText::sprintf('USER MAIL EDIT VENUE', $user->name, $user->username, $isNew, $venue->venue, $venue->url, $venue->street, $venue->plz, $venue->city, $venue->country, $text_description, $state);
             $data->subject = JText::sprintf('EDIT USER VENUE MAIL', $this->_SiteName);
             $data->receivers = $user->email;
             $this->_mailer($data);
         }
     } else {
         if ($this->params->get('newvenue_mail_user', '1')) {
             $data = new stdClass();
             $created = JHTML::Date($venue->created, JText::_('DATE_FORMAT_LC2'));
             $data->body = JText::sprintf('USER MAIL NEW VENUE', $user->name, $user->username, $created, $venue->venue, $venue->url, $venue->street, $venue->plz, $venue->city, $venue->country, $text_description, $state);
             $data->subject = JText::sprintf('NEW USER VENUE MAIL', $this->_SiteName);
             $data->receivers = $user->email;
             $this->_mailer($data);
         }
     }
     return true;
 }
Exemplo n.º 5
0
    echo $row->author;
    ?>
</a><br />
					<?php 
    echo JText::_('EMAIL') . ': ';
    ?>
<a href="mailto:<?php 
    echo $row->email;
    ?>
"><?php 
    echo $row->email;
    ?>
</a><br />
					<?php 
    $created = JHTML::Date($row->created, JText::_('DATE_FORMAT_LC2'));
    $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
    $ip = $row->author_ip == 'DISABLED' ? JText::_('DISABLED') : $row->author_ip;
    $image = JHTML::_('image', 'administrator/templates/' . $this->template . '/images/menu/icon-16-info.png', JText::_('NOTES'));
    $overlib = JText::_('CREATED AT') . ': ' . $created . '<br />';
    $overlib .= JText::_('WITH IP') . ': ' . $ip . '<br />';
    if ($row->modified != '0000-00-00 00:00:00') {
        $overlib .= JText::_('EDITED AT') . ': ' . $edited . '<br />';
        $overlib .= JText::_('EDITED FROM') . ': ' . $row->editor . '<br />';
    }
    ?>
					<span class="editlinktip hasTip" title="<?php 
    echo JText::_('EVENT STATS');
    ?>
::<?php 
    echo $overlib;
    ?>
Exemplo n.º 6
0
    ?>
</td>
		<td><?php 
    echo $this->escape($item->asset_id);
    ?>
</td>
		<td><?php 
    echo $this->escape($item->to_addr);
    ?>
</td>
		<td><?php 
    echo JHTML::Date($item->created, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
		<td><?php 
    echo $item->status == 0 ? 'N/A' : JHTML::Date($item->processed, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
		<td align="center"><i class="<?php 
    echo $item->html ? 'icon-ok' : 'icon-remove';
    ?>
"></i></td>
		<td align="center">
			<div class="badge <?php 
    echo $item->status == 1 ? 'badge-success' : 'badge-warning';
    ?>
 tooltip-hover"
				title="<?php 
    echo $item->status == 1 ? JText::_('COM_CJLIB_SENT') : JText::_('COM_CJLIB_PENDING');
    ?>
">
Exemplo n.º 7
0
 public function getFileDate($filename, $date)
 {
     $dateO = '';
     $ddt = $this->params->get('display_date_type', 0);
     if ((int) $ddt > 0) {
         if ($filename != '') {
             $dateO = PhocaDownloadFile::getFileTime($filename, $ddt);
         }
     } else {
         $dateO = JHTML::Date($date, JText::_('DATE_FORMAT_LC3'));
     }
     return $dateO;
 }
<?php

defined('_JEXEC') or die('Restricted access');
foreach ($this->comments as $comment) {
    ?>
	<p>&nbsp;</p>
	<p><strong><?php 
    echo htmlspecialchars($comment->full_name);
    ?>
</strong>
	<em><?php 
    echo JHTML::Date($comment->comment_date);
    ?>
</em></p>
	<p><?php 
    echo htmlspecialchars($comment->comment_text);
    ?>
</p>
	<?php 
}
Exemplo n.º 9
0
 $html .= '<tr valign="top"><td align="' . $alignment . '">' . $number . $files_pic . $link_text . '</td>';
 if ($view_date) {
     if ($view_date_text) {
         $view_date_text .= '&nbsp;';
     }
     if ($view_date_same_line) {
         if ($view_user) {
             $html .= '<td align="' . $date_alignment . '" class="td_jd_ldf_date_row">' . $view_date_text . JHTML::Date($files[$i]->log_datetime, $date_format, false) . $view_user_by . ' ' . $files[$i]->username . '</td>';
         } else {
             $html .= '<td align="' . $date_alignment . '" class="td_jd_ldf_date_row">' . $view_date_text . JHTML::Date($files[$i]->log_datetime, $date_format, false) . '</td>';
         }
     } else {
         if ($view_user) {
             $html .= '</tr><tr><td align="' . $date_alignment . '" class="td_jd_ldf_date_row">' . $view_date_text . JHTML::Date($files[$i]->log_datetime, $date_format, false) . $view_user_by . ' ' . $files[$i]->username . '</td>';
         } else {
             $html .= '</tr><tr><td align="' . $date_alignment . '" class="td_jd_ldf_date_row">' . $view_date_text . JHTML::Date($files[$i]->log_datetime, $date_format, false) . '</td>';
         }
     }
 } else {
     if ($view_user) {
         $html .= '</tr><tr><td align="' . $date_alignment . '" class="td_jd_ldf_date_row">' . $view_user_by . ' ' . $files[$i]->username . '</td>';
     }
 }
 $html .= '</tr>';
 // add category info
 if ($cat_show_text2) {
     if ($cat_show_as_link) {
         if ($files[$i]->menu_cat_itemid) {
             $html .= '<tr style="vertical-align:top;"><td style="text-align:' . $alignment . ';font-size:' . $cat_show_text_size . '; color:' . $cat_show_text_color . ';"><a href="index.php?option=' . $option . '&amp;view=category&catid=' . $files[$i]->cat_id . '&amp;Itemid=' . $files[$i]->menu_cat_itemid . '">' . $cat_show_text2 . '</a></td></tr>';
         } else {
             $html .= '<tr style="vertical-align:top;"><td style="text-align:' . $alignment . ';font-size:' . $cat_show_text_size . '; color:' . $cat_show_text_color . ';"><a href="index.php?option=' . $option . '&amp;view=category&catid=' . $files[$i]->cat_id . '&amp;Itemid=' . $Itemid . '">' . $cat_show_text2 . '</a></td></tr>';
Exemplo n.º 10
0
	public static function getFileTime($filename, $function, $format = "d. M Y") {
		
		$path			= PhocaDownloadPath::getPathSet();
		$fileNameAbs	= JPath::clean($path['orig_abs'] . DS . $filename);
		if (JFile::exists($fileNameAbs)) {
			switch($function) {
				case 2:
					$fileTime = filectime($fileNameAbs);
				break;
				case 3:
					$fileTime = fileatime($fileNameAbs);
				break;
				case 1:
				default:
					$fileTime = filemtime($fileNameAbs);
				break;
			}
			
			$fileTime = JHTML::Date($fileTime, $format);
		} else {
			$fileTime = '';
		}
		return $fileTime;
	}
Exemplo n.º 11
0
        ?>
</span></td>
						<td class="center"><span class="badge badge-info"><?php 
        echo JText::_($row->secure ? 'FLEXI_YES' : 'FLEXI_NO');
        ?>
</span></td>
					<?php 
    }
    ?>
					
					<td class="center"><?php 
    echo $row->uploader;
    ?>
</td>
					<td class="center"><?php 
    echo JHTML::Date($row->uploaded, JText::_('DATE_FORMAT_LC4') . " H:i:s");
    ?>
</td>
					
					<?php 
    if (!$this->folder_mode) {
        ?>
					<td class="center"><?php 
        echo $row->id;
        ?>
</td>
					<?php 
    }
    ?>
				</tr>
				<?php 
Exemplo n.º 12
0
 /**
  * Method to store the event
  *
  * @access	public
  * @return	id
  * @since	0.9
  */
 function store($data, $file)
 {
     global $mainframe;
     $user =& JFactory::getUser();
     $elsettings =& ELHelper::config();
     //Get mailinformation
     $SiteName = $mainframe->getCfg('sitename');
     $MailFrom = $mainframe->getCfg('mailfrom');
     $FromName = $mainframe->getCfg('fromname');
     $tzoffset = $mainframe->getCfg('offset');
     $row =& JTable::getInstance('eventlist_events', '');
     //Sanitize
     $data['datdescription'] = JRequest::getVar('datdescription', '', 'post', 'string', JREQUEST_ALLOWRAW);
     //include the metatags
     $data['meta_description'] = addslashes(htmlspecialchars(trim($elsettings->meta_description)));
     if (strlen($data['meta_description']) > 255) {
         $data['meta_description'] = substr($data['meta_description'], 0, 254);
     }
     $data['meta_keywords'] = addslashes(htmlspecialchars(trim($elsettings->meta_keywords)));
     if (strlen($data['meta_keywords']) > 200) {
         $data['meta_keywords'] = substr($data['meta_keywords'], 0, 199);
     }
     $curimage = JRequest::getVar('curimage', '', 'post', 'string');
     //bind it to the table
     if (!$row->bind($data)) {
         JError::raiseError(500, $this->_db->stderr());
         return false;
     }
     //Are we saving from an item edit?
     if ($row->id) {
         //check if user is allowed to edit events
         $editaccess = ELUser::editaccess($elsettings->eventowner, $row->created_by, $elsettings->eventeditrec, $elsettings->eventedit);
         $maintainer = ELUser::ismaintainer();
         if ($maintainer || $editaccess) {
             $allowedtoeditevent = 1;
         }
         if ($allowedtoeditevent == 0) {
             JError::raiseError(403, JText::_('NO ACCESS'));
         }
         $row->modified = gmdate('Y-m-d H:i:s');
         $row->modified_by = $user->get('id');
         /*
          * Is editor the owner of the event
          * This extra Check is needed to make it possible
          * that the venue is published after an edit from an owner
          */
         if ($elsettings->venueowner == 1 && $row->created_by == $user->get('id')) {
             $owneredit = 1;
         } else {
             $owneredit = 0;
         }
     } else {
         //check if user is allowed to submit new events
         $maintainer = ELUser::ismaintainer();
         $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes);
         if ($maintainer || $genaccess) {
             $dellink = 1;
         }
         if ($dellink == 0) {
             JError::raiseError(403, JText::_('NO ACCESS'));
         }
         //get IP, time and userid
         $row->created = gmdate('Y-m-d H:i:s');
         $row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED';
         $row->created_by = $user->get('id');
         //Set owneredit to false
         $owneredit = 0;
     }
     /*
      * Autopublish
      * check if the user has the required rank for autopublish
      */
     $autopubev = ELUser::validate_user($elsettings->evpubrec, $elsettings->autopubl);
     if ($autopubev || $owneredit) {
         $row->published = 1;
     } else {
         $row->published = 0;
     }
     //Image upload
     //If image upload is required we will stop here if no file was attached
     if (empty($file['name']) && $elsettings->imageenabled == 2) {
         $this->setError(JText::_('IMAGE EMPTY'));
         return false;
     }
     if (($elsettings->imageenabled == 2 || $elsettings->imageenabled == 1) && !empty($file['name'])) {
         jimport('joomla.filesystem.file');
         $base_Dir = JPATH_SITE . '/images/eventlist/events/';
         //check the image
         $check = ELImage::check($file, $elsettings);
         if ($check === false) {
             $mainframe->redirect($_SERVER['HTTP_REFERER']);
         }
         //sanitize the image filename
         $filename = ELImage::sanitize($base_Dir, $file['name']);
         $filepath = $base_Dir . $filename;
         if (!JFile::upload($file['tmp_name'], $filepath)) {
             $this->setError(JText::_('UPLOAD FAILED'));
             return false;
         } else {
             $row->datimage = $filename;
         }
     } else {
         //keep image if edited and left blank
         $row->datimage = $curimage;
     }
     //end image if
     $editoruser = ELUser::editoruser();
     if (!$editoruser) {
         //check datdescription --> wipe out code
         $row->datdescription = strip_tags($row->datdescription, '<br><br/>');
         //convert the linux \n (Mac \r, Win \r\n) to <br /> linebreaks
         $row->datdescription = str_replace(array("\r\n", "\r", "\n"), "<br />", $row->datdescription);
         // cut too long words
         $row->datdescription = wordwrap($row->datdescription, 75, ' ', 1);
         //check length
         $length = JString::strlen($row->datdescription);
         if ($length > $elsettings->datdesclimit) {
             //too long then shorten datdescription
             $row->datdescription = JString::substr($row->datdescription, 0, $elsettings->datdesclimit);
             //add ...
             $row->datdescription = $row->datdescription . '...';
         }
     }
     $row->title = trim(JFilterOutput::ampReplace($row->title));
     //set registration regarding the el settings
     switch ($elsettings->showfroregistra) {
         case 0:
             $row->registra = 0;
             break;
         case 1:
             $row->registra = 1;
             break;
         case 2:
             $row->registra = $row->registra;
             break;
     }
     switch ($elsettings->showfrounregistra) {
         case 0:
             $row->unregistra = 0;
             break;
         case 1:
             $row->unregistra = 1;
             break;
         case 2:
             if ($elsettings->showfroregistra >= 1) {
                 $row->unregistra = $row->unregistra;
             } else {
                 $row->unregistra = 0;
             }
             break;
     }
     //Make sure the table is valid
     if (!$row->check($elsettings)) {
         $this->setError($row->getError());
         return false;
     }
     //is this an edited event or not?
     //after store we allways have an id
     $edited = $row->id ? $row->id : false;
     //store it in the db
     if (!$row->store(true)) {
         JError::raiseError(500, $this->_db->stderr());
         return false;
     }
     $this->_db->setQuery('SELECT * FROM #__eventlist_venues WHERE id = ' . (int) $row->locid);
     $rowloc = $this->_db->loadObject();
     jimport('joomla.utilities.mail');
     $link = JURI::base() . JRoute::_('index.php?view=details&id=' . $row->id, false);
     //create the mail for the site owner
     if ($elsettings->mailinform == 1 || $elsettings->mailinform == 3) {
         $mail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('MAIL EVENT PUBLISHED', $link) : JText::_('MAIL EVENT UNPUBLISHED');
         if ($edited) {
             $modified_ip = getenv('REMOTE_ADDR');
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('MAIL EDIT EVENT', $user->name, $user->username, $user->email, $modified_ip, $edited, $row->title, $row->dates, $row->times, $rowloc->venue, $rowloc->city, $row->datdescription, $state);
             $mail->setSubject($SiteName . JText::_('EDIT EVENT MAIL'));
         } else {
             $created = JHTML::Date($row->created, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('MAIL NEW EVENT', $user->name, $user->username, $user->email, $row->author_ip, $created, $row->title, $row->dates, $row->times, $rowloc->venue, $rowloc->city, $row->datdescription, $state);
             $mail->setSubject($SiteName . JText::_('NEW EVENT MAIL'));
         }
         $receivers = explode(',', trim($elsettings->mailinformrec));
         $mail->addRecipient($receivers);
         $mail->setSender(array($MailFrom, $FromName));
         $mail->setBody($mailbody);
         $sent = $mail->Send();
     }
     //mail end
     //create the mail for the user
     if ($elsettings->mailinformuser == 1 || $elsettings->mailinformuser == 3) {
         $usermail = JFactory::getMailer();
         $state = $row->published ? JText::sprintf('USER MAIL EVENT PUBLISHED', $link) : JText::_('USER MAIL EVENT UNPUBLISHED');
         if ($edited) {
             $edited = JHTML::Date($row->modified, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('USER MAIL EDIT EVENT', $user->name, $user->username, $edited, $row->title, $row->dates, $row->times, $rowloc->venue, $rowloc->city, $row->datdescription, $state);
             $usermail->setSubject($SiteName . JText::_('EDIT USER EVENT MAIL'));
         } else {
             $created = JHTML::Date($row->created, JText::_('DATE_FORMAT_LC2'));
             $mailbody = JText::sprintf('USER MAIL NEW EVENT', $user->name, $user->username, $created, $row->title, $row->dates, $row->times, $rowloc->venue, $rowloc->city, $row->datdescription, $state);
             $usermail->setSubject($SiteName . JText::_('NEW USER EVENT MAIL'));
         }
         $usermail->addRecipient($user->email);
         $usermail->setSender(array($MailFrom, $FromName));
         $usermail->setBody($mailbody);
         $sent = $usermail->Send();
     }
     return $row->id;
 }
Exemplo n.º 13
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.º 14
0
    ?>
</a></td>
								<td><?php 
    echo $row->survey_key;
    ?>
</td>
								<td><?php 
    echo $this->escape($row->category);
    ?>
</td>
								<td><?php 
    echo $this->escape($row->name) . ' (' . $this->escape($row->username) . ')';
    ?>
</td>
								<td><?php 
    echo JHTML::Date($row->created, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
								<td>
									<div><?php 
    echo $row->publish_up;
    ?>
</div>
									<div><?php 
    echo $row->publish_down;
    ?>
</div>
								</td>
								<td class="center">
									<a href="<?php 
    echo JRoute::_('index.php?option=' . S_APP_NAME . '&view=reports&task=responses&id=' . $row->id);
Exemplo n.º 15
0
        <a href="<?php 
    echo $link;
    ?>
"><?php 
    echo stripslashes($row->title);
    ?>
</a>
      </td>
      <td>
        <?php 
    echo $row->type;
    ?>
      </td>
      <td align="center">
        <?php 
    echo $row->date == "0000-00-00" ? "" : JHTML::Date($row->date);
    ?>
      </td>
      <td>
        <?php 
    echo $row->format;
    ?>
      </td>
      <td align="center">
        <?php 
    echo $published;
    ?>
      </td>
    </tr>
    <?php 
    $k = 1 - $k;
Exemplo n.º 16
0
    ?>
 <?php 
    echo JText::_('COM_EVENTGALLERY_EVENTS_FILECOUNT_FILES');
    ?>
</small><br/>

				</td>

                <td>
					<?php 
    echo $folder->getDisplayName();
    ?>
				</td>
                <td class="nowrap">
                    <?php 
    echo JHTML::Date($row->date, JText::_('DATE_FORMAT_LC3'));
    ?>
<br>
                </td>
                
			</tr>
			<?php 
}
?>
		</table>
		<div class="pagination pagination-toolbar">
			<?php 
echo $this->pagination->getPagesLinks();
?>
		</div>
	</div>
Exemplo n.º 17
0
    ?>
</td>
				<td><?php 
    echo $row->username;
    ?>
</td>
				<td><?php 
    echo $row->email;
    ?>
</td>
				<td><?php 
    echo $row->uip;
    ?>
</td>
				<td><?php 
    echo JHTML::Date($row->uregdate, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
				<td><?php 
    echo $row->uid;
    ?>
</td>
			</tr>
			<?php 
    $k = 1 - $k;
}
?>
		</tbody>

	</table>
Exemplo n.º 18
0
							</span>
						<? endif; ?>
					<? endif; ?>
				</div>
				<div>
					<?php 
echo @helper('string.summary', array('text' => $result->text));
?>
				</div>
				<? if ( $params->get( 'show_date' )) : ?>
				<div class="small<?php 
echo @escape($params->get('pageclass_sfx'));
?>
">
					<? if($result->created) : ?>
						<?php 
echo JHTML::Date($result->created);
?>
					<? endif; ?>
				</div>
				<? endif; ?>
			</fieldset>
		<? $i++;
		endforeach;?>
		</td>
	</tr>
</table>
<div class="search-pagination"><?php 
echo @helper('paginator.pagination', array('total' => $total));
?>
<div style="clear: both;"></div></div>
Exemplo n.º 19
0
 public static function getDateTime()
 {
     $date = JFactory::getDate();
     $jVersion = self::getJoomlaVersion();
     if (JOOMLA30 == true) {
         $date = JFactory::getDate(JHTML::Date($date, "Y-m-d H:i:s", false));
         return $date->toSQL();
     } elseif (JOOMLA16 == true) {
         $date = JFactory::getDate(JHTML::Date($date, "Y-m-d H:i:s", false));
         return $date->toMySQL();
     } else {
         $date = JFactory::getDate(JHTML::Date($date->_date, "%Y-%m-%d %H:%M:%S"));
         return $date->toMySQL();
     }
 }
Exemplo n.º 20
0
    ?>
			
			<td align="center"><?php 
    echo $row->size;
    ?>
</td>
			<td align="center"><?php 
    echo $row->hits;
    ?>
</td>
			<td align="center"><?php 
    echo $row->uploader;
    ?>
</td>
			<td align="center"><?php 
    echo JHTML::Date($row->uploaded, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
<?php 
    if (!$this->folder_mode) {
        ?>
			<td align="center"><?php 
        echo $row->id;
        ?>
</td>
<?php 
    }
    ?>
		</tr>
		<?php 
    $k = 1 - $k;
Exemplo n.º 21
0
    if ($ce = getContentElementByName($content_element)) {
        $content_elements[] = $ce;
    }
}
// I didn't get any valid content element, get all avaible
if (!$content_elements) {
    $content_elements = getInstalledContentElements();
}
foreach ($content_elements as $ce) {
    if (!empty($results[$ce->name])) {
        if ($show_ce_label) {
            echo "<div class=\"cp_ce_label\">" . $ce->label . "</div>";
        }
        foreach ($results[$ce->name] as $ce_name => $row) {
            if ($row->created) {
                $created = JHTML::Date($row->created);
            } else {
                $created = '';
            }
            echo "<div class=\"cp_result\">\n";
            switch ($view) {
                case 'title':
                    showTitle($row, $params);
                    break;
                case 'fullintro':
                    showTitle($row, $params);
                    showFullIntro($ce, $row, $searchword, $params);
                    break;
                case 'intro':
                default:
                    showTitle($row, $params);
Exemplo n.º 22
0
?>
    </div>

    <div style="display:none">
        <?php 
if (isset($this->entries[0])) {
    echo '<meta itemprop="image" content="' . $this->entries[0]->getSharingImageUrl() . '" />';
    echo '<link rel="image_src" tpe="image/jpeg" href="' . $this->entries[0]->getSharingImageUrl() . '" />';
}
?>
        <span itemprop="startDate" content="<?php 
echo $this->folder->getDate();
?>
">
            <?php 
echo JHTML::Date($this->folder->getDate());
?>
        </span>
    </div>

    <?php 
echo $this->loadSnippet('imageset/imagesetselection');
?>
   
    <?php 
echo $this->loadSnippet('event/tiles_thumbnails');
?>
    
    <?php 
echo $this->loadSnippet('event/inc/paging_bottom');
?>
Exemplo n.º 23
0
 /**
  * Creates the page's display
  *
  * @since 1.0
  */
 function display($tpl = null)
 {
     //initialize variables
     $option = JRequest::getVar('option');
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $db = JFactory::getDBO();
     $menus = $app->getMenu();
     $menu = $menus->getActive();
     $uri = JFactory::getURI();
     $pathway = $app->getPathway();
     // Get view's Model
     $model = $this->getModel();
     $error = '';
     $rows = null;
     $total = 0;
     $form_id = $form_name = "searchForm";
     // Get parameters via model
     $params = $model->getParams();
     // Get various data from the model
     $areas = $this->get('areas');
     $state = $this->get('state');
     $searchword = $state->get('keyword');
     $searchphrase = $state->get('match');
     $searchordering = $state->get('ordering');
     // ***********************************************************
     // some parameter shortcuts common with advanced search plugin
     // ***********************************************************
     $canseltypes = $params->get('canseltypes', 1);
     $txtmode = $params->get('txtmode', 0);
     // 0: BASIC Index, 1: ADVANCED Index without search fields user selection, 2: ADVANCED Index with search fields user selection
     // Get if text searching according to specific (single) content type
     $show_txtfields = $params->get('show_txtfields', 1);
     //0:hide, 1:according to content, 2:use custom configuration
     $show_txtfields = $txtmode ? 0 : $show_txtfields;
     // disable this flag if using BASIC index for text search
     // Get if filtering according to specific (single) content type
     $show_filters = $params->get('show_filters', 1);
     //0:hide, 1:according to content, 2:use custom configuration
     // Force single type selection and showing the content type selector
     $type_based_search = $show_filters == 1 || $show_txtfields == 1;
     $canseltypes = $type_based_search ? 1 : $canseltypes;
     // ********************************
     // Load needed JS libs & CSS styles
     // ********************************
     FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
     flexicontent_html::loadFramework('jQuery');
     flexicontent_html::loadFramework('flexi_tmpl_common');
     // Add css files to the document <head> section (also load CSS joomla template override)
     if (!$params->get('disablecss', '')) {
         $document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/flexicontent.css', FLEXI_VERSION);
         $document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/flexi_filters.css', FLEXI_VERSION);
         //$document->addCustomTag('<!--[if IE]><style type="text/css">.floattext {zoom:1;}</style><![endif]-->');
     }
     if (file_exists(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'css' . DS . 'flexicontent.css')) {
         $document->addStyleSheetVersion($this->baseurl . '/templates/' . $app->getTemplate() . '/css/flexicontent.css', FLEXI_VERSION);
     }
     // **********************************************************
     // Calculate a (browser window) page title and a page heading
     // **********************************************************
     // Verify menu item points to current FLEXIcontent object
     if ($menu) {
         $view_ok = 'search' == @$menu->query['view'];
         $menu_matches = $view_ok;
         //$menu_params = FLEXI_J16GE ? $menu->params : new JParameter($menu->params);  // Get active menu item parameters
     } else {
         $menu_matches = false;
     }
     // MENU ITEM matched, use its page heading (but use menu title if the former is not set)
     if ($menu_matches) {
         $default_heading = FLEXI_J16GE ? $menu->title : $menu->name;
         // Cross set (show_) page_heading / page_title for compatibility of J2.5+ with J1.5 template (and for J1.5 with J2.5 template)
         $params->def('page_heading', $params->get('page_title', $default_heading));
         $params->def('page_title', $params->get('page_heading', $default_heading));
         $params->def('show_page_heading', $params->get('show_page_title', 0));
         $params->def('show_page_title', $params->get('show_page_heading', 0));
     } else {
         // Clear some menu parameters
         //$params->set('pageclass_sfx',	'');  // CSS class SUFFIX is behavior, so do not clear it ?
         // Calculate default page heading (=called page title in J1.5), which in turn will be document title below !! ...
         // meta_params->get('page_title') is meant for <title> but let's use as ... default page heading
         $default_heading = JText::_('FLEXI_SEARCH');
         // Decide to show page heading (=J1.5 page title), this default to no
         $show_default_heading = 0;
         // Set both (show_) page_heading / page_title for compatibility of J2.5+ with J1.5 template (and for J1.5 with J2.5 template)
         $params->set('page_title', $default_heading);
         $params->set('page_heading', $default_heading);
         $params->set('show_page_heading', $show_default_heading);
         $params->set('show_page_title', $show_default_heading);
     }
     // Prevent showing the page heading if ... currently no reason
     if (0) {
         $params->set('show_page_heading', 0);
         $params->set('show_page_title', 0);
     }
     // ************************************************************
     // Create the document title, by from page title and other data
     // ************************************************************
     // Use the page heading as document title, (already calculated above via 'appropriate' logic ...)
     $doc_title = $params->get('page_title');
     // Check and prepend or append site name to page title
     if ($doc_title != $app->getCfg('sitename')) {
         if ($app->getCfg('sitename_pagetitles', 0) == 1) {
             $doc_title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $doc_title);
         } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
             $doc_title = JText::sprintf('JPAGETITLE', $doc_title, $app->getCfg('sitename'));
         }
     }
     // Finally, set document title
     $document->setTitle($doc_title);
     // ************************
     // Set document's META tags
     // ************************
     // Workaround for Joomla not setting the default value for 'robots', so component must do it
     $app_params = $app->getParams();
     if ($_mp = $app_params->get('robots')) {
         $document->setMetadata('robots', $_mp);
     }
     // Overwrite with menu META data if menu matched
     if ($menu_matches) {
         if ($_mp = $menu->params->get('menu-meta_description')) {
             $document->setDescription($_mp);
         }
         if ($_mp = $menu->params->get('menu-meta_keywords')) {
             $document->setMetadata('keywords', $_mp);
         }
         if ($_mp = $menu->params->get('robots')) {
             $document->setMetadata('robots', $_mp);
         }
         if ($_mp = $menu->params->get('secure')) {
             $document->setMetadata('secure', $_mp);
         }
     }
     // ********************************************************************
     // Get Content Types allowed for user selection in the Search Form
     // Also retrieve their configuration, plus the currently selected types
     // ********************************************************************
     // Get them from configuration
     $contenttypes = $params->get('contenttypes', array());
     // Sanitize them
     $contenttypes = !is_array($contenttypes) ? array($contenttypes) : $contenttypes;
     $contenttypes = array_unique(array_map('intval', $contenttypes));
     // Make sure these are integers since we will be using them UNQUOTED
     // Force hidden content type selection if only 1 content type was initially configured
     $canseltypes = count($contenttypes) == 1 ? 0 : $canseltypes;
     // Type data and configuration (parameters), if no content types specified then all will be retrieved
     $typeData = flexicontent_db::getTypeData(implode(",", $contenttypes));
     $contenttypes = array();
     foreach ($typeData as $tdata) {
         $contenttypes[] = $tdata->id;
     }
     // Get Content Types to use either those currently selected in the Search Form, or those hard-configured in the search menu item
     if ($canseltypes) {
         $form_contenttypes = JRequest::getVar('contenttypes', array());
         // Sanitize them
         $form_contenttypes = !is_array($form_contenttypes) ? array($form_contenttypes) : $form_contenttypes;
         $form_contenttypes = array_unique(array_map('intval', $form_contenttypes));
         // Make sure these are integers since we will be using them UNQUOTED
         $_contenttypes = array_intersect($contenttypes, $form_contenttypes);
         if (!empty($_contenttypes)) {
             $contenttypes = $_contenttypes;
         }
         // catch empty case: no content types were given or not-allowed content types were passed
     }
     // Check for zero content type (can occur during sanitizing content ids to integers)
     if (!empty($contenttypes)) {
         foreach ($contenttypes as $i => $v) {
             if (!strlen($contenttypes[$i])) {
                 unset($contenttypes[$i]);
             }
         }
     }
     // Type based seach, get a single content type (first one, if more than 1 were given ...)
     if ($type_based_search && !empty($contenttypes)) {
         $single_contenttype = reset($contenttypes);
         $contenttypes = array($single_contenttype);
     } else {
         $single_contenttype = false;
     }
     // *************************************
     // Text Search Fields of the search form
     // *************************************
     if (!$txtmode) {
         $txtflds = array();
         $fields_text = array();
     } else {
         $txtflds = '';
         if ($show_txtfields) {
             if ($show_txtfields == 1) {
                 $txtflds = $single_contenttype ? $typeData[$single_contenttype]->params->get('searchable', '') : '';
             } else {
                 $txtflds = $params->get('txtflds', '');
             }
         }
         // Sanitize them
         $txtflds = preg_replace("/[\"'\\\\]/u", "", $txtflds);
         $txtflds = array_unique(preg_split("/\\s*,\\s*/u", $txtflds));
         if (!strlen($txtflds[0])) {
             unset($txtflds[0]);
         }
         // Create a comma list of them
         $txtflds_list = count($txtflds) ? "'" . implode("','", $txtflds) . "'" : '';
         // Retrieve field properties/parameters, verifying the support to be used as Text Search Fields
         // This will return all supported fields if field limiting list is empty
         $fields_text = FlexicontentFields::getSearchFields($key = 'id', $indexer = 'advanced', $txtflds_list, $contenttypes, $load_params = true, 0, 'search');
         if (empty($fields_text)) {
             // all entries of field limiting list were invalid , get ALL
             if (!empty($contenttypes)) {
                 $fields_text = FlexicontentFields::getSearchFields($key = 'id', $indexer = 'advanced', null, $contenttypes, $load_params = true, 0, 'search');
             } else {
                 $fields_text = array();
             }
         }
     }
     // ********************************
     // Filter Fields of the search form
     // ********************************
     // Get them from type configuration or from search menu item
     $filtflds = '';
     if ($show_filters) {
         if ($show_filters == 1) {
             $filtflds = $single_contenttype ? $typeData[$single_contenttype]->params->get('filters', '') : '';
         } else {
             $filtflds = $params->get('filtflds', '');
         }
     }
     // Sanitize them
     $filtflds = preg_replace("/[\"'\\\\]/u", "", $filtflds);
     $filtflds = array_unique(preg_split("/\\s*,\\s*/u", $filtflds));
     if (!strlen($filtflds[0])) {
         unset($filtflds[0]);
     }
     // Create a comma list of them
     $filtflds_list = count($filtflds) ? "'" . implode("','", $filtflds) . "'" : '';
     // Retrieve field properties/parameters, verifying the support to be used as Filter Fields
     // This will return all supported fields if field limiting list is empty
     if (count($filtflds)) {
         $filters_tmp = FlexicontentFields::getSearchFields($key = 'name', $indexer = 'advanced', $filtflds_list, $contenttypes, $load_params = true, 0, 'filter');
         // Use custom order
         $filters = array();
         if ($canseltypes && $show_filters) {
             foreach ($filtflds as $field_name) {
                 if (empty($filters_tmp[$field_name])) {
                     continue;
                 }
                 $filter_id = $filters_tmp[$field_name]->id;
                 $filters[$filter_id] = $filters_tmp[$field_name];
             }
         } else {
             foreach ($filters_tmp as $filter) {
                 $filters[$filter->id] = $filter;
                 // index by filter_id in this case too (for consistency, although we do not use the array index ?)
             }
         }
         unset($filters_tmp);
     }
     // If configured filters were not found/invalid for the current content type(s)
     // then retrieve all fields marked as filterable for the give content type(s) this is useful to list per content type filters automatically, even when not set or misconfigured
     if (empty($filters)) {
         if (!empty($contenttypes)) {
             $filters = FlexicontentFields::getSearchFields($key = 'id', $indexer = 'advanced', null, $contenttypes, $load_params = true, 0, 'filter');
         } else {
             $filters = array();
         }
     }
     // ****************************************
     // Create Form Elements (the 'lists' array)
     // ****************************************
     $lists = array();
     // *** Selector of Content Types
     if ($canseltypes) {
         $types = array();
         if ($show_filters) {
             $types[] = JHTML::_('select.option', '', JText::_('FLEXI_PLEASE_SELECT'));
         }
         foreach ($typeData as $type) {
             $types[] = JHTML::_('select.option', $type->id, JText::_($type->name));
         }
         $multiple_param = $show_filters ? ' onchange="adminFormPrepare(this.form); this.form.submit();" ' : ' multiple="multiple" ';
         $attribs = $multiple_param . ' size="5" class="fc_field_filter use_select2_lib fc_label_internal fc_prompt_internal"';
         $attribs .= ' data-fc_label_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_CLICK_TO_LIST'), 's') . '"';
         $attribs .= ' data-fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
         $lists['contenttypes'] = JHTML::_('select.genericlist', $types, 'contenttypes[]', $attribs, 'value', 'text', empty($form_contenttypes) ? '' : $form_contenttypes, 'contenttypes');
         /*
         $checked = !count($form_contenttypes) || !strlen($form_contenttypes[0]);
         $checked_attr = $checked ? 'checked="checked"' : '';
         $checked_class = $checked ? 'fc_highlight' : '';
         
         $lists['contenttypes']  = '<ul class="fc_field_filter fc_checkradio_group">';
         $lists['contenttypes'] .= ' <li class="fc_checkradio_option fc_checkradio_special">';
         $lists['contenttypes'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\', 1);" ';
         $lists['contenttypes'] .= '    id="_contenttypes_0" type="checkbox" name="contenttypes[0]" ';
         $lists['contenttypes'] .= '    value="" '.$checked_attr.' class="fc_checkradio" />';
         $lists['contenttypes'] .= '  <label class="'.$checked_class.'" for="_contenttypes_0">';
         $lists['contenttypes'] .= '   -'.JText::_('FLEXI_ALL').'-';
         $lists['contenttypes'] .= '  </label>';
         $lists['contenttypes'] .= ' </li>';
         foreach($typeData as $type) {
         	$checked = in_array($type->value, $form_contenttypes);
         	$checked_attr = $checked ? 'checked=checked' : '';
         	$checked_class = $checked ? ' fc_highlight' : '';
         	$lists['contenttypes'] .= ' <li class="fc_checkradio_option">';
         	$lists['contenttypes'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\');" ';
         	$lists['contenttypes'] .= '    id="_contenttypes_'.$type->value.'" type="checkbox" name="contenttypes[]" ';
         	$lists['contenttypes'] .= '    value="'.$type->value.'" '.$checked_attr.' class="fc_checkradio" />';
         	$lists['contenttypes'] .= '  <label class="'.$checked_class.'" for="_contenttypes_'.$type->value.'">';
         	$lists['contenttypes'] .= '   '.JText::_($type->text);
         	$lists['contenttypes'] .= '  </label>';
         	$lists['contenttypes'] .= ' </li>';
         }
         $lists['contenttypes'] .= '</ul>';
         */
     }
     // *** Selector of Fields for text searching
     if ($txtmode == 2 && count($fields_text)) {
         // Get selected text fields in the Search Form
         $form_txtflds = JRequest::getVar('txtflds', array());
         if (!$form_txtflds || empty($form_txtflds)) {
             $form_txtflds = array();
             //array('__FC_ALL__'); //array_keys($fields_text);
         }
         $attribs = ' multiple="multiple" size="5" class="fc_field_filter use_select2_lib fc_label_internal fc_prompt_internal"';
         $attribs .= ' data-fc_label_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_CLICK_TO_LIST'), 's') . '"';
         $attribs .= ' data-fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
         $lists['txtflds'] = JHTML::_('select.genericlist', $fields_text, 'txtflds[]', $attribs, 'name', 'label', $form_txtflds, 'txtflds');
         /*
         $checked = !count($form_txtflds) || !strlen($form_txtflds[0]);
         $checked_attr = $checked ? 'checked="checked"' : '';
         $checked_class = $checked ? 'fc_highlight' : '';
         
         $lists['txtflds']  = '<ul class="fc_field_filter fc_checkradio_group">';
         $lists['txtflds'] .= ' <li class="fc_checkradio_option fc_checkradio_special">';
         $lists['txtflds'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\', 1);" ';
         $lists['txtflds'] .= '    id="_txtflds_0" type="checkbox" name="txtflds[0]" value="" ';
         $lists['txtflds'] .= '    value="" '.$checked_attr.' class="fc_checkradio" />';
         $lists['txtflds'] .= '  <label class="'.$checked_class.'" for="_txtflds_0">';
         $lists['txtflds'] .= '   -'.JText::_('FLEXI_ALL').'-';
         $lists['txtflds'] .= '  </label>';
         $lists['txtflds'] .= ' </li>';
         foreach($fields_text as $field) {
         	$checked = in_array($field->name, $form_txtflds);
         	$checked_attr = $checked ? 'checked=checked' : '';
         	$checked_class = $checked ? ' fc_highlight' : '';
         	$lists['txtflds'] .= ' <li class="fc_checkradio_option">';
         	$lists['txtflds'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\');" ';
         	$lists['txtflds'] .= '    id="_txtflds_'.$field->id.'" type="checkbox" name="txtflds[]" ';
         	$lists['txtflds'] .= '    value="'.$field->name.'" '.$checked_attr.' class="fc_checkradio" />';
         	$lists['txtflds'] .= '  <label class="class=""'.$checked_class.'" for="_txtflds_'.$field->id.'">';
         	$lists['txtflds'] .= '   '.JText::_($field->label);
         	$lists['txtflds'] .= '  </label>';
         	$lists['txtflds'] .= ' </li>';
         }
         $lists['txtflds'] .= '</ul>';
         */
     }
     // *** Selector of FLEXIcontent Results Ordering
     if ($orderby_override = $params->get('orderby_override', 1)) {
         $lists['orderby'] = flexicontent_html::ordery_selector($params, $form_id, $autosubmit = 0);
     }
     // *** Selector of Pagination Limit
     if ($limit_override = $params->get('limit_override', 1)) {
         $lists['limit'] = flexicontent_html::limit_selector($params, $form_id, $autosubmit = 0);
     }
     // *** Selector of non-FLEXIcontent Results Ordering
     if ($show_searchordering = $params->get('show_searchordering', 1)) {
         // built select lists
         $orders = array();
         $orders[] = JHTML::_('select.option', 'newest', JText::_('FLEXI_ADV_NEWEST_FIRST'));
         $orders[] = JHTML::_('select.option', 'oldest', JText::_('FLEXI_ADV_OLDEST_FIRST'));
         $orders[] = JHTML::_('select.option', 'popular', JText::_('FLEXI_ADV_MOST_POP'));
         $orders[] = JHTML::_('select.option', 'alpha', JText::_('FLEXI_ADV_ALPHA'));
         $orders[] = JHTML::_('select.option', 'category', JText::_('FLEXI_ADV_SEARCH_SEC_CAT'));
         $lists['ordering'] = JHTML::_('select.genericlist', $orders, 'o', 'class="fc_field_filter use_select2_lib"', 'value', 'text', $searchordering, 'ordering');
     }
     // *** Selector for usage of Search Text
     if ($show_searchphrase = $params->get('show_searchphrase', 1)) {
         $searchphrase_names = array('natural' => 'FLEXI_NATURAL_PHRASE', 'natural_expanded' => 'FLEXI_NATURAL_PHRASE_GUESS_RELEVANT', 'all' => 'FLEXI_ALL_WORDS', 'any' => 'FLEXI_ANY_WORDS', 'exact' => 'FLEXI_EXACT_PHRASE');
         $phrases = array();
         foreach ($searchphrase_names as $searchphrase_value => $searchphrase_name) {
             $_obj = new stdClass();
             $_obj->value = $searchphrase_value;
             $_obj->text = $searchphrase_name;
             $phrases[] = $_obj;
         }
         $lists['searchphrase'] = JHTML::_('select.genericlist', $phrases, 'p', 'class="fc_field_filter use_select2_lib"', 'value', 'text', $searchphrase, 'searchphrase', $_translate = true);
         /*$lists['searchphrase']  = '<ul class="fc_field_filter fc_checkradio_group">';
         		foreach ($searchphrase_names as $searchphrase_value => $searchphrase_name) {
         			$lists['searchphrase'] .= ' <li class="fc_checkradio_option fc_checkradio_special">';
         			$checked = $searchphrase_value == $searchphrase;
         			$checked_attr = $checked ? 'checked=checked' : '';
         			$checked_class = $checked ? 'fc_highlight' : '';
         			$lists['searchphrase'] .= '  <input href="javascript:;" onclick="fc_toggleClassGrp(this.parentNode, \'fc_highlight\');" id="searchphrase_'.$searchphrase_value.'" type="radio" name="p" value="'.$searchphrase_value.'" '.$checked_attr.' />';
         			$lists['searchphrase'] .= '  <label class="'.$checked_class.'" style="display:inline-block; white-space:nowrap;" for="searchphrase_'.$searchphrase_value.'">';
         			$lists['searchphrase'] .=     JText::_($searchphrase_name);
         			$lists['searchphrase'] .= '  </label>';
         			$lists['searchphrase'] .= ' </li>';
         		}
         		$lists['searchphrase']  .= '</ul>';*/
     }
     // *** Selector for filter combination
     /*if($show_filtersop = $params->get('show_filtersop', 1)) {
     			$default_filtersop = $params->get('default_filtersop', 'all');
     			$filtersop = JRequest::getVar('filtersop', $default_filtersop);
     			$filtersop_arr		= array();
     			$filtersop_arr[] = JHTML::_('select.option',  'all', JText::_( 'FLEXI_SEARCH_ALL' ) );
     			$filtersop_arr[] = JHTML::_('select.option',  'any', JText::_( 'FLEXI_SEARCH_ANY' ) );
     			$lists['filtersop']= JHTML::_('select.radiolist',  $filtersop_arr, 'filtersop', '', 'value', 'text', $filtersop );
     		}*/
     // *** Selector of Search Areas
     // If showing this is disabled, then FLEXIcontent (advanced) search model will not use all search areas,
     // but instead it will use just 'flexicontent' search area, that is the search area of FLEXIcontent (advanced) search plugin
     if ($params->get('show_searchareas', 0)) {
         // Get Content Types currently selected in the Search Form
         $form_areas = JRequest::getVar('areas', array());
         //if ( empty($form_areas) || !count($form_areas) )  $form_areas = array('flexicontent');
         $checked = empty($form_areas) || !count($form_areas);
         $checked_attr = $checked ? 'checked="checked"' : '';
         $checked_class = $checked ? 'fc_highlight' : '';
         // Create array of area options
         $options = array();
         foreach ($areas['search'] as $area => $label) {
             $_area = new stdClass();
             $_area->text = $label;
             $_area->value = $area;
             $options[] = $_area;
         }
         $attribs = ' multiple="multiple" size="5" class="fc_field_filter use_select2_lib fc_label_internal fc_prompt_internal"';
         $attribs .= ' data-fc_label_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_CLICK_TO_LIST'), 's') . '"';
         $attribs .= ' data-fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
         $lists['areas'] = JHTML::_('select.genericlist', $options, 'areas[]', $attribs, 'value', 'text', $form_areas, 'areas', $do_jtext = true);
         /*
         $lists['areas']  = '<ul class="fc_field_filter fc_checkradio_group">';
         $lists['areas'] .= ' <li class="fc_checkradio_option fc_checkradio_special">';
         $lists['areas'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\', 1);" ';
         $lists['areas'] .= '    id="area_0" type="checkbox" name="area[0]" ';
         $lists['areas'] .= '    value="" '.$checked_attr.' class="fc_checkradio" />';
         $lists['areas'] .= '  <label class="'.$checked_class.'" for="_txtflds_0">';
         $lists['areas'] .= '   -'.JText::_('FLEXI_CONTENT_ONLY').'-';
         $lists['areas'] .= '  </label>';
         $lists['areas'] .= ' </li>';
         foreach($areas['search'] as $area_name => $area_label) {
         	$checked = in_array($area_name, $form_areas);
         	$checked_attr = $checked ? 'checked=checked' : '';
         	$checked_class = $checked ? ' fc_highlight' : '';
         	$lists['areas'] .= ' <li class="fc_checkradio_option">';
         	$lists['areas'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\');" ';
         	$lists['areas'] .= '    id="area_'.$area_name.'" type="checkbox" name="areas[]" ';
         	$lists['areas'] .= '    value="'.$area_name.'" '.$checked_attr.' class="fc_checkradio" />';
         	$lists['areas'] .= '  <label class="'.$checked_class.'" for="area_'.$area_name.'">';
         	$lists['areas'] .= '  '.JText::_($area_label);
         	$lists['areas'] .= '  </label>';
         	$lists['areas'] .= ' </li>';
         }
         $lists['areas'] .= '</ul>';
         */
     }
     // log the search
     FLEXIadvsearchHelper::logSearch($searchword);
     //limit searchword
     $min_word_len = $app->getUserState($option . '.min_word_len', 0);
     $min = $min_word_len ? $min_word_len : $params->get('minchars', 3);
     $max = $params->get('maxchars', 200);
     if (FLEXIadvsearchHelper::limitSearchWord($searchword, $min, $max)) {
         $error = JText::sprintf('FLEXI_SEARCH_MESSAGE', $min, $max);
     }
     // sanitise searchword
     if (FLEXIadvsearchHelper::santiseSearchWord($searchword, $state->get('match'), $min)) {
         $error = JText::_('IGNOREKEYWORD');
     }
     if (!$searchword && count(JRequest::get('post'))) {
         //$error = JText::_( 'Enter a search keyword' );
     }
     // put the filtered results back into the model
     // for next release, the checks should be done in the model perhaps...
     $state->set('keyword', $searchword);
     $filter_word_like_any = $params->get('filter_word_like_any', 0);
     if (!$error) {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'helpers' . DS . 'route.php';
         $results = $this->get('data');
         $total = $this->get('total');
         $pageNav = $this->get('pagination');
         // URL-encode filter values
         foreach ($_GET as $i => $v) {
             if (substr($i, 0, 6) === "filter") {
                 $_revert = array('%21' => '!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')');
                 $v = str_replace('&', '__amp__', $v);
                 $v = strtr(rawurlencode($v), $_revert);
                 $pageNav->setAdditionalUrlParam($i, $v);
             }
         }
         if ($state->get('match') == 'exact') {
             $searchwords = array($searchword);
             //$needle = $searchword;
         } else {
             $searchwords = preg_split("/\\s+/u", $searchword);
             //print_r($searchwords);
         }
         // Create regular expressions, for highlighting the matched words
         $w_regexp_highlight = array();
         foreach ($searchwords as $n => $_word) {
             $w_regexp_highlight[$_word] = mb_strlen($_word, 'utf-8') <= 2 || $n + 1 < count($searchwords) ? '#\\b(' . preg_quote($_word, '#') . ')\\b#iu' : '#\\b(' . preg_quote($_word, '#') . ')#iu';
         }
         for ($i = 0; $i < count($results); $i++) {
             $result =& $results[$i];
             if (strlen($searchwords[0])) {
                 $parts = FLEXIadvsearchHelper::prepareSearchContent($result->text, $params->get('text_chars', 200), $searchwords);
                 //if( count($parts)>1 ) { echo "<pre>"; print_r($parts); exit;}
                 foreach ($parts as $word_found => $part) {
                     if (!$word_found) {
                         continue;
                     }
                     $searchRegex = $w_regexp_highlight[$word_found];
                     $parts[$word_found] = preg_replace($searchRegex, '_fc_highlight_start_\\0_fc_highlight_end_', $part);
                 }
                 $result->text = implode($parts, " <br/> ");
                 $replace_count_total = 0;
                 // This is for LIKE %word% search for languages without spaces
                 if ($filter_word_like_any) {
                     if (strlen($word_found) <= 2) {
                         continue;
                     }
                     // Do not highlight too small words, since we do not consider spaces
                     foreach ($searchwords as $_word) {
                         $searchRegex = '#(' . preg_quote($_word, '#') . '[^\\s]*)#iu';
                         $result->text = preg_replace($searchRegex, '_fc_highlight_start_\\0_fc_highlight_end_', $result->text, 1, $replace_count);
                         if ($replace_count) {
                             $replace_count_total++;
                         }
                     }
                 }
                 $result->text = str_replace('_fc_highlight_start_', '<span class="highlight">', $result->text);
                 $result->text = str_replace('_fc_highlight_end_', '</span>', $result->text);
                 // Add some message about matches
                 /*if ( $state->get('match')=='any' ) {
                 			$text_search_header = "<u><b>".JText::sprintf('Text Search matched at least %d %% (%d out of %d words)', $replace_count_total/count($searchwords) * 100, $replace_count_total, count($searchwords)).": </b></u><br/>";
                 		} else if ( $state->get('match')=='all' ) {
                 			$text_search_header = "<u><b>".JText::sprintf('Text Search (all %d words required)', count($searchwords)).": </b></u><br/>";
                 		} else if ( $state->get('match')=='exact' ) {
                 			$text_search_header = "<u><b>".JText::_('Text Search (exact phrase)').": </b></u><br/>";
                 		} else if ( $state->get('match')=='natural_expanded' ) {
                 			$text_search_header = "<u><b>".JText::_('Text Search (phrase, guessing related)').": </b></u><br/>";
                 		} else if ( $state->get('match')=='natural' ) {
                 			$text_search_header = "<u><b>".JText::_('Text Search (phrase)').": </b></u><br/>";
                 		}
                 		$result->text = $text_search_header . $result->text;*/
             } else {
                 $parts = FLEXIadvsearchHelper::prepareSearchContent($result->text, $params->get('text_chars', 200), array());
                 $result->text = implode($parts, " <br/> ");
             }
             /*if ( !empty($result->fields_text) ) {
             			$result->text .= "<br/><u><b>".JText::_('Attribute filters matched')." : </b></u>";
             			$result->fields_text = str_replace('[span=highlight]', '<span class="highlight">', $result->fields_text);
             			$result->fields_text = str_replace('[/span]', '</span>', $result->fields_text);
             			$result->fields_text = str_replace('[br /]', '<br />', $result->fields_text);
             			$result->text .= $result->fields_text;
             		}*/
             $result->text = str_replace('[[[', '<', $result->text);
             $result->text = str_replace(']]]', '>', $result->text);
             $result->created = $result->created ? JHTML::Date($result->created) : '';
             $result->count = $i + 1;
         }
     }
     $this->result = JText::sprintf('FLEXI_TOTALRESULTSFOUND', $total);
     // ******************************************************************
     // Create HTML of filters (-AFTER- getData of model have been called)
     // ******************************************************************
     foreach ($filters as $filter) {
         $filter->parameters->set('display_label_filter_s', 0);
         $filter->value = JRequest::getVar('filter_' . $filter->id, false);
         //$fieldsearch = $app->getUserStateFromRequest( 'flexicontent.search.'.'filter_'.$filter->id, 'filter_'.$filter->id, array(), 'array' );
         //echo "Field name: ".$filter->name; echo ":: ". 'filter_'.$filter->id ." :: value: "; print_r($filter->value); echo "<br/>\n";
         $field_filename = $filter->iscore ? 'core' : $filter->field_type;
         FLEXIUtilities::call_FC_Field_Func($field_filename, 'onAdvSearchDisplayFilter', array(&$filter, $filter->value, $form_id));
     }
     //echo "<pre>"; print_r($_GET); exit;
     // Create links
     $link = JRoute::_(FlexicontentHelperRoute::getSearchRoute(0, $menu_matches ? $menu->id : 0));
     //$print_link = JRoute::_('index.php?view=search&pop=1&tmpl=component&print=1');
     $curr_url = str_replace('&', '&amp;', $_SERVER['REQUEST_URI']);
     $print_link = $curr_url . (strstr($curr_url, '?') ? '&amp;' : '?') . 'pop=1&amp;tmpl=component&amp;print=1';
     $pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->assignRef('action', $link);
     // $uri->toString()
     $this->assignRef('print_link', $print_link);
     $this->assignRef('contenttypes', $contenttypes);
     $this->assignRef('filters', $filters);
     $this->assignRef('results', $results);
     $this->assignRef('lists', $lists);
     $this->assignRef('params', $params);
     $this->assignRef('pageNav', $pageNav);
     $this->assignRef('pageclass_sfx', $pageclass_sfx);
     $this->assignRef('typeData', $typeData);
     $this->assign('ordering', $state->get('ordering'));
     $this->assign('searchword', $searchword);
     $this->assign('searchphrase', $state->get('match'));
     $this->assign('searchareas', $areas);
     $this->assign('total', $total);
     $this->assign('error', $error);
     $this->assignRef('document', $document);
     $this->assign('form_id', $form_id);
     $this->assign('form_name', $form_name);
     $print_logging_info = $params->get('print_logging_info');
     if ($print_logging_info) {
         global $fc_run_times;
         $start_microtime = microtime(true);
     }
     parent::display($tpl);
     if ($print_logging_info) {
         @($fc_run_times['template_render'] += round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10);
     }
 }
Exemplo n.º 24
0
$link = JRoute::_("index.php?option=com_eventgallery&view=event&folder=" . $this->entry->getFolderName() . "&Itemid=" . $this->currentItemid);
?>
<div class="item-container item-container-big">
	<div class="item item_first">
		<a href="<?php 
echo $link;
?>
">
			<div class="content">				
				<div class="data">
					<?php 
if ($this->params->get('show_date', 1) == 1) {
    ?>
<div class="date"><?php 
    echo JHTML::Date($this->entry->getDate());
    ?>
</div><?php 
}
?>
					<div class="title"><?php 
echo $this->entry->getDisplayName();
?>
</div>
					<?php 
if ($this->params->get('show_text', 1) == 1) {
    ?>
<div class="text"><?php 
    echo JHtml::_('content.prepare', $this->entry->getIntroText(), '', 'com_eventgallery.event');
    ?>
</div><?php 
Exemplo n.º 25
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $userLevels = implode(',', $user->getAuthorisedViewLevels());
     $db = JFactory::getDBO();
     $menu = $app->getMenu();
     $document = JFactory::getDocument();
     $params = $app->getParams();
     $moduleId = $app->input->get('id', 0, 'int');
     $table =& JTable::getInstance('module');
     if ((int) $moduleId > 0) {
         $db = JFactory::getDBO();
         $query = 'SELECT a.params' . ' FROM #__modules AS a' . ' WHERE a.published = 1' . ' AND a.id =' . (int) $moduleId . ' ORDER BY a.ordering';
         $db->setQuery($query);
         if (!$db->query()) {
             $this->setError($db->getErrorMsg());
             return false;
         }
         $module = $db->loadObject();
         if (isset($module->params) && $module->params != '') {
             jimport('joomla.html.parameter');
             $paramsM = new JRegistry();
             $paramsM->loadString($module->params);
             //$paramsM->loadJSON($module->params);
             // Params
             $categories = $paramsM->get('category_ids', '');
             $ordering = $paramsM->get('file_ordering', 6);
             $fileCount = $paramsM->get('file_count', 5);
             $feedTitle = $paramsM->get('feed_title', JText::_('COM_PHOCADOWNLOAD_DOWNLOAD'));
             $displayDateType = $paramsM->get('display_date_type', 1);
             $document->setTitle($this->escape(html_entity_decode($feedTitle)));
             $wheres = array();
             if (is_array($categories) && count($categories) > 0) {
                 JArrayHelper::toInteger($categories);
                 $categoriesString = implode(',', $categories);
                 $wheres[] = ' c.catid IN ( ' . $categoriesString . ' ) ';
             } else {
                 if ((int) $categories > 0) {
                     $wheres[] = ' c.catid IN ( ' . $categories . ' ) ';
                 }
             }
             $wheres[] = ' c.catid= cc.id';
             $wheres[] = '( (unaccessible_file = 1 ) OR (unaccessible_file = 0 AND c.access IN (' . $userLevels . ') ) )';
             $wheres[] = '( (unaccessible_file = 1 ) OR (unaccessible_file = 0 AND cc.access IN (' . $userLevels . ') ) )';
             $wheres[] = ' c.published = 1';
             $wheres[] = ' c.approved = 1';
             $wheres[] = ' cc.published = 1';
             $wheres[] = ' c.textonly = 0';
             // Active
             $jnow = JFactory::getDate();
             $now = $jnow->toSql();
             $nullDate = $db->getNullDate();
             $wheres[] = ' ( c.publish_up = ' . $db->Quote($nullDate) . ' OR c.publish_up <= ' . $db->Quote($now) . ' )';
             $wheres[] = ' ( c.publish_down = ' . $db->Quote($nullDate) . ' OR c.publish_down >= ' . $db->Quote($now) . ' )';
             $fileOrdering = PhocaDownloadOrdering::getOrderingText($ordering);
             $query = ' SELECT c.*, cc.id AS categoryid, cc.title AS categorytitle, cc.alias AS categoryalias, cc.access as cataccess, cc.accessuserid as cataccessuserid ' . ' FROM #__phocadownload AS c' . ' LEFT JOIN #__phocadownload_categories AS cc ON cc.id = c.catid' . ' WHERE ' . implode(' AND ', $wheres) . ' ORDER BY c.' . $fileOrdering;
             $db->setQuery($query, 0, $fileCount);
             $files = $db->loadObjectList();
             foreach ($files as $keyDoc => $valueDoc) {
                 // USER RIGHT - Access of categories (if file is included in some not accessed category) - - - - -
                 // ACCESS is handled in SQL query, ACCESS USER ID is handled here (specific users)
                 $rightDisplay = 0;
                 if (!empty($valueDoc)) {
                     $rightDisplay = PhocaDownloadAccess::getUserRight('accessuserid', $valueDoc->cataccessuserid, $valueDoc->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
                 }
                 // - - - - - - - - - - - - - - - - - - - - - -
                 if ($rightDisplay == 1) {
                     $item = new JFeedItem();
                     $title = $this->escape($valueDoc->title . ' (' . PhocaDownloadFile::getTitleFromFilenameWithExt($valueDoc->filename) . ')');
                     $title = html_entity_decode($title);
                     $item->title = $title;
                     $link = PhocaDownloadRoute::getCategoryRoute($valueDoc->categoryid, $valueDoc->categoryalias);
                     $item->link = JRoute::_($link);
                     // FILEDATE
                     $fileDate = '';
                     if ((int) $displayDateType > 0) {
                         if ($valueDoc->filename != '') {
                             $fileDate = PhocaDownloadFile::getFileTime($valueDoc->filename, $displayDateType, "Y-m-d H:M:S");
                         }
                     } else {
                         $fileDate = JHTML::Date($valueDoc->date, "Y-m-d H:i:s");
                     }
                     if ($fileDate != '') {
                         $item->date = $fileDate;
                     }
                     //$item->description 	= $valueDoc->description;
                     //	$item->description 	= '<div><img src="media/com_phocadownload/images/phoca-download.png" alt="" /></div><div>New file "' .$valueDoc->title . '" ('. $valueDoc->filename.') released on '. $dateDesc.' is available on <a href="http://www.phoca.cz/download">Phoca download site</a></div>'.$valueDoc->description;
                     $item->description = '<div><img src="media/com_phocadownload/images/phoca-download.png" alt="" /></div>' . $valueDoc->description;
                     $item->category = $valueDoc->categorytitle;
                     //	$item->section   	= $valueDoc->sectiontitle;
                     if ($valueDoc->author != '') {
                         $item->author = $valueDoc->author;
                     }
                     $document->addItem($item);
                 }
             }
         }
     }
 }
 function getDb()
 {
     // Get Component Global Options
     $iCparams = JComponentHelper::getParams('com_icagenda');
     $accessDefault = '';
     $submitAccess = $iCparams->get('submitAccess', $accessDefault);
     $approvalGroups = $iCparams->get('approvalGroups', array("8"));
     // Get User
     $user = JFactory::getUser();
     // Get User Access Levels
     //		$userLevels = $user->getAuthorisedViewLevels();
     // Get User Groups
     if (version_compare(JVERSION, '3.0', 'lt')) {
         $userGroups = $user->getAuthorisedGroups();
     } else {
         $userGroups = $user->groups;
     }
     $u_id = $user->get('id');
     $u_mail = $user->get('email');
     // logged-in Users: Name/User Name Option
     $nameJoomlaUser = $iCparams->get('nameJoomlaUser', 1);
     if ($nameJoomlaUser == 1) {
         $u_name = $user->get('name');
     } else {
         $u_name = $user->get('username');
     }
     $data = new stdClass();
     $data->id = null;
     $data->asset_id = JRequest::getVar('asset_id', '', 'post');
     $data->ordering = 0;
     $data->state = 1;
     // Control: if Manager
     jimport('joomla.access.access');
     $adminUsersArray = array();
     foreach ($approvalGroups as $ag) {
         $adminUsers = JAccess::getUsersByGroup($ag, False);
         $adminUsersArray = array_merge($adminUsersArray, $adminUsers);
     }
     if (in_array($u_id, $adminUsersArray)) {
         $data->approval = 0;
     } else {
         $data->approval = 1;
     }
     $data->access = 1;
     $data->language = '*';
     $menuID = JRequest::getVar('menuID', '', 'post');
     $data->username = JRequest::getVar('username', '', 'post');
     $data->title = JRequest::getVar('title', '', 'post');
     $data->catid = JRequest::getVar('catid', '', 'post');
     //		$data->image 				= JRequest::getVar('image', '', 'post');
     $image = JRequest::getVar('image', null, 'files', 'array');
     $data->image = $this->frontendImageUpload($image);
     $data->dates = JRequest::getVar('dates', '', 'post');
     $dates = $this->getDates($data->dates);
     rsort($dates);
     $datesall = $data->dates[0];
     if ($datesall != '0000-00-00 00:00') {
         $data->dates = serialize($dates);
     } else {
         $dates = array('0000-00-00 00:00:00');
         $data->dates = serialize($dates);
     }
     $datesget = unserialize($data->dates);
     $datesnext = $datesget[0];
     $data->startdate = JRequest::getVar('startdate', '', 'post');
     $data->enddate = JRequest::getVar('enddate', '', 'post');
     $nodate = '0000-00-00 00:00:00';
     // Calcul des dates d'une période.
     $startdate = $data->startdate;
     $enddate = $data->enddate;
     if ($startdate == NULL) {
         $startdate = $nodate;
     }
     if ($enddate == NULL) {
         $enddate = $nodate;
     }
     if ($startdate == $nodate && $enddate != $nodate) {
         $enddate = $nodate;
     }
     $startcontrol = $this->mkt($startdate);
     $endcontrol = $this->mkt($enddate);
     $errorperiod = '';
     if ($startcontrol > $endcontrol) {
         $errorperiod = '1';
     } else {
         if (class_exists('DateInterval')) {
             // Create array with all dates of the period - PHP 5.3+
             $start = new DateTime($startdate);
             $interval = '+1 days';
             $date_interval = DateInterval::createFromDateString($interval);
             $timestartdate = date('H:i', strtotime($startdate));
             $timeenddate = date('H:i', strtotime($enddate));
             if ($timeenddate <= $timestartdate) {
                 $end = new DateTime("{$enddate} +1 days");
             } else {
                 $end = new DateTime($enddate);
             }
             // Retourne toutes les dates.
             $perioddates = new DatePeriod($start, $date_interval, $end);
             $out = array();
         } else {
             // Create array with all dates of the period - PHP 5.2
             if ($startdate != $nodate && $enddate != $nodate) {
                 $start = new DateTime($startdate);
                 $timestartdate = date('H:i', strtotime($startdate));
                 $timeenddate = date('H:i', strtotime($enddate));
                 if ($timeenddate <= $timestartdate) {
                     $end = new DateTime("{$enddate} +1 days");
                 } else {
                     $end = new DateTime($enddate);
                 }
                 while ($start < $end) {
                     $out[] = $start->format('Y-m-d H:i');
                     $start->modify('+1 day');
                 }
             }
         }
         // Prépare serialize.
         if (!empty($perioddates)) {
             foreach ($perioddates as $dt) {
                 $out[] = $dt->format('Y-m-d H:i');
             }
         }
     }
     // Serialize les dates de la période.
     if ($startdate != $nodate && $enddate != $nodate) {
         if ($errorperiod != '1') {
             $data->period = serialize($out);
             $ctrl = unserialize($data->period);
             if (is_array($ctrl)) {
                 $period = unserialize($data->period);
             } else {
                 $period = $this->getPeriod($data->period);
             }
             rsort($period);
             $data->period = serialize($period);
         } else {
             $data->period = '';
         }
     } else {
         $data->period = '';
     }
     //		if($data->startdate){
     $periodnext = $data->startdate;
     //		}
     $mktdatesnext = $this->mkt($datesnext);
     $mktperiodnext = $this->mkt($periodnext);
     //		if(($data->startdate) AND ($data->dates)){
     if ($mktdatesnext < $mktperiodnext) {
         $data->next = $periodnext;
     } else {
         $data->next = $datesnext;
     }
     //		}
     /**
      * Set Week Days
      */
     $data->weekdays = JRequest::getVar('weekdays', '', 'post');
     if (!isset($data->weekdays) && !is_array($data->weekdays)) {
         $data->weekdays = '';
     }
     if (isset($data->weekdays) && is_array($data->weekdays)) {
         $data->weekdays = implode(",", $data->weekdays);
     }
     if (version_compare(JVERSION, '3.0', 'lt')) {
         $data->desc = JRequest::getVar('desc', '', 'post', 'string', JREQUEST_ALLOWHTML);
     } else {
         $data->desc = JFactory::getApplication()->input->get('desc', '', 'RAW');
     }
     $data->metadesc = JRequest::getVar('metadesc', '', 'post');
     $data->place = JRequest::getVar('place', '', 'post');
     $data->email = JRequest::getVar('email', '', 'post');
     $data->phone = JRequest::getVar('phone', '', 'post');
     $data->website = JRequest::getVar('website', '', 'post');
     //Retrieve file details from uploaded file, sent from upload form
     $file = JRequest::getVar('file', null, 'files', 'array');
     $data->file = $this->frontendFileUpload($file);
     $data->address = JRequest::getVar('address', '', 'post');
     $data->city = JRequest::getVar('city', '', 'post');
     $data->country = JRequest::getVar('country', '', 'post');
     $data->lat = JRequest::getVar('lat', '', 'post');
     $data->lng = JRequest::getVar('lng', '', 'post');
     $data->alias = JRequest::getVar('alias', '', 'post');
     // URL
     jimport('joomla.filter.output');
     if (empty($data->alias)) {
         $data->alias = $data->title;
     }
     $data->alias = JFilterOutput::stringURLSafe($data->alias);
     //		$data->id 					= JRequest::getVar('id', '', 'post');
     $data->created_by = $u_id;
     $data->created_by_alias = JRequest::getVar('created_by_alias', '', 'post');
     $data->created_by_email = JRequest::getVar('created_by_email', '', 'post');
     $data->created = JHTML::Date('now', 'Y-m-d H:i:s');
     $data->checked_out = JRequest::getVar('checked_out', '', 'post');
     $data->checked_out_time = JRequest::getVar('checked_out_time', '', 'post');
     $data->params = JRequest::getVar('params', '', 'post');
     if (isset($data->params) && is_array($data->params)) {
         // Convert the params field to a string.
         $parameter = new JRegistry();
         $parameter->loadArray($data->params);
         $data->params = (string) $parameter;
     }
     $data->asset_id = null;
     $db = JFactory::getDbo();
     // insert Event in Database
     if ($data->username != NULL && $data->title != NULL && $data->created_by_email != NULL) {
         $db->insertObject('#__icagenda_events', $data, id);
     } else {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Get the "event" URL
     $baseURL = JURI::base();
     $subpathURL = JURI::base(true);
     $baseURL = str_replace('/administrator', '', $baseURL);
     $subpathURL = str_replace('/administrator', '', $subpathURL);
     $urlsend = str_replace('&amp;', '&', JRoute::_('index.php?option=com_icagenda&view=submit&layout=send'));
     // Sub Path filtering
     $subpathURL = ltrim($subpathURL, '/');
     // URL List filtering
     $urlsend = ltrim($urlsend, '/');
     if (substr($urlsend, 0, strlen($subpathURL) + 1) == "{$subpathURL}/") {
         $urlsend = substr($urlsend, strlen($subpathURL) + 1);
     }
     $urlsend = rtrim($baseURL, '/') . '/' . ltrim($urlsend, '/');
     //		self::notificationUserEmail($data->created_by_email, $urlcheck);
     if (isset($data->id) and $data->id != '0' and $data->username != NULL and $data->title != NULL) {
         self::notificationManagerEmail($data->id, $data->title, $lien, $u_id);
     } else {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // get the application object
     $app = JFactory::getApplication();
     // redirect after successful submission
     $app->redirect(htmlspecialchars_decode($urlsend), JText::_('COM_ICAGENDA_EVENT_SUBMISSION_CONFIRMATION'), JText::_('COM_ICAGENDA_EVENT_SUBMISSION'));
 }
Exemplo n.º 27
0
 if ($view_hits) {
     if ($files[$i]->downloads) {
         if ($view_hits_same_line) {
             $html .= '<td style="text-align:' . $hits_alignment . ';">' . $hits_label . '&nbsp;' . modJdownloadsRelatedHelper::strToNumber($files[$i]->downloads) . '</td>';
         } else {
             $html .= '<tr style="vertical-align:top;"><td style="text-align:' . $hits_alignment . ';">' . $hits_label . '&nbsp;' . modJdownloadsRelatedHelper::strToNumber($files[$i]->downloads) . '</td>';
         }
     }
 }
 // add the hits
 if ($view_date) {
     if ($files[$i]->date_added) {
         if ($view_date_same_line) {
             $html .= '<td style="text-align:' . $date_alignment . ';"><small>' . substr(JHTML::Date($files[$i]->date_added, $date_format), 0, 10) . '</small></td>';
         } else {
             $html .= '</tr><tr><td style="text-align:' . $date_alignment . ';"><small>' . substr(JHTML::Date($files[$i]->date_added, $date_format), 0, 10) . '</small></td>';
         }
     }
 }
 $html .= '</tr>';
 // add the first download screenshot when exists and activated in options
 if ($view_thumbnails) {
     if ($first_image) {
         $thumbnail = '<img class="img" src="' . $thumbfolder . $first_image . '" style="text-align:top;padding:5px;border:' . $border . ';" width="' . $view_thumbnails_size . '" height="' . $view_thumbnails_size . '" alt="' . $files[$i]->file_title . '" />';
     } else {
         // use placeholder
         if ($view_thumbnails_dummy) {
             $thumbnail = '<img class="img" src="' . $thumbfolder . 'no_pic.gif" style="text-align:top;padding:5px;border:' . $border . ';" width="' . $view_thumbnails_size . '" height="' . $view_thumbnails_size . '" alt="" />';
         }
     }
     if ($thumbnail) {
function vmn_buildHTMLMessage($newsitem, &$message, $readmore, $sidebarmodules, $newsmailHTML, $send, $unsubscribealltext, $base_url, $categoryname, $subject, $stripmambots)
{
    global $mainframe;
    // Build e-mail message format
    //$subject 	= html_entity_decode($mainframe->getCfg('sitename') . " / " . $newsitem->title, ENT_QUOTES);
    $message = stripslashes($newsmailHTML);
    $introtext = $newsitem->introtext;
    if ($newsitem->catid > -1) {
        $bodytext = $newsitem->fulltext;
        truncateHTML($readmore, $introtext, $bodytext, $newsitem);
    } else {
        $text = explode("[#*%*#]", $newsitem->fulltext);
        $bodytext = $text[0];
    }
    $unsubscribealllink = '<a target="_blank" href="' . JURI::root() . '/' . $base_url . '&amp;unsubscribeall=1">' . $unsubscribealltext . '</a>';
    $search = array('[sitename]', '[livesite]', '[title]', '[introtext]', '[bodytext]', '[subject]', '[unsubscribeall]', '[senddate]', '[sendtime]', '[categoryname]');
    $replace = array($mainframe->getCfg('sitename'), JURI::root(), $newsitem->title, $introtext, $bodytext, $subject, $unsubscribealllink, JHTML::date('now', JTEXT::_('DATE_FORMAT_LC')), JHTML::date('now', '%H:%M'), $categoryname);
    $message = str_replace($search, $replace, $message);
    if (isset($newsitem->created_by)) {
        $message = str_replace("[publishdatetime]", JHTML::Date($newsitem->publish_up, JTEXT::_('DATE_FORMAT_LC2')), $message);
        $message = str_replace("[author]", vmn_getAuthorName($newsitem), $message);
    } else {
        $message = str_replace("[publishdatetime]", '', $message);
        $message = str_replace("[author]", '', $message);
    }
    for ($i = 0; $i < 6; $i++) {
        if (strlen($sidebarmodules[$i]['name'])) {
            $message = str_replace('[moduletitle' . ($i + 1) . ']', $sidebarmodules[$i]['title'], $message);
            $message = str_replace('[modulecontent' . ($i + 1) . ']', vmn_getModuleContent($sidebarmodules[$i], $send), $message);
        }
    }
    if (isset($newsitem->images)) {
        $message = vmn_mosImage($message, $newsitem->images);
    }
    $message = str_replace('{mospagebreak}', '', $message);
    $message = vmn_stripMambots($message, $stripmambots, true);
    return vmn_codeMessage($message);
}
Exemplo n.º 29
0
 function display($tpl = null)
 {
     global $mainframe;
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'search.php';
     // Initialize some variables
     $pathway =& $mainframe->getPathway();
     $uri =& JFactory::getURI();
     $error = '';
     $rows = null;
     $total = 0;
     // Get some data from the model
     $areas =& $this->get('areas');
     $state =& $this->get('state');
     $searchword = $state->get('keyword');
     $params =& $mainframe->getParams();
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     if (is_object($menu)) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title')) {
             $params->set('page_title', JText::_('Search'));
         }
     } else {
         $params->set('page_title', JText::_('Search'));
     }
     $document =& JFactory::getDocument();
     $document->setTitle($params->get('page_title'));
     // Get the parameters of the active menu item
     $params =& $mainframe->getParams();
     // built select lists
     $orders = array();
     $orders[] = JHTML::_('select.option', 'newest', JText::_('Newest first'));
     $orders[] = JHTML::_('select.option', 'oldest', JText::_('Oldest first'));
     $orders[] = JHTML::_('select.option', 'popular', JText::_('Most popular'));
     $orders[] = JHTML::_('select.option', 'alpha', JText::_('Alphabetical'));
     $orders[] = JHTML::_('select.option', 'category', JText::_('Section/Category'));
     $lists = array();
     $lists['ordering'] = JHTML::_('select.genericlist', $orders, 'ordering', 'class="inputbox"', 'value', 'text', $state->get('ordering'));
     $searchphrases = array();
     $searchphrases[] = JHTML::_('select.option', 'all', JText::_('All words'));
     $searchphrases[] = JHTML::_('select.option', 'any', JText::_('Any words'));
     $searchphrases[] = JHTML::_('select.option', 'exact', JText::_('Exact phrase'));
     $lists['searchphrase'] = JHTML::_('select.radiolist', $searchphrases, 'searchphrase', '', 'value', 'text', $state->get('match'));
     // log the search
     SearchHelper::logSearch($searchword);
     //limit searchword
     if (SearchHelper::limitSearchWord($searchword)) {
         $error = JText::_('SEARCH_MESSAGE');
     }
     //sanatise searchword
     if (SearchHelper::santiseSearchWord($searchword, $state->get('match'))) {
         $error = JText::_('IGNOREKEYWORD');
     }
     if (!$searchword && count(JRequest::get('post'))) {
         //$error = JText::_( 'Enter a search keyword' );
     }
     // put the filtered results back into the model
     // for next release, the checks should be done in the model perhaps...
     $state->set('keyword', $searchword);
     if (!$error) {
         $results =& $this->get('data');
         $total =& $this->get('total');
         $pagination =& $this->get('pagination');
         require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
         for ($i = 0; $i < count($results); $i++) {
             $row =& $results[$i]->text;
             if ($state->get('match') == 'exact') {
                 $searchwords = array($searchword);
                 $needle = $searchword;
             } else {
                 $searchwords = preg_split("/\\s+/u", $searchword);
                 $needle = $searchwords[0];
             }
             $row = SearchHelper::prepareSearchContent($row, 200, $needle);
             $searchwords = array_unique($searchwords);
             $searchRegex = '#(';
             $x = 0;
             foreach ($searchwords as $k => $hlword) {
                 $searchRegex .= $x == 0 ? '' : '|';
                 $searchRegex .= preg_quote($hlword, '#');
                 $x++;
             }
             $searchRegex .= ')#iu';
             $row = preg_replace($searchRegex, '<span class="highlight">\\0</span>', $row);
             $result =& $results[$i];
             if ($result->created) {
                 $created = JHTML::Date($result->created);
             } else {
                 $created = '';
             }
             $result->created = $created;
             $result->count = $i + 1;
         }
     }
     $this->result = JText::sprintf('TOTALRESULTSFOUND', $total);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('results', $results);
     $this->assignRef('lists', $lists);
     $this->assignRef('params', $params);
     $this->assign('ordering', $state->get('ordering'));
     $this->assign('searchword', $searchword);
     $this->assign('searchphrase', $state->get('match'));
     $this->assign('searchareas', $areas);
     $this->assign('total', $total);
     $this->assign('error', $error);
     $this->assign('action', $uri->toString());
     parent::display($tpl);
 }
Exemplo n.º 30
0
    echo $item->css_class;
    ?>
">&bull; <?php 
    echo $this->escape($item->badge_title);
    ?>
</span></td>
				<td class="left"><?php 
    echo $this->escape(JText::_($item->asset_title));
    ?>
</td>
				<td class="left"><?php 
    echo $this->escape($item->badge_description);
    ?>
</td>
				<td><?php 
    echo JHTML::Date($item->date_assigned, JText::_('DATE_FORMAT_LC2'));
    ?>
</td>
			</tr>
			<?php 
}
?>
		</tbody>
		<tfoot><tr><td colspan="9"><?php 
echo $this->pagination->getListFooter();
?>
</td></tr></tfoot>
	</table>

	<div style="display: none;">
		<input type="hidden" name="task" value="" />