• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pnUserGetTheme函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pnUserGetTheme函数的典型用法代码示例。如果您正苦于以下问题:PHP pnUserGetTheme函数的具体用法?PHP pnUserGetTheme怎么用?PHP pnUserGetTheme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pnUserGetTheme函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: pnVarCleanFromInput

 *
 */
// grab the form variables
$tplview = pnVarCleanFromInput('tplview');
$viewtype = pnVarCleanFromInput('viewtype');
$eid = pnVarCleanFromInput('eid');
$Date = pnVarCleanFromInput('Date');
$print = pnVarCleanFromInput('print');
$uid = pnUserGetVar('uid');
$pc_username = pnVarCleanFromInput('pc_username');
$output =& new pnHTML();
$output->SetInputMode(_PNH_VERBATIMINPUT);
if (!pnModAPILoad('postcalendar', 'user')) {
    die('Could not load PostCalendar user API');
}
$theme = pnUserGetTheme();
if (!pnThemeLoad($theme)) {
    die('Could not load theme');
}
$output->Text('<html><head>');
$output->Text("<title>" . pnConfigGetVar('sitename') . ' :: ' . pnConfigGetVar('slogan') . "</title>\n");
$output->Text('<link rel="StyleSheet" href="themes/' . $theme . '/style/styleNN.css" type="text/css" />');
$output->Text('<style type="text/css">@import url("themes/' . $theme . '/style/style.css"); </style>');
$output->Text('</head>');
$output->Text('<body bgcolor="#ffffff">');
// setup our cache id
$cacheid = md5($Date . $viewtype . $tplview . _SETTING_TEMPLATE . $eid . $print . $uid . $pc_username . $theme);
// display the correct view
switch ($viewtype) {
    case 'details':
        $output->Text(pnModAPIFunc('PostCalendar', 'user', 'eventDetail', array('eid' => $eid, 'Date' => $Date, 'print' => $print, 'cacheid' => $cacheid)));
开发者ID:juggernautsei,项目名称:openemr,代码行数:31,代码来源:print.php


示例2: mediashare_user_simplethumbnails

function mediashare_user_simplethumbnails($args)
{
    $albumId = mediashareGetIntUrl('aid', $args, 1);
    $template = isset($args['template']) ? $args['template'] : FormUtil::getPassedValue('template');
    $itemCount = isset($args['count']) ? $args['count'] : FormUtil::getPassedValue('count');
    // Check access (use albumId since no mediaId was passed)
    if (!mediashareAccessAlbum($albumId, mediashareAccessRequirementViewSomething)) {
        return LogUtil::registerPermissionError();
    }
    // 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('itemCount', count($items));
    $render->assign('mediaItems', $itemCount === null ? $items : array_slice($items, 0, $itemCount));
    $render->assign('album', $album);
    $render->assign('albumId', $albumId);
    $render->assign('thumbnailSize', pnModGetVar('mediashare', 'thumbnailSize'));
    $render->assign('theme', pnUserGetTheme());
    $template = 'content' . DataUtil::formatForOS($template);
    // filmstrip
    if (!$render->template_exists("mediashare_user_{$template}.html")) {
        $template = 'simplethumbnails';
    }
    return $render->fetch("mediashare_user_{$template}.html");
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:35,代码来源:pnuser.php


示例3: 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));
//.........这里部分代码省略.........
开发者ID:juggernautsei,项目名称:openemr,代码行数:101,代码来源:calendar.php


示例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}");
 }
开发者ID:mi-squared,项目名称:openemr,代码行数:96,代码来源:pcSmarty.class.php


示例5: PrintPage

