Example #1
0
                $hour = $defh;
                $min = $defi;
            }
            $tm = userTimeToServerTime(mktime($hour, $min, 0, $mm, $dd, $yy), $xoopsUser->getVar("timezone_offset"));
            if ($tm >= $edate && $tm > $now) {
                $xoopsDB->query('INSERT INTO ' . EXTBL . "(eidref,exdate)VALUES({$eid},{$tm})");
                $exid = $xoopsDB->getInsertID();
                $updated .= sprintf("(id:%s) %s [new %s]\n", "{$eid}-{$exid}", _MD_EXTENT_DATE, formatTimestamp($tm, _MD_POSTED_FMT));
                $chg++;
            } else {
                $errors[] = "{$v} - " . _MD_DATE_ERR;
            }
        }
    }
    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)));
 *
 * "Optional URL keywords" are those you can find after the module name in URLs.
 *
 * Therefore "Optional URL keywords" can be an active "permalink" 
 * (see permalinks in our documentation for further explanation).
 */
// +-----------------------------------------------------------------------+
//                            initialization                              |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH')) {
    die('Hacking attempt!');
}
include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
check_status(ACCESS_ADMINISTRATOR);
$tpl_extension = isset($conf['extents_for_templates']) ? unserialize($conf['extents_for_templates']) : array();
$new_extensions = get_extents();
/* Selective URLs keyword */
$relevant_parameters = array('----------', 'category', 'favorites', 'most_visited', 'best_rated', 'recent_pics', 'recent_cats', 'created-monthly-calendar', 'posted-monthly-calendar', 'search', 'flat', 'list', 'tags');
$query = '
SELECT permalink
  FROM ' . CATEGORIES_TABLE . '
  WHERE permalink IS NOT NULL
';
/* Add active permalinks */
$permalinks = array_from_query($query, 'permalink');
$relevant_parameters = array_merge($relevant_parameters, $permalinks);
/* Link all supported templates to their respective handle */
$eligible_templates = array('----------' => 'N/A', 'about.tpl' => 'about', 'comments.tpl' => 'comments', 'comment_list.tpl' => 'comment_list', 'footer.tpl' => 'tail', 'header.tpl' => 'header', 'identification.tpl' => 'identification', 'index.tpl' => 'index', 'mainpage_categories.tpl' => 'index_category_thumbnails', 'menubar.tpl' => 'menubar', 'menubar_categories.tpl' => 'mbCategories', 'menubar_identification.tpl' => 'mbIdentification', 'menubar_links.tpl' => 'mbLinks', 'menubar_menu.tpl' => 'mbMenu', 'menubar_specials.tpl' => 'mbSpecials', 'menubar_tags.tpl' => 'mbTags', 'month_calendar.tpl' => 'month_calendar', 'navigation_bar.tpl' => 'navbar', 'nbm.tpl' => 'nbm', 'notification.tpl' => 'notification', 'password.tpl' => 'password', 'picture.tpl' => 'picture', 'picture_content.tpl' => 'default_content', 'picture_nav_buttons.tpl' => 'picture_nav_buttons', 'popuphelp.tpl' => 'popuphelp', 'profile.tpl' => 'profile', 'profile_content.tpl' => 'profile_content', 'redirect.tpl' => 'redirect', 'register.tpl' => 'register', 'search.tpl' => 'search', 'search_rules.tpl' => 'search_rules', 'slideshow.tpl' => 'slideshow', 'tags.tpl' => 'tags', 'thumbnails.tpl' => 'index_thumbnails');
$flip_templates = array_flip($eligible_templates);
$available_templates = array_merge(array('N/A' => '----------'), get_dirs(PHPWG_ROOT_PATH . 'themes'));
// +-----------------------------------------------------------------------+
Example #3
0
            $isadmin = true;
        }
    }
}
set_next_event();
$data = fetch_event($eid, $exid, $isadmin);
if (empty($data)) {
    redirect_header(EGUIDE_URL . '/index.php', 3, _NOPERM);
    exit;
}
$_GET['cat'] = $data['topicid'];
// for notification
$now = time();
$data['exid'] = $exid;
// sub
$extents = get_extents($eid);
if ($exid) {
    $data['extent'] = true;
} else {
    if (count($extents) && $exid == 0) {
        if (count($extents) == 1) {
            // only one extent, chose that.
            header('Location: ' . EGUIDE_URL . '/event.php?eid=' . $eid . '&sub=' . $extents[0]['exid']);
            exit;
        }
        $data['extent'] = true;
        // also show editdate link
        $data['extents'] = $extents;
        $data['exdate'] = $extents[0]['exdate'];
    }
}
                    $value = $dir . $node;
                    $options['model'][$value] = $theme_id . ' / ' . $node;
                    $i++;
                }
            }
        }
    }
    if (end($options['model']) == '----------------------') {
        array_pop($options['model']);
    }
    // Assign variables to template
    $template->assign('create_tpl', array('NEW_FILE_NAME' => $filename, 'MODEL_OPTIONS' => $options['model'], 'MODEL_SELECTED' => $selected['model'], 'PARENT_OPTIONS' => $options['parent'], 'PARENT_SELECTED' => $selected['parent']));
} else {
    // List existing template extensions
    $selected = 0;
    $options[] = l10n('locfiledit_choose_file');
    $options[] = '----------------------';
    foreach (get_extents() as $pwg_template) {
        $value = $pwg_template;
        $options[$value] = str_replace('/', ' / ', $pwg_template);
        if ($edited_file == $value) {
            $selected = $value;
        }
    }
    if ($selected == 0 and !empty($edited_file)) {
        $options[$edited_file] = str_replace(array('./template-extension/', '/'), array('', ' / '), $edited_file);
        $selected = $edited_file;
    }
    $template->assign('css_lang_tpl', array('SELECT_NAME' => 'file_to_edit', 'OPTIONS' => $options, 'SELECTED' => $selected, 'NEW_FILE_URL' => $my_base_url . '-tpl&newfile', 'NEW_FILE_CLASS' => empty($edited_file) ? '' : 'top_right'));
}
$codemirror_mode = 'text/html';
Example #5
0
/**
 * returns a list of templates currently available in template-extension.
 * Each .tpl file is extracted from template-extension.
 *
 * @param string $start (internal use)
 * @return string[]
 */
function get_extents($start = '')
{
    if ($start == '') {
        $start = './template-extension';
    }
    $dir = opendir($start);
    $extents = array();
    while (($file = readdir($dir)) !== false) {
        if ($file == '.' or $file == '..' or $file == '.svn') {
            continue;
        }
        $path = $start . '/' . $file;
        if (is_dir($path)) {
            $extents = array_merge($extents, get_extents($path));
        } elseif (!is_link($path) and file_exists($path) and get_extension($path) == 'tpl') {
            $extents[] = substr($path, 21);
        }
    }
    return $extents;
}