本文整理汇总了PHP中pnUserLoggedIn函数的典型用法代码示例。如果您正苦于以下问题:PHP pnUserLoggedIn函数的具体用法?PHP pnUserLoggedIn怎么用?PHP pnUserLoggedIn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pnUserLoggedIn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cookiedecode
function cookiedecode()
{
if (!pnUserLoggedIn()) {
return;
}
global $cookie;
$cookie = array(pnUserGetVar('uid'), pnUserGetVar('uname'), pnUserGetVar('pass'), pnUserGetVar('storynum'), pnUserGetVar('umode'), pnUserGetVar('uorder'), pnUserGetVar('thold'), pnUserGetVar('noscore'), pnUserGetVar('ublockon'), pnUserGetVar('theme'), pnUserGetVar('commentmax'));
return $cookie;
}
示例2: blocks_login_block
function blocks_login_block($row)
{
global $HTTP_SERVER_VARS;
if (empty($row['title'])) {
$row['title'] = 'Login';
}
if (!pnSecAuthAction(0, 'Loginblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
// code taken pnGetBaseURI to fix issue with IIS not passing request_uri
// markwest
// Start of with REQUEST_URI
if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) {
$path = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
$path = getenv('REQUEST_URI');
}
if (empty($path) || substr($path, -1, 1) == '/') {
// REQUEST_URI was empty or pointed to a path
// Try looking at PATH_INFO
$path = getenv('PATH_INFO');
if (empty($path)) {
// No luck there either
// Try SCRIPT_NAME
if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
$path = $HTTP_SERVER_VARS['SCRIPT_NAME'];
} else {
$path = getenv('SCRIPT_NAME');
}
}
}
if (!pnUserLoggedIn()) {
// prettified a little with a table for inputs and button to avoid bugs like #493456 (Andy Varganov)
$boxstuff = '<form action="user.php" method="post">';
$boxstuff .= '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td>';
$boxstuff .= '<span class="pn-normal"> ' . _BLOCKNICKNAME . '</span></td></tr><tr><td>';
$boxstuff .= '<input type="text" name="uname" size="14" maxlength="25"></td></tr><tr><td>';
$boxstuff .= '<span class="pn-normal"> ' . _BLOCKPASSWORD . '</span></td></tr><tr><td>';
$boxstuff .= '<input type="password" name="pass" size="14" maxlength="20"></td></tr><tr><td>';
if (pnConfigGetVar('seclevel') != 'High') {
$boxstuff .= '<input type="checkbox" value="1" name="rememberme" />';
$boxstuff .= '<span class="pn-normal"> ' . _REMEMBERME . '</span></td></tr><tr><td>';
}
$boxstuff .= '<br>';
$boxstuff .= '<input type="hidden" name="module" value="NS-User" />';
$boxstuff .= '<input type="hidden" name="op" value="login" />';
$boxstuff .= '<input type="hidden" name="url" value="' . pnVarPrepForDisplay($path) . '" />';
$boxstuff .= '<input type="submit" value="' . _LOGIN . '" /></td></tr><tr><td>';
$boxstuff .= '<br /><span class="pn-normal">' . _ASREGISTERED . '</span></td></tr><tr><td></table></form>';
if (empty($row['title'])) {
$row['title'] = _LOGIN;
}
$row['content'] = $boxstuff;
return themesideblock($row);
}
}
示例3: dplink_user_main
function dplink_user_main()
{
$url = trim(pnModGetVar('dplink', 'url'));
$window = pnModGetVar('dplink', 'use_window');
$wrap = pnModGetVar('dplink', 'use_postwrap');
$user_data = array();
$home = pnGetBaseURL();
$home .= 'user.php?op=loginscreen&module=NS-User';
if (!pnUserLoggedIn()) {
pnRedirect($home);
}
// We need to get the user password string from the database
$uid = pnUserGetVar('uid');
list($dbconn) = pnDBGetConn();
$pntables = pnDBGetTables();
$usertable = $pntables['users'];
$usercol =& $pntables['users_column'];
$sql = "SELECT {$usercol['uname']}, {$usercol['pass']}, {$usercol['name']}, {$usercol['email']} " . "FROM {$usertable} WHERE {$usercol['uid']} = {$uid}";
$result = $dbconn->Execute($sql);
if ($dbconn->ErrorNo() != 0) {
die('Could not get user details');
}
if ($result->EOF) {
die('Could not get user detail');
}
list($uname, $password, $user_name, $user_email) = $result->fields;
$result->Close();
$user_data['login'] = $uname;
$user_data['passwd'] = $password;
$user_data['name'] = $user_name;
$user_data['email'] = $user_email;
$parm = serialize($user_data);
$check = md5($parm);
$cparm = gzcompress($parm);
$bparm = urlencode(base64_encode($cparm));
if ($window) {
$url .= '/index.php?login=pn&userdata=' . $bparm . '&check=' . $check;
header('Location: ' . $url);
} else {
$url .= '/index.php?login=pn%26userdata=' . $bparm . '%26check=' . $check;
if ($wrap) {
header('Location: modules.php?op=modload&name=PostWrap&file=index&page=' . $url);
} else {
header('Location: modules.php?op=modload&name=dplink&file=index&url=' . $url);
}
}
exit;
}
示例4: FlashChatBridge_Onlineblock_display
/**
* display block
*
* @param array $blockinfo a blockinfo structure
* @return output the rendered bock
*/
function FlashChatBridge_Onlineblock_display($blockinfo)
{
if (!SecurityUtil::checkPermission('FlashChatBridge:Onlineblock:', "::", ACCESS_READ)) {
return false;
}
if (!pnModAvailable('FlashChatBridge') || !pnUserLoggedIn()) {
return false;
}
//pnModLoad("FlashChatBridge");
$Users = pnModAPIFunc('FlashChatBridge', 'user', 'getChatterList');
$count = count($Users);
$render = pnRender::getInstance('FlashChatBridge', false);
$render->assign('Users', $Users);
$render->assign('Count', $count);
$blockinfo['content'] = $render->fetch('flashchatbridge_block_online.htm');
return pnBlockThemeBlock($blockinfo);
}
示例5: hasAlbumAccess
function hasAlbumAccess($albumId, $access, $viewKey)
{
// Admin can do everything
if (SecurityUtil::checkPermission('mediashare::', '::', ACCESS_ADMIN)) {
return true;
}
$userId = (int) pnUserGetVar('uid');
// Owner can do everything
if (!($album = pnModAPIFunc('mediashare', 'user', 'getAlbum', array('albumId' => $albumId)))) {
return false;
}
if ($album['ownerId'] == $userId) {
return true;
}
// Don't enable any edit access if not having normal Zikula edit access
if (!SecurityUtil::checkPermission('mediashare::', '::', ACCESS_EDIT)) {
$access = $access & ~mediashareAccessRequirementEditSomething;
}
// Must have normal PN read access to the module
if (!SecurityUtil::checkPermission('mediashare::', '::', ACCESS_READ)) {
return false;
}
// Anonymous is not allowed to add stuff, so remove those bits
if (!pnUserLoggedIn()) {
$access = $access & ~mediashareAccessRequirementAddSomething;
}
pnModDBInfoLoad('Groups');
// Make sure groups database info is available
$pntable = pnDBGetTables();
$accessTable = $pntable['mediashare_access'];
$accessColumn = $pntable['mediashare_access_column'];
$membershipTable = $pntable['group_membership'];
$membershipColumn = $pntable['group_membership_column'];
$invitedAlbums = pnModAPIFunc('mediashare', 'invitation', 'getInvitedAlbums', array());
if (is_array($invitedAlbums) && $invitedAlbums[$albumId] && ($access & mediashareAccessRequirementView) == mediashareAccessRequirementView) {
return true;
}
$sql = "SELECT COUNT(*)\n FROM {$accessTable}\n LEFT JOIN {$membershipTable}\n ON {$membershipColumn['gid']} = {$accessColumn['groupId']}\n AND {$membershipColumn['uid']} = {$userId}\n WHERE {$accessColumn['albumId']} = {$albumId}\n AND ({$accessColumn['access']} & {$access}) != 0\n AND ({$membershipColumn['gid']} IS NOT NULL OR {$accessColumn['groupId']} = -1)";
$result = DBUtil::executeSQL($sql);
if ($result === false) {
return LogUtil::registerError(__f('Error in %1$s: %2$s.', array('accessapi.hasAlbumAccess', 'Could not retrieve the user privilegies.'), $dom));
}
$hasAccess = DBUtil::marshallObjects($result, array('count'));
return $hasAccess[0]['count'] > 0;
}
示例6: blocks_user_block
function blocks_user_block($row)
{
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
if (!pnSecAuthAction(0, 'Userblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
if (pnUserLoggedIn() && pnUserGetVar('ublockon') == 1) {
$column =& $pntable['users_column'];
$uid = pnUserGetVar('uid');
$getblock = $dbconn->Execute("SELECT {$column['ublock']} FROM {$pntable['users']} WHERE {$column['uid']}=" . pnVarPrepForStore($uid) . "");
list($ublock) = $getblock->fields;
$username = pnUserGetVar('name');
$row['title'] = _MENUFOR . " " . pnVarPrepForDisplay($username) . "";
$row['content'] = $ublock;
return themesideblock($row);
}
}
示例7: FlashChatBridge_Bannerchatblock_display
/**
* display block
*
* @param array $blockinfo a blockinfo structure
* @return output the rendered bock
*/
function FlashChatBridge_Bannerchatblock_display($blockinfo)
{
if (!SecurityUtil::checkPermission('FlashChatBridge:Bannerchatblock:', "::", ACCESS_READ)) {
return false;
}
if (!pnModAvailable('FlashChatBridge') || !pnUserLoggedIn()) {
return false;
}
$render = pnRender::getInstance('FlashChatBridge', false);
$UserVars = pnUserGetVars(SessionUtil::getVar('uid'));
$settings = pnModGetVar('FlashChatBridge');
$settings['init_user'] = $UserVars['uname'];
$settings['init_password'] = $UserVars['pass'];
$settings['width'] = "100%";
$settings['height'] = "150";
$render->assign('settings', $settings);
$blockinfo['content'] = $render->fetch('flashchatbridge_user_chat_banner.htm');
return pnBlockThemeBlock($blockinfo);
}
示例8: extract
/**
* postcalendar_userapi_pcQueryEvents
* INPUT
* $args = Array of values possibly containing:
* $provider_id = array of provider ID numbers
*
* Returns an array containing the event's information
* @params array(key=>value)
* @params string key eventstatus
* @params int value -1 == hidden ; 0 == queued ; 1 == approved
* @return array $events[][]
*/
function &postcalendar_userapi_pcQueryEvents($args)
{
$end = '0000-00-00';
extract($args);
// echo "<!-- args = "; print_r($args); echo " -->\n"; // debugging
// $pc_username = pnVarCleanFromInput('pc_username');
$pc_username = $_SESSION['pc_username'];
// from Michael Brinson 2006-09-19
if (empty($pc_username) || is_array($pc_username)) {
$pc_username = "__PC_ALL__";
}
//echo "DEBUG pc_username: $pc_username \n"; // debugging
$topic = pnVarCleanFromInput('pc_topic');
$category = pnVarCleanFromInput('pc_category');
if (!empty($pc_username) && strtolower($pc_username) != 'anonymous') {
if ($pc_username == '__PC_ALL__' || $pc_username == -1) {
$ruserid = -1;
} else {
$ruserid = getIDfromUser($pc_username);
}
}
if (!isset($eventstatus)) {
$eventstatus = 1;
}
// sanity check on eventstatus
if ((int) $eventstatus < -1 || (int) $eventstatus > 1) {
$eventstatus = 1;
}
if (!isset($start)) {
$start = Date_Calc::dateNow('%Y-%m-%d');
}
list($sy, $sm, $sd) = explode('-', $start);
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
// link to the events tables
$table = $pntable['postcalendar_events'];
$cattable = $pntable['postcalendar_categories'];
$topictable = $pntable['postcalendar_topics'];
$sql = "SELECT DISTINCT a.pc_eid, a.pc_informant, a.pc_catid, " . "a.pc_title, a.pc_time, a.pc_hometext, a.pc_eventDate, a.pc_duration, " . "a.pc_endDate, a.pc_startTime, a.pc_recurrtype, a.pc_recurrfreq, " . "a.pc_recurrspec, a.pc_topic, a.pc_alldayevent, a.pc_location, " . "a.pc_conttel, a.pc_contname, a.pc_contemail, a.pc_website, a.pc_fee, " . "a.pc_sharing, a.pc_prefcatid, b.pc_catcolor, b.pc_catname, " . "b.pc_catdesc, a.pc_pid, a.pc_apptstatus, a.pc_aid, " . "concat(u.fname,' ',u.lname) as provider_name, " . "concat(pd.lname,', ',pd.fname) as patient_name, " . "concat(u2.fname, ' ', u2.lname) as owner_name, " . "DOB as patient_dob, a.pc_facility, pd.pubpid " . "FROM ( {$table} AS a ) " . "LEFT JOIN {$cattable} AS b ON b.pc_catid = a.pc_catid " . "LEFT JOIN users as u ON a.pc_aid = u.id " . "LEFT JOIN users as u2 ON a.pc_aid = u2.id " . "LEFT JOIN patient_data as pd ON a.pc_pid = pd.pid " . "WHERE a.pc_eventstatus = {$eventstatus} " . "AND ((a.pc_endDate >= '{$start}' AND a.pc_eventDate <= '{$end}') OR " . "(a.pc_endDate = '0000-00-00' AND a.pc_eventDate >= '{$start}' AND " . "a.pc_eventDate <= '{$end}')) ";
//==================================
//FACILITY FILTERING (lemonsoftware)(CHEMED)
if ($_SESSION['pc_facility']) {
$pc_facility = $_SESSION['pc_facility'];
$sql .= " AND a.pc_facility = {$pc_facility} ";
/*
AND u.facility_id = $pc_facility
AND u2.facility_id = $pc_facility "; */
} else {
if ($pc_facility) {
// pc_facility could be provided in the search arguments -- JRM March 2008
$sql .= " AND a.pc_facility = {$pc_facility} ";
/*.
" AND u.facility_id = $pc_facility".
" AND u2.facility_id = $pc_facility "; */
}
}
//EOS FACILITY FILTERING (lemonsoftware)
//==================================
// The above 3 lines replaced these:
// AND (a.pc_endDate >= '$start' OR a.pc_endDate = '0000-00-00')
// AND a.pc_eventDate <= '$end' ";
if (!empty($providerID)) {
$ruserid = $providerID;
}
// eliminate ruserid if we're trying to query by provider_id -- JRM
if (!empty($provider_id)) {
unset($ruserid);
}
if (isset($ruserid)) {
// get all events for the specified username
if ($ruserid == -1) {
$sql .= "AND (a.pc_sharing = '" . SHARING_BUSY . "' ";
$sql .= "OR a.pc_sharing = '" . SHARING_PUBLIC . "') ";
} else {
$sql .= "AND a.pc_aid IN (0, " . $ruserid . ") ";
}
} elseif (!pnUserLoggedIn()) {
// get all events for anonymous users
$sql .= "AND a.pc_sharing = '" . SHARING_GLOBAL . "' ";
} elseif (!empty($provider_id)) {
// get all events for a variety of provider IDs -- JRM
if ($provider_id[0] != "_ALL_") {
/**add all the events from the clinic provider id = 0*/
$sql .= "AND a.pc_aid in (0," . implode(",", $provider_id) . ") ";
}
} else {
// get all events for logged in user plus global events
$sql .= "AND (a.pc_aid IN (0," . $_SESSION['authUserID'] . ") OR a.pc_sharing = '" . SHARING_GLOBAL . "') ";
//.........这里部分代码省略.........
示例9: head
function head()
{
global $index, $artpage, $topic, $hlpfile, $hr, $theme, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $textcolor1, $textcolor2, $textcolor3, $textcolor4, $forumpage, $thename, $postnuke_theme, $pntheme, $themename, $themeimages, $additional_header, $themeOverrideCategory, $themeOverrideStory;
// modification mouzaia .71
$cWhereIsPerso = WHERE_IS_PERSO;
if (!empty($cWhereIsPerso)) {
include "modules/NS-Multisites/head.inc.php";
} else {
global $themesarein;
if (pnUserLoggedIn() && pnConfigGetVar('theme_change') != 1) {
$thistheme = pnUserGetTheme();
if (isset($theme)) {
$thistheme = pnVarPrepForOs($theme);
}
} else {
$thistheme = pnConfigGetVar('Default_Theme');
if (isset($theme)) {
$thistheme = pnVarPrepForOs($theme);
}
}
// eugenio themeover 20020413
// override the theme per category or story
// precedence is story over category override
if ($themeOverrideCategory != '' && file_exists("themes/{$themeOverrideCategory}")) {
$thistheme = $themeOverrideCategory;
}
if ($themeOverrideStory != '' && file_exists("themes/{$themeOverrideStory}")) {
$thistheme = $themeOverrideStory;
}
if (@file(WHERE_IS_PERSO . "themes/" . $thistheme . "/theme.php")) {
$themesarein = WHERE_IS_PERSO;
} else {
$themesarein = "";
}
}
// eugenio themeover 20020413
pnThemeLoad($thistheme);
/**
* Simple XHTML Beginnings
*/
if (pnConfigGetVar('supportxhtml')) {
//include("includes/xhtml.php");
xhtml_head_start(0);
/* Transitional Support for now */
} else {
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n<head>\n";
if (defined("_CHARSET") && _CHARSET != "") {
echo "<meta http-equiv=\"Content-Type\" " . "content=\"text/html; charset=" . _CHARSET . "\">\n";
}
}
if ($artpage == 1) {
/**
* article page output
*/
global $info, $hometext;
echo "<title>{$info['title']} :: " . pnConfigGetVar('sitename') . ' :: ' . pnConfigGetVar('slogan') . "</title>\n";
if (pnConfigGetVar('dyn_keywords') == 1) {
$htmlless = check_html($info['maintext'], $strip = 'nohtml');
$symbolLess = trim(ereg_replace('("|\\?|!|:|\\.|\\(|\\)|;|\\\\)+', ' ', $htmlless));
$keywords = ereg_replace('( |' . CHR(10) . '|' . CHR(13) . ')+', ',', $symbolLess);
$metatags = ereg_replace(",+", ",", $keywords);
echo "<meta http-equiv=\"Keywords\" content=\"{$metatags}\">\n";
} else {
echo "<meta name=\"KEYWORDS\" content=\"" . pnConfigGetVar('metakeywords') . "\">\n";
}
} else {
/**
* all other page output
*/
echo '<title>' . pnConfigGetVar('sitename') . ' :: ' . pnConfigGetVar('slogan') . "</title>\n";
echo '<meta name="KEYWORDS" content="' . pnConfigGetVar('metakeywords') . "\">\n";
}
echo '<meta name="DESCRIPTION" content="' . pnConfigGetVar('slogan') . "\">\n";
echo "<meta name=\"ROBOTS\" content=\"INDEX,FOLLOW\">\n";
echo "<meta name=\"resource-type\" content=\"document\">\n";
echo "<meta http-equiv=\"expires\" content=\"0\">\n";
echo '<meta name="author" content="' . pnConfigGetVar('sitename') . "\">\n";
echo '<meta name="copyright" content="Copyright (c) 2003 by ' . pnConfigGetVar('sitename') . "\">\n";
echo "<meta name=\"revisit-after\" content=\"1 days\">\n";
echo "<meta name=\"distribution\" content=\"Global\">\n";
echo '<meta name="generator" content="PostNuke ' . _PN_VERSION_NUM . " - http://postnuke.com\">\n";
echo "<meta name=\"rating\" content=\"General\">\n";
global $themesarein;
echo "<link rel=\"StyleSheet\" href=\"" . $themesarein . "themes/" . $thistheme . "/style/styleNN.css\" type=\"text/css\">\n";
echo "<style type=\"text/css\">";
echo "@import url(\"" . $themesarein . "themes/" . $thistheme . "/style/style.css\"); ";
echo "</style>\n";
echo "<script type=\"text/javascript\" src=\"javascript/showimages.php\"></script>\n\n";
/* Enable Wysiwyg editor configuration at seeting Added by bharvey42 edited by Neo */
$pnWysiwygEditor = pnConfigGetVar('WYSIWYGEditor');
if (is_numeric($pnWysiwygEditor) && $pnWysiwygEditor == 1) {
$pnWSEditorPath = pnGetBaseURI();
echo "<!--Visual Editor Plug-in-->" . "<script type=\"text/javascript\">QBPATH='" . $pnWSEditorPath . "/javascript'; VISUAL=0; SECURE=1;</script>" . "<script type=\"text/javascript\" src='" . $pnWSEditorPath . "/javascript/quickbuild.js'></script>" . "<script type=\"text/javascript\" src='" . $pnWSEditorPath . "/javascript/tabedit.js'></script>";
} else {
}
echo "<script type=\"text/javascript\" src=\"javascript/openwindow.php?hlpfile={$hlpfile}\"></script>\n\n";
if (isset($additional_header)) {
echo @implode("\n", $additional_header);
}
//.........这里部分代码省略.........
示例10: mediashare_edit_arrange
/**
* Arrange items
*/
function mediashare_edit_arrange($args)
{
$albumId = mediashareGetIntUrl('aid', $args, 1);
// Check access
if (!mediashareAccessAlbum($albumId, mediashareAccessRequirementAddMedia | mediashareAccessRequirementEditMedia, '')) {
return LogUtil::registerPermissionError();
}
if (isset($_POST['cancelButton'])) {
return pnRedirect(pnModURL('mediashare', 'edit', 'view', array('aid' => $albumId)));
}
if (isset($_POST['saveButton'])) {
return mediashareArrangeAlbum($args);
}
$dom = ZLanguage::getModuleDomain('mediashare');
if (!pnUserLoggedIn()) {
return LogUtil::registerError(__('You must be logged in to use this feature', $dom));
}
// Fetch current album
if (!($album = pnModAPIFunc('mediashare', 'user', 'getAlbum', array('albumId' => $albumId)))) {
return false;
}
if ($album === true) {
return LogUtil::registerError(__('Unknown album.', $dom));
}
// Fetch media items
if (($items = pnModAPIFunc('mediashare', 'user', 'getMediaItems', array('albumId' => $albumId))) === false) {
return false;
}
// Build the output
$render =& pnRender::getInstance('mediashare', false);
$render->assign('album', $album);
$render->assign('mediaItems', $items);
return $render->fetch('mediashare_edit_arrange.html');
}
示例11: admin_messages_messagesblock_display
/**
* display block
*/
function admin_messages_messagesblock_display($row)
{
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
if (!isset($row['title'])) {
$row['title'] = '';
}
if (!pnSecAuthAction(0, 'Admin Messages:Messagesblock:', "{$row['title']}::", ACCESS_READ)) {
return;
}
$messagestable = $pntable['message'];
$messagescolumn =& $pntable['message_column'];
if (pnConfigGetVar('multilingual') == 1) {
$currentlang = pnUserGetLang();
$querylang = "AND ({$messagescolumn['mlanguage']}='{$currentlang}' OR {$messagescolumn['mlanguage']}='')";
} else {
$querylang = '';
}
$sql = "SELECT {$messagescolumn['mid']},\n {$messagescolumn['title']},\n {$messagescolumn['content']},\n {$messagescolumn['date']},\n {$messagescolumn['view']}\n FROM {$messagestable}\n WHERE {$messagescolumn['active']} = 1 \n AND ( {$messagescolumn['expire']} > unix_timestamp(now())\n OR {$messagescolumn['expire']} = 0)\n {$querylang}\n ORDER by {$messagescolumn['mid']} DESC";
$result = $dbconn->Execute($sql);
if ($dbconn->ErrorNo() != 0) {
return;
}
$output = new pnHTML();
while (list($mid, $title, $content, $date, $view) = $result->fields) {
$result->MoveNext();
$show = 0;
if (pnSecAuthAction(0, 'Admin Messages:Messagesblock:', "{$row['title']}::{$mid}", ACCESS_READ)) {
switch ($view) {
case 1:
// Message for everyone
$show = 1;
break;
case 2:
// Message for users
if (pnUserLoggedIn()) {
$show = 1;
}
break;
case 3:
// Messages for non-users
if (!pnUserLoggedIn()) {
$show = 1;
}
break;
case 4:
// Messages for administrators of any description
if (pnSecAuthAction(0, '::', '::', ACCESS_ADMIN)) {
$show = 1;
}
break;
}
}
if ($show) {
list($title, $content) = pnModCallHooks('item', 'transform', '', array($title, $content));
$output->TableStart('', '', 0);
$output->SetInputMode(_PNH_VERBATIMINPUT);
$output->SetOutputMode(_PNH_RETURNOUTPUT);
$ttitle = $output->Linebreak();
$ttitle .= $output->Text($title);
$ttitle .= $output->Linebreak(2);
$output->SetOutputMode(_PNH_KEEPOUTPUT);
$output->TableAddRow(array("<font class=\"pn-title\">" . pnVarPrepHTMLDisplay($ttitle) . "</font>"), 'center');
$output->TableAddRow(array("<font class=\"pn-normal\">" . pnVarPrepHTMLDisplay($content) . "</font>"), 'left');
$output->SetInputMode(_PNH_PARSEINPUT);
$output->TableEnd();
}
}
if ($output->output != "") {
// Don't want a title
$row['title'] = '';
$row['content'] = $output->GetOutput();
return themesideblock($row);
}
}
示例12: postcalendar_admin_submit
function postcalendar_admin_submit($args)
{
if (!PC_ACCESS_ADMIN) {
return _POSTCALENDAR_NOAUTH;
}
pnModAPILoad(__POSTCALENDAR__, 'user');
$output = postcalendar_adminmenu();
// get the theme globals :: is there a better way to do this?
pnThemeLoad(pnUserGetTheme());
global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5, $textcolor1, $textcolor2;
extract($args);
$Date = postcalendar_getDate();
$year = substr($Date, 0, 4);
$month = substr($Date, 4, 2);
$day = substr($Date, 6, 2);
// basic event information
$event_subject = pnVarCleanFromInput('event_subject');
$event_desc = pnVarCleanFromInput('event_desc');
$event_sharing = pnVarCleanFromInput('event_sharing');
$event_category = pnVarCleanFromInput('event_category');
$event_topic = pnVarCleanFromInput('event_topic');
// event start information
$event_startmonth = pnVarCleanFromInput('event_startmonth');
$event_startday = pnVarCleanFromInput('event_startday');
$event_startyear = pnVarCleanFromInput('event_startyear');
$event_starttimeh = pnVarCleanFromInput('event_starttimeh');
$event_starttimem = pnVarCleanFromInput('event_starttimem');
$event_startampm = pnVarCleanFromInput('event_startampm');
// event end information
$event_endmonth = pnVarCleanFromInput('event_endmonth');
$event_endday = pnVarCleanFromInput('event_endday');
$event_endyear = pnVarCleanFromInput('event_endyear');
$event_endtype = pnVarCleanFromInput('event_endtype');
$event_dur_hours = pnVarCleanFromInput('event_dur_hours');
$event_dur_minutes = pnVarCleanFromInput('event_dur_minutes');
$event_duration = 60 * 60 * $event_dur_hours + 60 * $event_dur_minutes;
$event_allday = pnVarCleanFromInput('event_allday');
// location data
$event_location = pnVarCleanFromInput('event_location');
$event_street1 = pnVarCleanFromInput('event_street1');
$event_street2 = pnVarCleanFromInput('event_street2');
$event_city = pnVarCleanFromInput('event_city');
$event_state = pnVarCleanFromInput('event_state');
$event_postal = pnVarCleanFromInput('event_postal');
$event_location_info = serialize(compact('event_location', 'event_street1', 'event_street2', 'event_city', 'event_state', 'event_postal'));
// contact data
$event_contname = pnVarCleanFromInput('event_contname');
$event_conttel = pnVarCleanFromInput('event_conttel');
$event_contemail = pnVarCleanFromInput('event_contemail');
$event_website = pnVarCleanFromInput('event_website');
$event_fee = pnVarCleanFromInput('event_fee');
// event repeating data
$event_repeat = pnVarCleanFromInput('event_repeat');
$event_repeat_freq = pnVarCleanFromInput('event_repeat_freq');
$event_repeat_freq_type = pnVarCleanFromInput('event_repeat_freq_type');
$event_repeat_on_num = pnVarCleanFromInput('event_repeat_on_num');
$event_repeat_on_day = pnVarCleanFromInput('event_repeat_on_day');
$event_repeat_on_freq = pnVarCleanFromInput('event_repeat_on_freq');
$event_recurrspec = serialize(compact('event_repeat_freq', 'event_repeat_freq_type', 'event_repeat_on_num', 'event_repeat_on_day', 'event_repeat_on_freq'));
$pc_html_or_text = pnVarCleanFromInput('pc_html_or_text');
$form_action = pnVarCleanFromInput('form_action');
$pc_event_id = pnVarCleanFromInput('pc_event_id');
$data_loaded = pnVarCleanFromInput('data_loaded');
$is_update = pnVarCleanFromInput('is_update');
$authid = pnVarCleanFromInput('authid');
if (pnUserLoggedIn()) {
$uname = pnUserGetVar('uname');
} else {
$uname = pnConfigGetVar('anonymous');
}
if (!isset($event_repeat)) {
$event_repeat = 0;
}
// lets wrap all the data into array for passing to submit and preview functions
if (!isset($pc_event_id) || empty($pc_event_id) || $data_loaded) {
$eventdata = compact('event_subject', 'event_desc', 'event_sharing', 'event_category', 'event_topic', 'event_startmonth', 'event_startday', 'event_startyear', 'event_starttimeh', 'event_starttimem', 'event_startampm', 'event_endmonth', 'event_endday', 'event_endyear', 'event_endtype', 'event_dur_hours', 'event_dur_minutes', 'event_duration', 'event_allday', 'event_location', 'event_street1', 'event_street2', 'event_city', 'event_state', 'event_postal', 'event_location_info', 'event_contname', 'event_conttel', 'event_contemail', 'event_website', 'event_fee', 'event_repeat', 'event_repeat_freq', 'event_repeat_freq_type', 'event_repeat_on_num', 'event_repeat_on_day', 'event_repeat_on_freq', 'event_recurrspec', 'uname', 'Date', 'year', 'month', 'day', 'pc_html_or_text');
$eventdata['is_update'] = $is_update;
$eventdata['pc_event_id'] = $pc_event_id;
$eventdata['data_loaded'] = true;
} else {
$event = postcalendar_userapi_pcGetEventDetails($pc_event_id);
$eventdata['event_subject'] = $event['title'];
$eventdata['event_desc'] = $event['hometext'];
$eventdata['event_sharing'] = $event['sharing'];
$eventdata['event_category'] = $event['catid'];
$eventdata['event_topic'] = $event['topic'];
$eventdata['event_startmonth'] = substr($event['eventDate'], 5, 2);
$eventdata['event_startday'] = substr($event['eventDate'], 8, 2);
$eventdata['event_startyear'] = substr($event['eventDate'], 0, 4);
$eventdata['event_starttimeh'] = substr($event['startTime'], 0, 2);
$eventdata['event_starttimem'] = substr($event['startTime'], 3, 2);
$eventdata['event_startampm'] = $eventdata['event_starttimeh'] < 12 ? _PC_AM : _PC_PM;
$eventdata['event_endmonth'] = substr($event['endDate'], 5, 2);
$eventdata['event_endday'] = substr($event['endDate'], 8, 2);
$eventdata['event_endyear'] = substr($event['endDate'], 0, 4);
$eventdata['event_endtype'] = $event['endDate'] == '0000-00-00' ? '0' : '1';
$eventdata['event_dur_hours'] = $event['duration_hours'];
$eventdata['event_dur_minutes'] = $event['duration_minutes'];
$eventdata['event_duration'] = $event['duration'];
$eventdata['event_allday'] = $event['alldayevent'];
//.........这里部分代码省略.........
示例13: user_user_main
function user_user_main($var)
{
include 'header.php';
user_menu_draw();
if (pnUserLoggedIn()) {
$uname = pnUserGetVar('uname');
if (pnModAvailable('Comments')) {
user_main_last10com($uname);
}
if (pnModAvailable('News')) {
user_main_last10submit($uname);
}
include 'footer.php';
}
// ?else
}
示例14: blocks_past_block
function blocks_past_block($row)
{
$catid = pnVarCleanFromInput('catid');
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$oldnum = pnConfigGetVar('perpage');
if (!pnSecAuthAction(0, 'Pastblock::', "{$row['title']}::", ACCESS_READ)) {
return;
}
if (pnUserLoggedIn()) {
$storyhome = pnUserGetVar('storynum');
} else {
$storyhome = pnConfigGetVar('storyhome');
}
// Break out options from our content field
$vars = pnBlockVarsFromContent($row['content']);
// Defaults
if (empty($storynum)) {
$storynum = 10;
}
if (empty($vars['limit'])) {
$vars['limit'] = 10;
}
$storynum = $vars['limit'];
$column =& $pntable['stories_column'];
if (!isset($catid) || $catid == '') {
$articles = getArticles("{$column['ihome']}=0", "{$column['time']} DESC", $storynum, $storyhome);
} else {
$articles = getArticles("{$column['catid']}={$catid}", "{$column['time']} DESC", $storynum, $storyhome);
}
$time2 = "";
setlocale(LC_TIME, pnConfigGetVar('locale'));
$boxstuff = "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" class=\"pn-normal\">\n";
$vari = 0;
$see = 0;
foreach ($articles as $article) {
$info = genArticleInfo($article);
$links = genArticleLinks($info);
$preformat = genArticlePreformat($info, $links);
// a little bit tricky to remove the bold property from link description
// (2001-11-15, hdonner)
$preformat['title'] = str_replace("pn-title", "pn-normal", $preformat['title']);
if (!pnSecAuthAction(0, 'Stories::Story', "{$info['aid']}:{$info['cattitle']}:{$info['sid']}", ACCESS_READ) || !pnSecAuthAction(0, 'Topics::Topic', "{$info['topicname']}::{$info['tid']}", ACCESS_READ)) {
continue;
}
$see = 1;
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $info['time'], $datetime2);
$datetime2 = ml_ftime("" . _DATESTRING2 . "", mktime($datetime2[4], $datetime2[5], $datetime2[6], $datetime2[2], $datetime2[3], $datetime2[1]));
$datetime2 = ucfirst($datetime2);
if ($time2 == $datetime2) {
$boxstuff .= "<tr><td valign=\"top\"><big><strong>·</strong></big></td>" . "<td valign=\"top\" width=\"100%\"><span class=\"pn-normal\">" . $preformat['title'] . " ({$info['comments']})</span></td></tr>\n";
} else {
$boxstuff .= "<tr><td colspan=\"2\"><b>{$datetime2}</b></td></tr>\n" . "<tr><td valign=\"top\"><big><strong>·</strong></big></td>" . "<td valign=\"top\" width=\"100%\"><span class=\"pn-normal\">{$preformat['title']} ({$info['comments']})</span></td></tr>\n";
$time2 = $datetime2;
}
$vari++;
if ($vari == $vars['limit']) {
$usernum = pnUserGetVar('storynum');
if (!empty($usernum)) {
$storynum = $usernum;
} else {
$storynum = pnConfigGetVar('storyhome');
}
$min = $oldnum + $storynum;
$boxstuff .= "<tr><td> </td><td valign=\"top\"><a class=\"pn-normal\"";
if (!isset($catid)) {
$boxstuff .= "href=\"modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1\"><b>" . _OLDERARTICLES . "</b></a></td></tr>\n";
} else {
$boxstuff .= "href=\"modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1&stories_cat[0]={$catid}\"><b>" . _OLDERARTICLES . "</b></a></td></tr>\n";
}
}
}
$boxstuff .= "</table>";
if ($see == 1) {
if (empty($row['title'])) {
$row['title'] = _PASTARTICLES;
}
$row['content'] = $boxstuff;
return themesideblock($row);
}
}
示例15: die
<?php
if (!defined("LOADED_AS_MODULE")) {
die("You cannot access this file directly");
}
if (!pnLocalReferer()) {
die("You cannot access this file from an external site");
}
if (!$url) {
die("You must use the {} calling method in your menu, not []");
}
$home = pnGetBaseURL();
$home .= "user.php?op=loginscreen&module=NS-User";
if (!pnUserLoggedIn()) {
pnRedirect($home);
}
include "header.php";
echo "<iframe name='dplink' src='{$url}' width='100%' height='1600'\nmarginwidth=0 marginheight=0 frameborder=0></iframe>";
include "footer.php";