function PrintPage($sid)
{
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    // grab the actual story from the database
    $column =& $pntable['stories_column'];
    $result = $dbconn->Execute("SELECT {$column['title']},\n                                     {$column['time']},\n                                     {$column['hometext']},\n                                     {$column['bodytext']},\n                                     {$column['topic']},\n                                     {$column['notes']},\n                                     {$column['cid']},\n                                     {$column['aid']}\n                              FROM {$pntable['stories']} where {$column['sid']} = '" . pnVarPrepForStore($sid) . "'");
    list($title, $time, $hometext, $bodytext, $topic, $notes, $cid, $aid) = $result->fields;
    if (!isset($title) || $title == '') {
        include 'header.php';
        echo _DBSELECTERROR;
        include 'footer.php';
        exit;
    }
    if ($dbconn->ErrorNo() != 0) {
        include 'header.php';
        echo _DBSELECTERROR;
        include 'footer.php';
        exit;
    }
    // Get data for "autorise check"
    // Just a temp. solution;
    // Print.php needs completely redesign by using getArticles() and genArticleInfo()
    // fix for Stories::Story, Topics::Topic [larsneo]
    // find out the cattitle
    if ($cid == 0) {
        // Default category
        $cattitle = "" . _ARTICLES . "";
    } else {
        $catcolumn =& $pntable['stories_cat_column'];
        $catquery = buildSimpleQuery('stories_cat', array('title'), "{$catcolumn['catid']} = {$cid}");
        $catresult = $dbconn->Execute($catquery);
        list($cattitle) = $catresult->fields;
    }
    // find out the topictext
    $topicscolumn =& $pntable['topics_column'];
    $topicquery = buildSimpleQuery('topics', array('topictext', 'topicname'), "{$topicscolumn['topicid']} = {$topic}");
    $topicresult = $dbconn->Execute($topicquery);
    list($topictext, $topicname) = $topicresult->fields;
    if (pnSecAuthAction(0, 'Stories::Story', "{$aid}:{$cattitle}:{$sid}", ACCESS_READ) && pnSecAuthAction(0, 'Topics::Topic', "{$topicname}::{$topic}", ACCESS_READ)) {
        // user is authorised to view Stories::Story and Topics::Topic
        // Increment the read counter
        $column =& $pntable['stories_column'];
        $dbconn->Execute("UPDATE {$pntable['stories']} SET {$column['counter']}={$column['counter']}+1 WHERE {$column['sid']}='" . pnVarPrepForStore($sid) . "'");
        $time = $result->UnixTimeStamp($time);
        $cWhereIsPerso = WHERE_IS_PERSO;
        if (!empty($cWhereIsPerso)) {
            include "modules/NS-Multisites/print.inc.php";
        } else {
            $themesarein = "";
            $ThemeSel = pnUserGetTheme();
        }
        /* with this code there's no output if wiki is removed [larsneo]
            pnModAPILoad('Wiki', 'user');
            list($title,
                 $hometext,
                 $bodytext,
                 $notes) = pnModAPIFunc('wiki',
                                        'user',
                                        'transform',
                                        array('objectid' => $sid,
                                              'extrainfo' => array($title,
                                                                   $hometext,
                                                                   $bodytext,
                                                                   $notes)));
        	*/
        // call hooks
        list($title, $hometext, $bodytext, $notes) = pnModCallHooks('item', 'transform', '', array($title, $hometext, $bodytext, $notes));
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" . "<html>\n" . "<head><title>" . pnConfigGetVar('sitename') . "</title>\n";
        if (defined("_CHARSET") && _CHARSET != "") {
            echo "<META HTTP-EQUIV=\"Content-Type\" " . "CONTENT=\"text/html; charset=" . _CHARSET . "\">\n";
        }
        //changed to local stylesheet
        //echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$themesarein."themes/$ThemeSel/style/style.css\">";
        echo "<style type=\"text/css\">\n" . "<!--\n" . ".print-title {\n" . "background-color: transparent;\n" . "color: #990000;\n" . "font-family: Verdana, Arial, sans-serif;\n" . "font-size: 14px;\n" . "font-weight: bold;\n" . "text-decoration: none;\n" . "}\n" . ".print-sub {\n" . "background-color: transparent;\n" . "color: #000000;\n" . "font-family: Verdana, Arial, sans-serif;\n" . "font-size: 11px;\n" . "font-weight: normal;\n" . "text-decoration: none;\n" . "}\n" . ".print-normal {\n" . "background-color: transparent;\n" . "color: #000000;\n" . "font-family: Verdana, Arial, sans-serif;\n" . "font-size: 12px;\n" . "font-weight: normal;\n" . "text-decoration: none;\n" . "}\n" . ".print {\n" . "color: #000000;\n" . "background-color: #FFFFFF;\n" . "}\n" . "-->\n" . "</style>\n";
        echo "</head>\n" . "<body class=\"print\" bgcolor=\"#FFFFFF\" text=\"#000000\">\n" . "\n<table border=\"0\" width=\"85%\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#FFFFFF\">\n" . "<tr><td>\n" . "<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#FFFFFF\">\n" . "<tr><td>\n" . "<img src=\"" . WHERE_IS_PERSO . "images/" . pnConfigGetVar('site_logo') . "\" border=\"0\" alt=\"" . pnConfigGetVar('sitename') . "\">\n" . "<br /><br />\n" . "<b><font class=\"print-title\">" . pnVarPrepHTMLDisplay($title) . "</font></b><br /><br />\n" . "<font class=\"print-sub\">" . pnVarPrepHTMLDisplay($cattitle) . " / " . pnVarPrepHTMLDisplay($topictext) . "<br />\n" . "<b>" . _DATE . ":</b> " . ml_ftime(_DATETIMEBRIEF, $time) . "</font>\n" . "</td></tr>\n" . "<tr><td>\n" . "<font class=\"print-normal\">" . pnVarPrepHTMLDisplay($hometext) . "<br /><br />\n";
        if (!empty($bodytext)) {
            echo pnVarPrepHTMLDisplay($bodytext) . "<br />\n";
        }
        if (!empty($notes)) {
            echo pnVarPrepHTMLDisplay($notes) . "<br />\n";
        } else {
            echo "<br />\n";
        }
        echo "</font>\n" . "</td></tr>\n" . "<tr><td>\n" . "<hr size=\"1\"><font class=\"print-normal\">\n" . "" . _COMESFROM . " " . pnConfigGetVar('sitename') . "<br />\n" . "<a class=\"print-normal\" href=\"" . pnGetBaseURL() . "\">" . pnGetBaseURL() . "</a>\n" . "<br /><br />\n" . "" . _THEURL . "" . "<br />\n" . "<a class=\"print-normal\" href=\"" . pnGetBaseURL() . "modules.php?op=modload&amp;name=News&amp;file=article&amp;sid={$sid}\">" . pnGetBaseURL() . "modules.php?op=modload&amp;name=News&amp;file=article&amp;sid={$sid}" . "</a>\n" . "</font>\n" . "</td></tr>\n" . "</table>\n</td></tr>\n</table>\n" . "</body>\n" . "</html>\n";
    } else {
        // user is not authorised to view Stories::Story and Topics::Topic
        include 'header.php';
        echo _BADAUTHKEY;
        include 'footer.php';
        exit;
    }
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:93,代码来源:print.php


示例6: postcalendar_userapi_eventPreview

/**
 *  postcalendar_userapi_eventPreview
 *  Creates the detailed event display and outputs html.
 *  Accepts an array of key/value pairs
 *  @param array $event array of event details from the form
 *  @return string html output
 *  @access public
 */
function postcalendar_userapi_eventPreview($args)
{
    // get the theme globals :: is there a better way to do this?
    pnThemeLoad(pnUserGetTheme());
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5;
    global $textcolor1, $textcolor2;
    extract($args);
    unset($args);
    $uid = pnUserGetVar('uid');
    //=================================================================
    //  Setup Smarty Template Engine
    //=================================================================
    $tpl = new pcSmarty();
    $tpl->caching = false;
    // add preceding zeros
    $event_starttimeh = sprintf('%02d', $event_starttimeh);
    $event_starttimem = sprintf('%02d', $event_starttimem);
    $event_startday = sprintf('%02d', $event_startday);
    $event_startmonth = sprintf('%02d', $event_startmonth);
    $event_endday = sprintf('%02d', $event_endday);
    $event_endmonth = sprintf('%02d', $event_endmonth);
    if (!(bool) _SETTING_TIME_24HOUR) {
        if ($event_startampm == _PM_VAL) {
            if ($event_starttimeh != 12) {
                $event_starttimeh += 12;
            }
        } elseif ($event_startampm == _AM_VAL) {
            if ($event_starttimeh == 12) {
                $event_starttimeh = 00;
            }
        }
    }
    $event_startampm . " - ";
    $startTime = $event_starttimeh . ':' . $event_starttimem . ' ';
    $event = array();
    $event['eid'] = '';
    $event['uname'] = $uname;
    $event['catid'] = $event_category;
    if ($pc_html_or_text == 'html') {
        $prepFunction = 'pcVarPrepHTMLDisplay';
    } else {
        $prepFunction = 'pcVarPrepForDisplay';
    }
    $event['title'] = $prepFunction($event_subject);
    $event['hometext'] = $prepFunction($event_desc);
    $event['desc'] = $event['hometext'];
    $event['date'] = $event_startyear . $event_startmonth . $event_startday;
    $event['duration'] = $event_duration;
    $event['duration_hours'] = $event_dur_hours;
    $event['duration_minutes'] = $event_dur_minutes;
    $event['endDate'] = $event_endyear . '-' . $event_endmonth . '-' . $event_endday;
    $event['startTime'] = $startTime;
    $event['recurrtype'] = '';
    $event['recurrfreq'] = '';
    $event['recurrspec'] = $event_recurrspec;
    $event['topic'] = $event_topic;
    $event['alldayevent'] = $event_allday;
    $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);
    //=================================================================
    //  get event's topic information
    //=================================================================
    if (_SETTING_DISPLAY_TOPICS) {
        list($dbconn) = pnDBGetConn();
        $pntable = pnDBGetTables();
        $topics_table = $pntable['topics'];
        $topics_column = $pntable['topics_column'];
        $topicsql = "SELECT {$topics_column['topictext']},{$topics_column['topicimage']}\n            \t \t FROM {$topics_table}\n            \t \t WHERE {$topics_column['topicid']} = {$event['topic']}\n            \t \t LIMIT 1";
        $topic_result = $dbconn->Execute($topicsql);
        list($event['topictext'], $event['topicimg']) = $topic_result->fields;
        $topic_result->Close();
    } else {
        $event['topictext'] = $event['topicimg'] = '';
    }
    //=================================================================
    //  Find out what Template we're using
    //=================================================================
    $template_name = _SETTING_TEMPLATE;
    if (!isset($template_name)) {
        $template_name = 'default';
    }
    //=================================================================
    //  populate the template
//.........这里部分代码省略.........
开发者ID:bradymiller,项目名称:openemr,代码行数:101,代码来源:pnuserapi.php


示例7: themesideblock

/**
 * Display a block based on the current theme
 *
 */
function themesideblock($row)
{
    if (!isset($row['bid'])) {
        $row['bid'] = '';
    }
    if (!isset($row['title'])) {
        $row['title'] = '';
    }
    // check for collapsable menus being enabled, and setup the collapsable menu image.
    if (file_exists('themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/upb.gif')) {
        $upb = '<img src="themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/upb.gif" alt="" />';
    } else {
        $upb = '<img src="images/global/upb.gif" alt="" />';
    }
    if (file_exists('themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/downb.gif')) {
        $downb = '<img src="themes/' . pnVarPrepForOS(pnUserGetTheme()) . '/images/downb.gif" alt="" />';
    } else {
        $downb = '<img src="images/global/downb.gif" alt="" />';
    }
    if (pnUserLoggedIn() && pnModGetVar('Blocks', 'collapseable') == 1 && isset($row['collapsable']) && $row['collapsable'] == '1') {
        if (pnCheckUserBlock($row) == '1') {
            if (!empty($row['title'])) {
                $row['minbox'] = '<a href="' . pnVarPrepForDisplay(pnModURL('Blocks', 'user', 'changestatus', array('bid' => $row['bid'], 'authid' => pnSecGenAuthKey()))) . '">' . $upb . '</a>';
            }
        } else {
            $row['content'] = '';
            if (!empty($row['title'])) {
                $row['minbox'] = '<a href="' . pnVarPrepForDisplay(pnModURL('Blocks', 'user', 'changestatus', array('bid' => $row['bid'], 'authid' => pnSecGenAuthKey()))) . '">' . $downb . '</a>';
            }
        }
    } else {
        $row['minbox'] = '';
    }
    // end collapseable menu config
    return themesidebox($row);
}
开发者ID:BackupTheBerlios,项目名称:freshwind-svn,代码行数:40,代码来源:pnBlocks.php


示例8: postcalendar_userapi_eventDetail

function postcalendar_userapi_eventDetail($args, $admin = false)
{
    if (!(bool) PC_ACCESS_READ) {
        return _POSTCALENDARNOAUTH;
    }
    // get the theme globals :: is there a better way to do this?
    pnThemeLoad(pnUserGetTheme());
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5;
    global $textcolor1, $textcolor2;
    $popup = pnVarCleanFromInput('popup');
    extract($args);
    unset($args);
    if (!isset($cacheid)) {
        $cacheid = null;
    }
    if (!isset($eid)) {
        return false;
    }
    if (!isset($nopop)) {
        $nopop = false;
    }
    $uid = pnUserGetVar('uid');
    //=================================================================
    //  Find out what Template we're using
    //=================================================================
    $template_name = _SETTING_TEMPLATE;
    if (!isset($template_name)) {
        $template_name = 'default';
    }
    //=================================================================
    //  Setup Smarty Template Engine
    //=================================================================
    $tpl = new pcSmarty();
    if ($admin) {
        $template = $template_name . '/admin/details.html';
        $args['cacheid'] = '';
        $print = 0;
        $Date =& postcalendar_getDate();
        $tpl->caching = false;
    } else {
        $template = $template_name . '/user/details.html';
    }
    if (!$tpl->is_cached($template, $cacheid)) {
        // let's get the DB information
        list($dbconn) = pnDBGetConn();
        $pntable = pnDBGetTables();
        // get the event's information
        $event =& postcalendar_userapi_pcGetEventDetails($eid);
        // if the above is false, it's a private event for another user
        // we should not diplay this - so we just exit gracefully
        if ($event === false) {
            return false;
        }
        //=================================================================
        //  get event's topic information
        //=================================================================
        $topics_table = $pntable['topics'];
        $topics_column = $pntable['topics_column'];
        $topicsql = "SELECT {$topics_column['topictext']},{$topics_column['topicimage']}\n                     FROM {$topics_table}\n                     WHERE {$topics_column['topicid']} = {$event['topic']}\n                     LIMIT 1";
        $topic_result = $dbconn->Execute($topicsql);
        list($event['topictext'], $event['topicimg']) = $topic_result->fields;
        $location = unserialize($event['location']);
        $event['location'] = $location['event_location'];
        $event['street1'] = $location['event_street1'];
        $event['street2'] = $location['event_street2'];
        $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']);
//.........这里部分代码省略.........
开发者ID:stephen-smith,项目名称:openemr,代码行数:101,代码来源:common.api.php


示例9: dplink_adminmenu

function dplink_adminmenu()
{
    $theme = pnUserGetTheme();
    pnThemeLoad($theme);
    // Create output object
    $output = new pnHTML();
    // Security check
    if (!pnSecAuthAction(0, 'dplink::', '::', ACCESS_ADMIN)) {
        $output->Text(pnVarPrepHTMLDisplay(_SHIMLINKNOAUTH));
        return $output->GetOutput();
    }
    //Title
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->Title(pnVarPrepHTMLDisplay('<b>' . _SHIMLINK . '</b>'));
    $output->Text(pnVarPrepHTMLDisplay(_SHIMLINKMODIFYCONFIG));
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    // Start form
    $output->FormStart(pnModURL('dplink', 'admin', 'updateconfig'));
    // Add an authorisation ID
    $output->FormHidden('authid', pnSecGenAuthKey());
    // Start the table that holds the information to be modified.
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->TableStart();
    // dplink location
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODSUBJECT));
    $row[] = $output->FormText('url', pnModGetVar('dplink', 'url'), 50, 50);
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Warning
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWARNING));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Use I-frame
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWRAP));
    $row[] = $output->FormCheckbox('use_wrap', pnModGetVar('dplink', 'use_wrap'));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    // Open in New >Window
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(pnVarPrepHTMLDisplay(_MODWINDOW));
    $row[] = $output->FormCheckbox('use_window', pnModGetVar('dplink', 'use_window'));
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddrow($row, 'left');
    $output->TableEnd();
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    // End form
    //$output->Linebreak(1);
    ob_start();
    OpenTable();
    $oTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($oTable);
    $output->Text('<div align="center"><br>');
    $output->FormSubmit(pnVarPrepHTMLDisplay(_SHIMLINKUPDATE));
    $output->Text('<br><br></div>');
    ob_start();
    CloseTable();
    $cTable = ob_get_contents();
    ob_end_clean();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->Text($cTable);
    $output->FormEnd();
    // Return the output that has been generated by this function
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    return $output->GetOutput();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:98,代码来源:pnadmin.php


