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

PHP pnVarPrepForDisplay函数代码示例

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

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



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

示例1: blocks_ephem_block

function blocks_ephem_block($row)
{
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    $currentlang = pnUserGetLang();
    if (!pnSecAuthAction(0, 'Ephemeridsblock::', "{$row['title']}::", ACCESS_READ)) {
        return;
    }
    if (pnConfigGetVar('multilingual') == 1) {
        $column =& $pntable['ephem_column'];
        $querylang = "AND ({$column['elanguage']}='" . pnVarPrepForStore($currentlang) . "' OR {$column['elanguage']}='')";
    } else {
        $querylang = "";
    }
    $today = getdate();
    $eday = $today['mday'];
    $emonth = $today['mon'];
    $column =& $pntable['ephem_column'];
    $result = $dbconn->Execute("SELECT {$column['yid']}, {$column['content']}\n                              FROM {$pntable['ephem']}\n                              WHERE {$column['did']}='" . pnVarPrepForStore($eday) . "' AND {$column['mid']}='" . pnVarPrepForStore($emonth) . "' {$querylang}");
    $boxstuff = '<span class="pn-normal"><b>' . _ONEDAY . '</b></span><br />';
    while (list($yid, $content) = $result->fields) {
        $result->MoveNext();
        $boxstuff .= '<br /><br />';
        $boxstuff .= '<b>' . pnVarPrepForDisplay($yid) . '</b><br />' . pnVarPrepHTMLDisplay(nl2br($content)) . '';
    }
    if (empty($row['title'])) {
        $row['title'] = _EPHEMERIDS;
    }
    $row['content'] = $boxstuff;
    return themesideblock($row);
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:31,代码来源:ephem.php


示例2: blocks_related_block

function blocks_related_block($row)
{
    global $sid, $story;
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    if (!pnSecAuthAction(0, 'Relatedblock::', "{$row['title']}::", ACCESS_READ)) {
        return;
    }
    if ($story['topic']) {
        $row['content'] = '<font class="pn-normal">';
        $column =& $pntable['stories_column'];
        $sql = "SELECT {$column['sid']} as sid, {$column['title']} as title FROM {$pntable['stories']} WHERE {$column['topic']}=" . pnVarPrepForStore($story['topic']) . " ORDER BY {$column['counter']} DESC";
        $result = $dbconn->SelectLimit($sql, 1);
        $mrow = $result->GetRowAssoc(false);
        $result->MoveNext();
        $column =& $pntable['related_column'];
        $result = $dbconn->Execute("SELECT {$column['name']} as name, {$column['url']} as url FROM {$pntable['related']} WHERE {$column['tid']}=" . pnVarPrepForStore($story['topic']) . "");
        while (!$result->EOF) {
            $lrow = $result->GetRowAssoc(false);
            $result->MoveNext();
            $row['content'] .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"{$lrow['url']}\" target=\"_blank\">" . pnVarPrepForDisplay($lrow['name']) . "</a><br>\n";
        }
        $row['content'] .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"advtopics.php?topic={$story['topic']}\">" . _MOREABOUT . " " . pnVarPrepForDisplay($story['topicname']) . "</a><br>\n" . "<strong><big>&middot;</big></strong>&nbsp;<a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=Search&amp;file=index&amp;action=search&amp;overview=1&amp;active_stories=1&amp;stories_author={$story['aid']}\">" . _NEWSBY . " " . pnVarPrepForDisplay($story['aid']) . "</a><br>\n" . '</font><br><hr noshade width="95%" size="1"><b>' . _MOSTREAD . " " . pnVarPrepForDisplay($story['topicname']) . ":</b><br>\n" . "<center><a href=\"advarticle.php?sid={$mrow['sid']}\">" . pnVarPrepForDisplay($mrow['title']) . "</a></center><br><br>\n" . '<div align="right">' . "<a href=\"print.php?sid={$mrow['sid']}\"><img src=\"images/global/print.gif\" border=\"0\" alt=\"" . _PRINTER . "\"></a>&nbsp;&nbsp;" . "<a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=Recommend_Us&amp;file=index&amp;req=FriendSend&amp;sid={$sid}\"><img src=\"images/global/friend.gif\" border=\"0\" Alt=\"" . _FRIEND . "\"></a>\n" . '</div>';
        return themesideblock($row);
    }
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:26,代码来源:related.php


示例3: blocks_thelang_block

function blocks_thelang_block($row)
{
    $currentlang = pnUserGetLang();
    if (!pnSecAuthAction(0, 'Languageblock::', "{$row['title']}::", ACCESS_OVERVIEW)) {
        return;
    }
    if (!pnConfigGetVar('multilingual')) {
        return;
    }
    $currentURL = $_SERVER['REQUEST_URI'];
    if ($currentURL === "") {
        $currentURL = "index.php";
    }
    $pattern = '/\\?newlang=.../';
    $currentURL = preg_replace($pattern, '', $currentURL);
    $pattern = '/\\&newlang=.../';
    $currentURL = pnVarPrepForDisplay(preg_replace($pattern, '', $currentURL));
    $append = "&amp;";
    if (strpos($currentURL, '?') === false) {
        $append = "?";
    }
    $lang = languagelist();
    $handle = opendir('language');
    while ($f = readdir($handle)) {
        if (is_dir("language/{$f}") && !empty($lang[$f])) {
            $langlist[$f] = $lang[$f];
            $sel_lang[$f] = '';
        }
    }
    asort($langlist);
    $content = '<center><font class="pn-normal">' . _SELECTGUILANG . '</font><br><br>';
    if (pnConfigGetVar('useflags')) {
        $i = 1;
        foreach ($langlist as $k => $v) {
            if ($i > 3) {
                $content .= "<br>\n";
                $i = 1;
            }
            $imgsize = @getimagesize("images/flags/flag-{$k}.png");
            $content .= "<a href=\"{$currentURL}" . $append . "newlang={$k}\"><img src=\"images/flags/flag-{$k}.png\" border=\"0\" alt=\"{$lang[$k]}\" hspace=\"3\" vspace=\"3\" {$imgsize['3']}></a>";
            $i++;
        }
        $content .= '</center>';
    } else {
        $content .= '<form method="post" action="index.php"><select class="pn-text" name="newlanguage" onChange="top.location.href=this.options[this.selectedIndex].value">';
        $sel_lang[$currentlang] = ' selected';
        foreach ($langlist as $k => $v) {
            $content .= "<option value=\"{$currentURL}" . $append . "newlang={$k}\"{$sel_lang[$k]}>{$v}</option>\n";
        }
        $content .= '</select></form></center>';
    }
    if (empty($row['title'])) {
        $row['title'] = _SELECTLANGUAGE;
    }
    $row['content'] = $content;
    return themesideblock($row);
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:57,代码来源:thelang.php


示例4: 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">&nbsp;' . _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">&nbsp;' . _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">&nbsp;' . _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);
    }
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:56,代码来源:login.php


示例5: blocks_category_block

function blocks_category_block($row)
{
    global $topic, $catid;
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    if (!pnSecAuthAction(0, 'Categoryblock::', "{$row['title']}::", ACCESS_READ)) {
        return;
    }
    if (pnConfigGetVar('multilingual') == 1) {
        $column =& $pntable['stories_column'];
        $querylang = "AND ({$column['alanguage']}='" . pnVarPrepForStore(pnUserGetLang()) . "' OR {$column['alanguage']}='')";
        /* the OR is needed to display stories who are posted to ALL languages */
    } else {
        $querylang = '';
    }
    $column =& $pntable['stories_cat_column'];
    $result = $dbconn->Execute("SELECT {$column['catid']} as catid, {$column['title']} as title FROM {$pntable['stories_cat']} ORDER BY {$column['title']}");
    if ($result->EOF) {
        return;
    } else {
        $boxstuff = '<span class="pn-normal">';
        if ($catid == "") {
            // $boxstuff .= '<strong><big>&middot;</big></strong>&nbsp;<b>'._ALL_CATEGORIES.'</b><br />';
            $boxstuff .= "";
        } else {
            $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?op=modload&amp;name=News&amp;file=index&amp;topic={$topic}\">" . _ALL_CATEGORIES . "</a><br />";
        }
        for (; !$result->EOF; $result->MoveNext()) {
            $srow = $result->GetRowAssoc(false);
            if (pnSecAuthAction(0, 'Stories::Category', "{$srow['title']}::{$srow['catid']}", ACCESS_READ)) {
                $column =& $pntable['stories_column'];
                $result2 = $dbconn->Execute("SELECT {$column['time']} AS unixtime\n                                           FROM {$pntable['stories']}\n                                           WHERE {$column['catid']}=" . pnVarPrepForStore($srow['catid']) . " {$querylang}\n                                           ORDER BY {$column['time']} DESC");
                if (!$result2->EOF) {
                    $story = $result2->GetRowAssoc(false);
                    $story['unixtime'] = $result2->UnixTimeStamp($story['unixtime']);
                    $sdate = ml_ftime(_DATEBRIEF, $story['unixtime']);
                    if ($catid == $srow['catid']) {
                        $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<span class=\"pn-title\"><b>" . pnVarPrepForDisplay($srow['title']) . "</b></span> <span class=\"pn-sub\">(" . pnVarPrepForDisplay($sdate) . ")</span><br />";
                    } else {
                        $boxstuff .= "<strong><big>&middot;</big></strong>&nbsp;<a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=News&amp;file=index&amp;catid={$srow['catid']}&amp;topic={$topic}\">" . pnVarPrepForDisplay($srow['title']) . "</a> <span class=\"pn-sub\">(" . pnVarPrepForDisplay($sdate) . ")</span><br />";
                    }
                }
            }
        }
    }
    $boxstuff .= '</span>';
    if (empty($row['title'])) {
        $row['title'] = _CATEGORIES;
    }
    $row['content'] = $boxstuff;
    return themesideblock($row);
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:52,代码来源:category.php


示例6: blocks_weblinks_display

function blocks_weblinks_display($row)
{
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    if (!pnSecAuthAction(0, 'Weblinksblock::', "{$row['title']}::", ACCESS_READ)) {
        return;
    }
    $url = explode('|', $row['url']);
    if (!$url[0]) {
        $row['content'] = 'You forgot to set the module name!';
        return themesideblock($row);
    }
    if (!$url[1]) {
        $url[1] = 10;
    }
    $links_col =& $pntable['links_links_column'];
    $linksok = 0;
    $linkcount = 0;
    $result = $dbconn->Execute("SELECT {$links_col['cat_id']}, {$links_col['title']} FROM {$pntable['links_links']} ORDER BY {$links_col['date']} DESC");
    while (list($cid, $title) = $result->fields) {
        $result->MoveNext();
        $linkcount++;
        if (pnSecAuthAction(0, "Web Links::Category", "{$title}::{$cid}", ACCESS_READ)) {
            $linksok++;
        }
        if ($linksok == $url[1]) {
            break;
        }
    }
    $oldurl = $url[1];
    $url[1] = $linkcount;
    $row['content'] = '<span class="pn-normal">';
    $links_col =& $pntable['links_links_column'];
    $cats_col =& $pntable['links_categories_column'];
    $sql = "SELECT {$links_col['lid']} as lid, {$links_col['cat_id']} as catid, {$links_col['title']} as title, {$links_col['description']} as description, {$links_col['hits']} as hits, IF({$links_col['cat_id']}, CONCAT('/', {$cats_col['title']}), {$cats_col['title']}) AS cattitle\n               FROM {$pntable['links_links']}\n               LEFT JOIN {$pntable['links_categories']}\n               ON {$cats_col['cat_id']}={$links_col['cat_id']}\n               ORDER BY {$links_col['date']} DESC";
    $result = $dbconn->SelectLimit($sql, $url[1]);
    while (!$result->EOF) {
        $lrow = $result->GetRowAssoc(false);
        if (pnSecAuthAction(0, "Web Links::Category", "{$lrow['cattitle']}::{$lrow['catid']}", ACCESS_READ)) {
            $lrow['title'] = pnVarPrepForDisplay($lrow['title']);
            $lrow['description'] = pnVarPrepHTMLDisplay($lrow['description']);
            $lrow['cattitle'] = pnVarPrepForDisplay($lrow['cattitle']);
            $row['content'] .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?op=modload&amp;name={$url['0']}&amp;file=index&amp;req=visit&amp;lid={$lrow['lid']}\" target=\"_blank\" title=\"{$lrow['cattitle']}:\n{$lrow['description']}\" class=\"pn-sub\">{$lrow['title']}</a><br>\n";
            $result->MoveNext();
        }
    }
    //$row['content'] .= "<div align=\"right\"><font class=\"pn-sub\"><a href=\"modules.php?op=modload&name=Web_Links&file=index&req=NewLinks&newlinkshowdays=10\">"._READMORE."</a></font></div>";
    $row['content'] .= '</span>';
    return themesideblock($row);
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:50,代码来源:weblinks.php


示例7: 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);
    }
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:18,代码来源:user.php


示例8: send_email

function send_email()
{
    $adminmail = pnConfigGetVar('adminmail');
    $subject = "" . _ERROR404_MAILSUBJECT . "";
    $sitename = pnConfigGetVar('sitename');
    $remote_addr = pnServerGetVar('REMOTE_ADDR');
    $http_referer = pnServerGetVar('HTTP_REFERER');
    $redirect_url = pnServerGetVar('REDIRECT_URL');
    $server = pnServerGetVar('HTTP_HOST');
    $errordoc = "http://{$server}{$redirect_url}";
    $errortime = ml_ftime(_DATETIMEBRIEF, date(time()));
    $message = "{$subject}\n\n";
    $message .= "TIME: {$errortime}\n";
    $message .= "REMOTE_ADDR: {$remote_addr}\n";
    $message .= "ERRORDOC: " . pnVarPrepForDisplay($errordoc) . "\n";
    $message .= "HTTP_REFERER: {$http_referer}\n";
    pnMail($adminmail, $subject, $message, "From: \"{$sitename}\" <{$adminmail}>\nX-Mailer: PHP/" . phpversion());
    echo "<br /><br /><strong>" . _ERROR404_MAILED . "</strong>\n";
}
开发者ID:BackupTheBerlios,项目名称:freshwind-svn,代码行数:19,代码来源:error.php


示例9: modules_adminmenu

function modules_adminmenu()
{
    $output = new pnHTML();
    if (!pnSecAuthAction(0, 'Modules::', '::', ACCESS_ADMIN)) {
        $output->Text(_MODULESNOAUTH);
        return $output->GetOutput();
    }
    $output->Text(pnGetStatusMsg());
    $output->Linebreak(2);
    $output->TableStart(_MODULES);
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $columns = array();
    $columns[] = $output->URL(pnVarPrepForDisplay(pnModURL('Modules', 'admin', 'list')), _LIST);
    $columns[] = $output->URL(pnVarPrepForDisplay(pnModURL('Modules', 'admin', 'regenerate', array('authid' => pnSecGenAuthKey()))), _REGENERATE);
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddRow($columns);
    $output->SetInputMode(_PNH_PARSEINPUT);
    $output->TableEnd();
    return $output->GetOutput();
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:21,代码来源:pnadmin.php


示例10: user_title

function user_title($title)
{
    OpenTable();
    echo "<center><font class=\"pn-title\"><b>" . pnVarPrepForDisplay($title) . "</b></font></center>";
    CloseTable();
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:6,代码来源:tools.php


示例11: 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


示例12: editmsg

function editmsg()
{
    list($mid, $authid) = pnVarCleanFromInput('mid', 'authid');
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    include "header.php";
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"pn-title\"><b>" . _MESSAGESADMIN . "</b></font></center>";
    CloseTable();
    $column =& $pntable['message_column'];
    $result = $dbconn->Execute("SELECT {$column['title']},\n                                       {$column['content']},\n                                       {$column['date']},\n                                       {$column['expire']},\n                                       {$column['active']},\n                                       {$column['view']},\n                                       {$column['mlanguage']} \n                                FROM {$pntable['message']}\n                                WHERE {$column['mid']}= '" . pnVarPrepForStore($mid) . "'");
    list($title, $content, $mdate, $expire, $active, $view, $mlanguage) = $result->fields;
    if (!pnSecAuthAction(0, 'Messages::', "{$title}::{$mid}", ACCESS_EDIT)) {
        echo _MESSAGESEDITNOAUTH;
        include 'footer.php';
        return;
    }
    OpenTable();
    echo "<center><font class=\"pn-title\"><b>" . _EDITMSG . "</b></font></center>";
    $asel1 = '';
    $asel2 = '';
    if ($active == 1) {
        $asel1 = "checked";
    } elseif ($active == 0) {
        $asel2 = "checked";
    }
    $sel1 = '';
    $sel2 = '';
    $sel3 = '';
    $sel4 = '';
    if ($view == 1) {
        $sel1 = "selected";
    } elseif ($view == 2) {
        $sel2 = "selected";
    } elseif ($view == 3) {
        $sel3 = "selected";
    } elseif ($view == 4) {
        $sel4 = "selected";
    }
    $esel1 = '';
    $esel2 = '';
    $esel3 = '';
    $esel4 = '';
    $esel5 = '';
    $esel6 = '';
    if ($expire == 86400) {
        $esel1 = "selected";
    } elseif ($expire == 172800) {
        $esel2 = "selected";
    } elseif ($expire == 432000) {
        $esel3 = "selected";
    } elseif ($expire == 1296000) {
        $esel4 = "selected";
    } elseif ($expire == 2592000) {
        $esel5 = "selected";
    } elseif ($expire == 0) {
        $esel6 = "selected";
    }
    echo "<form action=\"admin.php\" method=\"post\">";
    echo "<b><font class=\"pn-normal\">" . _MESSAGETITLE . ":</font></b><br>" . "<input type=\"text\" name=\"title\" value=\"" . pnVarPrepForDisplay($title) . "\" size=\"50\" maxlength=\"100\"><br><br>" . "<b><font class=\"pn-normal\">" . _MESSAGECONTENT . ":</font></b><br>" . "<textarea name=\"content\" rows=\"10\" cols=\"80\">" . pnVarPrepForDisplay($content) . "</textarea><br><br><font class=\"pn-normal\">" . '<b>' . _LANGUAGE . ': </b></font>' . '<select name="mlanguage" size="1">' . '<option value="">' . _ALL . '</option>';
    $lang = languagelist();
    $sel_lang[$mlanguage] = ' selected';
    $handle = opendir('language');
    while ($f = readdir($handle)) {
        if (is_dir("language/{$f}") && !empty($lang[$f])) {
            $langlist[$f] = $lang[$f];
        }
    }
    asort($langlist);
    //  a bit ugly, but it works in E_ALL conditions (Andy Varganov)
    foreach ($langlist as $k => $v) {
        echo '<option value="' . $k . '"';
        if (isset($sel_lang[$k])) {
            echo ' selected';
        }
        echo '>' . $v . '</option>';
    }
    print '</select><br><br>' . "<font class=\"pn-normal\"><b>" . _ACTIVE . "?</b> <input type=\"radio\" name=\"active\" value=\"1\" {$asel1}>" . _YES . " " . "<input type=\"radio\" name=\"active\" value=\"0\" {$asel2}>" . _NO . "</font>";
    if ($active == 1) {
        echo "<br><br><font class=\"pn-normal\"><b>" . _CHANGEDATE . "</b>" . "<input type=\"radio\" name=\"chng_date\" value=\"1\">" . _YES . " " . "<input type=\"radio\" name=\"chng_date\" value=\"0\" checked>" . _NO . "</font><br><br>";
    } elseif ($active == 0) {
        echo "<br><font class=\"pn-sub\">" . _IFYOUACTIVE . "</font><br><br>" . "<input type=\"hidden\" name=\"chng_date\" value=\"1\">";
    }
    echo "<font class=\"pn-normal\"><b>" . _VIEWPRIV . "</b> <select name=\"view\">" . "<option value=\"1\" {$sel1}>" . _MVALL . "</option>" . "<option value=\"2\" {$sel2}>" . _MVUSERS . "</option>" . "<option value=\"3\" {$sel3}>" . _MVANON . "</option>" . "<option value=\"4\" {$sel4}>" . _MVADMIN . "</option>" . "</select></font><br><br>" . "<input type=\"hidden\" name=\"mdate\" value=\"{$mdate}\">" . "<input type=\"hidden\" name=\"mid\" value=\"{$mid}\">" . "<input type=\"hidden\" name=\"module\" value=\"" . $GLOBALS['module'] . "\">" . "<input type=\"hidden\" name=\"op\" value=\"savemsg\">" . "<input type=\"hidden\" name=\"authid\" value=\"" . pnSecGenAuthKey() . "\">" . "<input type=\"submit\" value=\"" . _SAVECHANGES . "\">" . "</form>";
    CloseTable();
    include "footer.php";
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:88,代码来源:admin.php


示例13: template_firstblock_modify

/**
 * modify block settings
 */
function template_firstblock_modify($blockinfo)
{
    // Create output object
    $output = new pnHTML();
    // Get current content
    $vars = pnBlockVarsFromContent($blockinfo['content']);
    // Defaults
    if (empty($vars['numitems'])) {
        $vars['numitems'] = 5;
    }
    // Create row
    $row = array();
    $output->SetOutputMode(_PNH_RETURNOUTPUT);
    $row[] = $output->Text(_NUMITEMS);
    $row[] = $output->FormText('numitems', pnVarPrepForDisplay($vars['numitems']), 5, 5);
    $output->SetOutputMode(_PNH_KEEPOUTPUT);
    // Add row
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->TableAddRow($row, 'left');
    $output->SetInputMode(_PNH_PARSEINPUT);
    // Return output
    return $output->GetOutput();
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:26,代码来源:first.php


示例14: draw_menu

 function draw_menu()
 {
     global $hlpfile;
     $currentlang = pnVarCleanFromInput('currentlang');
     OpenTable();
     echo '<center>' . "\n";
     if (count($this->options) == 0) {
         $this->title_file = '';
     }
     if ($this->title_file != '') {
         echo '<a href="' . $this->title_file . '" class="pn-title">';
     }
     echo '<font class="pn-title"><b>' . pnVarPrepForDisplay($this->title_text) . '</b></font>';
     if ($this->title_file != '') {
         echo '</a></center>';
     }
     echo "\n" . '<br>' . "\n";
     //    if (($this->detail_menu) or ($GLOBALS['module']=='oldway'))
     //   {
     // if (isset($this->help_file))
     // {
     $currentlang = pnUserGetLang();
     // fixed bug [ #357 ] empty pop up window
     if (file_exists($file = "modules/" . $GLOBALS['module'] . "/lang/" . pnVarPrepForOS($currentlang) . "/manual.html")) {
         $hlpfile = $file;
         echo '<center>[ <a href="javascript:openwindow(' . ')" class="pn-normal">' . _ONLINEMANUAL . '</a> ]' . "</center>\n";
     }
     //  }
     //    }
     if ($this->detail_menu) {
         if (count($this->options) == 0) {
             echo _ADMIN_NO_OPTION . "\n";
         } else {
             echo '<br><br>' . "\n" . '<table border="0" width="100%" cellspacing="1">' . "\n";
             if ($this->graphic_menu) {
                 $this->draw_options_graphic();
             } else {
                 $this->draw_options();
             }
             echo '</table>' . "\n";
         }
     }
     CloseTable();
 }
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:44,代码来源:menu.php


示例15: rss_parse_array

function rss_parse_array($f)
{
    $struct = '';
    foreach ($f as $line) {
        // Fix for CDATA tag not removed when fetching RSS -- bharvey42 6/9/03
        $line = preg_replace('#(<\\!\\[CDATA\\[)(.*)(\\]\\]>) #siU', '\\2', $line);
        $parse = '';
        // get our positions
        $sp = strpos($line, '>');
        $ep = strrpos($line, '<');
        $ep2 = strrpos($line, '>');
        // split into first tag, last tag, and content
        $first_tag = substr($line, 1, $sp - 1);
        $last_tag = substr($line, $ep + 1, $ep2 - $ep - 1);
        $content = substr($line, $sp + 1, $ep - 1 - $sp);
        if (!$line) {
            // blank line
            continue;
        }
        if ($first_tag == $last_tag) {
            // no content, single tag line
            if ($first_tag[0] == '/') {
                $parse['type'] = 'close';
                if ($temp_str = strstr($first_tag, ':')) {
                    $first_tag = $temp_str;
                }
                $parse['tag'] = strtolower(substr($first_tag, 1, strlen($first_tag) - 1));
            } else {
                $parse['type'] = 'open';
                $first_tag = preg_replace('/^\\S*:/', '', $first_tag);
                $first_tag = preg_replace('/\\s.*/', '', $first_tag);
                $parse['tag'] = strtolower($first_tag);
            }
            $parse['value'] = '';
        } else {
            // complete
            $parse['type'] = 'complete';
            $parse['tag'] = strtolower($first_tag);
            if ($content) {
                // Content might have HTML entities, turn it into
                // normal text and then parse it through our own
                // system
                $trans = get_html_translation_table(HTML_ENTITIES);
                $trans = array_flip($trans);
                // Need to do this twice as some systems pass us quotes like
                // &amp;quot; - ug
                $content = strtr($content, $trans);
                $content = strtr($content, $trans);
                $content = pnVarPrepForDisplay($content);
            }
            $parse['value'] = $content;
        }
        $struct[] = $parse;
    }
    return $struct;
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:56,代码来源:rss.php


示例16: search_faqs

function search_faqs()
{
    list($q, $bool, $startnum, $total, $active_faqs) = pnVarCleanFromInput('q', 'bool', 'startnum', 'total', 'active_faqs');
    if (empty($active_faqs)) {
        return;
    }
    if (!pnModAvailable('FAQ')) {
        return;
    }
    $dbconn =& pnDBGetConn(true);
    $pntable =& pnDBGetTables();
    $output =& new pnHTML();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    if (!isset($startnum) || !is_numeric($startnum)) {
        $startnum = 1;
    }
    if (isset($total) && !is_numeric($total)) {
        unset($total);
    }
    $w = search_split_query($q);
    $flag = false;
    $column =& $pntable['faqanswer_column'];
    $faqcatcol =& $pntable['faqcategories_column'];
    $query = "SELECT {$column['id_cat']} as id_cat, \n    \t\t\t\t{$column['question']} as question, \n    \t\t\t\t{$column['answer']} as answer,\n    \t\t\t\t{$faqcatcol['categories']} as categories\n              FROM {$pntable['faqanswer']} \n              LEFT JOIN {$pntable['faqcategories']} ON {$column['id_cat']}={$faqcatcol['id_cat']}\n              WHERE {$column['answer']} != \"\" AND \n";
    foreach ($w as $word) {
        if ($flag) {
            switch ($bool) {
                case 'AND':
                    $query .= ' AND ';
                    break;
                case 'OR':
                default:
                    $query .= ' OR ';
                    break;
            }
        }
        $query .= '(';
        // faqs
        $query .= "{$column['question']} LIKE '" . pnVarPrepForStore($word) . "' OR \n";
        $query .= "{$column['answer']} LIKE '" . pnVarPrepForStore($word) . "'\n";
        $query .= ')';
        $flag = true;
    }
    if (pnConfigGetVar('multilingual') == 1) {
        $query .= " AND ({$faqcatcol['flanguage']}='" . pnVarPrepForStore(pnUserGetLang()) . "' OR {$faqcatcol['flanguage']}='')";
    }
    $query .= " ORDER BY {$column['id']}";
    // get the total count with permissions!
    if (empty($total)) {
        $total = 0;
        $countres =& $dbconn->Execute($query);
        // check for a db error
        if ($dbconn->ErrorNo() != 0) {
            return;
        }
        while (!$countres->EOF) {
            $row = $countres->GetRowAssoc(false);
            if (pnSecAuthAction(0, "FAQ::", "{$row['categories']}::{$row['id_cat']}", ACCESS_READ)) {
                $total++;
            }
            $countres->MoveNext();
        }
    }
    $result = $dbconn->SelectLimit($query, 10, $startnum - 1);
    // check for a db error
    if ($dbconn->ErrorNo() != 0) {
        return;
    }
    if (!$result->EOF) {
        $output->Text(_FAQ . ': ' . $total . ' ' . _SEARCHRESULTS);
        $output->SetInputMode(_PNH_VERBATIMINPUT);
        // Rebuild the search string from previous information
        $url = "index.php?name=Search&amp;action=search&amp;active_faqs=1&amp;bool={$bool}&amp;q={$q}";
        $output->Text("<dl>");
        while (!$result->EOF) {
            $row = $result->GetRowAssoc(false);
            if (pnSecAuthAction(0, "FAQ::", "{$row['categories']}::{$row['id_cat']}", ACCESS_READ)) {
                $row['answer'] = strip_tags($row['answer']);
                if (strlen($row['answer']) > 128) {
                    $row['answer'] = substr($row['answer'], 0, 125) . '...';
                }
                $output->Text("<dt><a href=\"index.php?name=FAQ&amp;myfaq=yes&amp;id_cat={$row['id_cat']}\">" . pnVarPrepForDisplay($row[question]) . "</a></dt>");
                $output->Text("<dd>" . pnVarPrepForDisplay($row[answer]) . "</dd>");
            }
            $result->MoveNext();
        }
        $output->Text('</dl>');
        // Munge URL for template
        $urltemplate = $url . "&amp;startnum=%%&amp;total={$total}";
        $output->Pager($startnum, $total, $urltemplate, 10);
    } else {
        $output->SetInputMode(_PNH_VERBATIMINPUT);
        $output->Text(_SEARCH_NO_FAQS);
        $output->SetInputMode(_PNH_PARSEINPUT);
    }
    $output->Linebreak(3);
    return $output->GetOutput();
}
开发者ID:BackupTheBerlios,项目名称:freshwind-svn,代码行数:98,代码来源:faq.php


示例17: FormFile

 /**
  * Add HTML tags for a file upload field as part of a form.
  *
  * @access public
  * @since 1.13 - 2002/01/23
  * @param string $fieldname the name of the field
  * @param integer $size (optional) the size of the field on the page in number
  * of characters
  * @param integer $maxsize (optional) the maximum file size allowed (in bytes)
  * @param string $accesskey (optional) accesskey to active this item
  * @return string An HTML string if <code>ReturnHTML()</code> has been called,
  * otherwise null
  */
 function FormFile($fieldname, $size = 32, $maxsize = 1000000, $accesskey = '')
 {
     if (empty($fieldname)) {
         return;
     }
     $this->tabindex++;
     $output = '<input type="hidden" name="MAX_FILE_SIZE" value="' . pnVarPrepForDisplay($maxsize) . '" />';
     $output .= '<input' . ' type="file"' . ' name="' . pnVarPrepForDisplay($fieldname) . '"' . ' id="' . pnVarPrepForDisplay($fieldname) . '"' . ' size="' . pnVarPrepForDisplay($size) . '"' . (empty($accesskey) ? '' : ' accesskey="' . pnVarPrepForDisplay($accesskey) . '"') . ' tabindex="' . $this->tabindex . '"' . ' />';
     if ($this->GetOutputMode() == _PNH_RETURNOUTPUT) {
         return $output;
     } else {
         $this->output .= $output;
     }
 }
开发者ID:juggernautsei,项目名称:openemr,代码行数:27,代码来源:pnHTML.php


示例18: EmailStats

<

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP pnVarPrepForOS函数代码示例发布时间:2022-05-15
下一篇:
PHP pnVarCleanFromInput函数代码示例发布时间: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