本文整理汇总了PHP中pnModGetIDFromName函数的典型用法代码示例。如果您正苦于以下问题:PHP pnModGetIDFromName函数的具体用法?PHP pnModGetIDFromName怎么用?PHP pnModGetIDFromName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnModGetIDFromName函数的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: postcalendar_footer
function postcalendar_footer()
{
// lets get the module's information
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
//$footer = "<p align=\"right\"><a href=\"http://www.postcalendar.tv\">PostCalendar v$modinfo[version]</a></p>";
$footer = "";
return $footer;
}
示例3: postcalendar_user_submit
//.........这里部分代码省略.........
$eventdata['event_city'] = $loc_data['event_city'];
$eventdata['event_state'] = $loc_data['event_state'];
$eventdata['event_postal'] = $loc_data['event_postal'];
$eventdata['event_location_info'] = $loc_data;
$eventdata['event_contname'] = $event['contname'];
$eventdata['event_conttel'] = $event['conttel'];
$eventdata['event_contemail'] = $event['contemail'];
$eventdata['event_website'] = $event['website'];
$eventdata['event_fee'] = $event['fee'];
$eventdata['event_repeat'] = $event['recurrtype'];
$rspecs = unserialize($event['recurrspec']);
$eventdata['event_repeat_freq'] = $rspecs['event_repeat_freq'];
$eventdata['event_repeat_freq_type'] = $rspecs['event_repeat_freq_type'];
$eventdata['event_repeat_on_num'] = $rspecs['event_repeat_on_num'];
$eventdata['event_repeat_on_day'] = $rspecs['event_repeat_on_day'];
$eventdata['event_repeat_on_freq'] = $rspecs['event_repeat_on_freq'];
$eventdata['event_recurrspec'] = $rspecs;
$eventdata['uname'] = $uname;
$eventdata['event_userid'] = $event['event_userid'];
$eventdata['event_pid'] = $event['pid'];
$eventdata['event_aid'] = $event['aid'];
$eventdata['Date'] = $Date;
$eventdata['year'] = $year;
$eventdata['month'] = $month;
$eventdata['day'] = $day;
$eventdata['is_update'] = true;
$eventdata['pc_event_id'] = $pc_event_id;
$event_data['patient_name'] = $event_patient_name;
$eventdata['data_loaded'] = true;
$eventdata['pc_html_or_text'] = $pc_html_or_text;
$eventdata['category'] = base64_encode(serialize($category));
}
// lets get the module's information
$modinfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$categories = pnModAPIFunc(__POSTCALENDAR__, 'user', 'getCategories');
$output->tabindex = 1;
//================================================================
// ERROR CHECKING
//================================================================
// removed event_desc as a required_var
$required_vars = array('event_subject');
$required_name = array(_PC_EVENT_TITLE, _PC_EVENT_DESC);
$error_msg = '';
$output->SetOutputMode(_PNH_RETURNOUTPUT);
$reqCount = count($required_vars);
//print_r($eventdata);
for ($r = 0; $r < $reqCount; $r++) {
if (empty(${$required_vars}[$r]) || !preg_match('/\\S/i', ${$required_vars}[$r])) {
$error_msg .= $output->Text('<b>' . $required_name[$r] . '</b> ' . _PC_SUBMIT_ERROR4);
$error_msg .= $output->Linebreak();
}
}
unset($reqCount);
// check repeating frequencies
if ($event_repeat == REPEAT) {
//can't have a repeating event that doesnt have an end date
if ($event_endtype == 0) {
$error_msg .= $output->Text("Repeating events must have an end date set.");
$error_msg .= $output->Linebreak();
}
if (!isset($event_repeat_freq) || $event_repeat_freq < 1 || empty($event_repeat_freq)) {
$error_msg .= $output->Text(_PC_SUBMIT_ERROR5);
$error_msg .= $output->Linebreak();
} elseif (!is_numeric($event_repeat_freq)) {
$error_msg .= $output->Text(_PC_SUBMIT_ERROR6);
$error_msg .= $output->Linebreak();
示例4: __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}");
}
示例5: 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();
}
示例6: pnRedirect
if (empty($module)) {
// call for admin.php without module parameter
pnRedirect(pnModURL('Admin', 'admin', 'adminpanel'));
exit;
} else {
if (!pnModAvailable($module) || !pnSecAuthAction(0, "{$module}::", '::', ACCESS_EDIT)) {
// call for an unavailable module - either not available or not authorized
header('HTTP/1.0 403 Access Denied');
include 'header.php';
echo 'Module <strong>' . pnVarPrepForDisplay($module) . '</strong> not available';
include 'footer.php';
exit;
}
}
// get the module information
$modinfo = pnModGetInfo(pnModGetIDFromName($module));
if ($modinfo['type'] == 2 || $modinfo['type'] == 3) {
// Redirect to new style admin panel
pnRedirect(pnModURL($module, 'admin'));
exit;
}
if (!file_exists($adminfile = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/admin.php')) {
// Module claims to be old-style, but no admin.php present - quit here
header('HTTP/1.0 404 Not Found');
include 'header.php';
echo 'Wrong call for Adminfunction in Module <strong>' . pnVarPrepForDisplay($module) . '</strong>';
include 'footer.php';
exit;
}
/**
* old style module administration
示例7: insert_basic_data
function insert_basic_data($prefix)
{
global $inst_dbconn;
// title of blocks
$incoming_block_title = defined('_BLOCKTITLE_INCOMING') ? "" . _BLOCKTITLE_INCOMING . "" : 'Incoming';
$whoisonline_block_title = defined('_BLOCKTITLE_WHOISONLINE') ? "" . _BLOCKTITLE_WHOISONLINE . "" : 'Online';
$otherstories_block_title = defined('_BLOCKTITLE_OTHERSTORIES') ? "" . _BLOCKTITLE_OTHERSTORIES . "" : 'Other Stories';
$usersblock_block_title = defined('_BLOCKTITLE_USERSBLOCK') ? "" . _BLOCKTITLE_USERSBLOCK . "" : 'Users Block';
$searchbox_block_title = defined('_BLOCKTITLE_SEARCHBOX') ? "" . _BLOCKTITLE_SEARCHBOX . "" : 'Search Box';
$languages_block_title = defined('_BLOCKTITLE_LANGUAGES') ? "" . _BLOCKTITLE_LANGUAGES . "" : 'Languages';
$catmenu_block_title = defined('_BLOCKTITLE_CATMENU') ? "" . _BLOCKTITLE_CATMENU . "" : 'Categories Menu';
$ranhead_block_title = defined('_BLOCKTITLE_RANHEAD') ? "" . _BLOCKTITLE_RANHEAD . "" : 'Random Headlines';
$poll_block_title = defined('_BLOCKTITLE_POLL') ? "" . _BLOCKTITLE_POLL . "" : 'Poll';
$bigstory_block_title = defined('_BLOCKTITLE_BIGSTORY') ? "" . _BLOCKTITLE_BIGSTORY . "" : 'Todays Big Story';
$userslogin_block_title = defined('_BLOCKTITLE_USERSLOGIN') ? "" . _BLOCKTITLE_USERSLOGIN . "" : 'Login';
$pastart_block_title = defined('_BLOCKTITLE_PASTART') ? "" . _BLOCKTITLE_PASTART . "" : 'Past Articles';
$adminmess_block_title = defined('_BLOCKTITLE_ADMINMESS') ? "" . _BLOCKTITLE_ADMINMESS . "" : 'Administration Messages';
$usersblocktexte_block_title = defined('_BLOCKTITLE_USERSBLOCK_TEXTE') ? "" . _BLOCKTITLE_USERSBLOCK_TEXTE . "" : 'Put anything you want here';
// main menu
// note: this is also used for setting up the permission table!
$mainblock_block_title = defined('_BLOCKTITLE_MAINMENU') ? "" . _BLOCKTITLE_MAINMENU . "" : 'Main Menu';
$mainblock_block_home = defined('_BLOCKTITLE_MAINMENU_HOME') ? "" . _BLOCKTITLE_MAINMENU_HOME . "" : 'Home';
$mainblock_block_homealt = defined('_BLOCKTITLE_MAINMENU_HOMEALT') ? "" . _BLOCKTITLE_MAINMENU_HOMEALT . "" : 'Back to the home page.';
$mainblock_block_user = defined('_BLOCKTITLE_MAINMENU_USER') ? "" . _BLOCKTITLE_MAINMENU_USER . "" : 'My Account';
$mainblock_block_useralt = defined('_BLOCKTITLE_MAINMENU_USERALT') ? "" . _BLOCKTITLE_MAINMENU_USERALT . "" : 'Administer your personal account.';
$mainblock_block_admin = defined('_BLOCKTITLE_MAINMENU_ADMIN') ? "" . _BLOCKTITLE_MAINMENU_ADMIN . "" : 'Administration';
$mainblock_block_adminalt = defined('_BLOCKTITLE_MAINMENU_ADMINALT') ? "" . _BLOCKTITLE_MAINMENU_ADMINALT . "" : 'Administer your PostNuked site.';
$mainblock_block_userexit = defined('_BLOCKTITLE_MAINMENU_USEREXIT') ? "" . _BLOCKTITLE_MAINMENU_USEREXIT . "" : 'Logout';
$mainblock_block_userexitalt = defined('_BLOCKTITLE_MAINMENU_USEREXITALT') ? "" . _BLOCKTITLE_MAINMENU_USEREXITALT . "" : 'Logout of your account.';
$mainblock_block_dl = defined('_BLOCKTITLE_MAINMENU_DL') ? "" . _BLOCKTITLE_MAINMENU_DL . "" : 'Downloads';
$mainblock_block_dlalt = defined('_BLOCKTITLE_MAINMENU_DLALT') ? "" . _BLOCKTITLE_MAINMENU_DLALT . "" : 'Find downloads listed on this website.';
$mainblock_block_faq = defined('_BLOCKTITLE_MAINMENU_FAQ') ? "" . _BLOCKTITLE_MAINMENU_FAQ . "" : 'FAQ';
$mainblock_block_faqalt = defined('_BLOCKTITLE_MAINMENU_FAQALT') ? "" . _BLOCKTITLE_MAINMENU_FAQALT . "" : 'Frequently Asked Questions';
$mainblock_block_news = defined('_BLOCKTITLE_MAINMENU_NEWS') ? "" . _BLOCKTITLE_MAINMENU_NEWS . "" : 'News';
$mainblock_block_newsalt = defined('_BLOCKTITLE_MAINMENU_NEWSALT') ? "" . _BLOCKTITLE_MAINMENU_NEWSALT . "" : 'Latest News on this site.';
$mainblock_block_rws = defined('_BLOCKTITLE_MAINMENU_RWS') ? "" . _BLOCKTITLE_MAINMENU_RWS . "" : 'Reviews';
$mainblock_block_rwsalt = defined('_BLOCKTITLE_MAINMENU_RWSALT') ? "" . _BLOCKTITLE_MAINMENU_RWSALT . "" : 'Reviews Section on this website.';
$mainblock_block_search = defined('_BLOCKTITLE_MAINMENU_SEARCH') ? "" . _BLOCKTITLE_MAINMENU_SEARCH . "" : 'Search';
$mainblock_block_searchalt = defined('_BLOCKTITLE_MAINMENU_SEARCHALT') ? "" . _BLOCKTITLE_MAINMENU_SEARCHALT . "" : 'Search our website.';
$mainblock_block_sections = defined('_BLOCKTITLE_MAINMENU_SECTIONS') ? "" . _BLOCKTITLE_MAINMENU_SECTIONS . "" : 'Sections';
$mainblock_block_sectionsalt = defined('_BLOCKTITLE_MAINMENU_SECTIONSALT') ? "" . _BLOCKTITLE_MAINMENU_SECTIONSALT . "" : 'Other content on this website.';
$mainblock_block_snews = defined('_BLOCKTITLE_MAINMENU_SNEWS') ? "" . _BLOCKTITLE_MAINMENU_SNEWS . "" : 'Submit News';
$mainblock_block_snewsalt = defined('_BLOCKTITLE_MAINMENU_SNEWSALT') ? "" . _BLOCKTITLE_MAINMENU_SNEWSALT . "" : 'Submit an article.';
$mainblock_block_topics = defined('_BLOCKTITLE_MAINMENU_TOPICS') ? "" . _BLOCKTITLE_MAINMENU_TOPICS . "" : 'Topics';
$mainblock_block_topicsalt = defined('_BLOCKTITLE_MAINMENU_TOPICSALT') ? "" . _BLOCKTITLE_MAINMENU_TOPICSALT . "" : 'Listing of news topics on this website.';
$mainblock_block_wlinks = defined('_BLOCKTITLE_MAINMENU_WLINKS') ? "" . _BLOCKTITLE_MAINMENU_WLINKS . "" : 'Web Links';
$mainblock_block_wlinksalt = defined('_BLOCKTITLE_MAINMENU_WLINKSALT') ? "" . _BLOCKTITLE_MAINMENU_WLINKSALT . "" : 'Links to other sites.';
// popuplate blocks table
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES (1,'menu','{$mainblock_block_title}','style:=1\ndisplaymodules:=0\ndisplaywaiting:=0\ncontent:=index.php|{$mainblock_block_home}|{$mainblock_block_homealt}.LINESPLITuser.php|{$mainblock_block_user}|{$mainblock_block_useralt}.LINESPLITadmin.php|{$mainblock_block_admin}|{$mainblock_block_adminalt}.LINESPLITuser.php?module=User&op=logout|{$mainblock_block_userexit}|{$mainblock_block_userexitalt}.LINESPLIT|{$modules}|LINESPLIT[Downloads]|{$mainblock_block_dl}|{$mainblock_block_dlalt}.LINESPLIT[FAQ]|{$mainblock_block_faq}|{$mainblock_block_faqalt}.LINESPLIT[News]|{$mainblock_block_news}|{$mainblock_block_newsalt}.LINESPLIT[Reviews]|{$mainblock_block_rws}|{$mainblock_block_rwsalt}.LINESPLIT[Search]|{$mainblock_block_search}|{$mainblock_block_searchalt}.LINESPLIT[Sections]|{$mainblock_block_sections}|{$mainblock_block_sectionsalt}.LINESPLIT[Submit_News]|{$mainblock_block_snews}|{$mainblock_block_snewsalt}.LINESPLIT[Topics]|{$mainblock_block_topics}|{$mainblock_block_topicsalt}.LINESPLIT[Web_Links]|{$mainblock_block_wlinks}|{$mainblock_block_wlinksalt}.','',0, 'l','1.0',1,0,20011122090726,'', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$mainblock_block_title})</span>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '2', 'menu', '{$incoming_block_title}', 'style:=1\ndisplaymodules:=0\ndisplaywaiting:=1\ncontent:=', '', 0, 'l', '2.0', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$incoming_block_title})</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '3', 'online', '{$whoisonline_block_title}', '', '', 0, 'l', '3.0', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$whoisonline_block_title})</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '4', 'stories', '$otherstories_block_title', 'type:=1 topic:=-1 category:=-1 limit:=10', '', 0, 'r', '1.0', '1', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED. $prefix."_blocks ($otherstories_block_title)</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '5', 'user', '{$usersblock_block_title}', '{$usersblocktexte_block_title}', '', 0, 'l', '3.5', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$usersblock_block_title})</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '6', 'search', '{$searchbox_block_title}', '', '', 0, 'l', '4.0', '0', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$searchbox_block_title})</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '8', 'thelang', '{$languages_block_title}', '', '', 0, 'l', '6.0', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$languages_block_title})</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '9', 'category', '$catmenu_block_title', '', '', 0, 'r', '1.5', '1', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED.$prefix."_blocks ($catmenu_block_title)</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '10', 'random', '$ranhead_block_title', '', '', 0, 'r', '2.0', '0', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED.$prefix."_blocks ($ranhead_block_title)</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '11', 'poll', '$poll_block_title', '', '', 0, 'r', '3.0', '1', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED.$prefix."_blocks ($poll_block_title)</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '12', 'big', '$bigstory_block_title', '', '', 0, 'r', '4.0', '1', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED.$prefix."_blocks ($bigstory_block_title)</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '13', 'login', '{$userslogin_block_title}', '', '', 0, 'r', '5.0', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$userslogin_block_title})</strong>");
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_blocks VALUES ( '14', 'past', '$pastart_block_title', '', '', 0, 'r', '6.0', '1', '0', '00000000000000', '', 1 , 1)") or die ("<strong>"._NOTUPDATED.$prefix."_blocks ($pastart_block_title)</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_blocks VALUES ( '15', 'messages', '{$adminmess_block_title}', '', '', '" . pnModGetIDFromName('Admin_Messages') . "', 'c', '1.0', '1', '0', '00000000000000', '', 1 , 1)") or die("<strong>" . _NOTUPDATED . $prefix . "_blocks ({$adminmess_block_title})</strong>");
echo "<br /><span class=\"pn-sub\">" . $prefix . "_blocks " . _UPDATED . "</span>";
// populate group_perms table
// $result = $inst_dbconn->Execute("INSERT INTO ".$prefix."_group_perms VALUES (0, 2, 1, 0, '.*', '.*', 800, 0)") || die("<strong>"._NOTUPDATED.$prefix."_group_perms</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_group_perms VALUES (0, -1, 2, 0, 'Menublock::', '{$mainblock_block_title}:{$mainblock_block_admin}:', 0, 0)") || die("<strong>" . _NOTUPDATED . $prefix . "_group_perms</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_group_perms VALUES (0, 1, 3, 0, '.*', '.*', 300, 0)") || die("<strong>" . _NOTUPDATED . $prefix . "_group_perms</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_group_perms VALUES (0, 0, 4, 0, 'Menublock::', '{$mainblock_block_title}:({$mainblock_block_user}|{$mainblock_block_userexit}|{$mainblock_block_snews}):', 0, 0)") || die("<strong>" . _NOTUPDATED . $prefix . "_group_perms</strong>");
$result = $inst_dbconn->Execute("INSERT INTO " . $prefix . "_group_perms VALUES (0, 0, 5, 0, '.*', '.*', 200, 0)") || die("<strong>" . _NOTUPDATED . $prefix . "_group_perms</strong>");
echo "<br /><span class=\"pn-sub\">" . $prefix . "_group_perms" . _UPDATED . "</span>";
}
示例8: pnBlockLoad
/**
* load a block
*
* @param string $modname module name
* @param string $block name of the block
* @return bool true on successful load, false otherwise
*/
function pnBlockLoad($modname, $block)
{
static $loaded = array();
if (empty($modname) || $modname == 'Core' || $modname == 'Blocks') {
$modname = 'Core';
$moddir = 'includes/blocks';
$langdir = 'includes/language/blocks';
} else {
$modinfo = pnModGetInfo(pnModGetIdFromName($modname));
$moddir = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/pnblocks';
$langdir = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/pnlang';
}
if (isset($loaded["{$modname}/{$block}"])) {
return true;
}
// Load the block
$incfile = $block . '.php';
$filepath = $moddir . '/' . pnVarPrepForOS($incfile);
if (!file_exists($filepath)) {
return false;
}
include_once $filepath;
$loaded["{$modname}/{$block}"] = 1;
// Load the block language files
$currentlangfile = $langdir . '/' . pnVarPrepForOS(pnUserGetLang()) . '/' . pnVarPrepForOS($incfile);
$defaultlangfile = $langdir . '/' . pnVarPrepForOS(pnConfigGetVar('language')) . '/' . pnVarPrepForOS($incfile);
if (file_exists($currentlangfile)) {
include $currentlangfile;
} elseif (file_exists($defaultlangfile)) {
include $defaultlangfile;
}
// get the block info
$infofunc = "{$modname}_{$block}block_info";
if (function_exists($infofunc)) {
$blocks_modules[$block] = $infofunc();
}
// set the module and keys for the new block
$blocks_modules[$block]['bkey'] = $block;
if (!isset($blocks_modules[$block]['module'])) {
$blocks_modules[$block]['module'] = $modname;
}
$blocks_modules[$block]['mid'] = pnModGetIDFromName($blocks_modules[$block]['module']);
// merge the blockinfo in the global list of blocks
if (!isset($GLOBALS['blocks_modules'])) {
$GLOBALS['blocks_modules'] = array();
}
$GLOBALS['blocks_modules'][$blocks_modules[$block]['mid']][$block] = $blocks_modules[$block];
// Initialise block if required (new-style)
$initfunc = "{$modname}_{$block}block_init";
if (function_exists($initfunc)) {
$initfunc();
}
return true;
}
示例9: pnModGetInfo
* 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
*
*/
//=========================================================================
// Require utility classes
//=========================================================================
$pcModInfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__));
$pcDir = pnVarPrepForOS($pcModInfo['directory']);
require_once "modules/{$pcDir}/common.api.php";
unset($pcModInfo, $pcDir);
function postcalendar_adminapi_buildHourSelect($args)
{
extract($args);
$time24hours = pnModGetVar(__POSTCALENDAR__, 'time24hours');
if (!isset($hour)) {
$hour = $time24hours ? date('H') : date('h');
}
$output = new pnHTML();
$output->SetInputMode(_PNH_VERBATIMINPUT);
$options = array();
if ($time24hours) {
for ($i = 0; $i < 24; $i++) {
示例10: 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);
}
//.........这里部分代码省略.........
示例11: 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) {
//.........这里部分代码省略.........
示例12: _add_plugins_dir
/**
* add a plugins dir to _plugin_dir array
*
* This function takes module name and adds two path two the plugins_dir array
* when existing
*
* @param string $module well known module name
* @access private
*/
function _add_plugins_dir($module)
{
$modinfo = pnModGetInfo(pnModGetIDFromName($module));
$modpath = $modinfo['type'] == 3 ? 'system' : 'modules';
$mod_plugs = "{$modpath}/{$modinfo['directory']}/pntemplates/plugins";
if (file_exists($mod_plugs)) {
array_push($this->plugins_dir, $mod_plugs);
}
// uncomment for .8 until modtype=3 for system modules is implemented
$modpath = 'system';
$mod_plugs = "{$modpath}/{$modinfo['directory']}/pntemplates/plugins";
if (file_exists($mod_plugs)) {
array_push($this->plugins_dir, $mod_plugs);
}
}
示例13: elseif
exit;
} elseif (function_exists($function_main)) {
$function_main($_REQUEST);
exit;
} else {
// die("error : user_execute($file,$function_op)");
pnRedirect('index.php');
return true;
}
}
// when we are here, the call is the result of an action
// requested by a (legacy) Your_Account plugin.
// Get all user modules...
$usermods = pnModGetUserMods();
// since the your account module does't have index.php/pnuser.php it
// won't be listed as user_capable hence we need to manually add it to
// our result set. [markwest]
$usermods[] = pnModGetInfo(pnModGetIDFromName('Your_Account'));
// ...and run the requested action (specified by $op)
foreach ($usermods as $usermod) {
if (@is_dir($dir = 'modules/' . $usermod['directory'] . '/user/case/')) {
$casedir = opendir($dir);
while ($func = readdir($casedir)) {
if (eregi('^case.', $func)) {
$ModName = $usermod['name'];
include $dir . pnVarPrepForOS($func);
}
}
closedir($casedir);
}
}
示例14: pnModLangLoad
/**
* pnModLangLoad
* loads the language files for a module
*
* @author Mark West
* @link http://www.markwest.me.uk
* @param modname - name of the module
* @param type - type of the language file to load e.g. user, admin
* @param api - load api lang file or gui lang file
*/
function pnModLangLoad($modname, $type = 'user', $api = false)
{
// define input, all numbers and booleans to strings
$modname = isset($modname) ? (string) $modname : '';
// validate
if (!pnVarValidate($modname, 'mod')) {
return false;
}
// get the module info
$modinfo = isset($modname) ? pnModGetInfo(pnModGetIDFromName($modname)) : false;
if (!$modinfo) {
return false;
}
// create variables for the OS preped version of the directory
list($osdirectory, $ostype) = pnVarPrepForOS($modinfo['directory'], $type);
$defaultlang = pnConfigGetVar('language');
if (empty($defaultlang)) {
$defaultlang = 'eng';
}
$osapi = '';
if ($api) {
$osapi = 'api';
}
$currentlang = pnUserGetLang();
if (file_exists("modules/{$osdirectory}/pnlang/{$currentlang}/{$ostype}{$osapi}.php")) {
include_once "modules/{$osdirectory}/pnlang/" . pnVarPrepForOS($currentlang) . "/{$ostype}{$osapi}.php";
} elseif (file_exists("modules/{$osdirectory}/pnlang/{$defaultlang}/{$ostype}{$osapi}.php")) {
include_once "modules/{$osdirectory}/pnlang/" . pnVarPrepForOS($defaultlang) . "/{$ostype}{$osapi}.php";
}
return;
}
示例15: modules_get_manual
/**
* Loads the required manual for module
*/
function modules_get_manual()
{
$currentlang = pnSessionGetVar('lang');
$language = pnConfigGetVar('language');
if (!isset($GLOBALS['ModName'])) {
$modname = pnModGetName();
} else {
$modname = $GLOBALS['ModName'];
}
$modinfo = pnModGetInfo(pnModGetIDFromName($modname));
if (file_exists('modules/' . pnVarPrepForOS($modinfo['directory']) . '/lang/' . pnVarPrepForOS($currentlang) . '/manual.html')) {
$hlpfile = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/lang/' . pnVarPrepForOS($currentlang) . '/manual.html';
} elseif (!empty($language)) {
if (file_exists('modules/' . pnVarPrepForOS($modinfo['directory']) . '/lang/' . pnVarPrepForOS($language) . '/manual.html')) {
$hlpfile = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/lang/' . pnVarPrepForOS($language) . '/manual.html';
}
} else {
$hlpfile = 'modules/' . pnVarPrepForOS($modinfo['directory']) . '/lang/eng/manual.html';
}
return;
}