当前位置: 首页>>代码示例>>PHP>>正文


PHP JEVHelper::onDisplayCustomFieldsMultiRow方法代码示例

本文整理汇总了PHP中JEVHelper::onDisplayCustomFieldsMultiRow方法的典型用法代码示例。如果您正苦于以下问题:PHP JEVHelper::onDisplayCustomFieldsMultiRow方法的具体用法?PHP JEVHelper::onDisplayCustomFieldsMultiRow怎么用?PHP JEVHelper::onDisplayCustomFieldsMultiRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JEVHelper的用法示例。


在下文中一共展示了JEVHelper::onDisplayCustomFieldsMultiRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: iCalMailGenerator

 public static function iCalMailGenerator($row, $params, $ics_method = "PUBLISH")
 {
     if ($ics_method == "CANCEL") {
         $status = "CANCELLED";
     }
     if (JFile::exists(JPATH_SITE . "/plugins/jevents/jevnotify/")) {
         //If using JEvents notify plugin we need to load it for the processing of data.
         JLoader::register('JEVNotifyHelper', JPATH_SITE . "/plugins/jevents/jevnotify/helper.php");
     }
     $icalEvents = array($row);
     if (ob_get_contents()) {
         ob_end_clean();
     }
     $html = "";
     $params = JComponentHelper::getParams("com_jevents");
     if ($params->get('outlook2003icalexport')) {
         $html .= "BEGIN:VCALENDAR\r\nPRODID:JEvents 3.1 for Joomla//EN\r\n";
     } else {
         $html .= "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:JEvents 3.1 for Joomla//EN\r\n";
     }
     $html .= "CALSCALE:GREGORIAN\r\nMETHOD:" . $ics_method . "\r\n";
     if (isset($status)) {
         $html .= "STATUS:" . $status . "\r\n";
     }
     if (!empty($icalEvents)) {
         ob_start();
         $tzid = self::vtimezone($icalEvents);
         $html .= ob_get_clean();
         // Build Exceptions dataset - all done in big batches to save multiple queries
         $exceptiondata = array();
         $ids = array();
         foreach ($icalEvents as $a) {
             $ids[] = $a->ev_id();
             if (count($ids) > 100) {
                 $db = JFactory::getDBO();
                 $db->setQuery("SELECT * FROM #__jevents_exception where eventid IN (" . implode(",", $ids) . ")");
                 $rows = $db->loadObjectList();
                 foreach ($rows as $row) {
                     if (!isset($exceptiondata[$row->eventid])) {
                         $exceptiondata[$row->eventid] = array();
                     }
                     $exceptiondata[$row->eventid][$row->rp_id] = $row;
                 }
                 $ids = array();
             }
         }
         // mop up the last ones
         if (count($ids) > 0) {
             $db = JFactory::getDBO();
             $db->setQuery("SELECT * FROM #__jevents_exception where eventid IN (" . implode(",", $ids) . ")");
             $rows = $db->loadObjectList();
             foreach ($rows as $row) {
                 if (!isset($exceptiondata[$row->eventid])) {
                     $exceptiondata[$row->eventid] = array();
                 }
                 $exceptiondata[$row->eventid][$row->rp_id] = $row;
             }
         }
         // make sure the array is now reindexed for the sake of the plugins!
         $icalEvents = array_values($icalEvents);
         // Call plugin on each event
         $dispatcher = JDispatcher::getInstance();
         ob_start();
         JEVHelper::onDisplayCustomFieldsMultiRow($icalEvents);
         ob_end_clean();
         foreach ($icalEvents as $a) {
             // if event has repetitions I must find the first one to confirm the dates
             if ($a->hasrepetition()) {
                 $a = $a->getOriginalFirstRepeat();
             }
             if (!$a) {
                 continue;
             }
             $html .= "BEGIN:VEVENT\r\n";
             $html .= "UID:" . $a->uid() . "\r\n";
             $html .= "CATEGORIES:" . $a->catname() . "\r\n";
             if (!empty($a->_class)) {
                 $html .= "CLASS:" . $a->_class . "\r\n";
             }
             $html .= "SUMMARY:" . $a->title() . "\r\n";
             if ($a->location() != "") {
                 if (!is_numeric($a->location())) {
                     $html .= "LOCATION:" . self::wraplines(self::replacetags($a->location())) . "\r\n";
                 } else {
                     if (isset($a->_loc_title)) {
                         $html .= "LOCATION:" . self::wraplines(self::replacetags($a->_loc_title)) . "\r\n";
                     } else {
                         $html .= "LOCATION:" . self::wraplines(self::replacetags($a->location())) . "\r\n";
                     }
                 }
             }
             // We Need to wrap this according to the specs
             /* $html .= "DESCRIPTION:".preg_replace("'<[\/\!]*?[^<>]*?>'si","",preg_replace("/\n|\r\n|\r$/","",$a->content()))."\n"; */
             $html .= self::setDescription(strip_tags($a->content())) . "\r\n";
             if ($a->hasContactInfo()) {
                 $html .= "CONTACT:" . self::replacetags($a->contact_info()) . "\r\n";
             }
             if ($a->hasExtraInfo()) {
                 $html .= "X-EXTRAINFO:" . self::wraplines(self::replacetags($a->_extra_info)) . "\r\n";
             }
//.........这里部分代码省略.........
开发者ID:madcsaba,项目名称:li-de,代码行数:101,代码来源:helper.php

示例2: IN

     $db = JFactory::getDBO();
     $db->setQuery("SELECT * FROM #__jevents_exception where eventid IN (" . implode(",", $ids) . ")");
     $rows = $db->loadObjectList();
     foreach ($rows as $row) {
         if (!isset($exceptiondata[$row->eventid])) {
             $exceptiondata[$row->eventid] = array();
         }
         $exceptiondata[$row->eventid][$row->rp_id] = $row;
     }
 }
 // make sure the array is now reindexed for the sake of the plugins!
 $this->icalEvents = array_values($this->icalEvents);
 // Call plugin on each event
 $dispatcher = JEventDispatcher::getInstance();
 ob_start();
 JEVHelper::onDisplayCustomFieldsMultiRow($this->icalEvents);
 ob_end_clean();
 foreach ($this->icalEvents as $a) {
     // if event has repetitions I must find the first one to confirm the dates
     if ($a->hasrepetition() && $this->withrepeats) {
         $a = $a->getOriginalFirstRepeat();
     }
     if (!$a) {
         continue;
     }
     // Fix for end time of first repeat if its an exception
     if (array_key_exists($a->ev_id(), $exceptiondata) && array_key_exists($a->rp_id(), $exceptiondata[$a->ev_id()])) {
         $exception = $exceptiondata[$a->ev_id()][$a->rp_id()];
         // if its the first repeat that has had its end time changes we have not stored this data so need to determine it again
         if ($exception->startrepeat == $exception->oldstartrepeat && $exception->exception_type == 1) {
             // look for repeats that are not exceptions
开发者ID:hriggs,项目名称:cs-website,代码行数:31,代码来源:export.php

示例3: listEventsByKeyword


//.........这里部分代码省略.........
     $total = 0;
     // process the new plugins
     // get extra data and conditionality from plugins
     $extrawhere = array();
     $extrajoin = array();
     $extrafields = "";
     // must have comma prefix
     $needsgroup = false;
     $filterarray = array("published");
     // If there are extra filters from the module then apply them now
     $reg = JFactory::getConfig();
     $modparams = $reg->get("jev.modparams", false);
     if ($modparams && $modparams->get("extrafilters", false)) {
         $filterarray = array_merge($filterarray, explode(",", $modparams->get("extrafilters", false)));
     }
     $filters = jevFilterProcessing::getInstance($filterarray);
     $filters->setWhereJoin($extrawhere, $extrajoin);
     $needsgroup = $filters->needsGroupBy();
     JPluginHelper::importPlugin('jevents');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onListIcalEvents', array(&$extrafields, &$extratables, &$extrawhere, &$extrajoin, &$needsgroup));
     $catwhere = "\n WHERE ev.catid IN(" . $this->accessibleCategoryList() . ")";
     $params = JComponentHelper::getParams("com_jevents");
     if ($params->get("multicategory", 0)) {
         $extrajoin[] = "\n #__jevents_catmap as catmap ON catmap.evid = rpt.eventid";
         $extrajoin[] = "\n #__categories AS catmapcat ON catmap.catid = catmapcat.id";
         $extrafields .= ", GROUP_CONCAT(DISTINCT catmap.catid SEPARATOR ',') as catids";
         $extrawhere[] = " catmapcat.access IN (" . JEVHelper::getAid($user) . ")";
         $extrawhere[] = " catmap.catid IN(" . $this->accessibleCategoryList() . ")";
         $needsgroup = true;
         $catwhere = "\n WHERE 1 ";
     }
     $extrajoin = count($extrajoin) ? " \n LEFT JOIN " . implode(" \n LEFT JOIN ", $extrajoin) : '';
     $extrawhere = count($extrawhere) ? ' AND ' . implode(' AND ', $extrawhere) : '';
     // NB extrajoin is a string from now on
     $extrasearchfields = array();
     $dispatcher->trigger('onSearchEvents', array(&$extrasearchfields, &$extrajoin, &$needsgroup));
     if (count($extrasearchfields) > 0) {
         $extraor = implode(" OR ", $extrasearchfields);
         $extraor = " OR " . $extraor;
         // replace the ### placeholder with the keyword
         $extraor = str_replace("###", $keyword, $extraor);
         $searchpart = $useRegX ? "(det.summary RLIKE '{$keyword}' OR det.description RLIKE '{$keyword}' OR det.location RLIKE '{$keyword}' OR det.extra_info RLIKE '{$keyword}' {$extraor})\n" : " (MATCH (det.summary, det.description, det.extra_info) AGAINST ('{$keyword}' IN BOOLEAN MODE) {$extraor})\n";
     } else {
         $searchpart = $useRegX ? "(det.summary RLIKE '{$keyword}' OR det.description RLIKE '{$keyword}'  OR det.location RLIKE '{$keyword}'  OR det.extra_info RLIKE '{$keyword}')\n" : "MATCH (det.summary, det.description, det.extra_info) AGAINST ('{$keyword}' IN BOOLEAN MODE)\n";
     }
     // Now Search Icals
     $query = "SELECT count( distinct det.evdet_id) FROM #__jevents_vevent as ev" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . $extrajoin . $catwhere . "\n AND icsf.state=1 AND icsf.access IN (" . JEVHelper::getAid($user) . ")" . "\n AND ev.access IN (" . JEVHelper::getAid($user) . ")" . "\n AND ";
     $query .= $searchpart;
     $query .= $extrawhere;
     $query .= $having;
     $db->setQuery($query);
     //echo $db->explain();
     $total += intval($db->loadResult());
     if ($total < $limitstart) {
         $limitstart = 0;
     }
     $rows = array();
     if ($total == 0) {
         return $rows;
     }
     // Now Search Icals
     // New version
     $query = "SELECT DISTINCT det.evdet_id FROM  #__jevents_vevdetail as det" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventdetail_id = det.evdet_id" . "\n LEFT JOIN #__jevents_vevent as ev ON ev.ev_id = rpt.eventid" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . $extrajoin . $catwhere . "\n  AND icsf.state=1 AND icsf.access IN (" . JEVHelper::getAid($user) . ")" . "\n AND ev.access IN (" . JEVHelper::getAid($user) . ")";
     $query .= " AND ";
     $query .= $searchpart;
     $query .= $extrawhere;
     $query .= $having;
     $query .= "\n ORDER BY rpt.startrepeat ASC ";
     $query .= "\n {$limitstring}";
     $db->setQuery($query);
     if ($adminuser) {
         //echo $db->_sql;
         //echo $db->explain();
     }
     //echo $db->explain();
     $details = $db->loadColumn();
     $icalrows = array();
     foreach ($details as $detid) {
         $query2 = "SELECT ev.*, rpt.*, det.* {$extrafields}" . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat  ) as ydn, MONTH(rpt.endrepeat   ) as mdn, DAYOFMONTH(rpt.endrepeat   ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat  ) as hdn, MINUTE(rpt.endrepeat   ) as mindn, SECOND(rpt.endrepeat   ) as sdn" . "\n FROM #__jevents_vevent as ev" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . "\n LEFT JOIN #__jevents_icsfile as icsf ON icsf.ics_id=ev.icsid" . $extrajoin . "\n WHERE rpt.eventdetail_id = {$detid}" . $extrawhere . $having . "\n ORDER BY rpt.startrepeat ASC limit 1";
         $db->setQuery($query2);
         //echo $db->explain();
         $data = $db->loadObject();
         // belts and braces - some servers have a MYSQLK bug on the  user of DISTINCT!
         if (!$data->ev_id) {
             continue;
         }
         $icalrows[] = $data;
     }
     $num_events = count($icalrows);
     for ($i = 0; $i < $num_events; $i++) {
         // convert rows to jevents
         $icalrows[$i] = new jIcalEventRepeat($icalrows[$i]);
     }
     JEventsDBModel::translateEvents($icalrows);
     JEVHelper::onDisplayCustomFieldsMultiRow($icalrows);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onDisplayCustomFieldsMultiRowUncached', array(&$icalrows));
     return $icalrows;
 }
开发者ID:poorgeek,项目名称:JEvents,代码行数:101,代码来源:dbmodel.php


注:本文中的JEVHelper::onDisplayCustomFieldsMultiRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。