示例10: pollResults

function pollResults($pollID)
{
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    // if pollID isn't set use the latest pollID. Skooter
    //if(!isset($pollID)) $pollID = 1;  //could be a bug if pollID '1' is deleted. Skooter
    if (!isset($pollID) || empty($pollID) || is_numeric($pollID) && $pollID == 0) {
        $pollID = pollLatest();
    }
    $column =& $pntable['poll_desc_column'];
    $result = $dbconn->Execute("SELECT {$column['polltitle']} FROM {$pntable['poll_desc']} WHERE {$column['pollid']}=" . (int) pnVarPrepForStore($pollID));
    list($holdtitle) = $result->fields;
    echo "<br /><span class=\"pn-normal\"><b>" . pnVarPrepForDisplay(stripslashes($holdtitle)) . "</b></span><br /><br />";
    $result->Close();
    $column =& $pntable['poll_data_column'];
    $result = $dbconn->Execute("SELECT SUM({$column['optioncount']}) AS sum FROM {$pntable['poll_data']} WHERE {$column['pollid']}=" . (int) pnVarPrepForStore($pollID));
    list($sum) = $result->fields;
    $result->Close();
    echo "<table border=\"0\">";
    /* cycle through all options */
    $column =& $pntable['poll_data_column'];
    $result = $dbconn->Execute("SELECT {$column['optiontext']}, {$column['optioncount']} FROM {$pntable['poll_data']} WHERE ({$column['pollid']}=" . (int) pnVarPrepForStore($pollID) . " AND {$column['optiontext']} NOT LIKE \"\") ORDER BY {$column['voteid']}");
    while (list($optionText, $optionCount) = $result->fields) {
        $result->MoveNext();
        echo "<tr><td>";
        echo "<span class=\"pn-normal\">" . pnVarPrepForDisplay(stripslashes($optionText)) . "</span>";
        echo "</td>";
        if ($sum) {
            $percent = 100 * $optionCount / $sum;
        } else {
            $percent = 0;
        }
        echo "<td>";
        $percentInt = (int) $percent * 4 * pnConfigGetVar('BarScale');
        $percent2 = (int) $percent;
        $ThemeSel = pnUserGetTheme();
        if ($percent > 0) {
            echo "<img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"15\" width=\"7\" alt=\"{$percent2} %\" />";
            echo "<img src=\"themes/{$ThemeSel}/images/mainbar.gif\" height=\"15\" width=\"{$percentInt}\" alt=\"{$percent2} %\" />";
            echo "<img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"15\" width=\"7\" alt=\"{$percent2} %\" />";
        } else {
            echo "<img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"15\" width=\"7\" alt=\"{$percent2} %\" />";
            echo "<img src=\"themes/{$ThemeSel}/images/mainbar.gif\" height=\"15\" width=\"3\" alt=\"{$percent2} %\" />";
            echo "<img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"15\" width=\"7\" alt=\"{$percent2} %\" />";
        }
        printf("<span class=pn-normal> %.2f %% (%d)</span>", $percent, $optionCount);
        echo "</td></tr>";
    }
    echo "</table><br />";
    echo "<p style=\"text-align:center\"><span class=\"pn-normal\">";
    echo "<b>" . _TOTALVOTES . " {$sum}</b><br />";
    echo "</span><span class=\"pn-sub\">" . _ONEPERDAY . "</span><span class=\"pn-normal\"><br /><br />";
    $booth = $pollID;
    echo "[ <a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=NS-Polls&amp;file=index&amp;pollID={$booth}\">" . _VOTING . "</a> | ";
    echo "<a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=NS-Polls&amp;file=index\">" . _OTHERPOLLS . "</a> ]</span></p>";
    return 1;
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:57,代码来源:poll.php


示例11: pnInit


//.........这里部分代码省略.........
    error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
    // Hack for some weird PHP systems that should have the
    // LC_* constants defined, but don't
    if (!defined('LC_TIME')) {
        define('LC_TIME', 'LC_TIME');
    }
    // Initialise and load configuration
    $pnconfig = array();
    $pndebug = array();
    include 'config.php';
    $GLOBALS['pnconfig'] = $pnconfig;
    $GLOBALS['pndebug'] = $pndebug;
    // Initialize the (ugly) additional header array
    $GLOBALS['additional_header'] = array();
    // load ADODB
    pnADODBInit();
    // Connect to database
    if (!pnDBInit()) {
        die('Database initialisation failed');
    }
    // Set up multisites
    // added this @define for .71, ugly ?
    // i guess the E_ALL stuff.
    @define('WHERE_IS_PERSO', '');
    // Initialise and load pntables
    pnDBSetTables();
    // user and modules system includes
    include 'includes/pnUser.php';
    include 'includes/pnMod.php';
    // Set compression on if desired
    if (pnConfigGetVar('UseCompression') == 1) {
        ob_start("ob_gzhandler");
    }
    if (isset($_REQUEST['_SESSION'])) {
        die('Attempted pollution of SESSION space via GPC request');
    }
    // Other includes
    include 'includes/pnSession.php';
    if (pnConfigGetVar('anonymoussessions') || !empty($_REQUEST['POSTNUKESID'])) {
        // Start session
        if (!pnSessionSetup()) {
            die('Session setup failed');
        }
        if (!pnSessionInit()) {
            die('Session initialisation failed');
        }
    }
    // load security functions.
    include 'includes/pnSecurity.php';
    include 'includes/pnBlocks.php';
    // Load our language files
    include 'includes/pnLang.php';
    pnLangLoad();
    // inclusion of pnrender class -- jn
    include 'includes/pnRender.class.php';
    include 'includes/pnTheme.php';
    include 'includes/pnHTML.php';
    // Legacy includes
    if (pnConfigGetVar('loadlegacy') == '1') {
        include 'includes/legacy/legacy.php';
        include 'includes/legacy/queryutil.php';
        include 'includes/legacy/xhtml.php';
        include 'includes/legacy/oldfuncs.php';
    }
    // Check for site closed
    if (pnConfigGetVar('siteoff') && !pnSecAuthAction(0, 'Settings::', 'SiteOff::', ACCESS_ADMIN)) {
        include 'includes/templates/siteoff.htm';
        die;
    }
    // Cross-Site Scripting attack defense - Sent by larsneo
    // some syntax checking against injected javascript
    if (pnConfigGetVar('pnAntiCracker') == '1') {
        include 'includes/pnAntiCracker.php';
        pnSecureInput();
    }
    // load safehtml class for xss filtering
    // the XML_HTMLSAX3 define is also needed inside the class so we
    // cannot use the path directly in the include.
    if (pnConfigGetVar('safehtml') == '1') {
        define('XML_HTMLSAX3', 'includes/classes/safehtml/');
        include XML_HTMLSAX3 . 'safehtml.php';
    }
    // Banner system
    // TODO - move to banners module
    if (pnModAvailable('Banners')) {
        include 'includes/pnBanners.php';
    }
    // Call Stats module counter code if installed
    if (pnModAvailable('Stats') && !pnSecAuthAction(0, '.*', '.*', ACCESS_ADMIN)) {
        include 'includes/legacy/counter.php';
    }
    // Handle referer
    if (pnModAvailable('Referers') && pnConfigGetVar('httpref') == 1) {
        include 'includes/legacy/referer.php';
        httpreferer();
    }
    // Load the theme
    pnThemeLoad(pnUserGetTheme());
    return true;
}
开发者ID:BackupTheBerlios,项目名称:freshwind-svn,代码行数:101,代码来源:pnAPI.php


