本文整理汇总了PHP中pnModURL函数的典型用法代码示例。如果您正苦于以下问题:PHP pnModURL函数的具体用法?PHP pnModURL怎么用?PHP pnModURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnModURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mediashare_source_zip_view
function mediashare_source_zip_view(&$args)
{
$albumId = mediashareGetIntUrl('aid', $args, 0);
if (isset($_POST['saveButton'])) {
return mediashareSourceZipUpload($args);
}
if (isset($_POST['moreButton']) || isset($_POST['continueButton'])) {
// After upload - update items and then continue to next page
if (!mediashareSourceZipUpdate()) {
return false;
}
}
if (isset($_POST['cancelButton']) || isset($_POST['continueButton'])) {
return pnRedirect(pnModURL('mediashare', 'edit', 'view', array('aid' => $albumId)));
}
if (isset($_POST['moreButton'])) {
return pnRedirect(pnModURL('mediashare', 'edit', 'addmedia', array('aid' => $albumId, 'source' => 'zip')));
}
// FIXME Required globals??
pnModAPILoad('mediashare', 'edit');
$uploadInfo = pnModAPIFunc('mediashare', 'source_zip', 'getUploadInfo');
$render =& pnRender::getInstance('mediashare', false);
$render->assign('imageNum', 1);
$render->assign('uploadFields', array(1));
$render->assign('post_max_size', $uploadInfo['post_max_size']);
$render->assign('upload_max_filesize', $uploadInfo['upload_max_filesize']);
return $render->fetch('mediashare_source_zip_view.html');
}
示例2: smarty_function_exampleadminlinks
/**
* Smarty function to display admin links for the example module
* based on the user's permissions
*
* Example
* <!--[exampleadminlinks start="[" end="]" seperator="|" class="pn-menuitem-title"]-->
*
* @author Andreas Krapohl
* @since 10/01/04
* @see function.exampleadminlinks.php::smarty_function_exampleadminlinks()
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @param string $start start string
* @param string $end end string
* @param string $seperator link seperator
* @param string $class CSS class
* @return string the results of the module function
*/
function smarty_function_exampleadminlinks($params, &$smarty)
{
extract($params);
unset($params);
// set some defaults
if (!isset($start)) {
$start = '[';
}
if (!isset($end)) {
$end = ']';
}
if (!isset($seperator)) {
$seperator = '|';
}
if (!isset($class)) {
$class = 'pn-menuitem-title';
}
$adminlinks = "<span class=\"{$class}\">{$start} ";
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_READ)) {
$adminlinks .= "<a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'view')) . "\">" . _VIEW . "</a> ";
}
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_ADD)) {
$adminlinks .= "{$seperator} <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'new')) . "\">" . _NEW . "</a> ";
}
if (pnSecAuthAction(0, 'Example::', '::', ACCESS_ADMIN)) {
$adminlinks .= "{$seperator} <a href=\"" . pnVarPrepHTMLDisplay(pnModURL('Example', 'admin', 'modifyconfig')) . "\">" . _MODIFYCONFIG . "</a> ";
}
$adminlinks .= "{$end}</span>\n";
return $adminlinks;
}
示例3: FlashChatBridge_adminapi_getlinks
function FlashChatBridge_adminapi_getlinks()
{
$links = array();
if (SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_ADMIN)) {
$links[] = array('url' => pnModURL('FlashChatBridge', 'admin', 'main'), 'text' => __('Common Settings'));
$links[] = array('url' => pnModURL('FlashChatBridge', 'admin', 'flashchatadmin'), 'text' => __('123FlashChat Settings'));
}
return $links;
}
示例4: 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);
}
}
}
}
}
示例5: mediashare_adminapi_getlinks
/**
* get available admin panel links
*
* @return array array of admin links
*/
function mediashare_adminapi_getlinks()
{
$dom = ZLanguage::getModuleDomain('mediashare');
$links = array();
if (SecurityUtil::checkPermission('mediashare::', '::', ACCESS_ADMIN)) {
$links[] = array('url' => pnModURL('mediashare', 'user', 'view'), 'text' => __('Browse', $dom));
$links[] = array('url' => pnModURL('mediashare', 'admin', 'plugins'), 'text' => __('Plugins', $dom));
$links[] = array('url' => pnModURL('mediashare', 'admin', 'recalc'), 'text' => __('Regenerate', $dom));
$links[] = array('url' => pnModURL('mediashare', 'admin', 'main'), 'text' => __('Settings', $dom));
}
return $links;
}
示例6: smarty_function_pc_form_nav_open
/**
* $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_form_nav_open($args = array())
{
extract($args);
unset($args);
$viewtype = strtolower(pnVarCleanFromInput('viewtype'));
if (_SETTING_OPEN_NEW_WINDOW && $viewtype == 'details') {
$target = 'target="csCalendar"';
} else {
$target = '';
}
$fstart = '<form action="' . pnModURL(__POSTCALENDAR__, 'user', 'view') . '"' . ' method="post"' . ' enctype="application/x-www-form-urlencoded" ' . $target . '>';
echo $fstart;
}
示例7: template_firstblock_display
/**
* display block
*/
function template_firstblock_display($blockinfo)
{
// Security check
if (!pnSecAuthAction(0, 'Template:Firstblock:', "{$blockinfo['title']}::", ACCESS_READ)) {
return;
}
// Get variables from content block
$vars = pnBlockVarsFromContent($blockinfo['content']);
// Defaults
if (empty($vars['numitems'])) {
$vars['numitems'] = 5;
}
// Database information
pnModDBInfoLoad('Template');
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$templatetable = $pntable['template'];
$templatecolumn =& $pntable['template_column'];
// Query
$sql = "SELECT {$templatecolumn['tid']},\n {$templatecolumn['name']}\n FROM {$templatetable}\n ORDER by {$templatecolumn['name']}";
$result = $dbconn->SelectLimit($sql, $vars['numitems']);
if ($dbconn->ErrorNo() != 0) {
return;
}
if ($result->EOF) {
return;
}
// Create output object
$output = new pnHTML();
// Display each item, permissions permitting
for (; !$result->EOF; $result->MoveNext()) {
list($tid, $name) = $result->fields;
if (pnSecAuthAction(0, 'Template::', "{$name}::{$tid}", ACCESS_OVERVIEW)) {
if (pnSecAuthAction(0, 'Template::', "{$name}::{$tid}", ACCESS_READ)) {
$output->URL(pnModURL('Template', 'user', 'viewdetail', array('tid' => $tid)), $name);
} else {
$output->Text($name);
}
$output->Linebreak();
}
}
// Populate block info and pass to theme
$blockinfo['content'] = $output->GetOutput();
return themesideblock($blockinfo);
}
示例8: FlashChatBridge_admin_updateconfig
/**
* Update 123FlashChat Settings
*
* @author Tree Florian
* @return mixed true if successful, false if unsuccessful, error string otherwise
*/
function FlashChatBridge_admin_updateconfig()
{
// Security check
if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_ADMIN)) {
return LogUtil::registerPermissionError();
}
// get settings from form - do before authid check
$settings = FormUtil::getPassedValue('settings', null, 'POST');
// if this form wasnt posted to redirect back
if ($settings === NULL) {
return pnRedirect(pnModURL('Settings', 'admin', 'modifyconfig'));
}
/*
// confirm the forms auth key
if (!SecurityUtil::confirmAuthKey()) {
return LogUtil::registerAuthidError();
}
*/
$lastchar = substr($settings['client_path'], -1);
if ($lastchar != "\\" && $lastchar != "/" && $settings['client_path'] != "") {
$settings['client_path'] = $settings['client_path'] . "/";
}
$settings['server_data_path'] = str_replace("\\", "/", $settings['server_data_path']);
$lastchar = substr($settings['server_data_path'], -1);
if ($lastchar != "\\" && $lastchar != "/" && $settings['client_path'] != "") {
$settings['server_data_path'] = $settings['server_data_path'] . "/";
}
$settings['active_chat_standard'] = $settings['active_chat_standard'] == 1 ? 1 : 0;
$settings['active_chat_html'] = $settings['active_chat_html'] == 1 ? 1 : 0;
$settings['active_chat_avatar'] = $settings['active_chat_avatar'] == 1 ? 1 : 0;
$settings['active_chat_live'] = $settings['active_chat_live'] == 1 ? 1 : 0;
$settings['active_chat_pocket'] = $settings['active_chat_pocket'] == 1 ? 1 : 0;
$settings['active_chat_lite'] = $settings['active_chat_lite'] == 1 ? 1 : 0;
$settings['active_chat_banner'] = $settings['active_chat_banner'] == 1 ? 1 : 0;
// Write the vars
//$configvars = pnModGetVar('FlashChatBridge');
foreach ($settings as $key => $value) {
pnModSetVar('FlashChatBridge', $key, $value);
}
//$configvars = pnModGetVar('FlashChatBridge');
// Let any other modules know that the modules configuration has been updated
pnModCallHooks('module', 'updateconfig', 'FlashChatBridge', array('module' => 'FlashChatBridge'));
return pnRedirect(pnModURL('FlashChatBridge', 'admin', 'modifyconfig'));
}
示例9: postcalendar_calendarblock_display
/**
* display block
*/
function postcalendar_calendarblock_display($blockinfo)
{
// You supposed to be here?
if (!pnSecAuthAction(0, 'PostCalendar:calendarblock:', "{$blockinfo['title']}::", ACCESS_OVERVIEW)) {
return false;
}
// find out what view we're using
$template_view = pnVarCleanFromInput('tplview');
if (!isset($template_view)) {
$template_view = 'default';
}
// find out what template we're using
$template_name = _SETTING_TEMPLATE;
if (!isset($template_name) || empty($template_name)) {
$template_name = 'default';
}
// What is today's correct date
$Date =& postcalendar_getDate();
// Get variables from content block
$vars = unserialize($blockinfo['content']);
$showcalendar = $vars['pcbshowcalendar'];
$showevents = $vars['pcbeventoverview'];
$eventslimit = $vars['pcbeventslimit'];
$nextevents = $vars['pcbnextevents'];
$pcbshowsslinks = $vars['pcbshowsslinks'];
$pcbeventsrange = $vars['pcbeventsrange'];
// Let's setup the info to build this sucka!
$the_year = substr($Date, 0, 4);
$the_month = substr($Date, 4, 2);
$the_day = substr($Date, 6, 2);
$uid = pnUserGetVar('uid');
$cacheid1 = $cacheid2 = $cacheid3 = '';
$theme = pnUserGetTheme();
pnThemeLoad($theme);
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5;
global $textcolor1, $textcolor2;
// 20021125 - rraymond :: we have to do this to make it work with envolution
$pcModInfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$pcDir = pnVarPrepForOS($pcModInfo['directory']);
require_once "modules/{$pcDir}/pnincludes/Smarty/Config_File.class.php";
unset($pcModInfo);
// set up Smarty
$tpl =& new pcSmarty();
// setup the Smarty cache id
$templates_cached = true;
if ($showcalendar) {
$cacheid1 = md5($Date . 'M' . $template_view . $template_name . $showcalendar . $showevents . $nextevents . $uid . $theme);
if (!$tpl->is_cached($template_name . '/views/calendarblock/month_view.html', $cacheid1)) {
$templates_cached = false;
}
}
if ($showevents) {
$cacheid2 = md5($Date . 'T' . $template_view . $template_name . $showcalendar . $showevents . $nextevents . $uid . $theme);
if (!$tpl->is_cached($template_name . '/views/calendarblock/todays_events.html', $cacheid2)) {
$templates_cached = false;
}
}
if ($nextevents) {
$cacheid3 = md5($Date . 'U' . $template_view . $template_name . $showcalendar . $showevents . $nextevents . $uid . $theme);
if (!$tpl->is_cached($template_name . '/views/calendarblock/upcoming_events.html', $cacheid3)) {
$templates_cached = false;
}
}
// start the output container
$output = pnModAPIFunc(__POSTCALENDAR__, 'user', 'pageSetup');
// if one of the templates is not cached, we need to run the following
if (!$templates_cached) {
// set up the next and previous months to move to
$prev_month = Date_Calc::beginOfPrevMonth(1, $the_month, $the_year, '%Y%m%d');
$next_month = Date_Calc::beginOfNextMonth(1, $the_month, $the_year, '%Y%m%d');
$last_day = Date_Calc::daysInMonth($the_month, $the_year);
$pc_prev = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => $prev_month));
$pc_next = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => $next_month));
$pc_month_name = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getmonthname', array('Date' => mktime(0, 0, 0, $the_month, $the_day, $the_year)));
$month_link_url = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => date('Ymd', mktime(0, 0, 0, $the_month, 1, $the_year))));
$month_link_text = $pc_month_name . ' ' . $the_year;
//*******************************************************************
// Here we get the events for the current month view
//*******************************************************************
$day_of_week = 1;
$pc_month_names = array(_CALJAN, _CALFEB, _CALMAR, _CALAPR, _CALMAY, _CALJUN, _CALJUL, _CALAUG, _CALSEP, _CALOCT, _CALNOV, _CALDEC);
$pc_short_day_names = array(_CALSUNDAYSHORT, _CALMONDAYSHORT, _CALTUESDAYSHORT, _CALWEDNESDAYSHORT, _CALTHURSDAYSHORT, _CALFRIDAYSHORT, _CALSATURDAYSHORT);
$pc_long_day_names = array(_CALSUNDAY, _CALMONDAY, _CALTUESDAY, _CALWEDNESDAY, _CALTHURSDAY, _CALFRIDAY, _CALSATURDAY);
switch (_SETTING_FIRST_DAY_WEEK) {
case _IS_MONDAY:
$pc_array_pos = 1;
$first_day = date('w', mktime(0, 0, 0, $the_month, 0, $the_year));
$end_dow = date('w', mktime(0, 0, 0, $the_month, $last_day, $the_year));
if ($end_dow != 0) {
$the_last_day = $last_day + (7 - $end_dow);
} else {
$the_last_day = $last_day;
}
break;
case _IS_SATURDAY:
$pc_array_pos = 6;
$first_day = date('w', mktime(0, 0, 0, $the_month, 2, $the_year));
//.........这里部分代码省略.........
示例10: Lenses_admin_update_lens
function Lenses_admin_update_lens($args)
{
// Clean input from the form.
$lens_data = pnVarCleanFromInput('lens_data');
$bc = pnVarCleanFromInput('bc');
$enh_colors = pnVarCleanFromInput('enh_colors');
$opaque_colors = pnVarCleanFromInput('opaque_colors');
// Extract any extra arguments.
extract($args);
// Confirm $authid hidden field from form template.
if (!pnSecConfirmAuthKey()) {
pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_BADAUTHKEY));
return pnRedirect(pnModURL('Lenses', 'admin', 'main'));
}
//take the arrays for the base curves and the simple opaque and enhancer colors
//and create a string that's added to the appropriate parts of the $lens_data array
$lens_data[bc_simple] = $bc[0] . " " . $bc[1] . " " . $bc[2];
$lens_data[enh_names_simple] = "";
$lens_data[opaque_names_simple] = "";
foreach ($enh_colors as $value) {
$lens_data[enh_names_simple] .= $value . " ";
}
foreach ($opaque_colors as $value) {
$lens_data[opaque_names_simple] .= $value . " ";
}
// Attempt to update lens.
if (pnModAPIFunc('Lenses', 'admin', 'update_lens', array('lens_data' => $lens_data))) {
pnSessionSetVar('statusmsg', pnVarPrepHTMLDisplay(_UPDATESUCCEDED));
}
// No output. Redirect user.
return pnRedirect(pnModURL('Lenses', 'user', 'view', array('tid' => $lens_data[tid])));
}
示例11: postcalendar_userapi_buildView
//.........这里部分代码省略.........
if ($viewtype != 'year') {
$eventsByDate =& postcalendar_userapi_pcGetEvents(array('start' => $starting_date, 'end' => $ending_date, 'viewtype' => $viewtype, 'provider_id' => $provIDs));
} else {
$eventsByDate = array();
}
//=================================================================
// Create an array with the day names in the correct order
//=================================================================
$daynames = array();
$numDays = count($pc_long_day_names);
for ($i = 0; $i < $numDays; $i++) {
if ($pc_array_pos >= $numDays) {
$pc_array_pos = 0;
}
array_push($daynames, $pc_long_day_names[$pc_array_pos]);
$pc_array_pos++;
}
unset($numDays);
$sdaynames = array();
$numDays = count($pc_short_day_names);
for ($i = 0; $i < $numDays; $i++) {
if ($pc_array_pos >= $numDays) {
$pc_array_pos = 0;
}
array_push($sdaynames, $pc_short_day_names[$pc_array_pos]);
$pc_array_pos++;
}
unset($numDays);
//=================================================================
// Prepare some values for the template
//=================================================================
$prev_month = Date_Calc::beginOfPrevMonth(1, $the_month, $the_year, '%Y%m%d');
$next_month = Date_Calc::beginOfNextMonth(1, $the_month, $the_year, '%Y%m%d');
$pc_prev = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => $prev_month, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$pc_next = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'month', 'Date' => $next_month, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$prev_day = Date_Calc::prevDay($the_day, $the_month, $the_year, '%Y%m%d');
$next_day = Date_Calc::nextDay($the_day, $the_month, $the_year, '%Y%m%d');
$pc_prev_day = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'day', 'Date' => $prev_day, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$pc_next_day = pnModURL(__POSTCALENDAR__, 'user', 'view', array('tplview' => $template_view, 'viewtype' => 'day', 'Date' => $next_day, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$prev_week = date('Ymd', mktime(0, 0, 0, $week_first_day_month, $week_first_day_date - 7, $week_first_day_year));
$next_week = date('Ymd', mktime(0, 0, 0, $week_last_day_month, $week_last_day_date + 1, $week_last_day_year));
$pc_prev_week = pnModURL(__POSTCALENDAR__, 'user', 'view', array('viewtype' => 'week', 'Date' => $prev_week, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$pc_next_week = pnModURL(__POSTCALENDAR__, 'user', 'view', array('viewtype' => 'week', 'Date' => $next_week, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$prev_year = date('Ymd', mktime(0, 0, 0, 1, 1, $the_year - 1));
$next_year = date('Ymd', mktime(0, 0, 0, 1, 1, $the_year + 1));
$pc_prev_year = pnModURL(__POSTCALENDAR__, 'user', 'view', array('viewtype' => 'year', 'Date' => $prev_year, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
$pc_next_year = pnModURL(__POSTCALENDAR__, 'user', 'view', array('viewtype' => 'year', 'Date' => $next_year, 'pc_username' => $pc_username, 'pc_category' => $category, 'pc_topic' => $topic));
//=================================================================
// Populate the template
//=================================================================
$all_categories = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getCategories');
if (isset($calendarView)) {
$tpl->assign_by_ref('CAL_FORMAT', $calendarView);
}
if ($viewtype == "week") {
$last_blocks = array();
foreach ($eventsByDate as $cdate => $day) {
$tblock = array_reverse($day['blocks']);
$last_blocks[$cdate] = count($tblock) - 1;
for ($i = 0; $i < count($tblock); $i++) {
if (!empty($tblock[$i])) {
$last_blocks[$cdate] = count($tblock) - $i;
break;
}
}
}
示例12: blocks_menu_block
function blocks_menu_block($row)
{
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
// Generic check
if (!pnSecAuthAction(0, 'Menublock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
// Break out options from our content field
$vars = pnBlockVarsFromContent($row['content']);
// Display style
// style = 1 - simple list
// style = 2 - drop-down list
// Title
$block['title'] = $row['title'];
// Styling
if (empty($vars['style'])) {
$vars['style'] = 1;
}
$block['content'] = startMenuStyle($vars['style']);
$content = 0;
// nkame: must start with some blank line, otherwise we're not able to
// chose the first option in case of a drop-down menu.
// a better solution would be to detect where we are, and adjust the selected
// option in the list, and only add a blank line in case of no recognition.
if ($vars['style'] == 2) {
$block['content'] .= addMenuStyledUrl($vars['style'], "", "", "");
}
// Content
if (!empty($vars['content'])) {
$contentlines = explode("LINESPLIT", $vars['content']);
foreach ($contentlines as $contentline) {
list($url, $title, $comment) = explode('|', $contentline);
if (pnSecAuthAction(0, "Menublock::", "{$row['title']}:{$title}:", ACCESS_READ)) {
$block['content'] .= addMenuStyledUrl($vars['style'], pnVarPrepForDisplay($title), $url, pnVarPrepForDisplay($comment));
$content = 1;
}
}
}
// Modules
if (!empty($vars['displaymodules'])) {
$mods = pnModGetUserMods();
// Separate from current content, if any
if ($content == 1) {
$block['content'] .= addMenuStyledUrl($vars['style'], "", "", "");
}
foreach ($mods as $mod) {
// jgm - need to work back ML into modules table somehow
// if (file_exists("modules/$mod/modname.php")) {
// include "modules/$mod/modname.php";
// } else {
if (pnSecAuthAction(0, "{$mod['name']}::", "::", ACCESS_OVERVIEW)) {
switch ($mod['type']) {
case 1:
$block['content'] .= addMenuStyledUrl($vars['style'], pnVarPrepForDisplay($mod['displayname']), "modules.php?op=modload&name=" . pnVarPrepForDisplay($mod['directory']) . "&file=index", pnVarPrepForDisplay($mod['description']));
$content = 1;
break;
case 2:
$block['content'] .= addMenuStyledUrl($vars['style'], pnVarPrepForDisplay($mod['displayname']), pnModURL($mod['name'], 'user', 'main'), pnVarPrepForDisplay($mod['description']));
$content = 1;
break;
}
}
}
}
// Waiting content
if (!empty($vars['displaywaiting'])) {
// Separate from current content, if any
if ($content == 1) {
$block['content'] .= addMenuStyledUrl($vars['style'], "", "", "");
}
$header = 0;
if (pnSecAuthAction(0, "Stories::Story", "::", ACCESS_ADD)) {
$result = $dbconn->Execute("SELECT count(1) FROM {$pntable['queue']}\n WHERE {$pntable['queue_column']['arcd']}=0");
if ($dbconn->ErrorNo() == 0) {
list($qnum) = $result->fields;
$result->Close();
if ($qnum) {
if ($header == 0) {
$block['content'] .= addMenuStyledUrl($vars['style'], "<strong>" . _WAITINGCONT . "</strong>", "", "");
$header = 1;
}
$block['content'] .= addMenuStyledUrl($vars['style'], _SUBMISSIONS . ": {$qnum}", "admin.php?module=NS-AddStory&op=submissions", "");
$content = 1;
}
}
}
if (pnSecAuthAction(0, "Reviews::", "::", ACCESS_ADD)) {
$result = $dbconn->Execute("SELECT count(1) FROM {$pntable['reviews_add']}");
if ($dbconn->ErrorNo() == 0) {
list($rnum) = $result->fields;
$result->Close();
if ($rnum) {
if ($header == 0) {
$block['content'] .= addMenuStyledUrl($vars['style'], "<strong>" . _WAITINGCONT . "</strong>", "", "");
$header = 1;
}
$block['content'] .= addMenuStyledUrl($vars['style'], _WREVIEWS . ": {$rnum}", "admin.php?module=Reviews&op=main", "");
$content = 1;
}
//.........这里部分代码省略.........
示例13: smarty_function_pager
//.........这里部分代码省略.........
$pos = 0;
}
} else {
//$pos = 0; //29-sep-2003 markus weber added line
//if ( isset($Request[$posvar]) ) { //29-sep-2003 markus weber added if around existing code
// $pos = $Request[$posvar];
//}
}
// END INIT
// If $forwardvars set, add only listed vars to query string, else add all POST and GET vars
$vars = array();
if (isset($forwardvars)) {
if (!is_array($forwardvars)) {
$forwardvars = preg_split('/[,;\\s]/', $forwardvars, -1, PREG_SPLIT_NO_EMPTY);
}
foreach ((array) $forwardvars as $key => $var) {
if (!empty($var) and !empty($Request[$var])) {
$vars[$var] = $Request[$var];
}
}
} else {
$vars = $Request;
}
unset($vars['module']);
unset($vars['func']);
unset($vars['type']);
unset($vars['name']);
unset($vars['file']);
unset($vars[$posvar]);
// if there is no position (or 0), prepare the link for the second page
if ((empty($pos) or $pos < 1) and $rowcount > $limit) {
if (!empty($firstpos)) {
$vars[$posvar] = $firstpos;
$short['first'] .= $modurl ? pnModURL($module, $type, $func, $vars) : $url . '/' . $posvar . '=' . $firstpos;
// $url.$link.$posvar.'='.$firstpos;
} elseif ($pos == -1) {
$vars[$posvar] = 1 + $shift;
$short['first'] .= $modurl ? pnModURL($module, $type, $func, $vars) : $url . '/' . $posvar . '=' . (1 + $shift);
// $url.$link.$posvar.'='.(1 + $shift);
} else {
$vars[$posvar] = $limit + $shift;
$short['first'] = $modurl ? pnModURL($module, $type, $func, $vars) : $url . '/' . $posvar . '=' . ($limit + $shift);
// $url.$link.$posvar.'='.($limit+$shift);
}
}
// START create data to print
if ($rowcount > $limit) {
if ($rowcount < $limit * 30) {
for ($i = 1; $i < $rowcount + 1; $i += $limit) {
if ($pos + 1 >= $i and $pos + 1 < $i + $limit) {
$short['now'] = $i;
}
$vars[$posvar] = $i - 1 + $shift;
$pages[$i] = $modurl ? pnModURL($module, $type, $func, $vars) : $url . '/' . $posvar . '/' . $vars[$posvar];
// $url.$link.$posvar.'='.($i - 1 + $shift);
}
} else {
// If there are a lot of records long before the actual position,
// do big steps ($limit*10)
for ($i = 1; $i < $pos - 16 * $limit; $i += 10 * $limit) {
$vars[$posvar] = $i - 1 + $shift;
$pages[$i] = $modurl ? pnModURL($module, $type, $func, $vars) : $url . '/' . $posvar . '/' . $vars[$posvar];
//$pages[$i] = $url.$link.$posvar.'='.($i - 1 + $shift);
}
// Around the actual position, do small steps ($limit)
for ($tmp = 1; $i < $pos + 16 * $limit and $i < $rowcount + 1; $i += $limit) {
示例14: 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);
}
//.........这里部分代码省略.........
示例15: postcalendar_userapi_eventDetail
//.........这里部分代码省略.........
$event['city'] = $location['event_city'];
$event['state'] = $location['event_state'];
$event['postal'] = $location['event_postal'];
$event['date'] = str_replace('-', '', $Date);
//=================================================================
// populate the template
//=================================================================
if (!empty($event['location']) || !empty($event['street1']) || !empty($event['street2']) || !empty($event['city']) || !empty($event['state']) || !empty($event['postal'])) {
$tpl->assign('LOCATION_INFO', true);
} else {
$tpl->assign('LOCATION_INFO', false);
}
if (!empty($event['contname']) || !empty($event['contemail']) || !empty($event['conttel']) || !empty($event['website'])) {
$tpl->assign('CONTACT_INFO', true);
} else {
$tpl->assign('CONTACT_INFO', false);
}
$display_type = substr($event['hometext'], 0, 6);
if ($display_type == ':text:') {
$prepFunction = 'pcVarPrepForDisplay';
$event['hometext'] = substr($event['hometext'], 6);
} elseif ($display_type == ':html:') {
$prepFunction = 'pcVarPrepHTMLDisplay';
$event['hometext'] = substr($event['hometext'], 6);
} else {
$prepFunction = 'pcVarPrepHTMLDisplay';
}
unset($display_type);
// prep the vars for output
$event['title'] =& $prepFunction($event['title']);
$event['hometext'] =& $prepFunction($event['hometext']);
$event['desc'] =& $event['hometext'];
$event['conttel'] =& $prepFunction($event['conttel']);
$event['contname'] =& $prepFunction($event['contname']);
$event['contemail'] =& $prepFunction($event['contemail']);
$event['website'] =& $prepFunction(postcalendar_makeValidURL($event['website']));
$event['fee'] =& $prepFunction($event['fee']);
$event['location'] =& $prepFunction($event['location']);
$event['street1'] =& $prepFunction($event['street1']);
$event['street2'] =& $prepFunction($event['street2']);
$event['city'] =& $prepFunction($event['city']);
$event['state'] =& $prepFunction($event['state']);
$event['postal'] =& $prepFunction($event['postal']);
$tpl->assign_by_ref('A_EVENT', $event);
//=================================================================
// populate the template $ADMIN_OPTIONS
//=================================================================
$target = '';
if (_SETTING_OPEN_NEW_WINDOW) {
$target = 'target="csCalendar"';
}
$admin_edit_url = $admin_delete_url = '';
if (pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_ADMIN)) {
$admin_edit_url = pnModURL(__POSTCALENDAR__, 'admin', 'submit', array('pc_event_id' => $eid));
$admin_delete_url = pnModURL(__POSTCALENDAR__, 'admin', 'adminevents', array('action' => _ACTION_DELETE, 'pc_event_id' => $eid));
}
$user_edit_url = $user_delete_url = '';
if (pnUserLoggedIn()) {
$logged_in_uname = $_SESSION['authUser'];
} else {
$logged_in_uname = '';
}
$can_edit = false;
if (pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_ADD) && validateGroupStatus($logged_in_uname, getUsername($event['uname']))) {
$user_edit_url = pnModURL(__POSTCALENDAR__, 'user', 'submit', array('pc_event_id' => $eid));
$user_delete_url = pnModURL(__POSTCALENDAR__, 'user', 'delete', array('pc_event_id' => $eid));
$can_edit = true;
}
$tpl->assign('STYLE', $GLOBALS['style']);
$tpl->assign_by_ref('ADMIN_TARGET', $target);
$tpl->assign_by_ref('ADMIN_EDIT', $admin_edit_url);
$tpl->assign_by_ref('ADMIN_DELETE', $admin_delete_url);
$tpl->assign_by_ref('USER_TARGET', $target);
$tpl->assign_by_ref('USER_EDIT', $user_edit_url);
$tpl->assign_by_ref('USER_DELETE', $user_delete_url);
$tpl->assign_by_ref('USER_CAN_EDIT', $can_edit);
}
//=================================================================
// Parse the template
//=================================================================
if ($popup != 1 && $print != 1) {
$output = "\n\n<!-- START POSTCALENDAR OUTPUT [-: HTTP://POSTCALENDAR.TV :-] -->\n\n";
$output .= $tpl->fetch($template, $cacheid);
$output .= "\n\n<!-- END POSTCALENDAR OUTPUT [-: HTTP://POSTCALENDAR.TV :-] -->\n\n";
} else {
$theme = pnUserGetTheme();
echo "<html><head>";
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/{$theme}/style/styleNN.css\" TYPE=\"text/css\">\n\n\n";
echo "<style type=\"text/css\">\n";
echo "@import url(\"themes/{$theme}/style/style.css\"); ";
echo "</style>\n";
echo "</head><body>\n";
$tpl->display($template, $cacheid);
echo postcalendar_footer();
echo "\n</body></html>";
session_write_close();
exit;
}
return $output;
}