$marker = preg_split('/,|[\\r\\n]+/', $config['maker_set']);
        }
        $tmp = $marker;
        while (list($k, $v) = array_splice($tmp, 0, 2)) {
            if ($full < $k) {
                return $v;
            }
        }
        return '';
    }
}
while (list($title, $id, $sub, $edate, $description, $full, $close, $resv) = $db->fetchRow($result)) {
    if ($edate - $close < $now) {
        $full = -1;
    }
    $mark = $resv ? eguide_marker($full, $plugin['dirname']) : '';
    $server_time = $edate;
    $user_time = $server_time + $tzoffset_s2u;
    if (date('n', $user_time) != $this->month) {
        continue;
    }
    $target_date = date('j', $user_time);
    $mark .= ' ' . date('H:i', $user_time);
    // show time
    $param = "eid={$id}" . (empty($sub) ? '' : "&amp;sub={$sub}");
    $tmp_array = array('dotgif' => $plugin['dotgif'], 'dirname' => $plugin['dirname'], 'link' => XOOPS_URL . "/modules/{$plugin['dirname']}/event.php?{$param}&amp;caldate={$this->year}-{$this->month}-{$target_date}", 'id' => $id, 'server_time' => $server_time, 'user_time' => $user_time, 'name' => 'eid', 'title' => "{$mark} " . $myts->makeTboxData4Show($title));
    if ($just1gif) {
        // just 1 gif per a plugin & per a day
        $plugin_returns[$target_date][$plugin['dirname']] = $tmp_array;
    } else {
        // multiple gifs allowed per a plugin & per a day
示例#2
0
	$module =& $module_handler->getByDirname('eguide');
	$config_handler =& xoops_gethandler('config');
	$config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
	$marker = preg_split('/,|[\r\n]+/',$config['maker_set']);
    }
    $tmp = $marker;
    while(list($k,$v) = array_splice($tmp, 0, 2)) {
	if ($full<$k) return $v;
    }
    return '';
}
}

	while( list( $title , $id , $sub, $edate , $description , $full, $close, $style) = $db->fetchRow( $result ) ) {
		if (($edate-$close)<$now) $full = -1;
		$mark = eguide_marker($full, $plugin['dirname']);
		$server_time = $edate;

		$user_time = $server_time + $tzoffset_s2u ;
		if( date( 'j' , $user_time ) != $this->date ) continue ;
		$target_date = date('j',$user_time) ;
		$mark .= ' '.date('H:i',$user_time) ; // show time
		$param ="eid=$id".(empty($sub)?'':"&amp;sub=$sub");
		$br = 0;
		$html = 1;
		switch ($style) {
		case 2: $html = 0;
		case 1: $br = 1;
		}
		$tmp_array = array(
			'dotgif' => $plugin['dotgif'] ,
示例#3
0
   function b_event_top_show_base($dirname, $prefix, $options)
   {
       global $xoopsDB, $xoopsUser;
       $myts =& MyTextSanitizer::getInstance();
       $now = time();
       list($detail, $nitem, $nlen, $list_type, $cat) = $options;
       $cond = "";
       $ids = array();
       if ($cat) {
           $labs = array();
           foreach (explode(',', $cat) as $val) {
               $nval = intval($val);
               if ($nval) {
                   $ids[] = $nval;
               } else {
                   $labs[] = $xoopsDB->quoteString($val);
               }
           }
           if ($ids) {
               $cond = "catid IN (" . join(',', $ids) . ")";
           }
           if ($labs) {
               if ($cond) {
                   $cond .= " OR ";
               }
               $cond .= "catname IN (" . join(',', $labs) . ")";
           }
           if ($cond) {
               $res = $xoopsDB->query("SELECT catid,catname,catimg FROM " . $xoopsDB->prefix($prefix . "_category") . " WHERE " . $cond);
               $ids = array();
               while (list($id, $name, $img) = $xoopsDB->fetchRow($res)) {
                   $ids[$id] = array('name' => htmlspecialchars($name), 'img' => $img);
               }
               $cond = $ids ? " AND topicid IN (" . join(',', array_keys($ids)) . ")" : "";
           }
       }
       $module_url = XOOPS_URL . "/modules/{$dirname}";
       $more_url = $module_url . "/index.php";
       switch ($list_type) {
           case 1:
               // list of one entry for same event
               $sql = "SELECT eid, title, summary, style, MIN(IF(exdate,exdate,edate)) edate, cdate, uid FROM " . $xoopsDB->prefix($prefix) . " LEFT JOIN " . $xoopsDB->prefix($prefix . "_extent") . " ON eid=eidref AND exdate>{$now} WHERE (edate>{$now} OR exdate) {$cond} AND status=0 GROUP BY eid ORDER BY cdate DESC";
               break;
           case 2:
               // list of one entry for expired event
               $sql = "SELECT eid, title, summary, style, MAX(IF(exdate,exdate,edate)) edate, cdate, uid FROM " . $xoopsDB->prefix($prefix) . " LEFT JOIN " . $xoopsDB->prefix($prefix . "_extent") . " ON eid=eidref AND exdate<{$now} WHERE (edate<{$now} OR exdate) {$cond} AND status=0 GROUP BY eid ORDER BY cdate DESC";
               $more_url .= "?prev=1";
               break;
           case 0:
               // list of all entry event
               $sql = "SELECT e.eid, title, summary, style, IF(exdate,exdate,edate) edate, cdate, uid,\nexid, IF(x.reserved,x.reserved,o.reserved)/persons*100 as full, closetime\nFROM " . $xoopsDB->prefix($prefix) . ' e
 LEFT JOIN ' . $xoopsDB->prefix($prefix . "_opt") . ' o ON e.eid=o.eid
 LEFT JOIN ' . $xoopsDB->prefix($prefix . "_extent") . " x ON e.eid=eidref\nWHERE ((expire>=edate AND expire>{$now})\n       OR (expire<edate AND IF(exdate,exdate,edate)+expire>{$now})) {$cond}\n  AND status=0 ORDER BY edate";
               break;
       }
       $result = $xoopsDB->query($sql, $nitem, 0);
       $block = array('detail' => $detail, 'dirname' => $dirname, 'module_url' => $module_url, 'more_url' => $more_url, 'categories' => $ids, 'events' => array());
       while ($myrow = $xoopsDB->fetchArray($result)) {
           $event = array();
           $title = $myts->makeTboxData4Show($myrow["title"]);
           if (XOOPS_USE_MULTIBYTES) {
               if (function_exists('mb_strcut') && strlen($title) >= $nlen) {
                   $title = $myts->makeTboxData4Show(mb_strcut($myrow['title'], 0, $nlen - 1, _CHARSET)) . "...";
               }
           } else {
               if (strlen($title) >= $nlen) {
                   $title = $myts->makeTboxData4Show(substr($myrow['title'], 0, $nlen - 1)) . "...";
               }
           }
           $edate = empty($myrow['exdate']) ? $myrow['edate'] : $myrow['exdate'];
           $event['title'] = $title;
           $event['eid'] = $myrow['eid'];
           if (isset($myrow['exid'])) {
               $event['exid'] = $myrow['exid'];
           }
           $event['date'] = eventdate($edate, _BLOCK_DATE_FMT);
           $event['_date'] = eventdate($edate, 's');
           $event['uname'] = XoopsUser::getUnameFromId($myrow['uid']);
           $event['post'] = formatTimestamp($myrow['cdate'], _BLOCK_DATE_FMT);
           $event['_post'] = formatTimestamp($myrow['cdate'], 'm');
           $event['uid'] = $myrow['uid'];
           $html = 1;
           $br = 0;
           switch ($myrow['style']) {
               case 2:
                   $html = 0;
               case 1:
                   $br = 1;
           }
           $event['description'] = $myts->displayTarea($myrow['summary'], $html, 0, 1, 1, $br);
           if (isset($myrow['full'])) {
               $event['mark'] = eguide_marker($myrow['full'], $dirname);
           }
           $block['events'][] = $event;
       }
       $module_handler =& xoops_gethandler('module');
       $module =& $module_handler->getByDirname($dirname);
       if ($xoopsUser && $xoopsUser->isAdmin($module->getVar('mid'))) {
           $result = $xoopsDB->query("SELECT count(eid) FROM " . $xoopsDB->prefix($prefix) . " WHERE status=1");
           if ($xoopsDB->getRowsNum($result)) {
               list($block['waiting']) = $xoopsDB->fetchRow($result);
           }
       }
       return $block;
   }