示例12: add_core_data

 /**
 * add core data to the template
 *
 * This function adds some basic data to the template depending on the
 * current user and the PN settings.
 *
 * @param   list of module names. all mod vars of these modules will be included too
            The mod vars of the current module will always be included
 * @return  boolean true if ok, otherwise false
 * @access  public
 */
 function add_core_data()
 {
     $pncore = array();
     $pncore['version_num'] = _PN_VERSION_NUM;
     $pncore['version_id'] = _PN_VERSION_ID;
     $pncore['version_sub'] = _PN_VERSION_SUB;
     $pncore['logged_in'] = pnUserLoggedIn();
     $pncore['language'] = pnUserGetLang();
     $pncore['themeinfo'] = pnThemeInfo(pnUserGetTheme());
     pnThemeLoad($pncore['themeinfo']['name']);
     $colors = array();
     $colors['bgcolor1'] = pnThemeGetVar('bgcolor1');
     $colors['bgcolor2'] = pnThemeGetVar('bgcolor2');
     $colors['bgcolor3'] = pnThemeGetVar('bgcolor3');
     $colors['bgcolor4'] = pnThemeGetVar('bgcolor4');
     $colors['bgcolor5'] = pnThemeGetVar('bgcolor5');
     $colors['sepcolor'] = pnThemeGetVar('sepcolor');
     $colors['textcolor1'] = pnThemeGetVar('textcolor1');
     $colors['textcolor2'] = pnThemeGetVar('textcolor2');
     // add userdata
     $pncore['user'] = pnUserGetVars(pnSessionGetVar('uid'));
     // add modvars of current module
     $pncore[$this->module] = pnModGetVar($this->module);
     // add mod vars of all modules supplied as parameter
     foreach (func_get_args() as $modulename) {
         // if the modulename is empty do nothing
         if (!empty($modulename) && !is_array($modulename) && $modulename != $this->module) {
             // check if user wants to have /PNConfig
             if ($modulename == _PN_CONFIG_MODULE) {
                 $pnconfig = pnModGetVar(_PN_CONFIG_MODULE);
                 foreach ($pnconfig as $key => $value) {
                     // unserialize all config vars
                    

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pnUserGetVar函数代码示例发布时间:2022-05-15
下一篇:
PHP pnUserGetLang函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap