Esempio n. 1
0
function eguide_dlimit_condition($eid, $exid)
{
    global $xoopsDB, $xoopsUser, $xoopsConfig;
    // check reservation count
    $uid = $xoopsUser->getVar('uid');
    $res = $xoopsDB->query("SELECT IF(exdate, exdate, edate) edate FROM " . EGTBL . " LEFT JOIN " . EXTBL . " ON eid=eidref AND exid={$exid} WHERE eid={$eid}");
    list($edate) = $xoopsDB->fetchRow($res);
    // start of day calc in default time zone
    list($y, $m, $d) = explode('-', eventdate($edate, 'Y-m-d', $xoopsConfig['default_TZ']));
    $bound = eguide_form_options('bound_time', '00:00');
    list($hour, $min) = explode(':', $bound);
    $start = userTimeToServerTime(mktime($hour, $min, 0, $m, $d, $y), $xoopsConfig['default_TZ']);
    $last = $start + 24 * 3600 - 1;
    /* +1day */
    $res = $xoopsDB->query("SELECT count(rvid) FROM " . RVTBL . " r LEFT JOIN " . EGTBL . " e ON r.eid=e.eid LEFT JOIN " . EXTBL . " x ON r.eid=x.eidref AND x.exid=r.exid WHERE r.uid={$uid} AND IF(exdate, exdate, edate) BETWEEN {$start} AND {$last}");
    list($count) = $xoopsDB->fetchRow($res);
    return $count;
}
Esempio n. 2
0
function user_notify($eid)
{
    global $xoopsDB, $xoopsConfig;
    $result = $xoopsDB->query("SELECT title,edate,expire,status,topicid FROM " . EGTBL . " WHERE eid={$eid}");
    if (!$result || $xoopsDB->getRowsNum($result) == 0) {
        echo "<div class='error'>Not found Event(eid='{$eid}')</div>\n";
        return;
    }
    $data = $xoopsDB->fetchArray($result);
    $title = $data['title'];
    $edate = $data['edate'];
    $expire = $data['expire'];
    // using XOOPS2 notification system
    if (!$GLOBALS['xoopsModuleConfig']['user_notify'] || ($expire > $edate ? $expire < time() : $edate + $expire < time()) || $data['status'] != STAT_NORMAL) {
        return false;
    }
    $tags = array('EVENT_TITLE' => $title, 'EVENT_DATE' => eventdate($edate, _MD_TIME_FMT), 'EVENT_NOTE' => '', 'EVENT_URL' => EGUIDE_URL . "/event.php?eid={$eid}");
    $notification_handler =& xoops_gethandler('notification');
    $notification_handler->triggerEvent('global', 0, 'new', $tags);
    $notification_handler->triggerEvent('category', $data['topicid'], 'new', $tags);
    $result = $xoopsDB->query("SELECT rvid, email, confirm FROM " . RVTBL . " WHERE eid=0");
    while ($data = $xoopsDB->fetchArray($result)) {
        $xoopsMailer =& getMailer();
        $xoopsMailer->useMail();
        $xoopsMailer->setSubject(_MD_NEWSUB);
        $tpl = 'notify_user_new.tpl';
        $xoopsMailer->setTemplateDir(template_dir($tpl));
        $xoopsMailer->setTemplate($tpl);
        $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
        $xoopsMailer->setFromName(eguide_from_name());
        $xoopsMailer->assign($tags);
        $xoopsMailer->assign("CANCEL_URL", EGUIDE_URL . "/reserv.php?op=cancel&rvid=" . $data['rvid'] . "&key=" . $data['confirm']);
        $xoopsMailer->setToEmails($data['email']);
        if (!$xoopsMailer->send()) {
            echo "<div class='error'>" . $xoopsMailer->getErrors() . "</div>\n";
        }
    }
}
Esempio n. 3
0
            }
        }
    }
    if ($chg) {
        $extents = get_extents($eid, true);
        $xoopsDB->query('UPDATE ' . EGTBL . " SET ldate=0 WHERE eid={$eid}");
        $res = $xoopsDB->query('SELECT * FROM ' . EGTBL . " WHERE eid={$eid}");
        $data = $xoopsDB->fetchArray($res);
        if ($data['status'] == STAT_NORMAL) {
            $tags = array('uid' => $data['uid'], 'URL_EVENTS' => $data['title'] . "\n" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/event.php?eid=" . $eid, 'UPDATED' => $updated, 'DO_UNAME' => $xoopsUser->getVar('uname'));
            include "notify.inc.php";
            event_notify('update', $tags);
        }
        redirect_header(EGUIDE_URL . '/editdate.php?eid=' . $eid, 1, _MD_DBUPDATED);
        exit;
    }
    $_POST['adds'] = '';
}
$xoopsTpl->assign('count', sprintf(_MD_INFO_COUNT, count($extents)));
$xoopsTpl->assign('labels', array(_DELETE, _MD_EXTENT_DATE, _MD_ORDER_COUNT, _EDIT . sprintf(" (%s, %s)", _MD_EVENT_DATE, _MD_RESERV_PERSONS)));
foreach ($extents as $key => $data) {
    $tm = $data['exdate'];
    $extents[$key]['date'] = eventdate($tm);
    if ($tm > $now) {
        $extents[$key]['edit'] = formatTimestamp($tm, 'Y-m-d H:i');
    }
}
$xoopsTpl->assign('errors', $errors);
$xoopsTpl->assign('adds', htmlspecialchars(param('adds', '')));
$xoopsTpl->assign('extents', $extents);
include XOOPS_ROOT_PATH . '/footer.php';
Esempio n. 4
0
function order_notify($data, $email, $value)
{
    global $xoopsModuleConfig, $xoopsUser, $xoopsModule;
    $poster = new XoopsUser($data['uid']);
    $eid = $data['eid'];
    $exid = $data['exid'];
    $url = EGUIDE_URL . '/event.php?eid=' . $eid . ($exid ? "&sub={$exid}" : '');
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $tplname = $data['autoaccept'] ? "accept%s.tpl" : "order%s.tpl";
    $extra = eguide_form_options('reply_extension');
    $tplfile = sprintf($tplname, '');
    // default template name
    $tmpdir = template_dir($tplfile);
    if ($extra) {
        $vals = unserialize_text($value);
        if (isset($vals[$extra])) {
            $extpl = sprintf($tplname, $vals[$extra]);
            if (file_exists("{$tmpdir}{$extpl}")) {
                $tplfile = $extpl;
            }
        }
    } else {
        $extra = eguide_form_options('reply_tpl_suffix');
        if ($extra) {
            $extpl = sprintf($tplname, $extra);
            if (file_exists("{$tmpdir}{$extpl}")) {
                $tplfile = $extpl;
            }
        }
    }
    $xoopsMailer->setTemplateDir($tmpdir);
    $xoopsMailer->setTemplate($tplfile);
    if ($xoopsModuleConfig['member_only'] && is_object($xoopsUser)) {
        $user = $xoopsUser;
        if (isset($data['reserv_uid'])) {
            $ruid = $data['reserv_uid'];
            $user = new XoopsUser($ruid);
        } else {
            $xoopsMailer->setToUsers($user);
        }
        $uinfo = sprintf("%s: %s (%s)\n", _MD_UNAME, $user->getVar('uname'), $user->getVar('name'));
    } else {
        if (!empty($email)) {
            $xoopsMailer->setToEmails($email);
        }
        $uinfo = "";
    }
    if ($email) {
        $uinfo .= sprintf("%s: %s\n", _MD_EMAIL, $email);
    }
    $rvid = $data['rvid'];
    $conf = $data['confirm'];
    $edate = eventdate($data['edate']);
    $tags = array("EVENT_URL" => $url, "RVID" => $rvid, "CANCEL_KEY" => $conf, "CANCEL_URL" => EGUIDE_URL . "/reserv.php?op=cancel&rvid={$rvid}&key={$conf}", "INFO" => $uinfo . $value, "TITLE" => $edate . " " . $data['title'], "EVENT_DATE" => $edate, "EVENT_TITLE" => $data['title'], "SUMMARY" => strip_tags($data['summary']));
    $subj = eguide_form_options('reply_subject', _MD_SUBJECT);
    $xoopsMailer->assign($tags);
    $xoopsMailer->setSubject($subj);
    $xoopsMailer->setFromEmail($poster->getVar('email'));
    $xoopsMailer->setFromName(eguide_from_name());
    $ret = $xoopsMailer->send();
    // send to order person
    if (!$ret) {
        return $ret;
    }
    $xoopsMailer->reset();
    $xoopsMailer->useMail();
    $xoopsMailer->setTemplateDir(template_dir($tplfile));
    $xoopsMailer->setTemplate($tplfile);
    $xoopsMailer->assign($tags);
    $xoopsMailer->setSubject($subj);
    $xoopsMailer->setFromEmail($poster->getVar('email'));
    $xoopsMailer->setFromName(eguide_from_name());
    if ($data['notify']) {
        if (!in_array($xoopsModuleConfig['notify_group'], $poster->groups())) {
            $xoopsMailer->setToUsers($poster);
        }
        $member_handler =& xoops_gethandler('member');
        $notify_group = $member_handler->getGroup($xoopsModuleConfig['notify_group']);
        $xoopsMailer->setToGroups($notify_group);
        $xoopsMailer->send();
    }
    return $ret;
}
Esempio n. 5
0
<?php

// Send Event Information
// $Id: sendinfo.php,v 1.13 2010/02/21 11:07:50 nobu Exp $
include 'header.php';
require 'perm.php';
$op = param('op', 'form');
$eid = param('eid');
$exid = param('sub');
include XOOPS_ROOT_PATH . "/header.php";
assign_module_css();
$result = $xoopsDB->query("SELECT IF(exdate,exdate,edate) edate, title, uid FROM " . EGTBL . " LEFT JOIN " . EXTBL . " ON eid=eidref AND exid={$exid} WHERE eid={$eid}");
$data = $xoopsDB->fetchArray($result);
$edate = eventdate($data['edate']);
$title = $edate . " " . htmlspecialchars($data['title']);
$evurl = EGUIDE_URL . "/event.php?eid={$eid}" . ($exid ? "&sub={$exid}" : "");
echo "<p><a href='{$evurl}' class='evhead'>{$title}</a></p>\n";
if ($op == "doit") {
    $title = param('title', '');
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setSubject($title);
    $xoopsMailer->setBody(param('body', ''));
    $xoopsMailer->setFromEmail($xoopsUser->email());
    $xoopsMailer->setFromName(eguide_from_name());
    $xoopsMailer->assign("EVENT_URL", EGUIDE_URL . "/event.php?eid={$eid}");
    $req = param('request') ? " OR eid=0" : "";
    $status = param('status');
    if (empty($status)) {
        $status = _RVSTAT_RESERVED;
    }
Esempio n. 6
0
    $cond .= ' AND uid=' . $xoopsUser->getVar('uid');
}
if (isset($_GET['eid'])) {
    $cond .= ' AND e.eid=' . intval($_GET['eid']);
}
$result = $xoopsDB->query('SELECT ' . $fields . ' FROM ' . EGTBL . ' e LEFT JOIN ' . OPTBL . ' o ON e.eid=o.eid LEFT JOIN ' . EXTBL . " x ON e.eid=eidref\n  WHERE {$cond} ORDER BY edate");
include XOOPS_ROOT_PATH . '/header.php';
$xoopsOption['template_main'] = EGPREFIX . '_collect.html';
assign_module_css();
$num = $xoopsDB->getRowsNum($result);
$dateline = $timeline = $cells = $event = array();
$peid = 0;
// prime event id
while ($data = $xoopsDB->fetchArray($result)) {
    $edate = $data['edate'];
    $data['date'] = eventdate($edate);
    $day = formatTimestamp($edate, 'Y-m-d');
    $time = formatTimestamp($edate, 'H:i');
    $eid = $data['eid'];
    if (!isset($event[$eid])) {
        $event[$eid] = edit_eventdata($data);
        if (!$peid && $data['exid']) {
            $peid = $data['eid'];
        }
    }
    if (!isset($timeline[$time])) {
        $timeline[$time] = formatTimestamp($edate, _MD_STIME_FMT);
    }
    if (!isset($cells[$day])) {
        $cells[$day] = array();
        $dateline[$day] = formatTimestamp($edate, _MD_SDATE_FMT);
Esempio n. 7
0
    switch ($extents) {
        case 'weekly':
            $step = $step * 7;
        case 'daily':
            for ($n = 0, $i = $edate; $n < $repeat; $n++, $i += $step) {
                $v = $init ? true : isset($sets[$n]);
                $extent_sets[] = array('exdate' => $i, 'no' => $n, 'date' => eventdate($i), 'checked' => $v);
                $sets[$n] = $v ? $i : 0;
            }
            break;
        case 'monthly':
            list($y, $m, $d, $h, $mi) = split(' ', formatTimestamp($edate, "Y m j G i"));
            for ($n = 0; $n < $repeat; $n++) {
                $i = userTimeToServerTime(mktime($h, $mi, 0, $m + $n, $d, $y));
                $v = $init ? true : isset($sets[$n]);
                $extent_sets[] = array('exdate' => $i, 'no' => $n, 'date' => eventdate($i), 'checked' => $v);
                $sets[$n] = $v ? $i : 0;
            }
        default:
            break;
    }
}
$now = time();
if ($op == 'save' || $op == 'date') {
    // database field names
    $updated = "";
    $fields = array('title' => _MD_TITLE, 'edate' => _MD_EVENT_DATE, 'expire' => _MD_EVENT_EXPIRE, 'summary' => _MD_INTROTEXT, 'body' => _MD_EXTEXT, 'style' => _MD_EVENT_STYLE, 'status' => $ev_stats[STAT_NORMAL], 'topicid' => _MD_EVENT_CATEGORY);
    if ($eid) {
        $cond = $adm ? "" : " AND uid={$uid}";
        // condition update by poster
        $result = $xoopsDB->query('SELECT * FROM ' . EGTBL . " WHERE eid={$eid}");
Esempio n. 8
0
    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
}
$uid = $xoopsUser->getVar('uid');
include XOOPS_ROOT_PATH . '/header.php';
$xoopsOption['template_main'] = EGPREFIX . '_mylist.html';
if (isset($_GET['uid']) && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
    $uid = (int) $_GET['uid'];
    $user = new XoopsUser($uid);
    $xoopsTpl->assign('show_user', $user);
}
assign_module_css();
$res = $xoopsDB->query('SELECT count(rvid) FROM ' . RVTBL . ' WHERE uid=' . $uid);
list($rvcount) = $xoopsDB->fetchRow($res);
$rvmax = $xoopsModuleConfig['max_list'];
$rvstart = isset($_GET['start']) ? intval($_GET['start']) : 0;
$nav = new XoopsPageNav($rvcount, $rvmax, $rvstart, "start");
if ($rvcount > $rvmax) {
    $xoopsTpl->assign('navigation', $nav->renderNav());
}
$res = $xoopsDB->query('SELECT r.eid,r.exid, r.rdate, e.title,
IF(exdate,exdate,edate) edate, rvid, confirm, closetime
FROM ' . RVTBL . ' r LEFT JOIN ' . EGTBL . ' e ON r.eid=e.eid LEFT JOIN ' . EXTBL . ' x
  ON r.eid=eidref AND r.exid=x.exid LEFT JOIN ' . OPTBL . " o ON e.eid=o.eid\n WHERE r.uid={$uid} ORDER BY edate DESC", $rvmax, $rvstart);
$now = time();
while ($data = $xoopsDB->fetchArray($res)) {
    $data['edate_fmt'] = eventdate($data['edate']);
    $data['cancel'] = $data['edate'] - $data['closetime'] > $now;
    $data['rdate_fmt'] = formatTimestamp($data['rdate'], _MD_TIME_FMT);
    $xoopsTpl->append('reserved', $data);
}
include XOOPS_ROOT_PATH . '/footer.php';
Esempio n. 9
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;
   }
Esempio n. 10
0
 $data['rvid'] = $rvid = $xoopsDB->getInsertId();
 $evurl = EGUIDE_URL . "/event.php?eid={$eid}" . ($exid ? "&sub={$exid}" : "");
 if (order_notify($data, $email, $value)) {
     $url = eguide_form_options('redirect', '');
     if (!empty($url)) {
         $sec = 3;
         if (preg_match('/^(\\d+);/', $url, $d)) {
             $sec = $d[1];
             $url = preg_replace('/^(\\d+);\\s*/', '', $url);
         }
         $url = str_replace(array('{X_EID}', '{X_SUB}', '{X_RVID}'), array($eid, $exid, $rvid), $url);
         $xoopsTpl->assign('xoops_module_header', sprintf('<meta http-equiv="Refresh" content="%u; url=%s" />', $sec, htmlspecialchars($url)));
         assign_module_css();
     }
     echo "<div class='evform'>\n";
     echo "<p><a href='{$evurl}' class='evhead'>" . eventdate($data['edate']) . " &nbsp; " . htmlspecialchars($data['title']) . "</a></p>";
     echo "<h3>" . _MD_RESERVATION . "</h3>\n";
     echo "<p><b>" . _MD_RESERV_ACCEPT . "</b></p>";
     if ($value) {
         echo "<h3>" . _MD_RESERV_CONF . "</h3>";
         echo "<blockquote class='evbody'>" . $myts->displayTarea($value) . "</blockquote>";
     }
     if ($url) {
         echo "<p>" . sprintf(_IFNOTRELOAD, $url) . "</p>";
     }
     //
     // register user notify request
     //
     if ($xoopsModuleConfig['user_notify'] && param('notify', '')) {
         $reg = $xoopsDB->query('SELECT * FROM ' . RVTBL . " WHERE email={$ml} AND eid=0");
         if ($xoopsDB->getRowsNum($reg) == 0) {
Esempio n. 11
0
function summary_csv()
{
    global $xoopsDB;
    function _q($x)
    {
        return '"' . preg_replace('/"/', '""', $x) . '"';
    }
    $file = "eguide_summary_" . formatTimestamp(time(), "Ymd") . ".csv";
    $charset = eguide_form_options('export_charset', _MD_EXPORT_CHARSET);
    header("Content-Type: text/plain; Charset=" . $charset);
    header('Content-Disposition:attachment;filename="' . $file . '"');
    $result = $xoopsDB->query('SELECT e.eid,if(x.exid,x.exid,0) exid, IF(exdate,exdate,edate) exdate,title,uid,status,persons,IF(x.reserved,x.reserved,o.reserved) reserved FROM ' . EGTBL . ' e LEFT JOIN ' . OPTBL . ' o ON e.eid=o.eid LEFT JOIN ' . EXTBL . " x ON e.eid=eidref ORDER BY exdate DESC,e.eid DESC");
    $out = '"' . join('","', array("ID", "", _MD_EXTENT_DATE, _AM_TITLE, _AM_POSTER, _MD_RESERV_PERSONS, _AM_RESERVATION)) . "\"\n";
    while ($data = $xoopsDB->fetchArray($result)) {
        $date = eventdate($data['exdate']);
        $poster = XoopsUser::getUnameFromId($data['uid']);
        $exid = $data['exid'] ? $data['exid'] : '';
        $out .= join(',', array($data['eid'], $exid, _q($date), _q($data['title']), _q($poster), $data['persons'], $data['reserved'])) . "\n";
    }
    if ($charset != _CHARSET) {
        if (function_exists("mb_convert_encoding")) {
            $out = mb_convert_encoding($out, $charset, _CHARSET);
        } elseif (function_exists("iconv")) {
            $out = iconv($charset, _CHARSET, $out);
        }
    }
    echo $out;
    exit;
}
Esempio n. 12
0
        $rvdata = $xoopsDB->fetchArray($result);
    }
}
$result = $xoopsDB->query("SELECT * FROM " . OPTBL . " WHERE eid={$eid}");
$opts = $xoopsDB->fetchArray($result);
$result = $xoopsDB->query("SELECT IF(exdate,exdate,edate) edate, title, uid,\nsummary, cdate, counter, style, topicid FROM " . EGTBL . ' e LEFT JOIN ' . EXTBL . " x\nON eid=eidref AND exid={$exid} WHERE eid={$eid}");
$head = $xoopsDB->fetchArray($result);
$edate = $head['edate'];
if ($exid) {
    $extents = array();
    $result = $xoopsDB->query("SELECT exdate FROM " . EXTBL . " WHERE exid={$exid}");
    list($edate) = $xoopsDB->fetchRow($result);
} else {
    $extents = get_extents($eid, true);
}
$title = eventdate($edate) . " " . htmlspecialchars($head['title']);
$poster = new XoopsUser($head['uid']);
if (empty($op)) {
    $op = 'view';
}
$print = $op == 'print';
// make optional field and countable list.
if ($eid) {
    $result = $xoopsDB->query("SELECT optfield,optvars FROM " . OPTBL . " WHERE eid={$eid}");
    $opts = $xoopsDB->fetchArray($result);
    eguide_form_options(unserialize_vars($opts['optvars']));
    $item = array();
    foreach (explode("\n", preg_replace('/\\r/', '', $opts['optfield'])) as $ln) {
        // comment line
        if (preg_match('/^\\s*#/', $ln) || preg_match('/^\\s*$/', $ln)) {
            continue;