function pical_todays_schedule_edit($options)
 {
     global $xoopsDB, $xoopsConfig;
     $mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
     $now_cid = empty($options[1]) ? 0 : intval($options[1]);
     // setting physical & virtual paths
     $mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
     $mod_url = XOOPS_URL . "/modules/{$mydirname}";
     // defining class of piCal
     require_once "{$mod_path}/class/piCal.php";
     require_once "{$mod_path}/class/piCal_xoops.php";
     // creating an instance of piCal
     $cal = new piCal_xoops(date('Y-n-j'), $xoopsConfig['language'], true);
     $cal->use_server_TZ = true;
     // setting properties of piCal
     $cal->conn = $xoopsDB->conn;
     include "{$mod_path}/include/read_configs.php";
     $cal->base_url = $mod_url;
     $cal->base_path = $mod_path;
     $cal->images_url = "{$mod_url}/images/{$skin_folder}";
     $cal->images_path = "{$mod_path}/images/{$skin_folder}";
     $ret = "<input type='hidden' name='options[0]' value='{$mydirname}' />\n";
     // カテゴリー選択ボックスの生成
     $ret .= _MB_PICAL_CATSEL . ':';
     $ret .= "<select name='options[1]'>\n<option value='0'>" . _ALL . "</option>\n";
     foreach ($cal->categories as $cid => $cat) {
         $selected = $now_cid == $cid ? "selected='selected'" : "";
         $depth_desc = str_repeat('-', intval($cat->cat_depth));
         $cat_title4show = $cal->text_sanitizer_for_show($cat->cat_title);
         $ret .= "\t<option value='{$cid}' {$selected}>{$depth_desc} {$cat_title4show}</option>\n";
     }
     $ret .= "</select>\n";
     return $ret;
 }
 function validate_id($link_id)
 {
     global $xoopsDB, $xoopsConfig, $xoopsUser;
     $eventcomment_id = intval($link_id);
     $mydirname = $this->mydirname;
     if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
         die('Invalid mydirname');
     }
     $mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
     $table_event = $xoopsDB->prefix("pical{$mydirnumber}_event");
     $MOD_PATH = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
     if (!class_exists('piCal_xoops')) {
         require_once $MOD_PATH . '/class/piCal.php';
         require_once $MOD_PATH . '/class/piCal_xoops.php';
     }
     $cal = new piCal_xoops('', $xoopsConfig['language'], true);
     include $MOD_PATH . '/include/read_configs.php';
     $whr_categories = $cal->get_where_about_categories();
     $whr_class = $cal->get_where_about_class();
     list($count) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM {$table_event} WHERE id={$eventcomment_id} AND admission > 0 AND ({$whr_categories}) AND ({$whr_class})"));
     if ($count <= 0) {
         return false;
     } else {
         return $eventcomment_id;
     }
 }
 function pical_monthly_calendar_show($options)
 {
     global $xoopsConfig, $xoopsDB;
     $mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
     // setting physical & virtual paths
     $mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
     $mod_url = XOOPS_URL . "/modules/{$mydirname}";
     // defining class of piCal
     if (!class_exists('piCal_xoops')) {
         require_once "{$mod_path}/class/piCal.php";
         require_once "{$mod_path}/class/piCal_xoops.php";
     }
     // creating an instance of piCal
     $cal = new piCal_xoops("", $xoopsConfig['language'], true);
     // ignoring cid from GET
     $cal->now_cid = 0;
     // setting properties of piCal
     $cal->conn = $xoopsDB->conn;
     include "{$mod_path}/include/read_configs.php";
     $cal->base_url = $mod_url;
     $cal->base_path = $mod_path;
     $cal->images_url = "{$mod_url}/images/{$skin_folder}";
     $cal->images_path = "{$mod_path}/images/{$skin_folder}";
     $original_level = error_reporting(E_ALL ^ E_NOTICE);
     require_once "{$mod_path}/include/patTemplate.php";
     $tmpl = new PatTemplate();
     $tmpl->readTemplatesFromFile("{$cal->images_path}/block_monthly.tmpl.html");
     // setting skin folder
     $tmpl->addVar("WholeBoard", "SKINPATH", $cal->images_url);
     // setting language
     $tmpl->addVar("WholeBoard", "LANG_PREV_MONTH", _MB_PICAL_PREV_MONTH);
     $tmpl->addVar("WholeBoard", "LANG_NEXT_MONTH", _MB_PICAL_NEXT_MONTH);
     $tmpl->addVar("WholeBoard", "LANG_YEAR", _MB_PICAL_YEAR);
     $tmpl->addVar("WholeBoard", "LANG_MONTH", _MB_PICAL_MONTH);
     $tmpl->addVar("WholeBoard", "LANG_JUMP", _MB_PICAL_JUMP);
     // Static parameter for the request
     $tmpl->addVar("WholeBoard", "GET_TARGET", "{$mod_url}/index.php");
     $tmpl->addVar("WholeBoard", "QUERY_STRING", '');
     // Variables required in header part etc.
     $tmpl->addVars("WholeBoard", $cal->get_calendar_information('M'));
     // BODY of the calendar
     $tmpl->addVar("WholeBoard", "CALENDAR_BODY", $cal->get_monthly_html("{$mod_url}/index.php"));
     // legends of long events
     foreach ($cal->long_event_legends as $bit => $legend) {
         $tmpl->addVar("LongEventLegends", "BIT_MASK", 1 << $bit - 1);
         $tmpl->addVar("LongEventLegends", "LEGEND_ALT", _PICAL_MB_ALLDAY_EVENT . " {$bit}");
         $tmpl->addVar("LongEventLegends", "LEGEND", $legend);
         $tmpl->addVar("LongEventLegends", "SKINPATH", $cal->images_url);
         $tmpl->parseTemplate("LongEventLegends", "a");
     }
     // content generated from patTemplate
     $block['content'] = $tmpl->getParsedTemplate("WholeBoard");
     error_reporting($original_level);
     return $block;
 }
