本文整理汇总了PHP中pnVarPrepForOS函数的典型用法代码示例。如果您正苦于以下问题:PHP pnVarPrepForOS函数的具体用法?PHP pnVarPrepForOS怎么用?PHP pnVarPrepForOS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnVarPrepForOS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_pc_view_select
/**
* $Id$
*
* PostCalendar::PostNuke Events Calendar Module
* Copyright (C) 2002 The PostCalendar Team
* http://postcalendar.tv
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* To read the license please read the docs/license.txt or visit
* http://www.gnu.org/copyleft/gpl.html
*
*/
function smarty_function_pc_view_select($args)
{
@define('_PC_FORM_TEMPLATE', true);
$Date = postcalendar_getDate();
if (!isset($y)) {
$y = substr($Date, 0, 4);
}
if (!isset($m)) {
$m = substr($Date, 4, 2);
}
if (!isset($d)) {
$d = substr($Date, 6, 2);
}
$tplview = pnVarCleanFromInput('tplview');
$viewtype = pnVarCleanFromInput('viewtype');
if (!isset($viewtype)) {
$viewtype = _SETTING_DEFAULT_VIEW;
}
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$mdir = pnVarPrepForOS($modinfo['directory']);
unset($modinfo);
$pcTemplate = pnVarPrepForOS(_SETTING_TEMPLATE);
if (empty($pcTemplate)) {
$pcTemplate = 'default';
}
$viewlist = array();
$handle = opendir("modules/{$mdir}/pntemplates/{$pcTemplate}/views/{$viewtype}");
$hide_list = array('.', '..', 'CVS', 'index.html');
while ($f = readdir($handle)) {
if (!in_array($f, $hide_list)) {
$viewlist[] = $f;
}
}
closedir($handle);
unset($no_list);
sort($viewlist);
$tcount = count($viewlist);
//$options = "<select id=\"tplview\" name=\"tplview\" class=\"$args[class]\">"; - pennfirm
$options = "<select id=\"tplview\" name=\"viewtype\" class=\"{$args['class']}\">";
$selected = $tplview;
for ($t = 0; $t < $tcount; $t++) {
$id = str_replace('.html', '', $viewlist[$t]);
$sel = $selected == $id ? 'selected' : '';
$options .= "<option value=\"{$id}\" {$sel} class=\"{$args['class']}\">{$id}</option>";
}
$options .= '</select>';
if (!isset($args['label'])) {
$args['label'] = _PC_TPL_VIEW_SUBMIT;
}
$submit = '<input type="submit" valign="middle" name="submit" value="' . $args['label'] . '" class="' . $args['class'] . '" />';
// build the form
if ($t > 1) {
echo $options, $submit;
}
}
示例2: admin_menu
function admin_menu($help_file = '')
{
$pntable = pnDBGetTables();
list($newsubs) = db_select_one_row("SELECT count(*) FROM {$pntable['queue']}");
if (!pnSecAuthAction(0, "::", '::', ACCESS_EDIT)) {
// suppress admin display - return to index.
pnRedirect('index.php');
} else {
menu_title('admin.php', _ADMINMENU);
menu_graphic(pnConfigGetVar('admingraphic'));
if ($help_file != '') {
menu_help($help_file, _ONLINEMANUAL);
}
$mods = pnModGetAdminMods();
if ($mods == false) {
// there aren't admin modules
return;
}
foreach ($mods as $mod) {
// Hack until the new news module comes into being
// TODO - remove this at appropriate time
if ($mod['name'] == 'AddStory') {
$mod['name'] = 'Stories';
}
if (pnSecAuthAction(0, "{$mod['name']}::", '::', ACCESS_EDIT)) {
if (file_exists("modules/" . pnVarPrepForOS($mod['directory']) . "/pnadmin.php")) {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/pnimages/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option(pnVarPrepForDisplay(pnModURL($mod['name'], 'admin')), $mod['displayname'], $imgfile);
} else {
$file = "modules/" . pnVarPrepForOS($mod['directory']) . "/images/admin.";
if (file_exists($file . 'gif')) {
$imgfile = $file . 'gif';
} elseif (file_exists($file . 'jpg')) {
$imgfile = $file . 'jpg';
} elseif (file_exists($file . 'png')) {
$imgfile = $file . 'png';
} else {
$imgfile = 'modules/NS-Admin/images/default.gif';
}
menu_add_option("admin.php?module={$mod['directory']}&op=main", $mod['displayname'], $imgfile);
}
}
}
}
}
示例3: pnThemeInfo
/**
* pnThemeInfo()
* <br />
* This function returns information about a certain theme.
* For this purpose, it includes the xaninfo.php file (for
* Xanthia themes) or the themeinfo.php (for other themes).
* <br />
* If the name passed isn't a valid theme, false is returned.
* <br />
* For a valid theme, at least these values are returned:
* xanthia (boolean, true if this is a Xanthia theme)
* hidden (boolean, true if this is a hidden theme)
* active (boolean, true if the theme is active)
*
* @author Joerg Napp
* @since PostNuke .760
* @param string $theme the name of the theme
* @return array the theme information
**/
function pnThemeInfo($theme)
{
$theme = isset($theme) ? $theme : '';
if (!pnVarValidate($theme, 'theme')) {
return false;
}
$themepath = pnVarPrepForOS($theme);
// determine if this is a valid theme
if (!file_exists(WHERE_IS_PERSO . "themes/{$themepath}/theme.php") && !file_exists("themes/{$themepath}/theme.php")) {
return false;
}
$themeinfo = array();
// Setting the defaults
$themeinfo['name'] = $theme;
// might be useful
$themeinfo['hidden'] = false;
// A theme isn't hidden unless explicitly marked as hidden
$themeinfo['xanthia'] = false;
// assume the theme not to be a Xanthia theme unless xaninfo.php is present.
$themeinfo['active'] = true;
// assume the theme to be active unless it isn't
if (file_exists($file = WHERE_IS_PERSO . "themes/{$themepath}/themeinfo.php")) {
include $file;
} elseif (file_exists($file = "themes/{$themepath}/themeinfo.php")) {
include $file;
} elseif (file_exists($file = WHERE_IS_PERSO . "themes/{$themepath}/xaninfo.php")) {
$themeinfo['xanthia'] = true;
include $file;
} elseif (file_exists($file = "themes/{$themepath}/xaninfo.php")) {
$themeinfo['xanthia'] = true;
include $file;
}
if ($themeinfo['xanthia']) {
if (pnModAPILoad('Xanthia', 'user')) {
// see if the skin is in the database (=active)
$skinid = pnModAPIFunc('Xanthia', 'user', 'getSkinID', array('skin' => $theme));
$themeinfo['active'] = (bool) $skinid;
} else {
// don't use Xanthia themes without Xanthia.
// Maybe the function should return false (= not a valid theme) in this case?
$themeinfo['active'] = false;
}
}
return $themeinfo;
}
示例4: getmodulesinstanceschemainfo
function getmodulesinstanceschemainfo()
{
$moddir = opendir('modules/');
while ($modname = readdir($moddir)) {
// Old-style version file
$osfile = 'modules/' . pnVarPrepForOS($modname) . '/Version.php';
@(include $osfile);
// New-style version file
$osfile = 'modules/' . pnVarPrepForOS($modname) . '/pnversion.php';
@(include $osfile);
if (!empty($modversion['securityschema'])) {
foreach ($modversion['securityschema'] as $component => $instance) {
pnSecAddSchema($component, $instance);
}
}
$modversion['securityschema'] = '';
}
closedir($moddir);
}
示例5: switch
exit;
} else {
// Old-old style of loading modules
if (empty($op)) {
$op = "modload";
}
if (empty($file)) {
$file = "index";
}
include 'includes/legacy.php';
switch ($op) {
case 'modload':
define("LOADED_AS_MODULE", "1");
// added for the module/system seperation [class007]
if (file_exists('modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php')) {
include 'modules/' . pnVarPrepForOS($name) . '/' . pnVarPrepForOS($file) . '.php';
} else {
// Failed to load the module
$output = new pnHTML();
//$output->StartPage();
$output->Text('Failed to load module ' . $module);
$output->EndPage();
$output->PrintPage();
exit;
}
break;
default:
// Failed to load the module
$output = new pnHTML();
//$output->StartPage();
$output->Text('Sorry, you cannot access this file directly...');
示例6: postcalendar_admin_categoryLimits
function postcalendar_admin_categoryLimits($msg = '', $e = '', $args)
{
if (!PC_ACCESS_ADD) {
return _POSTCALENDARNOAUTH;
}
extract($args);
unset($args);
$output = new pnHTML();
$output->SetInputMode(_PNH_VERBATIMINPUT);
// set up Smarty
$tpl = new pcSmarty();
$tpl->caching = false;
$template_name = pnModGetVar(__POSTCALENDAR__, 'pcTemplate');
if (!isset($template_name)) {
$template_name = 'default';
}
if (!empty($e)) {
$output->Text('<div style="padding:5px; border:1px solid red; background-color: pink;">');
$output->Text('<center><b>' . $e . '</b></center>');
$output->Text('</div><br />');
}
if (!empty($msg)) {
$output->Text('<div style="padding:5px; border:1px solid green; background-color: lightgreen;">');
$output->Text('<center><b>' . $msg . '</b></center>');
$output->Text('</div><br />');
}
//=================================================================
// Setup the correct config file path for the templates
//=================================================================
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$modir = pnVarPrepForOS($modinfo['directory']);
$modname = $modinfo['displayname'];
//print_r($all_categories);
unset($modinfo);
$tpl->assign('action', pnModURL(__POSTCALENDAR__, 'admin', 'categoryLimitsUpdate'));
//===============================================================
// Setup titles for smarty
//===============================================================
$tpl->assign('_PC_LIMIT_TITLE', _PC_LIMIT_TITLE);
$tpl->assign('StartTimeTitle', _PC_LIMIT_START_TIME);
$tpl->assign('EndTimeTile', _PC_LIMIT_END_TIME);
$tpl->assign('LimitHoursTitle', _PC_TIMED_DURATION_HOURS);
$tpl->assign('LimitMinutesTitle', _PC_TIMED_DURATION_MINUTES);
//=============================================================
// Setup Vars for smarty
//============================================================
$tpl->assign('mer_title', 'mer');
$mer = array('am', 'pm');
$tpl->assign_by_ref('mer', $mer);
$tpl->assign('starttimeh', 'starttimeh');
$tpl->assign('starttimem', 'starttimem');
$tpl->assign('endtimeh', 'endtimeh');
$tpl->assign('endtimem', 'endtimem');
$tpl->assign('InputLimit', 'limit');
$tpl->assign('LimitTitle', _PC_LIMIT_TITLE);
$tpl->assign('_PC_NEW_LIMIT_TITLE', _PC_NEW_LIMIT_TITLE);
$tpl->assign('_PC_CAT_DELETE', _PC_CAT_DELETE);
$tpl->assign('EndTimeTitle', _PC_LIMIT_END_TIME);
$hour_array = array('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '21', '21', '22', '23');
$min_array = array('00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55');
$tpl->assign_by_ref('hour_array', $hour_array);
$tpl->assign_by_ref('min_array', $min_array);
$categories = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getCategories');
// create translations of category names if applicable
$sizeAllCat = count($categories);
for ($m = 0; $m < $sizeAllCat; $m++) {
$tempCategory = $categories[$m]["name"];
$categories[$m]["name"] = xl_appt_category($tempCategory);
}
$tpl->assign_by_ref('categories', $categories);
$limits = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getCategoryLimits');
$tpl->assign_by_ref('limits', $limits);
$tpl->assign('BGCOLOR2', $GLOBALS['style']['BGCOLOR2']);
$tpl->assign("catTitle", _PC_REP_CAT_TITLE_S);
$tpl->assign("catid", "catid");
$form_submit = '<input type=hidden name="form_action" value="commit"/>
' . $authkey . '<input type="submit" name="submit" value="' . xl('go') . '">';
$tpl->assign('FormSubmit', $form_submit);
$output->Text($tpl->fetch($template_name . '/admin/submit_category_limit.html'));
$output->Text(postcalendar_footer());
return $output->GetOutput();
}
示例7: __construct
function __construct()
{
$theme = pnUserGetTheme();
$osTheme = pnVarPrepForOS($theme);
pnThemeLoad($theme);
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $bgcolor6, $textcolor1, $textcolor2;
// call constructor
parent::__construct();
// gather module information
$pcModInfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$pcDir = pnVarPrepForOS($pcModInfo['directory']);
$pcDisplayName = $pcModInfo['displayname'];
unset($pcModInfo);
// setup up pcSmarty configs
$this->compile_check = true;
$this->force_compile = false;
$this->debugging = false;
$this->template_dir = "modules/{$pcDir}/pntemplates";
array_push($this->plugins_dir, "modules/{$pcDir}/pnincludes/Smarty/plugins");
array_push($this->plugins_dir, "modules/{$pcDir}/plugins");
$this->compile_dir = "modules/{$pcDir}/pntemplates/compiled";
$this->cache_dir = "modules/{$pcDir}/pntemplates/cache";
$this->caching = _SETTING_USE_CACHE;
$this->cache_lifetime = _SETTING_CACHE_LIFETIME;
$this->left_delimiter = '[-';
$this->right_delimiter = '-]';
//============================================================
// checks for safe mode
// i think it's safe to say we can do this automagically now
//============================================================
$safe_mode = ini_get('safe_mode');
$safe_mode_gid = ini_get('safe_mode_gid');
$open_basedir = ini_get('open_basedir');
$use_safe_mode = (bool) $safe_mode || (bool) $safe_mode_gid || !empty($open_basedir);
if ($use_safe_mode) {
$this->use_sub_dirs = false;
} else {
$this->use_sub_dirs = true;
}
unset($use_safe_mode, $safe_mode, $safe_mode_gid, $open_basedir);
$this->autoload_filters = array('output' => array('trimwhitespace'));
$lang = pnUserGetLang();
$func = pnVarCleanFromInput('func');
$print = pnVarCleanFromInput('print');
// assign theme globals
$this->assign_by_ref('BGCOLOR1', $bgcolor1);
$this->assign_by_ref('BGCOLOR2', $bgcolor2);
$this->assign_by_ref('BGCOLOR3', $bgcolor3);
$this->assign_by_ref('BGCOLOR4', $bgcolor4);
$this->assign_by_ref('BGCOLOR5', $bgcolor5);
$this->assign_by_ref('BGCOLOR6', $bgcolor6);
$this->assign_by_ref('TEXTCOLOR1', $textcolor1);
$this->assign_by_ref('TEXTCOLOR2', $textcolor2);
$this->assign_by_ref('USER_LANG', $lang);
$this->assign_by_ref('FUNCTION', $func);
$this->assign('PRINT_VIEW', $print);
$this->assign('USE_POPUPS', _SETTING_USE_POPUPS);
$this->assign('USE_TOPICS', _SETTING_DISPLAY_TOPICS);
$this->assign('USE_INT_DATES', _SETTING_USE_INT_DATES);
$this->assign('OPEN_NEW_WINDOW', _SETTING_OPEN_NEW_WINDOW);
$this->assign('EVENT_DATE_FORMAT', _SETTING_DATE_FORMAT);
$this->assign('HIGHLIGHT_COLOR', _SETTING_DAY_HICOLOR);
$this->assign('24HOUR_TIME', _SETTING_TIME_24HOUR);
$this->assign_by_ref('MODULE_NAME', $pcDisplayName);
$this->assign_by_ref('MODULE_DIR', $pcDir);
$this->assign('ACCESS_NONE', PC_ACCESS_NONE);
$this->assign('ACCESS_OVERVIEW', PC_ACCESS_OVERVIEW);
$this->assign('ACCESS_READ', PC_ACCESS_READ);
$this->assign('ACCESS_COMMENT', PC_ACCESS_COMMENT);
$this->assign('ACCESS_MODERATE', PC_ACCESS_MODERATE);
$this->assign('ACCESS_EDIT', PC_ACCESS_EDIT);
$this->assign('ACCESS_ADD', PC_ACCESS_ADD);
$this->assign('ACCESS_DELETE', PC_ACCESS_DELETE);
$this->assign('ACCESS_ADMIN', PC_ACCESS_ADMIN);
//=================================================================
// Find out what Template we're using
//=================================================================
$template_name = _SETTING_TEMPLATE;
if (!isset($template_name)) {
$template_name = 'default';
}
//=================================================================
// Find out what Template View to use
//=================================================================
$template_view = pnVarCleanFromInput('tplview');
if (!isset($template_view)) {
$template_view = 'default';
}
$this->config_dir = "modules/{$pcDir}/pntemplates/{$template_name}/config/";
$this->assign_by_ref('TPL_NAME', $template_name);
$this->assign_by_ref('TPL_VIEW', $template_view);
$this->assign('TPL_IMAGE_PATH', $GLOBALS['rootdir'] . "/main/calendar/modules/{$pcDir}/pntemplates/{$template_name}/images");
$this->assign('TPL_ROOTDIR', $GLOBALS['rootdir']);
$this->assign('TPL_STYLE_PATH', "modules/{$pcDir}/pntemplates/{$template_name}/style");
$this->assign('THEME_PATH', "themes/{$osTheme}");
}
示例8: postcalendar_userapi_buildView
/**
* postcalendar_userapi_buildView
*
* Builds the calendar display
* @param string $Date mm/dd/yyyy format (we should use timestamps)
* @return string generated html output
* @access public
*/
function postcalendar_userapi_buildView($args)
{
$print = pnVarCleanFromInput('print');
$show_days = pnVarCleanFromInput('show_days');
extract($args);
unset($args);
$schedule_start = $GLOBALS[schedule_start];
$schedule_end = $GLOBALS[schedule_end];
// $times is an array of associative arrays, where each sub-array
// has keys 'hour', 'minute' and 'mer'.
//
$times = array();
// For each hour in the schedule...
//
for ($blocknum = $schedule_start; $blocknum <= $schedule_end; $blocknum++) {
$mer = $blocknum >= 12 ? 'pm' : 'am';
// $minute is an array of time slot strings within this hour.
$minute = array('00');
for ($minutes = $GLOBALS['calendar_interval']; $minutes <= 60; $minutes += $GLOBALS['calendar_interval']) {
if ($minutes <= '9') {
$under_ten = "0" . $minutes;
array_push($minute, "{$under_ten}");
} else {
if ($minutes >= '60') {
break;
} else {
array_push($minute, "{$minutes}");
}
}
}
foreach ($minute as $m) {
array_push($times, array("hour" => $blocknum, "minute" => $m, "mer" => $mer));
}
}
//=================================================================
// get the module's information
//=================================================================
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$pcDir = $modinfo['directory'];
unset($modinfo);
//=================================================================
// grab the for post variable
//=================================================================
// $pc_username = pnVarCleanFromInput('pc_username');
$pc_username = $_SESSION['pc_username'];
// from Michael Brinson 2006-09-19
$category = pnVarCleanFromInput('pc_category');
$topic = pnVarCleanFromInput('pc_topic');
//=================================================================
// set the correct date
//=================================================================
$Date = postcalendar_getDate();
//=================================================================
// get the current view
//=================================================================
if (!isset($viewtype)) {
$viewtype = 'month';
}
//=================================================================
// Find out what Template we're using
//=================================================================
$template_name = _SETTING_TEMPLATE;
if (!isset($template_name)) {
$template_name = 'default';
}
//=================================================================
// Find out what Template View to use
//=================================================================
$template_view = pnVarCleanFromInput('tplview');
if (!isset($template_view)) {
$template_view = 'default';
}
//=================================================================
// See if the template view exists
//=================================================================
if (!file_exists("modules/{$pcDir}/pntemplates/{$template_name}/views/{$viewtype}/{$template_view}.html")) {
$template_view_load = 'default';
} else {
$template_view_load = pnVarPrepForOS($template_view);
}
//=================================================================
// Grab the current theme information
//=================================================================
pnThemeLoad(pnUserGetTheme());
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $bgcolor6, $textcolor1, $textcolor2;
//=================================================================
// Insert necessary JavaScript into the page
//=================================================================
$output = pnModAPIFunc(__POSTCALENDAR__, 'user', 'pageSetup');
//=================================================================
// Setup Smarty Template Engine
//=================================================================
//.........这里部分代码省略.........
示例9: smarty_function_pc_filter
/**
* $Id$
*
* PostCalendar::PostNuke Events Calendar Module
* Copyright (C) 2002 The PostCalendar Team
* http://postcalendar.tv
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* To read the license please read the docs/license.txt or visit
* http://www.gnu.org/copyleft/gpl.html
*
*/
function smarty_function_pc_filter($args, &$smarty)
{
extract($args);
unset($args);
if (empty($type)) {
$smarty->trigger_error("pc_filter: missing 'type' parameter");
return;
}
$Date = postcalendar_getDate();
if (!isset($y)) {
$y = substr($Date, 0, 4);
}
if (!isset($m)) {
$m = substr($Date, 4, 2);
}
if (!isset($d)) {
$d = substr($Date, 6, 2);
}
$tplview = pnVarCleanFromInput('tplview');
$viewtype = pnVarCleanFromInput('viewtype');
$pc_username = pnVarCleanFromInput('pc_username');
if (!isset($viewtype)) {
$viewtype = _SETTING_DEFAULT_VIEW;
}
$types = explode(',', $type);
$output = new pnHTML();
$output->SetOutputMode(_PNH_RETURNOUTPUT);
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$mdir = pnVarPrepForOS($modinfo['directory']);
unset($modinfo);
$pcTemplate = pnVarPrepForOS(_SETTING_TEMPLATE);
if (empty($pcTemplate)) {
$pcTemplate = 'default';
}
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
//================================================================
// build the username filter pulldown
//================================================================
if (in_array('user', $types)) {
@define('_PC_FORM_USERNAME', true);
$sql = "SELECT DISTINCT users.username, users.lname, users.fname\n\t \t\t\tFROM {$pntable['postcalendar_events']}, users where users.id=pc_aid\n\t\t\t\tORDER BY pc_aid";
$result = $dbconn->Execute($sql);
if ($result !== false) {
$useroptions = "<select multiple='multiple' size='3' name=\"pc_username[]\" class=\"{$class}\">";
$useroptions .= "<option value=\"\" class=\"{$class}\">" . _PC_FILTER_USERS . "</option>";
$selected = $pc_username == '__PC_ALL__' ? 'selected="selected"' : '';
$useroptions .= "<option value=\"__PC_ALL__\" class=\"{$class}\" {$selected}>" . _PC_FILTER_USERS_ALL . "</option>";
for (; !$result->EOF; $result->MoveNext()) {
$sel = $pc_username == $result->fields[0] ? 'selected="selected"' : '';
$useroptions .= "<option value=\"" . $result->fields[0] . "\" {$sel} class=\"{$class}\">" . $result->fields[1] . ", " . $result->fields[2] . "</option>";
}
$useroptions .= '</select>';
$result->Close();
}
}
//================================================================
// build the category filter pulldown
//================================================================
if (in_array('category', $types)) {
@define('_PC_FORM_CATEGORY', true);
$category = pnVarCleanFromInput('pc_category');
$categories = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getCategories');
$catoptions = "<select name=\"pc_category\" class=\"{$class}\">";
$catoptions .= "<option value=\"\" class=\"{$class}\">" . _PC_FILTER_CATEGORY . "</option>";
foreach ($categories as $c) {
$sel = $category == $c['id'] ? 'selected="selected"' : '';
$catoptions .= "<option value=\"{$c['id']}\" {$sel} class=\"{$class}\">" . xl_appt_category($c[name]) . "</option>";
}
$catoptions .= '</select>';
}
//================================================================
// build the topic filter pulldown
//================================================================
if (in_array('topic', $types) && _SETTING_DISPLAY_TOPICS) {
//.........这里部分代码省略.........
示例10: pnBlockLoadAll
/**
* load all blocks
*/
function pnBlockLoadAll()
{
// Load core and old-style blocks
global $blocks_modules;
$dib = opendir('includes/blocks/');
while ($f = readdir($dib)) {
if (preg_match('/\\.php$/', $f)) {
$block = preg_replace('/\\.php$/', '', $f);
if (!pnBlockLoad('Core', $block)) {
// Block load failed
return false;
}
if (!isset($blocks_modules[$block]['module'])) {
$blocks_modules[$block]['bkey'] = $block;
$blocks_modules[$block]['module'] = 'Core';
$blocks_modules[$block]['mid'] = 0;
}
}
}
closedir($dib);
// Load new-style blocks
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$modulestable = $pntable['modules'];
$modulescolumn =& $pntable['modules_column'];
$sql = "SELECT {$modulescolumn['name']},\n {$modulescolumn['directory']},\n {$modulescolumn['id']}\n FROM {$modulestable}";
$result = $dbconn->Execute($sql);
if ($dbconn->ErrorNo() != 0) {
return;
}
while (list($name, $directory, $mid) = $result->fields) {
$result->MoveNext();
$blockdir = 'modules/' . pnVarPrepForOS($directory) . '/pnblocks';
if (!@is_dir($blockdir)) {
continue;
}
$dib = opendir($blockdir);
while ($f = readdir($dib)) {
if (preg_match('/\\.php$/', $f)) {
$block = preg_replace('/\\.php$/', '', $f);
if (!pnBlockLoad($name, $block)) {
// Block load failed
return false;
}
// Get info on the block
$usname = preg_replace('/ /', '_', $name);
$infofunc = $usname . '_' . $block . 'block_info';
if (function_exists($infofunc)) {
$blocks_modules["{$name}{$block}"] = $infofunc();
if (!isset($blocks_modules["{$name}{$block}"]['module'])) {
$blocks_modules["{$name}{$block}"]['module'] = $name;
}
$blocks_modules["{$name}{$block}"]['bkey'] = $block;
$blocks_modules["{$name}{$block}"]['mid'] = $mid;
} else {
// Might be old-style block in new place - sigh
if (!empty($blocks_modules[$block])) {
$blocks_modules["{$name}{$block}"] = $blocks_modules[$block];
unset($blocks_modules[$block]);
if (!isset($blocks_modules["{$name}{$block}"]['module'])) {
$blocks_modules["{$name}{$block}"]['module'] = $name;
}
$blocks_modules["{$name}{$block}"]['bkey'] = $block;
$blocks_modules["{$name}{$block}"]['mid'] = $mid;
}
}
}
}
}
$result->Close();
// Return information gathered
return $blocks_modules;
}
示例11: smarty_function_pc_url
/**
* $Id$
*
* PostCalendar::PostNuke Events Calendar Module
* Copyright (C) 2002 The PostCalendar Team
* http://postcalendar.tv
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* To read the license please read the docs/license.txt or visit
* http://www.gnu.org/copyleft/gpl.html
*
*/
function smarty_function_pc_url($args)
{
//print "<br />args<br />";
//print_r($args);
//print "<br />args<br />";
extract($args);
unset($args);
if (!isset($action)) {
$action = _SETTING_DEFAULT_VIEW;
}
if (empty($print)) {
$print = false;
} else {
$print = true;
}
$starth = "";
if ($setdeftime == 1) {
$starth = date("H");
}
$ampm = 1;
if ($starth >= 12) {
$ampm = 2;
}
$template_view = pnVarCleanFromInput('tplview');
$viewtype = strtolower(pnVarCleanFromInput('viewtype'));
// pnVarCleanFromInput('pc_username'); //(CHEMED) replaced by the code below
//(CHEMED) Facility filtering
$pc_username = $_SESSION['pc_username'];
$pc_facility = $_SESSION['pc_facility'];
//END (CHEMED)
$category = pnVarCleanFromInput('pc_category');
$topic = pnVarCleanFromInput('pc_topic');
$popup = pnVarCleanFromInput('popup');
if (!isset($date)) {
$Date = postcalendar_getDate();
} else {
$Date = $date;
}
// some extra cleanup if necessary
$Date = str_replace('-', '', $Date);
$pcModInfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$pcDir = pnVarPrepForOS($pcModInfo['directory']);
switch ($action) {
case 'submit':
if (!empty($starth)) {
$link = pnModURL(__POSTCALENDAR__, 'user', 'submit', array('tplview' => $template_view, 'Date' => $Date, 'event_starttimeh' => $starth, 'event_startampm' => $ampm));
} else {
$link = pnModURL(__POSTCALENDAR__, 'user', 'submit', array('tplview' => $template_view, 'Date' => $Date));
}
break;
case 'submit-admin':
$link = pnModURL(__POSTCALENDAR__, 'admin', 'submit', array('tplview' => $template_view, 'Date' => $Date));
break;
case 'search':
$link = pnModURL(__POSTCALENDAR__, 'user', 'search');
break;
case 'day':
$link = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'day', 'Date' => $Date, 'pc_facility' => $pc_facility, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic, 'print' => $print), $localpath);
break;
case 'week':
$link = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'week', 'Date' => $Date, 'pc_facility' => $pc_facility, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic, 'print' => $print));
break;
case 'month':
$link = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => $Date, 'pc_facility' => $pc_facility, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic, 'print' => $print));
break;
case 'year':
$link = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'year', 'Date' => $Date, 'pc_facility' => $pc_facility, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic, 'print' => $print));
break;
case 'detail':
if (isset($eid)) {
if (_SETTING_OPEN_NEW_WINDOW && !$popup) {
$link = "javascript:opencal({$eid},'{$Date}');";
} else {
$link = pnModURL(__POSTCALENDAR__, 'user', 'view', array('Date' => $Date, 'tplview' => $template_view, 'viewtype' => 'details', 'eid' => $eid, 'print' => $print), $localpath);
}
//.........这里部分代码省略.........
示例12: user_dynamic_data
function user_dynamic_data()
{
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$currentlangfile = 'language/' . pnVarPrepForOS(pnUserGetLang()) . '/user.php';
$defaultlangfile = 'language/' . pnVarPrepForOS(pnConfigGetVar('language')) . '/user.php';
if (file_exists($currentlangfile)) {
include $currentlangfile;
} elseif (file_exists($defaultlangfile)) {
include $defaultlangfile;
}
include "header.php";
GraphicAdmin();
OpenTable();
echo "<center><font class=\"pn-title\"><b>" . _USERADMIN . "</b></font></center>";
CloseTable();
// This section displays the dynamic fields
// and the order in which they are displayed
OpenTable();
print '<center><font size="3" class="pn-title"><b>' . _DYNAMICDATA . '</b></font></center><br>' . '<table class=\'pn-normal\' border=\'1\' width=\'100%\'>' . '<tr>' . '<th>' . _FIELDACTIVE . '</th>' . '<th colspan=\'2\'>' . _FIELDLABEL . '</th>' . '<th>' . _FIELDWEIGHT . '</th>' . '<th>' . _FIELDTYPE . '</th>' . '<th>' . _FIELDLENGTH . '</th>' . '<th>' . _DELETE . '</th>' . '</tr>';
$column =& $pntable['user_property_column'];
$result = $dbconn->Execute("SELECT {$column['prop_id']}, {$column['prop_label']},{$column['prop_dtype']},\n {$column['prop_length']}, {$column['prop_weight']}, {$column['prop_validation']}\n FROM {$pntable['user_property']} ORDER BY {$column['prop_weight']}");
if ($dbconn->ErrorNo() != 0) {
echo $dbconn->ErrorNo() . "List User Properties: " . $dbconn->ErrorMsg() . "<br>";
error_log($dbconn->ErrorNo() . "List User Properties: " . $dbconn->ErrorMsg() . "<br>");
return;
}
$active_count = 0;
$true_count = 0;
$total_count = $result->PO_RecordCount();
$prop_weight = 0;
while (list($prop_id, $prop_label, $prop_dtype, $prop_length, $prop_weight, $prop_validation) = $result->fields) {
$result->MoveNext();
$true_count++;
if ($prop_weight != 0) {
$active_count++;
$next_prop_weight = $active_count + 1;
}
$eval_cmd = "\$prop_label_text={$prop_label};";
@eval($eval_cmd);
// display the proper icom and link to enable or disable the field
switch (true) {
// Mandatory Images can't be disabled
case $prop_dtype == _UDCONST_MANDATORY:
$img_cmd = '<img src="images/global/green_dot.gif" border=0 ALT="' . _FIELD_REQUIRED . '">';
break;
case $prop_weight != 0:
$img_cmd = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=deactivate_property&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/green_dot.gif" border=0 ALT="' . _FIELD_DEACTIVATE . '">' . '</a>';
break;
default:
$img_cmd = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=activate_property&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/red_dot.gif" border=0 ALT="' . _FIELD_ACTIVATE . '">' . '</a>';
}
switch ($prop_dtype) {
case _UDCONST_MANDATORY:
$data_type_text = _UDT_MANDATORY;
$data_length_text = _FIELD_NA;
break;
case _UDCONST_CORE:
$data_type_text = _UDT_CORE;
$data_length_text = _FIELD_NA;
break;
case _UDCONST_STRING:
$data_type_text = _UDT_STRING;
$data_length_text = $prop_length;
break;
case _UDCONST_TEXT:
$data_type_text = _UDT_TEXT;
$data_length_text = _FIELD_NA;
break;
case _UDCONST_FLOAT:
$data_type_text = _UDT_FLOAT;
$data_length_text = _FIELD_NA;
break;
case _UDCONST_INTEGER:
$data_type_text = _UDT_INTEGER;
$data_length_text = _FIELD_NA;
break;
default:
$data_length_text = "";
$data_type_text = "";
}
switch (true) {
case $active_count == 0:
$arrows = " ";
break;
case $active_count == 1:
$arrows = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=increase_weight&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/down.gif" alt="' . _DOWN . '" border="0">' . '</a>';
break;
case $true_count == $total_count:
$arrows = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=decrease_weight&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/up.gif" alt="' . _UP . '" border="0">' . '</a>';
break;
default:
$arrows = '<img src="images/global/up.gif" alt="' . _UP . '"> <img src="images/global/down.gif" alt="' . _DOWN . '">';
$arrows = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=decrease_weight&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/up.gif" border="0" alt="' . _UP . '">' . '</a> ' . "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=increase_weight&property={$prop_id}&weight={$prop_weight}\">" . '<img src="images/global/down.gif" border="0" alt="' . _DOWN . '">' . '</a>';
}
if ($prop_dtype == _UDCONST_MANDATORY || $prop_dtype == _UDCONST_CORE) {
$del_text = _FIELD_NA;
} else {
$del_text = "<a href=\"admin.php?module=" . $GLOBALS['module'] . "&op=delete_property&property={$prop_id}\">" . _DELETE . '</a>';
}
//.........这里部分代码省略.........
示例13: pnRender
$pnRender =& new pnRender($modinfo['name']);
$pnRender->assign($return);
if (isset($return['template'])) {
echo $pnRender->fetch($return['template']);
} else {
$modname = strtolower($modinfo['name']);
$type = strtolower($type);
$func = strtolower($func);
echo $pnRender->fetch("{$modname}_{$type}_{$func}.htm");
}
} else {
echo 'Function <em>' . pnVarPrepForDisplay($func) . '</em> in module <em>' . pnVarPrepForDisplay($module) . '</em> returned.';
}
include_once 'footer.php';
}
} else {
// Old-old style of loading modules
if (empty($file)) {
$file = 'index';
}
define('LOADED_AS_MODULE', '1');
if (file_exists('modules/' . pnVarPrepForOS($modinfo['directory']) . '/' . pnVarPrepForOS($file) . '.php')) {
include 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/' . pnVarPrepForOS($file) . '.php';
} else {
// Failed to load the module
header('HTTP/1.0 404 Not Found');
include 'header.php';
echo 'Failed to load module <strong>' . pnVarPrepForDisplay($modinfo['name']) . '</strong>';
include 'footer.php';
}
}
示例14: get_template_path
/**
* Checks which path to use for required template
*
* @param string $template
*/
function get_template_path($template)
{
// the current module
$pnmodgetname = pnModGetName();
// get the module path to templates
$module = $this->module;
$modinfo = pnModGetInfo(pnModGetIDFromName($module));
// get the theme path to templates
$theme = pnUserGetTheme();
// prepare the values for OS
$os_pnmodgetname = pnVarPrepForOS($pnmodgetname);
$os_module = pnVarPrepForOS($module);
$os_modpath = pnVarPrepForOS($modinfo['directory']);
$os_theme = pnVarPrepForOS($theme);
// Define the locations in which we will look for templates
// (in this order)
// Note: Paths 1, 3, 5 - This allows for the hook or block functions
// (such as ratings and comments) to use different templates depending
// on the top level module. e.g. the comments dialog can be different
// for news and polls...
// They are only evaluated when the calling module is not the current one.
//
// 1. The top level module directory in the requested module folder
// in the theme directory.
$themehookpath = "themes/{$theme}/templates/modules/{$module}/{$pnmodgetname}";
// 2. The module directory in the current theme.
$themepath = "themes/{$theme}/templates/modules/{$module}";
// 3. The top level module directory in the requested module folder
// in the modules sub folder.
$modhookpath = "modules/{$modinfo['directory']}/pntemplates/{$pnmodgetname}";
// 4. The module directory in the modules sub folder.
$modpath = "modules/{$modinfo['directory']}/pntemplates";
// 5. The top level module directory in the requested module folder
// in the system sub folder.
$syshookpath = "system/{$modinfo['directory']}/pntemplates/{$pnmodgetname}";
// 6. The module directory in the system sub folder.
$syspath = "system/{$modinfo['directory']}/pntemplates";
$ostemplate = pnVarPrepForOS($template);
//.'.htm';
// check the module for which we're looking for a template is the
// same as the top level mods. This limits the places to look for
// templates.
if ($module == $pnmodgetname) {
$search_path = array($themepath, $modpath, $syspath);
} else {
$search_path = array($themehookpath, $themepath, $modhookpath, $modpath, $syshookpath, $syspath);
}
foreach ($search_path as $path) {
if (file_exists("{$path}/{$ostemplate}") && is_readable("{$path}/{$ostemplate}")) {
return $path;
}
}
// when we arrive here, no path was found
return false;
}
示例15: pnInit
* GNU General Public License for more details.
*
* To read the license please visit http://www.gnu.org/copyleft/gpl.html
* ----------------------------------------------------------------------
* Original Author of file: larsneo
* Purpose of file: Error Handling
* Usage: Set up the redirection in your .htaccess with
* ErrorDocument 404 http://www.yoursite.com/error.php
* Note: REDIRECT_URL won't be available but
* due to subfolders one can't use a relative path :-/
* ----------------------------------------------------------------------
**/
include_once 'includes/pnAPI.php';
pnInit();
$currentlang = pnUserGetLang();
$currentlang = pnVarPrepForOS($currentlang);
if (file_exists("language/{$currentlang}/error.php")) {
include "language/{$currentlang}/error.php";
} elseif (file_exists("language/eng/error.php")) {
include "language/eng/error.php";
}
$reportlevel = pnConfigGetVar('reportlevel');
$funtext = pnConfigGetVar('funtext');
header('HTTP/1.1 404 Not Found');
include 'header.php';
if ($funtext == 0) {
echo "<h2>" . _ERROR404_HEAD . "</h2>\n" . "<br /><br />\n" . "<strong>" . _ERROR404_TRY . "</strong><br />\n" . _ERROR404_TRY1 . "<br />\n" . "<a href=\"index.php\">" . _ERROR404_TRY2 . "</a><br />\n" . _ERROR404_TRY3 . "<br />\n" . _ERROR404_TRY4 . "\n";
if (pnModAvailable('Search')) {
echo '<br /><a href="' . pnVarPrepForDisplay(pnModURL('Search')) . '">' . _ERROR404_TRY5 . "</a>\n";
}
} else {