当前位置: 首页>>代码示例>>PHP>>正文


PHP descript函数代码示例

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


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

示例1: parseubb

function parseubb($text)
{
    $text = preg_replace('#\\[b\\](.*?)\\[/b\\]#si', '<b>\\1</b>', $text);
    $text = preg_replace('#\\[i\\](.*?)\\[/i\\]#si', '<i>\\1</i>', $text);
    $text = preg_replace('#\\[u\\](.*?)\\[/u\\]#si', '<u>\\1</u>', $text);
    $text = preg_replace('#\\[center\\](.*?)\\[/center\\]#si', '<center>\\1</center>', $text);
    $text = preg_replace('#\\[br/\\]#si', '<br/>', $text);
    $text = preg_replace('#\\[br /\\]#si', '<br />', $text);
    $text = preg_replace('#\\[url\\]([\\r\\n]*)(http://|ftp://|https://|ftps://)([^\\s\'\\";\\+]*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'\\2\\3\' target=\'_blank\'>\\2\\3</a>', $text);
    $text = preg_replace('#\\[url\\]([\\r\\n]*)([^\\s\'\\";\\+]*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'http://\\2\' target=\'_blank\'>\\2</a>', $text);
    $text = preg_replace('#\\[url=([\\r\\n]*)(http://|ftp://|https://|ftps://)([^\\s\'\\";\\+]*?)\\](.*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'\\2\\3\' target=\'_blank\'>\\4</a>', $text);
    $text = preg_replace('#\\[url=([\\r\\n]*)([^\\s\'\\";\\+]*?)\\](.*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'http://\\2\' target=\'_blank\'>\\3</a>', $text);
    $text = preg_replace('#\\[mail\\]([\\r\\n]*)([^\\s\'\\";:\\+]*?)([\\r\\n]*)\\[/mail\\]#si', '<a href=\'mailto:\\2\'>\\2</a>', $text);
    $text = preg_replace('#\\[mail=([\\r\\n]*)([^\\s\'\\";:\\+]*?)\\](.*?)([\\r\\n]*)\\[/mail\\]#si', '<a href=\'mailto:\\2\'>\\3</a>', $text);
    $text = preg_replace('#\\[small\\](.*?)\\[/small\\]#si', '<span class=\'small\'>\\1</span>', $text);
    $text = preg_replace('#\\[color=(black|blue|brown|cyan|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|violet|white|yellow)\\](.*?)\\[/color\\]#si', '<span style=\'color:\\1\'>\\2</span>', $text);
    $text = preg_replace('#\\[flash width=([0-9]*?) height=([0-9]*?)\\]([^\\s\'\\";:\\+]*?)(\\.swf)\\[/flash\\]#si', '<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\' id=\'\\3\\4\' width=\'\\1\' height=\'\\2\'><param name=movie value=\'\\3\\4\'><param name=\'quality\' value=\'high\'><param name=\'bgcolor\' value=\'#ffffff\'><embed src=\'\\3\\4\' quality=\'high\' bgcolor=\'#ffffff\' width=\'\\1\' height=\'\\2\' type=\'application/x-shockwave-flash\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>', $text);
    $text = preg_replace("#\\[img\\]((http|ftp|https|ftps)://)(.*?)(\\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\\[/img\\]#sie", "'<img src=\\'\\1'.str_replace(array('.php','?','&','='),'','\\3').'\\4\\' style=\\'border:0px\\'>'", $text);
    $qcount = substr_count($text, "[quote]");
    $ccount = substr_count($text, "[code]");
    for ($i = 0; $i < $qcount; $i++) {
        $text = preg_replace('#\\[quote\\](.*?)\\[/quote\\]#si', '<div class=\'quote\'>\\1</div>', $text);
    }
    for ($i = 0; $i < $ccount; $i++) {
        $text = preg_replace('#\\[code\\](.*?)\\[/code\\]#si', '<div class=\'quote\' style=\'width:400px;white-space:nowrap;overflow:auto\'><code style=\'white-space:nowrap\'>\\1<br><br><br></code></div>', $text);
    }
    $text = descript($text, false);
    return $text;
}
开发者ID:ksb1712,项目名称:pragyan,代码行数:29,代码来源:bbparser.php

示例2: getdir

function getdir()
{
    global $links;
    $r = explode("/", trim($_GET['dir'], "/"));
    if (count($r) == 2) {
        return gennavi($links);
    }
    if (count($r) == 3) {
        return gennavi(starts($links[$r[2]]['url']));
    }
    if (count($r) == 4) {
        $first = starts($links[$r[2]]['url']);
        $trailer = trailer($first[$r[3]]['url']);
        if ($GLOBALS['kinodescription'] == true) {
            $beschreibung = descript($first[$r[3]]['keyurl']);
            $blank['------']['url'] = " ";
            $all = $trailer + $blank + $beschreibung;
        } else {
            $all = $trailer;
        }
        return gennavi($all);
    }
}
开发者ID:BackupTheBerlios,项目名称:onlinestreams-svn,代码行数:23,代码来源:Kino.de.php

示例3: add_breadcrumb

include LOCALE . LOCALESET . "admin/settings.php";
add_breadcrumb(array('link' => ADMIN . "settings_security.php" . $aidlink, 'title' => $locale['security_settings']));
$available_captchas = array();
if ($temp = opendir(INCLUDES . "captchas/")) {
    while (FALSE !== ($file = readdir($temp))) {
        if ($file != "." && $file != ".." && is_dir(INCLUDES . "captchas/" . $file)) {
            $available_captchas[$file] = $locale[$file];
        }
    }
}
if (isset($_POST['savesettings'])) {
    $error = 0;
    // there is no need for this.
    // Custom stuff
    $privacy_policy = addslash(preg_replace("(^<p>\\s</p>\$)", "", $_POST['privacy_policy']));
    $maintenance_message = addslash(descript($_POST['maintenance_message']));
    // Save settings after validation
    $StoreArray = array("captcha" => form_sanitizer($_POST['captcha'], "", "captcha"), "privacy_policy" => $privacy_policy, "allow_php_exe" => form_sanitizer($_POST['allow_php_exe'], 0, "allow_php_exe"), "flood_interval" => form_sanitizer($_POST['flood_interval'], 15, "flood_interval"), "flood_autoban" => form_sanitizer($_POST['flood_autoban'], 1, "flood_autoban"), "maintenance_level" => form_sanitizer($_POST['maintenance_level'], 102, "maintenance_level"), "maintenance" => form_sanitizer($_POST['maintenance'], 0, "maintenance"), "maintenance_message" => form_sanitizer($_POST['maintenance_message'], "", "maintenance_message"), "bad_words_enabled" => form_sanitizer($_POST['bad_words_enabled'], 0, "bad_words_enabled"), "bad_words" => form_sanitizer($_POST['bad_words'], "", "bad_words"), "bad_word_replace" => form_sanitizer($_POST['bad_word_replace'], "", "bad_word_replace"));
    // Validate extra fields
    if ($StoreArray['captcha'] == "grecaptcha") {
        // appends captcha settings
        $StoreArray += array("recaptcha_public" => form_sanitizer($_POST['recaptcha_public'], "", "recaptcha_public"), "recaptcha_private" => form_sanitizer($_POST['recaptcha_private'], "", "recaptcha_private"), "recaptcha_theme" => form_sanitizer($_POST['recaptcha_theme'], "", "recaptcha_theme"), "recaptcha_type" => form_sanitizer($_POST['recaptcha_type'], "", "recaptcha_type"));
    }
    if ($defender->safe()) {
        foreach ($StoreArray as $key => $value) {
            $result = NULL;
            if ($defender->safe()) {
                $Array = array("settings_name" => $key, "settings_value" => $value);
                dbquery_insert(DB_SETTINGS, $Array, 'update', array("primary_key" => "settings_name"));
            }
        }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:settings_security.php

示例4: evaluateSample


//.........这里部分代码省略.........
    echo $row['kltt_spec_desc'];
    ?>
</textarea>
                  <label for="comment" class="field-icon">
                    <i class="fa fa-comments"></i>
                  </label>
                    <span class="input-footer">Specification Description</span>
                </label>
              </div>
            </td>
          </tr>
          <tr>
            <td>Result Description 1 <font color="red">*</font></td>
            <td>:</td>
            <td>
              <div class="col-md-12">
                <label class="field prepend-icon">
                  <textarea class="gui-textarea" id="txt_result_1" placeholder="Add Description"><?php 
    echo $row['kltt_result_desc1'];
    ?>
</textarea>
                  <label for="comment" class="field-icon">
                    <i class="fa fa-comments"></i>
                  </label>
                    <span class="input-footer">
                      Result Description 1
                      <div class="btn-group">
                        <button type="button" class="btn btn-alert btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                          Select
                          <span class="caret ml5"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                          <?php 
    echo descript('txt_result_1');
    ?>
                        </ul>
                      </div>
                    </span>
                </label>
              </div>
            </td>
          </tr>
          <tr>
            <td>Result Description 2</td>
            <td>:</td>
            <td>
              <div class="col-md-12">
                <label class="field prepend-icon">
                  <textarea class="gui-textarea" id="txt_result_2" placeholder="Add Description"><?php 
    echo $row['kltt_result_desc2'];
    ?>
</textarea>
                  <label for="comment" class="field-icon">
                    <i class="fa fa-comments"></i>
                  </label>
                    <span class="input-footer">
                      Result Description 2
                      <div class="btn-group">
                        <button type="button" class="btn btn-alert btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                          Select
                          <span class="caret ml5"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                          <?php 
    echo descript('txt_result_2');
    ?>
开发者ID:syafiqazwan,项目名称:pharmaco,代码行数:67,代码来源:pkk.php

示例5: author

| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "contact.php";
add_to_title($locale['global_200'] . $locale['400']);
if (isset($_POST['sendmessage'])) {
    $error = "";
    $mailname = isset($_POST['mailname']) ? substr(stripinput(trim($_POST['mailname'])), 0, 50) : "";
    $email = isset($_POST['email']) ? substr(stripinput(trim($_POST['email'])), 0, 100) : "";
    $subject = isset($_POST['subject']) ? substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50) : "";
    $message = isset($_POST['message']) ? descript(stripslash(trim($_POST['message']))) : "";
    if ($mailname == "") {
        $error .= " <span class='alt'>" . $locale['420'] . "</span><br />\n";
    }
    if ($email == "" || !preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $email)) {
        $error .= " <span class='alt'>" . $locale['421'] . "</span><br />\n";
    }
    if ($subject == "") {
        $error .= " <span class='alt'>" . $locale['422'] . "</span><br />\n";
    }
    if ($message == "") {
        $error .= " <span class='alt'>" . $locale['423'] . "</span><br />\n";
    }
    $_CAPTCHA_IS_VALID = false;
    include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
    if ($_CAPTCHA_IS_VALID == false) {
开发者ID:dioda,项目名称:phpfusion,代码行数:31,代码来源:contact.php

示例6: redirect

require_once "../../../maincore.php";
require_once THEMES . "templates/admin_header.php";
if (!checkrights("ADNX") || !iSUPERADMIN || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
require_once INFUSIONS . "addondb/inc/inc.functions.php";
require_once ADDON . "infusion_db.php";
require_once ADDON_INC . "inc.nav.php";
if (file_exists(ADDON_LOCALE . LOCALESET . "admin/settings.php")) {
    include ADDON_LOCALE . LOCALESET . "admin/settings.php";
} else {
    include ADDON_LOCALE . "English/admin/settings.php";
}
if (isset($_POST['savesettings'])) {
    $error = 0;
    $result = dbquery("UPDATE " . DB_ADDON_STGS . " SET\r\n\t    set_addondb_onf='" . (isnum($_POST['set_addondb_onf']) ? $_POST['set_addondb_onf'] : "0") . "',\r\n\t    set_addondb_comm='" . (isnum($_POST['set_addondb_comm']) ? $_POST['set_addondb_comm'] : "0") . "',\r\n\t    set_addondb_sub='" . (isnum($_POST['set_addondb_sub']) ? $_POST['set_addondb_sub'] : "0") . "',\r\n\t    addons_per_page='" . (isnum($_POST['addons_per_page']) ? $_POST['addons_per_page'] : "20") . "',\r\n\t    addons_dev_qual='" . (isnum($_POST['addons_dev_qual']) ? $_POST['addons_dev_qual'] : "2") . "',\r\n\t    set_new_time='" . (isNum($_POST['set_new_time']) ? $_POST['set_new_time'] : "0") . "',\r\n\t    susp_time='" . (isNum($_POST['susp_time']) ? $_POST['susp_time'] : "0") . "',\r\n\t    set_addon_maintmsg='" . addslash(descript($_POST['set_addon_maintmsg'])) . "'\r\n\t");
    if (!$result) {
        $error = 1;
    }
    redirect(FUSION_SELF . $aidlink . "&error=" . $error);
}
opentable($locale['addondbs100']);
echo "<form name='settingsform' method='post' action='" . FUSION_SELF . $aidlink . "'>\n";
echo "<table align='center' cellpadding='0' cellspacing='1' width='90%' class='tbl-border'>\n<tr>\n";
echo "<th class='forum-caption' colspan='3' align='left'><b>" . $locale['addondbs109'] . "</b><br /></th>\n";
echo "</tr>\n<tr>\n";
// Maintenance Mode
echo "<td class='tbl2' align='right' valign='top'><b>" . $locale['addondbs101'] . ":</b></td>\n";
echo "<td class='tbl2' align='left'>\n";
echo "<label><input type='radio' name='set_addondb_onf' value='1'" . ($settings_global['set_addondb_onf'] == "1" ? " checked='checked'" : "") . " />&nbsp;" . $locale['addondbs102'] . "</label>\n";
echo "&nbsp;<label><input type='radio' name='set_addondb_onf' value='0'" . ($settings_global['set_addondb_onf'] == "0" ? " checked='checked'" : "") . " />&nbsp;" . $locale['addondbs103'] . "</label>\n</td>\n";
开发者ID:xXxthebeastxXx,项目名称:addondb,代码行数:31,代码来源:settings.php

示例7: author

| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "contact.php";
add_to_title($locale['global_200'] . $locale['400']);
$settings = fusion_get_settings();
$input = array('mailname' => '', 'email' => '', 'subject' => '', 'message' => '', 'captcha_code' => '');
if (isset($_POST['sendmessage'])) {
    foreach ($input as $key => $value) {
        if (isset($_POST[$key])) {
            // Subject needs 'special' treatment
            if ($key == 'subject') {
                $input['subject'] = substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 128);
                // most unique in the entire CMS. keep.
                $input['subject'] = form_sanitizer($input['subject'], $input[$key], $key);
                // Others don't
            } else {
                $input[$key] = form_sanitizer($_POST[$key], $input[$key], $key);
            }
            // Input not posted, fallback to the default
        } else {
            $input[$key] = form_sanitizer($input[$key], $input[$key], $key);
        }
    }
    $_CAPTCHA_IS_VALID = FALSE;
    include INCLUDES . "captchas/" . $settings['captcha'] . "/captcha_check.php";
    // Dynamics need to develop Captcha. Before that, use method 2.
    if ($_CAPTCHA_IS_VALID == FALSE) {
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:contact.php

示例8: secsys_parser

 function secsys_parser($text)
 {
     $text = preg_replace('#\\[url\\]([\\r\\n]*)(http://|ftp://|https://|ftps://)([^\\s\'\\";\\+]*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'\\2\\3\' target=\'_blank\'>\\2\\3</a>', $text);
     $text = preg_replace('#\\[url\\]([\\r\\n]*)([^\\s\'\\";\\+]*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'http://\\2\' target=\'_blank\'>\\2</a>', $text);
     $text = preg_replace('#\\[url=([\\r\\n]*)(http://|ftp://|https://|ftps://)([^\\s\'\\";\\+]*?)\\](.*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'\\2\\3\' target=\'_blank\'>\\4</a>', $text);
     $text = preg_replace('#\\[url=([\\r\\n]*)([^\\s\'\\";\\+]*?)\\](.*?)([\\r\\n]*)\\[/url\\]#si', '<a href=\'http://\\2\' target=\'_blank\'>\\3</a>', $text);
     $text = preg_replace('#\\[mail\\]([\\r\\n]*)([^\\s\'\\";:\\+]*?)([\\r\\n]*)\\[/mail\\]#si', '<a href=\'mailto:\\2\'>\\2</a>', $text);
     $text = preg_replace('#\\[mail=([\\r\\n]*)([^\\s\'\\";:\\+]*?)\\](.*?)([\\r\\n]*)\\[/mail\\]#si', '<a href=\'mailto:\\2\'>\\2</a>', $text);
     $text = descript($text, false);
     return strtolower($text);
 }
开发者ID:simplyianm,项目名称:clububer,代码行数:11,代码来源:main_control.php

示例9: substr

}
if ($captcha == "2") {
    require_once INCLUDES . "recaptcha/recaptchalib.php";
    $resp = null;
    $recaptcha_error = null;
}
if (isset($_POST['sendmessage'])) {
    if ($captcha == "1") {
        // Captcha
        include_once INCLUDES . "securimage/securimage.php";
    }
    $error = "";
    $mailname = substr(stripinput(trim($_POST['mailname'])), 0, 50);
    $email = substr(stripinput(trim($_POST['email'])), 0, 100);
    $subject = substr(str_replace(array("\r", "\n", "@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50);
    $message = descript(stripslash(trim($_POST['message'])));
    if ($mailname == "") {
        $error .= "&middot; <span class='alt'>" . $locale['420'] . "</span><br />\n";
    }
    if ($email == "" || !preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $email)) {
        $error .= "&middot; <span class='alt'>" . $locale['421'] . "</span><br />\n";
    }
    if ($subject == "") {
        $error .= "&middot; <span class='alt'>" . $locale['422'] . "</span><br />\n";
    }
    if ($message == "") {
        $error .= "&middot; <span class='alt'>" . $locale['423'] . "</span><br />\n";
    }
    if ($captcha == "1") {
        // Captcha
        $securimage = new Securimage();
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:contact.php

示例10: parseubb

function parseubb($text, $selected = false, $disable_lightbox = false)
{
    global $bbcode_cache, $settings;
    // Pimped: $settings added
    if (!$bbcode_cache) {
        cache_bbcode();
    }
    if (is_array($bbcode_cache) && count($bbcode_cache)) {
        if ($selected) {
            $sel_bbcodes = explode("|", $selected);
        }
        foreach ($bbcode_cache as $bbcode) {
            if ($selected && in_array($bbcode, $sel_bbcodes)) {
                if (file_exists(INCLUDES . "bbcodes/" . $bbcode . "_bbcode_include.php")) {
                    if (file_exists(LOCALE . LOCALESET . "bbcodes/" . $bbcode . ".php")) {
                        include LOCALE . LOCALESET . "bbcodes/" . $bbcode . ".php";
                    } elseif (file_exists(LOCALE . "English/bbcodes/" . $bbcode . ".php")) {
                        include LOCALE . "English/bbcodes/" . $bbcode . ".php";
                    }
                    include INCLUDES . "bbcodes/" . $bbcode . "_bbcode_include.php";
                }
            } elseif (!$selected) {
                if (file_exists(INCLUDES . "bbcodes/" . $bbcode . "_bbcode_include.php")) {
                    if (file_exists(LOCALE . LOCALESET . "bbcodes/" . $bbcode . ".php")) {
                        include LOCALE . LOCALESET . "bbcodes/" . $bbcode . ".php";
                    } elseif (file_exists(LOCALE . "English/bbcodes/" . $bbcode . ".php")) {
                        include LOCALE . "English/bbcodes/" . $bbcode . ".php";
                    }
                    include INCLUDES . "bbcodes/" . $bbcode . "_bbcode_include.php";
                }
            }
        }
    }
    $text = descript($text, false);
    return $text;
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:36,代码来源:core_include.php

示例11: descript

         $submit_info['article_body'] = descript($_POST['article_body']);
         $submit_info['article_breaks'] = isset($_POST['line_breaks']) ? "y" : "n";
         $result = dbquery("INSERT INTO " . DB_SUBMISSIONS . " (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES ('a', '" . $userdata['user_id'] . "', '" . time() . "', '" . addslashes(serialize($submit_info)) . "')");
         add_to_title($locale['global_200'] . $locale['500']);
         opentable($locale['500']);
         echo "<div style='text-align:center'><br />\n" . $locale['510'] . "<br /><br />\n";
         echo "<a href='submit.php?stype=a'>" . $locale['511'] . "</a><br /><br />\n";
         echo "<a href='index.php'>" . $locale['412'] . "</a><br /><br />\n</div>\n";
         closetable();
     }
 } else {
     if (isset($_POST['preview_article'])) {
         $article_cat = isnum($_POST['article_cat']) ? $_POST['article_cat'] : "0";
         $article_subject = stripinput($_POST['article_subject']);
         $article_snippet = phpentities(descript(stripslash($_POST['article_snippet'])));
         $article_body = phpentities(descript(stripslash($_POST['article_body'])));
         $breaks = isset($_POST['line_breaks']) ? " checked='checked'" : "";
         opentable($article_subject);
         echo isset($_POST['line_breaks']) ? nl2br($article_body) : $article_body;
         closetable();
         tablebreak();
     }
     if (!isset($_POST['preview_article'])) {
         $article_cat = "0";
         $article_subject = "";
         $article_snippet = "";
         $article_body = "";
         $breaks = " checked='checked'";
     }
     $cat_list = "";
     $sel = "";
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:submit.php

示例12: elseif

if (isset($_GET['error']) && (isnum($_GET['error']) || $_GET['error'] == "pw") && !isset($message)) {
    if ($_GET['error'] == "0") {
        $message = $locale['con900'];
    } elseif ($_GET['error'] == "1") {
        $message = $locale['con901'];
    } elseif ($_GET['error'] == "pw") {
        $message = $locale['con903'];
    }
    if (isset($message)) {
        echo "<div id='close-message'><div class='admin-message'>" . $message . "</div></div>\n";
    }
}
if (isset($_POST['savesettings'])) {
    if (check_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "")) {
        $error = 0;
        if (!set_mainsetting('contact_site', addslashes(descript(stripslash($_POST['contact_site']))))) {
            $error = 1;
        }
        set_admin_pass(isset($_POST['admin_password']) ? stripinput($_POST['admin_password']) : "");
        log_admin_action("admin-1", "admin_contact_page");
        redirect(FUSION_SELF . $aidlink . "&error=" . $error);
    } else {
        redirect(FUSION_SELF . $aidlink . "&error=pw");
    }
}
opentable($locale['con100']);
echo "<form name='settingsform' method='post' action='" . FUSION_SELF . $aidlink . "'>\n";
echo "<table cellpadding='0' cellspacing='0' width='90%' class='center'>\n<tr>\n";
echo "<td valign='top' width='15%' class='tbl'>" . $locale['con101'] . "<br /><span class='small2'>" . $locale['con102'] . "</span></td>\n";
echo "<td width='50%' class='tbl'><textarea name='contact_site' cols='80' rows='20' class='textbox'>" . phpentities(stripslashes($settings['contact_site'])) . "</textarea></td>\n";
echo "</tr>\n";
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:contact_page.php

示例13: in_array

    return in_array($value, array_keys($search_opts)) ? true : false;
}
/**
 * Site Port validation rules
 * @param $value
 * @return bool
 */
function validate_site_port($value)
{
    return (isnum($value) || empty($value)) && in_array($value, array(0, 80, 443)) && $value < 65001 ? true : false;
}
// These are the default settings and the only settings we expect to be posted
$settings_main = array('siteintro' => fusion_get_settings('siteintro'), 'sitename' => fusion_get_settings('sitename'), 'sitebanner' => fusion_get_settings('sitebanner'), 'siteemail' => fusion_get_settings('siteemail'), 'siteusername' => fusion_get_settings('siteusername'), 'footer' => fusion_get_settings('footer'), 'site_protocol' => fusion_get_settings('site_protocol'), 'site_host' => fusion_get_settings('site_host'), 'site_path' => fusion_get_settings('site_path'), 'site_port' => fusion_get_settings('site_port'), 'description' => fusion_get_settings('description'), 'keywords' => fusion_get_settings('keywords'), 'opening_page' => fusion_get_settings('opening_page'), 'default_search' => fusion_get_settings('default_search'), 'exclude_left' => fusion_get_settings('exclude_left'), 'exclude_upper' => fusion_get_settings('exclude_upper'), 'exclude_aupper' => fusion_get_settings('exclude_aupper'), 'exclude_lower' => fusion_get_settings('exclude_lower'), 'exclude_blower' => fusion_get_settings('exclude_blower'), 'exclude_right' => fusion_get_settings('exclude_right'));
// Saving settings
if (isset($_POST['savesettings'])) {
    $settings_main = array('siteintro' => descript(addslashes(addslashes($_POST['siteintro']))), 'sitename' => form_sanitizer($_POST['sitename'], '', 'sitename'), 'sitebanner' => form_sanitizer($_POST['sitebanner'], '', 'sitebanner'), 'siteemail' => form_sanitizer($_POST['siteemail'], '', 'siteemail'), 'siteusername' => form_sanitizer($_POST['siteusername'], '', 'siteusername'), 'footer' => descript(addslashes(addslashes($_POST['footer']))), 'site_protocol' => form_sanitizer($_POST['site_protocol'], '', 'site_protocol'), 'site_host' => form_sanitizer($_POST['site_host'], '', 'site_host'), 'site_path' => form_sanitizer($_POST['site_path'], '', 'site_path'), 'site_port' => form_sanitizer($_POST['site_port'], '', 'site_port'), 'description' => form_sanitizer($_POST['description'], '', 'description'), 'keywords' => form_sanitizer($_POST['keywords'], '', 'keywords'), 'opening_page' => form_sanitizer($_POST['opening_page'], '', 'opening_page'), 'default_search' => form_sanitizer($_POST['default_search'], '', 'default_search'), 'exclude_left' => form_sanitizer($_POST['exclude_left'], '', 'exclude_left'), 'exclude_upper' => form_sanitizer($_POST['exclude_upper'], '', 'exclude_upper'), 'exclude_aupper' => form_sanitizer($_POST['exclude_aupper'], '', 'exclude_aupper'), 'exclude_lower' => form_sanitizer($_POST['exclude_lower'], '', 'exclude_lower'), 'exclude_blower' => form_sanitizer($_POST['exclude_blower'], '', 'exclude_blower'), 'exclude_right' => form_sanitizer($_POST['exclude_right'], '', 'exclude_right'));
    if (strpos($settings_main['site_host'], "/") !== FALSE) {
        $settings_main['site_host'] = explode("/", $settings_main['site_host'], 2);
        if ($settings_main['site_host'][1] != "") {
            $_POST['site_path'] = "/" . $settings_main['site_host'][1];
        }
        $settings_main['site_host'] = $settings_main['site_host'][0];
    }
    if (defender::safe()) {
        foreach ($settings_main as $settings_key => $settings_value) {
            dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . $settings_value . "' WHERE settings_name='" . $settings_key . "'");
        }
        $settings_main['siteurl'] = $settings_main['site_protocol'] . "://" . $settings_main['site_host'] . ($settings_main['site_port'] ? ":" . $settings_main['site_port'] : "") . $settings_main['site_path'];
        dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . $settings_main['siteurl'] . "' WHERE settings_name='siteurl'");
        addNotice("success", $locale['900']);
        redirect(FUSION_SELF . $aidlink);
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:settings_main.php

示例14: opentable

echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='" . $locale['xml_lang'] . "' lang='" . $locale['xml_lang'] . "'>\n";
echo "<head>\n";
echo "<title>" . $locale['urg_findmember_104'] . " " . GOLD_VERSION . "</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=" . $locale['charset'] . "' />\n";
echo "<link rel='stylesheet' href='" . THEME . "styles.css' type='text/css' />\n";
echo "</head>\n<body>\n";
opentable($locale['urg_findmember_100']);
echo "<div style='padding: 5px;'>";
if (!empty($_POST['stext'])) {
    if (isset($stext)) {
        $stext = stripinput($stext);
    }
    if (!isset($stext)) {
        $stext = isset($_POST['stext']) ? $_POST['stext'] : "";
    }
    $stext = descript($stext);
    $result = dbquery("SELECT user_id,user_name FROM " . DB_USERS . " WHERE user_name LIKE '%{$stext}%' OR user_id LIKE '%{$stext}%' ORDER BY user_name");
    while ($data = dbarray($result)) {
        echo "<a href='" . BASEDIR . "profile.php?lookup=" . $data['user_id'] . "'>" . $data['user_name'] . "</a><br>\n";
    }
} else {
    echo $locale['urg_findmember_101'];
    echo "<form name='searchform' method='post' action='findmember.php'>\n";
    echo "<input type='text' name='stext' value='" . isset($stext) . "' class='textbox' style='width:200px' />\n";
    echo "<input type='submit' name='search' value='" . $locale['urg_findmember_102'] . "' class='button' /></form>\n";
}
echo "</div>";
echo "<div style='text-align: center;'><p>\n";
echo "<a href='javascript:window.close();'><img border='0' src='images/close.png' title='" . $locale['urg_findmember_103'] . "' alt='" . $locale['urg_findmember_103'] . "' /></a>\n";
echo "</p></div>\n";
closetable();
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:findmember.php

示例15: redirect

require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/settings.php";
if (!checkrights("S6") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (isset($_POST['savesettings'])) {
    $error = 0;
    if (isnum($_POST['newsperpage'])) {
        if ($_POST['newsperpage'] % 2 == 0) {
            $_POST['newsperpage']++;
        }
    } else {
        $_POST['newsperpage'] = 11;
    }
    $result = dbquery("UPDATE " . DB_SETTINGS . " SET\n\t\ttinymce_enabled='" . (isnum($_POST['tinymce_enabled']) ? $_POST['tinymce_enabled'] : "0") . "',\n\t\tsmtp_host='" . stripinput($_POST['smtp_host']) . "',\n\t\tsmtp_username='" . stripinput($_POST['smtp_username']) . "',\n\t\tsmtp_password='" . stripinput($_POST['smtp_password']) . "',\n\t\tbad_words_enabled='" . (isnum($_POST['bad_words_enabled']) ? $_POST['bad_words_enabled'] : "0") . "',\n\t\tbad_words='" . addslash($_POST['bad_words']) . "',\n\t\tbad_word_replace='" . stripinput($_POST['bad_word_replace']) . "',\n\t\tguestposts='" . (isnum($_POST['guestposts']) ? $_POST['guestposts'] : "0") . "',\n\t\tnumofshouts='" . (isnum($_POST['numofshouts']) ? $_POST['numofshouts'] : "10") . "',\n\t\tuserthemes='" . (isnum($_POST['userthemes']) ? $_POST['userthemes'] : "0") . "',\n\t\tnewsperpage='" . (isnum($_POST['newsperpage']) ? $_POST['newsperpage'] : "11") . "',\n\t\tflood_interval='" . (isnum($_POST['flood_interval']) ? $_POST['flood_interval'] : "15") . "',\n\t\tmaintenance='" . (isnum($_POST['maintenance']) ? $_POST['maintenance'] : "0") . "',\n\t\tmaintenance_message='" . addslash(descript($_POST['maintenance_message'])) . "'\n\t");
    if (!$result) {
        $error = 1;
    }
    redirect(FUSION_SELF . $aidlink . "&error=" . $error);
}
$settings2 = dbarray(dbquery("SELECT * FROM " . DB_SETTINGS));
opentable($locale['400']);
require_once ADMIN . "settings_links.php";
echo "<form name='settingsform' method='post' action='" . FUSION_SELF . $aidlink . "'>\n";
echo "<table cellpadding='0' cellspacing='0' width='500' class='center'>\n<tr>\n";
echo "<td width='50%' class='tbl'>" . $locale['662'] . "<br /><span class='small2'>" . $locale['663'] . "</span></td>\n";
echo "<td width='50%' class='tbl'><select name='tinymce_enabled' class='textbox'>\n";
echo "<option value='1'" . ($settings2['tinymce_enabled'] == "1" ? " selected='selected'" : "") . ">" . $locale['518'] . "</option>\n";
echo "<option value='0'" . ($settings2['tinymce_enabled'] == "0" ? " selected='selected'" : "") . ">" . $locale['519'] . "</option>\n";
echo "</select></td>\n";
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:settings_misc.php


注:本文中的descript函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。