Ejemplo n.º 4
0
 function pical_search_base($mydirname, $keywords, $andor, $limit, $offset, $uid)
 {
     global $xoopsConfig, $xoopsDB, $xoopsUser;
     // setting physical & virtual paths
     $mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
     $mod_url = XOOPS_URL . "/modules/{$mydirname}";
     // defining class of piCal
     if (!class_exists('piCal_xoops')) {
         require_once "{$mod_path}/class/piCal.php";
         require_once "{$mod_path}/class/piCal_xoops.php";
     }
     // creating an instance of piCal
     $cal = new piCal_xoops("", $xoopsConfig["language"], true);
     $cal->use_server_TZ = true;
     // setting properties of piCal
     $cal->conn = $xoopsDB->conn;
     include "{$mod_path}/include/read_configs.php";
     $cal->images_url = "{$mod_url}/images/{$skin_folder}";
     $cal->images_path = "{$mod_path}/images/{$skin_folder}";
     $ret = $cal->get_xoops_search_result($keywords, $andor, $limit, $offset, $uid);
     return $ret;
 }
Ejemplo n.º 5
0
// クラス定義の読み込み
if (!class_exists('piCal_xoops')) {
    require_once "{$mod_path}/class/piCal.php";
    require_once "{$mod_path}/class/piCal_xoops.php";
}
// GET,POST変数の取得・前処理
if (empty($_GET['action']) && !empty($_GET['event_id'])) {
    $_GET['action'] = 'View';
}
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = '';
}
// creating an instance of piCal
$cal = new piCal_xoops("", $xoopsConfig['language'], true);
// setting properties of piCal
$cal->conn = $conn;
include "{$mod_path}/include/read_configs.php";
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
// データベース更新関係の処理(いずれも、Locationで飛ばす)
if (isset($_POST['update'])) {
    // 更新
    if (!$editable) {
        die(_MB_PICAL_ERR_NOPERMTOUPDATE);
    }
    // Ticket Check
    if (!$xoopsGTicket->check()) {
 function pical_mini_calendar_show($options)
 {
     global $xoopsConfig, $xoopsDB, $xoopsUser;
     $mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
     // caldate や日付ジャンプの指定が無く(当月のデフォルトミニカレンダー表示)
     // かつ、ユーザのTimezoneがdefaultTZと一緒(一番多そうなシチュエーション)の
     // 場合には、キャッシュを使う
     if (empty($_GET['caldate']) && empty($_POST['pical_jumpcaldate']) && (!is_object($xoopsUser) || $xoopsUser->timezone() == $xoopsConfig['default_TZ'])) {
         $use_cache = true;
         $cachefile = XOOPS_CACHE_PATH . "/{$mydirname}_minical_cache_{$xoopsConfig['language']}.html";
         // 5 minutes
         if (file_exists($cachefile) && filemtime($cachefile) > time() - 300) {
             if (false !== ($fp = fopen($cachefile, 'r'))) {
                 $block['content'] = '';
                 while (!feof($fp)) {
                     $block['content'] .= fgets($fp, 4096);
                 }
                 fclose($fp);
                 return $block;
             }
         }
     } else {
         $use_cache = false;
     }
     // setting physical & virtual paths
     $mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
     $mod_url = XOOPS_URL . "/modules/{$mydirname}";
     // defining class of piCal
     if (!class_exists('piCal_xoops')) {
         require_once "{$mod_path}/class/piCal.php";
         require_once "{$mod_path}/class/piCal_xoops.php";
     }
     // creating an instance of piCal
     $cal = new piCal_xoops("", $xoopsConfig['language'], true);
     // ignoring cid from GET
     $cal->now_cid = 0;
     // setting properties of piCal
     $cal->conn = $xoopsDB->conn;
     include "{$mod_path}/include/read_configs.php";
     $cal->base_url = $mod_url;
     $cal->base_path = $mod_path;
     $cal->images_url = "{$mod_url}/images/{$skin_folder}";
     $cal->images_path = "{$mod_path}/images/{$skin_folder}";
     switch ($mini_calendar_target) {
         case 'MONTHLY':
             $get_target = "{$mod_url}/index.php";
             $query_string = "smode=Monthly";
             break;
         case 'WEEKLY':
             $get_target = "{$mod_url}/index.php";
             $query_string = "smode=Weekly";
             break;
         case 'DAILY':
             $get_target = "{$mod_url}/index.php";
             $query_string = "smode=Daily";
             break;
         case 'LIST':
             $get_target = "{$mod_url}/index.php";
             $query_string = "smode=List";
             break;
         default:
         case 'PHP_SELF':
             $get_target = '';
             $query_string = "";
             break;
     }
     $block = array();
     $block['content'] = $cal->get_mini_calendar_html($get_target, $query_string);
     // キャッシュの書き出し
     if ($use_cache && $mini_calendar_target != 'PHP_SELF') {
         if (false !== ($fp = fopen($cachefile, 'w'))) {
             fwrite($fp, $block['content']);
             fclose($fp);
         }
     }
     return $block;
 }
Ejemplo n.º 7
0
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
require_once XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/gtickets.php";
// SERVER, GET 変数の取得
$action = isset($_POST['action']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_POST['action']) : '';
$done = isset($_GET['done']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['done']) : '';
$disp = isset($_GET['disp']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['disp']) : '';
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
// MySQLへの接続
$conn = $xoopsDB->conn;
// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
$mod_url = XOOPS_URL . "/modules/{$mydirname}";
// creating an instance of piCal
$cal = new piCal_xoops("", $xoopsConfig['language'], true);
// setting properties of piCal
$cal->conn = $conn;
include '../include/read_configs.php';
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
// XOOPS関連の初期化
$myts =& MyTextSanitizer::getInstance();
$cattree = new XoopsTree($cal->cat_table, "cid", "pid");
$gperm_handler =& xoops_gethandler('groupperm');
// データベース更新などがからむ処理
if ($action == "insert") {
    // Ticket Check
    if (!$xoopsGTicket->check()) {
Ejemplo n.º 8
0
	$now : the result of time()
	$plugin = array('dirname'=>'dirname','name'=>'name','dotgif'=>'*.gif')
	$just1gif : 0 or 1
	
	$plugin_returns[ DATE ][]
*/
// for Duplicatable
if (!preg_match('/^(\\D+)(\\d*)$/', $plugin['dirname'], $regs)) {
    echo "invalid dirname: " . htmlspecialchars($plugin['dirname']);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
if ($this->base_url == XOOPS_URL . "/modules/" . $plugin['dirname']) {
    $cal =& $this;
} else {
    // create a targeting instance of piCal
    $cal = new piCal_xoops("", $this->language, true);
    // this should not be affected by $_GET['cid']
    $cal->now_cid = '';
    // setting properties of piCal
    global $xoopsDB;
    $cal->conn = $xoopsDB->conn;
    include XOOPS_ROOT_PATH . "/modules/{$plugin['dirname']}/include/read_configs.php";
    $cal->base_url = XOOPS_URL . "/modules/" . $plugin['dirname'];
    $cal->base_path = XOOPS_ROOT_PATH . "/modules/" . $plugin['dirname'];
    $cal->images_url = "{$cal->base_url}/images/{$skin_folder}";
    $cal->images_path = "{$cal->base_path}/images/{$skin_folder}";
}
// options
$options = explode('|', $plugin['options']);
// options[0] : category extract
if (!empty($options[0])) {
Ejemplo n.º 9
0
$mydirnumber = $regs[2] === '' ? '' : intval( $regs[2] ) ;

$conn = $xoopsDB->conn ;

// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH."/modules/$mydirname" ;
$mod_url = XOOPS_URL."/modules/$mydirname" ;

// クラス定義の読み込み
if( ! class_exists( 'piCal_xoops' ) ) {
	require_once( "$mod_path/class/piCal.php" ) ;
	require_once( "$mod_path/class/piCal_xoops.php" ) ;
}

// creating an instance of piCal 
$cal = new piCal_xoops( "" , $xoopsConfig['language'] , true ) ;

// setting properties of piCal
$cal->conn = $conn ;
include( "$mod_path/include/read_configs.php" ) ;
$cal->base_url = $mod_url ;
$cal->base_path = $mod_path ;
$cal->images_url = "$mod_url/images/$skin_folder" ;
$cal->images_path = "$mod_path/images/$skin_folder" ;


// Include our module's language file
if( file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/language/'.$xoopsConfig['language'].'/main.php') ) {
	require_once(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/language/'.$xoopsConfig['language'].'/main.php');
	require_once(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/language/'.$xoopsConfig['language'].'/modinfo.php');
} else {
Ejemplo n.º 10
0
}
header('Content-Type:text/xml; charset=utf-8');
// for "Duplicatable"
$mydirname = basename(dirname(__FILE__));
if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
$mod_url = XOOPS_URL . "/modules/{$mydirname}";
// defining class of piCal
require_once "{$mod_path}/class/piCal.php";
require_once "{$mod_path}/class/piCal_xoops.php";
// creating an instance of piCal
$cal = new piCal_xoops(date('Y-n-j'), $xoopsConfig['language'], true);
$cal->use_server_TZ = true;
// ignoring cid from GET
// $cal->now_cid = 0 ;
// setting properties of piCal
$cal->conn = $xoopsDB->conn;
include "{$mod_path}/include/read_configs.php";
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
$block = $cal->get_blockarray_date_event("{$mod_url}/index.php");
//mb_http_output( 'UTF-8' ) ;
//ob_start( 'mb_output_handler' ) ;
ob_start('xoops_utf8_encode');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<rss version=\"2.0\">\n  <channel>\n    <title>" . $xoopsModule->getVar('name') . ' - ' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "</title>\n    <link>{$mod_url}/</link>\n    <description>" . htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES) . "</description>\n    <lastBuildDate>" . formatTimestamp(time(), 'r') . "</lastBuildDate>\n    <webMaster>" . $xoopsConfig['adminmail'] . "</webMaster>\n    <editor>" . $xoopsConfig['adminmail'] . "</editor>\n    <category>Calendar</category>\n    <generator>piCal for XOOPS</generator>\n    <language>" . _LANGCODE . "</language>\n";
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
require_once XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/gtickets.php";
// SERVER, GET 変数の取得
$tz = isset($_GET['tz']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['tz']) : "y";
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$num = isset($_GET['num']) ? intval($_GET['num']) : 20;
$done = isset($_GET['done']) ? $_GET['done'] : '';
// MySQLへの接続
$conn = $xoopsDB->conn;
// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
$mod_url = XOOPS_URL . "/modules/{$mydirname}";
// creating an instance of piCal
$cal = new piCal_xoops("", $xoopsConfig['language'], true);
// setting properties of piCal
$cal->conn = $conn;
include '../include/read_configs.php';
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
// Timezone の処理
$serverTZ = $cal->server_TZ;
$userTZ = $xoopsUser->timezone();
$tzoptions = "\n\t<option value='s'>" . _AM_TZOPT_SERVER . "</option>\n\t<option value='g'>" . _AM_TZOPT_GMT . "</option>\n\t<option value='y'>" . _AM_TZOPT_USER . "</option>\n";
switch ($tz) {
    case 's':
        $tzoffset = 0;
        $tzdisp = ($serverTZ >= 0 ? "+" : "-") . sprintf("%02d:%02d", abs($serverTZ), abs($serverTZ) * 60 % 60);
Ejemplo n.º 12
0
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
require_once XOOPS_ROOT_PATH . "/modules/{$mydirname}/include/gtickets.php";
// SERVER, GET 変数の取得
$tz = isset($_GET['tz']) ? preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['tz']) : "y";
$pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
$num = isset($_GET['num']) ? intval($_GET['num']) : 20;
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$txt = isset($_GET['txt']) ? trim($_GET['txt']) : '';
// MySQLへの接続
$conn = $xoopsDB->conn;
// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
$mod_url = XOOPS_URL . "/modules/{$mydirname}";
// creating an instance of piCal
$cal = new piCal_xoops("", $xoopsConfig['language'], true);
// setting properties of piCal
$cal->conn = $conn;
include '../include/read_configs.php';
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
// カテゴリー一覧の処理
$cattree = new XoopsTree($cal->cat_table, "cid", "pid");
ob_start();
$cattree->makeMySelBox("cat_title", "weight", $cid, 1, 'cid', '');
$cat_selbox = ob_get_contents();
ob_end_clean();
$cat_selbox4extract = str_replace("<option value='0'>", "<option value='0'>" . _ALL . "</option>\n<option value='-1'" . ($cid == -1 ? "selected" : "") . ">", $cat_selbox);
// Timezone の処理
Ejemplo n.º 13
0
}
header('Content-Type:text/xml; charset=utf-8');
// for "Duplicatable"
$mydirname = basename(dirname(__FILE__));
if (!preg_match('/^(\\D+)(\\d*)$/', $mydirname, $regs)) {
    echo "invalid dirname: " . htmlspecialchars($mydirname);
}
$mydirnumber = $regs[2] === '' ? '' : intval($regs[2]);
// setting physical & virtual paths
$mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
$mod_url = XOOPS_URL . "/modules/{$mydirname}";
// defining class of piCal
require_once "{$mod_path}/class/piCal.php";
require_once "{$mod_path}/class/piCal_xoops.php";
// creating an instance of piCal
$cal = new piCal_xoops(date('Y-n-j'), $xoopsConfig['language'], true);
$cal->use_server_TZ = true;
// ignoring cid from GET
// $cal->now_cid = 0 ;
// setting properties of piCal
$cal->conn = $xoopsDB->conn;
include "{$mod_path}/include/read_configs.php";
$cal->base_url = $mod_url;
$cal->base_path = $mod_path;
$cal->images_url = "{$mod_url}/images/{$skin_folder}";
$cal->images_path = "{$mod_path}/images/{$skin_folder}";
$block = $cal->get_blockarray_coming_event("{$mod_url}/index.php", 10, true);
//mb_http_output( 'UTF-8' ) ;
//ob_start( 'mb_output_handler' ) ;
ob_start('xoops_utf8_encode');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<rss version=\"2.0\">\n  <channel>\n    <title>" . $xoopsModule->getVar('name') . ' - ' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "</title>\n    <link>{$mod_url}/</link>\n    <description>" . htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES) . "</description>\n    <lastBuildDate>" . formatTimestamp(time(), 'r') . "</lastBuildDate>\n    <webMaster>" . $xoopsConfig['adminmail'] . "</webMaster>\n    <editor>" . $xoopsConfig['adminmail'] . "</editor>\n    <category>Calendar</category>\n    <generator>piCal for XOOPS</generator>\n    <language>" . _LANGCODE . "</language>\n";
 function pical_minical_ex_show($options)
 {
     global $xoopsConfig, $xoopsDB, $xoopsUser;
     // speed check
     //global $GIJ_common_time ;
     //list($usec, $sec) = explode(" ",microtime());
     //echo ((float)$sec + (float)$usec) - $GIJ_common_time ;
     // get bid
     if (defined('XOOPS_CUBE_LEGACY')) {
         // XoopsCube 2.1
         $bid = $options[sizeof($options) - 1];
     } else {
         if (substr(XOOPS_VERSION, 6, 3) == '2.2') {
             // XOOPS 2.2
             // instanceid as bid from block_instance
             $bid = @$GLOBALS['pical_blockinstance_id'];
         } else {
             // XOOPS 2.0.x/2.3.x/ImpressCMS
             if (is_object($GLOBALS['block_arr'][$GLOBALS['i']])) {
                 // bid from newblocks
                 $bid = $GLOBALS['block_arr'][$GLOBALS['i']]->getVar('bid');
             } else {
                 return array();
             }
         }
     }
     $mydirname = empty($options[0]) ? basename(dirname(dirname(__FILE__))) : $options[0];
     $gifaday = empty($options[1]) ? 2 : intval($options[1]);
     $just1gif = empty($options[2]) ? 0 : 1;
     //	$plugins_tmp = empty( $options[3] ) ? array() : explode( ',' , $options[3] ) ;
     // robots mode (arrows in minicalex will point not a current page but piCal)
     $robots_mode = preg_match('/(msnbot|Googlebot|Yahoo! Slurp)/i', $_SERVER['HTTP_USER_AGENT']);
     // GET URL extraction
     // Only integer values are valid (for preventing from XSS)
     $additional_get = '';
     if (!$robots_mode) {
         foreach ($_GET as $g_key => $g_val) {
             if ($g_key == 'caldate' || $g_key == session_name()) {
                 continue;
             }
             if (intval($g_val) != $g_val) {
                 $additional_get = '';
                 break;
             } else {
                 $additional_get .= '&amp;' . urlencode($g_key) . '=' . intval($g_val);
             }
         }
     }
     // cache enable or not
     if (empty($_POST['pical_jumpcaldate']) && (empty($_GET['caldate']) || in_array(substr($_GET['caldate'], 0, 4), array(date('Y'), date('Y') - 1)))) {
         $enable_cache = true;
         //		$enable_cache = false ;
     } else {
         $enable_cache = false;
     }
     // cache read
     if ($enable_cache) {
         if (empty($_GET['caldate'])) {
             $Ym = date('Ym');
         } else {
             list($Y, $m) = explode('-', $_GET['caldate']);
             if (empty($m)) {
                 $Ym = date('Ym');
             } else {
                 $Ym = sprintf('%04d%02d', $Y, $m);
             }
         }
         $bid_hash = substr(md5($bid . XOOPS_DB_PREFIX), -6);
         $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
         $cache_file = XOOPS_CACHE_PATH . "/{$mydirname}_minical_ex_{$bid_hash}_{$xoopsConfig['language']}_";
         if (file_exists($cache_file . $Ym)) {
             $cache_bodies = file($cache_file . $Ym);
             if (sizeof($cache_bodies) == 3) {
                 $expire = intval($cache_bodies[0]);
                 $prev_uid = intval($cache_bodies[1]);
                 if ($expire > time() && $prev_uid == $uid) {
                     $block = unserialize($cache_bodies[2]);
                     if ($robots_mode) {
                         $block['root_url'] = $block['mod_url'] . '/';
                         // $block['php_self'] = '/' ;
                         $block['additional_get'] = '';
                     } else {
                         $block['root_url'] = '';
                         // $block['php_self'] = $_SERVER['SCRIPT_NAME'] ;
                         $block['additional_get'] = $additional_get;
                     }
                     // speed check
                     //list($usec, $sec) = explode(" ",microtime());
                     //echo ((float)$sec + (float)$usec) - $GIJ_common_time ;
                     return $block;
                 }
             }
         }
     }
     // MyTextSanitizer
     $myts =& MyTextSanitizer::getInstance();
     // setting physical & virtual paths
     $mod_path = XOOPS_ROOT_PATH . "/modules/{$mydirname}";
     $mod_url = XOOPS_URL . "/modules/{$mydirname}";
     // defining class of piCal
     if (!class_exists('piCal_xoops')) {
         require_once "{$mod_path}/class/piCal.php";
         require_once "{$mod_path}/class/piCal_xoops.php";
     }
     // creating an instance of piCal
     $cal = new piCal_xoops("", $xoopsConfig['language'], true);
     // ignoring cid from GET
     $cal->now_cid = 0;
     // setting properties of piCal
     $cal->conn = $xoopsDB->conn;
     include "{$mod_path}/include/read_configs.php";
     $cal->base_url = $mod_url;
     $cal->base_path = $mod_path;
     $cal->images_url = "{$mod_url}/images/{$skin_folder}";
     $cal->images_path = "{$mod_path}/images/{$skin_folder}";
     $block = $cal->get_minical_ex($gifaday, $just1gif, $cal->get_plugins("mcx{$bid}"));
     // speed check
     // global $GIJ_common_time ;
     // list($usec, $sec) = explode(" ",microtime());
     // echo ((float)$sec + (float)$usec) - $GIJ_common_time ;
     if ($enable_cache) {
         $fp = fopen($cache_file . sprintf('%04d%02d', $cal->year, $cal->month), 'w');
         fwrite($fp, time() + 300 . "\n");
         // 5 mininutes (hard coded)
         fwrite($fp, intval($uid) . "\n");
         fwrite($fp, serialize($block));
         fclose($fp);
     }
     if ($robots_mode) {
         $block['root_url'] = $block['mod_url'] . '/';
         // $block['php_self'] = '/' ;
         $block['additional_get'] = '';
     } else {
         $block['root_url'] = '';
         $block['additional_get'] = $additional_get;
     }
     return $block;
 }