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

PHP htmlencode函数代码示例

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

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



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

示例1: _openMenuGroupList

function _openMenuGroupList($menuName, $isSelected, $skipIfAlreadyInGroup = false)
{
    global $SHOW_EXPANDED_MENU;
    if ($skipIfAlreadyInGroup && @$GLOBALS['IN_GROUP']) {
        return;
    }
    $aClass = 'nav-top-item';
    $liAttr = '';
    $ulAttr = ' style="display: none;"';
    if ($isSelected) {
        $aClass .= ' current';
        $liAttr = ' class="current"';
    }
    if ($isSelected || $SHOW_EXPANDED_MENU || $menuName == '') {
        $ulAttr = '';
    }
    $html = _closeMenuGroupList();
    $html .= "\n  <li{$liAttr}>";
    if ($menuName) {
        $html .= "<a href='javascript:void(0);' class='{$aClass}'>" . htmlencode($menuName) . "</a>";
    }
    $html .= "\n    <ul{$ulAttr}>\n";
    $GLOBALS['IN_GROUP'] = true;
    return $html;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:25,代码来源:header_functions.php


示例2: editFormHtml

    function editFormHtml($record)
    {
        // set field attributes
        $fieldHeight = @$this->fieldHeight ? $this->fieldHeight : 100;
        $fieldPrefix = @$this->fieldPrefix;
        if ($fieldPrefix != '') {
            $fieldPrefix .= "<br/>\n";
        }
        // get field value
        if ($record) {
            $fieldValue = @$record[$this->name];
        } else {
            if (array_key_exists($this->name, $_REQUEST)) {
                $fieldValue = @$_REQUEST[$this->name];
            } else {
                $fieldValue = getEvalOutput(@$this->defaultContent);
            }
        }
        //
        if ($this->autoFormat) {
            $fieldValue = preg_replace("/<br\\/>\n/", "\n", $fieldValue);
        }
        // remove autoformat break tags
        $encodedValue = htmlencode($fieldValue);
        // display field
        print <<<__HTML__
   <tr>
    <td style="vertical-align: top">{$this->label}</td>
    <td>
      {$fieldPrefix}
      <textarea name="{$this->name}" style="width: 100%; height: {$fieldHeight}px" rows="5" cols="50">{$encodedValue}</textarea>
    </td>
   </tr>
__HTML__;
    }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:35,代码来源:textbox.php


示例3: editFormHtml

    function editFormHtml($record)
    {
        // set field attributes
        $description = getEvalOutput(@$this->description);
        $fieldHeight = @$this->fieldHeight ? $this->fieldHeight : 100;
        $fieldPrefix = @$this->fieldPrefix;
        if ($fieldPrefix != '') {
            $fieldPrefix .= "<br/>\n";
        }
        // get field value
        if ($record) {
            $fieldValue = @$record[$this->name];
        } else {
            if (array_key_exists($this->name, $_REQUEST)) {
                $fieldValue = @$_REQUEST[$this->name];
            } else {
                $fieldValue = getEvalOutput(@$this->defaultContent);
            }
        }
        $encodedValue = htmlencode($fieldValue);
        // display field
        print <<<__HTML__
 <tr>
  <td style="vertical-align: top">{$this->label}</td>
  <td>
    {$fieldPrefix}
    <textarea name="{$this->name}" id="field_{$this->name}" rows="5" cols="40" style="width: 100%; height: {$fieldHeight}px; visibility: hidden;">{$encodedValue}</textarea>
    {$description}
  </td>
 </tr>
__HTML__;
    }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:32,代码来源:wysiwyg.php


示例4: editFormHtml

 function editFormHtml($record)
 {
     global $isMyAccountMenu;
     // set field attributes
     $formRowAttrs = array('inputType' => @$this->isPasswordField ? 'password' : 'text', 'maxLengthAttr' => @$this->maxLength ? "maxlength='{$this->maxLength}'" : '', 'styleWidth' => @$this->fieldWidth ? "{$this->fieldWidth}px" : "250px", 'description' => getEvalOutput(@$this->description), 'prefixText' => @$this->fieldPrefix, 'readOnly' => '');
     // get field value
     if ($record) {
         $fieldValue = @$record[$this->name];
     } else {
         if (array_key_exists($this->name, $_REQUEST)) {
             $fieldValue = @$_REQUEST[$this->name];
         } else {
             $fieldValue = getEvalOutput(@$this->defaultValue);
         }
     }
     $encodedValue = htmlencode($fieldValue);
     // special case for My Account's password field
     if ($isMyAccountMenu && $this->name == 'password') {
         $this->_editFormRow($formRowAttrs + array('label' => t('Current Password'), 'fieldname' => 'password:old', 'encodedValue' => ''));
         $this->_editFormRow($formRowAttrs + array('label' => t('New Password'), 'fieldname' => $this->name, 'encodedValue' => ''));
         $this->_editFormRow($formRowAttrs + array('label' => t('New Password (again)'), 'fieldname' => 'password:again', 'encodedValue' => ''));
     } else {
         $this->_editFormRow($formRowAttrs + array('label' => $this->label, 'fieldname' => $this->name, 'encodedValue' => $encodedValue));
     }
 }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:25,代码来源:textfield.php


示例5: set_var

function set_var(&$result, $var, $type, $multibyte = false, $regex = '')
{
    settype($var, $type);
    $result = $var;
    if ($type == 'string') {
        $result = htmlencode($result, $multibyte);
    }
}
开发者ID:nopticon,项目名称:noptc,代码行数:8,代码来源:core.php


示例6: getDisplayValue

 function getDisplayValue($record)
 {
     // override me in derived classes
     $value = $this->getDatabaseValue($record);
     if (is_array($value)) {
         return 'array';
     }
     // for debugging
     return htmlencode($value);
 }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:10,代码来源:field_class.php


示例7: HtmlEditor

function HtmlEditor($FieldName, $Value, $Width = '100%', $Height = '300px')
{
    global $__CKEDITOR_JS_LOAD_Status__;
    if (!$__CKEDITOR_JS_LOAD_Status__) {
        $html_js = '<script type="text/javascript" src="/Plugins/ckeditor/ckeditor.js"></script><script type="text/javascript" src="/Javascripts/editor.functions.js"></script>';
        $__CKEDITOR_JS_LOAD_Status__ = true;
    }
    $html = '<textarea name="' . $FieldName . '"  cols="45" rows="5" style="width:' . $Width . ';height:' . $Height . ';">' . htmlencode($Value) . '</textarea>';
    if ($html_js) {
        $html .= $html_js;
    }
    $html .= '<script language="javascript" type="text/javascript">HtmlEditor(\'' . $FieldName . '\');</script>';
    return $html;
}
开发者ID:baiduXM,项目名称:agent,代码行数:14,代码来源:editor.functions.php


示例8: _pel_cmsList_messageColumn

function _pel_cmsList_messageColumn($displayValue, $tableName, $fieldname, $record = array())
{
    if ($tableName != '_error_log') {
        return $displayValue;
    }
    // skip all by our table
    //
    if ($fieldname == 'dateLogged') {
        if (!$record) {
            return str_replace(' ', '&nbsp;', t("Date / When"));
        }
        // header - we detect the header hook by checking if the 4th argument is set
        $displayValue = "<div title='" . htmlencode($record['dateLogged']) . "'>";
        $displayValue .= str_replace(' ', '&nbsp;', prettyDate($record['dateLogged']));
        // row cell - we detect the row cell by checking if $record is set
        $displayValue .= "</div>";
    }
    //
    if ($fieldname == '_error_summary_') {
        if (!$record) {
            return t("Error Details");
        }
        // header - we detect the header hook by checking if the 4th argument is set
        // row cell - we detect the row cell by checking if $record is set
        // get truncated url
        $truncatedUrl = $record['url'];
        $maxLength = 90;
        if (preg_match("/^(.{0,{$maxLength}})(\\s|\$)/s", $truncatedUrl, $matches)) {
            $truncatedUrl = $matches[1];
        } else {
            $truncatedUrl = mb_substr($truncatedUrl, 0, $maxLength);
        }
        // otherwise force cut at maxlength (for content with no whitespace such as malicious or non-english)
        if (strlen($truncatedUrl) < strlen($record['url'])) {
            $truncatedUrl .= " ...";
        }
        //
        $displayValue = "<div style='line-height:1.5em'>\n";
        $displayValue .= nl2br(htmlencode("{$record['error']}\n{$record['filepath']} (line {$record['line_num']})\n{$truncatedUrl}"));
        $displayValue .= "</div>";
        //$displayValue  = "<table border='0' cellspacing='0' cellpadding='0' class='spacedTable'>\n";
        //                           $displayValue .= "  <tr><td>" .t('Error').    "</td><td>&nbsp:&nbsp;</td><td>" .htmlencode($record['error']).    "</div></td></tr>\n";
        //if ($record['url'])      { $displayValue .= "  <tr><td>" .t('URL').      "</td><td>&nbsp:&nbsp;</td><td>" .htmlencode($record['url']).      "</div></td></tr>\n"; }
        //if ($record['filepath']) { $displayValue .= "  <tr><td>" .t('Filepath'). "</td><td>&nbsp:&nbsp;</td><td>" .htmlencode($record['filepath']). "</div></td></tr>\n";   }
        //$displayValue .= "  </table>\n";
    }
    return $displayValue;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:48,代码来源:actionHandler.php


示例9: editFormHtml

    function editFormHtml($record)
    {
        global $TABLE_PREFIX, $tableName;
        $calendarTable = $TABLE_PREFIX . "_datecalendar";
        // get dates
        $dates = array();
        $date = getdate();
        $monthNum = $date['mon'];
        $year = $date['year'];
        $firstMonth = sprintf("%04d%02d%02d", $year, $monthNum, '01');
        for ($i = 1; $i <= 12; $i++) {
            $dates[] = array('year' => $year, 'monthNum' => $monthNum);
            if (++$monthNum > 12) {
                $year++;
                $monthNum = 1;
            }
        }
        $lastMonth = sprintf("%04d%02d%02d", $year, $monthNum, '01');
        // load dates from database
        $selectedDates = array();
        $query = "SELECT DATE_FORMAT(date, '%Y%m%d') as date FROM `{$calendarTable}` ";
        $query .= "WHERE `tablename` = '{$tableName}' ";
        $query .= "  AND `fieldname` = '{$this->name}' ";
        $query .= "  AND `recordNum` = '" . mysql_escape($_REQUEST['num']) . "' ";
        $query .= "  AND '{$firstMonth}' <= `date` AND `date` <= '{$lastMonth}'";
        $result = mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
        while ($row = mysql_fetch_assoc($result)) {
            $selectedDates[$row['date']] = 1;
        }
        if (is_resource($result)) {
            mysql_free_result($result);
        }
        // get calendar HTML
        $calendarHtml = '';
        foreach ($dates as $date) {
            $calendarHtml .= _createEditCalendar($date['monthNum'], $date['year'], $selectedDates);
        }
        // display field
        print <<<__HTML__
   <tr>
    <td valign="top">{$this->label}</td>
    <td>{$calendarHtml}</td>
   </tr>
__HTML__;
    }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:45,代码来源:dateCalendar.php


示例10: _ogm_cmsList_messageColumn

function _ogm_cmsList_messageColumn($displayValue, $tableName, $fieldname, $record = array())
{
    if ($tableName != '_outgoing_mail') {
        return $displayValue;
    }
    // skip all by our table
    if ($fieldname != '_message_summary_') {
        return $displayValue;
    }
    // skip all but pseudo-field
    // header - we detect the header hook by checking if the 4th argument is set
    if (!$record) {
        return t("Messages");
    }
    // row cell - we detect the row cell by checking if $record is set
    $output = "\n  <table border='0' cellspacing='0' cellpadding='0' class='spacedTable'>\n   <tr><td><b>" . t('Date') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['createdDate']) . "</td></tr>\n   <tr><td><b>" . t('From') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['from']) . "</td></tr>\n   <tr><td><b>" . t('To') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['to']) . "</td></tr>\n   <tr><td><b>" . t('Subject') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['subject']) . "</td></tr>\n  </table>\n";
    return $output;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:18,代码来源:actionHandler.php


示例11: showListResultsForHookKey

function showListResultsForHookKey($hookInfo, $key)
{
    uksort($hookInfo[$key], '_sortUnderscoresLast');
    $i = 0;
    foreach (array_keys($hookInfo[$key]) as $callerName) {
        $i++;
        if ($i == 2) {
            echo "\n<a href=\"#\" onclick=\"\$(this).hide(); \$(this).closest('td').find('div').show(); return false;\">(" . count(array_keys(array_keys($hookInfo[$key]))) . " " . t('total') . ")</a><div style=\"display: none;\">\n";
        }
        echo htmlencode($callerName);
        if ($i != 1) {
            echo "<br/>\n";
        }
    }
    if ($i > 1) {
        echo "</div>\n";
    }
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:18,代码来源:pluginHooks.php


示例12: showCopyOptions

function showCopyOptions()
{
    $includedTypes = array('single', 'multi', 'category');
    $skippedTables = array('accounts');
    foreach (getSortedSchemas() as $tableName => $schema) {
        if (preg_match("/^_/", $tableName)) {
            continue;
        }
        // skip private tables
        if (in_array($tableName, $skippedTables)) {
            continue;
        }
        // skip system tables
        if (!in_array(@$schema['menuType'], $includedTypes)) {
            continue;
        }
        // skip unknown menu types
        $encodedValue = htmlencode($tableName);
        $encodedLabel = htmlencode(coalesce(@$schema['menuName'], $tableName));
        print "<option value='{$encodedValue}'>{$encodedLabel}</option>\n";
    }
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:22,代码来源:addTable.php


示例13: saveUploadDetails

function saveUploadDetails()
{
    global $TABLE_PREFIX;
    security_dieUnlessPostForm();
    security_dieUnlessInternalReferer();
    security_dieOnInvalidCsrfToken();
    // update uploads
    if (is_array(@$_REQUEST['uploadNums'])) {
        foreach ($_REQUEST['uploadNums'] as $uploadNum) {
            if (!$uploadNum) {
                die(__FUNCTION__ . ": No upload num specified!");
            }
            $query = "UPDATE `{$TABLE_PREFIX}uploads`\n";
            $query .= "   SET info1 = '" . mysql_escape(@$_REQUEST["{$uploadNum}_info1"]) . "',\n";
            $query .= "       info2 = '" . mysql_escape(@$_REQUEST["{$uploadNum}_info2"]) . "',\n";
            $query .= "       info3 = '" . mysql_escape(@$_REQUEST["{$uploadNum}_info3"]) . "',\n";
            $query .= "       info4 = '" . mysql_escape(@$_REQUEST["{$uploadNum}_info4"]) . "',\n";
            $query .= "       info5 = '" . mysql_escape(@$_REQUEST["{$uploadNum}_info5"]) . "'\n";
            $query .= " WHERE num = '" . mysql_escape($uploadNum) . "' AND ";
            if ($_REQUEST['num']) {
                $query .= "recordNum     = '" . mysql_escape($_REQUEST['num']) . "'";
            } else {
                if ($_REQUEST['preSaveTempId']) {
                    $query .= "preSaveTempId = '" . mysql_escape($_REQUEST['preSaveTempId']) . "'";
                } else {
                    die("No value specified for 'num' or 'preSaveTempId'!");
                }
            }
            mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
        }
    }
    //
    print "<script type='text/javascript'>self.parent.reloadIframe('{$_REQUEST['fieldName']}_iframe')</script>";
    // reload uploadlist
    print "<script type='text/javascript'>self.parent.tb_remove();</script>\n";
    // close thickbox
    exit;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:38,代码来源:uploadModify_functions.php


示例14: editFormHtml

 function editFormHtml($record)
 {
     global $escapedTableName, $CURRENT_USER;
     // set field attributes
     $fieldValue = $record ? @$record[$this->name] : '';
     // load categories
     $categoriesByNum = array();
     $query = "SELECT * FROM `{$escapedTableName}` ORDER BY globalOrder";
     $result = mysql_query($query) or die("MySQL Error: " . mysql_error() . "\n");
     while ($row = mysql_fetch_assoc($result)) {
         $isOwner = @$row['createdByUserNum'] == $CURRENT_USER['num'];
         if (@$row['createdByUserNum'] && (!$isOwner && !$GLOBALS['hasEditorAccess'])) {
             continue;
         }
         $categoriesByNum[$row['num']] = $row;
     }
     if (is_resource($result)) {
         mysql_free_result($result);
     }
     //
     print "  <tr>\n";
     print "   <td>{$this->label}</td>\n";
     print "   <td>\n";
     print "  <select name='{$this->name}'>\n";
     print "  <option value='0'>None (top level category)</option>\n";
     foreach ($categoriesByNum as $num => $category) {
         $value = $category['num'];
         $selectedAttr = selectedIf($value, $fieldValue, true);
         $encodedLabel = htmlencode($category['breadcrumb']);
         $isUnavailable = preg_match("/:" . @$record['num'] . ":/", $category['lineage']);
         $extraAttr = $isUnavailable ? "style='color: #AAA' disabled='disabled' " : '';
         print "<option value=\"{$value}\" {$extraAttr} {$selectedAttr}>{$encodedLabel}</option>\n";
     }
     print "  </select>\n";
     //
     print "   </td>\n";
     print "  </tr>\n";
 }
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:38,代码来源:parentCategory.php


示例15: _emt_cmsList_messageColumn

function _emt_cmsList_messageColumn($displayValue, $tableName, $fieldname, $record = array())
{
    if ($tableName != '_email_templates') {
        return $displayValue;
    }
    // skip all by our table
    //
    if ($fieldname == '_template_summary_') {
        if (!$record) {
            return t("Template");
        }
        // header - we detect the header hook by checking if the 4th argument is set
        // row cell - we detect the row cell by checking if $record is set
        $displayValue = "\n      <table border='0' cellspacing='0' cellpadding='0' class='spacedTable'>\n       <tr><td><b>" . str_replace(' ', '&nbsp;', t('Template ID')) . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['template_id']) . "</td></tr>\n       <tr><td><b>" . t('Description') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['description']) . "</td></tr>\n       <tr><td><b>" . t('Subject') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['subject']) . "</td></tr>\n      </table>\n    ";
    }
    //
    if ($fieldname == '_message_summary_') {
        if (!$record) {
            return t("Content");
        }
        // header - we detect the header hook by checking if the 4th argument is set
        // row cell - we detect the row cell by checking if $record is set
        $displayValue = "<table border='0' cellspacing='0' cellpadding='0' class='spacedTable'>\n";
        $displayValue .= "  <tr><td><b>" . t('From') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['from']) . "</td></tr>\n";
        if ($record['reply-to']) {
            $displayValue .= "  <tr><td><b>" . t('Reply-To') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['reply-to']) . "</td></tr>\n";
        }
        $displayValue .= "  <tr><td><b>" . t('To') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['to']) . "</td></tr>\n";
        if ($record['cc']) {
            $displayValue .= "  <tr><td><b>" . t('CC') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['cc']) . "</td></tr>\n";
        }
        if ($record['bcc']) {
            $displayValue .= "  <tr><td><b>" . t('BCC') . "</b></td><td>&nbsp:&nbsp;</td><td>" . htmlencode($record['bcc']) . "</td></tr>\n";
        }
        $displayValue .= "  </table>\n";
    }
    return $displayValue;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:38,代码来源:actionHandler.php


示例16: _cg2_getGeneratorList

function _cg2_getGeneratorList($heading, $description, $type)
{
    $html = '';
    // list header
    $html .= "<h3>" . htmlencode(t($heading)) . "</h3>\n";
    $html .= "<div style='margin-left: 25px'>\n";
    $html .= "  " . htmlencode($description) . "\n";
    $html .= "<table class='data' style='width: inherit'>\n";
    $html .= "<tr><td colspan='2'></td></tr>";
    // adds top line to row set
    // list rows
    $rows = '';
    foreach (getGenerators($type) as $generator) {
        $trClass = '';
        //(@$trClass == "listRowOdd") ? 'listRowEven' : 'listRowOdd'; # rotate bgclass
        $link = "?menu=" . urlencode(@$_REQUEST['menu']) . "&amp;_generator=" . urlencode($generator['function']);
        if (@$_REQUEST['tableName']) {
            $link .= "&amp;tableName=" . urlencode($_REQUEST['tableName']);
        }
        $rows .= "<tr class='listRow {$trClass}'>\n";
        $rows .= " <td><a href='{$link}'>" . htmlencode(t($generator['name'])) . "</a></td>\n";
        $rows .= " <td>" . htmlencode(t($generator['description'])) . "</td>\n";
        $rows .= "</tr>\n";
    }
    if (!$rows) {
        $rows .= "<tr class='listRow'>\n";
        $rows .= " <td colspan='2' style='color: #999'>" . t('There are current no generators in this category.') . "</td>\n";
        $rows .= "</tr>\n";
    }
    $html .= $rows;
    // list footer
    $html .= "</table>\n";
    $html .= "</div><br/><br/>\n";
    //
    return $html;
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:36,代码来源:actionHandler.php


示例17: _getColumnDisplayValueAndAttributes

function _getColumnDisplayValueAndAttributes($fieldname, &$record)
{
    global $schema, $tableName;
    $fieldValue = @$record[$fieldname];
    $fieldSchema = @$schema[$fieldname];
    if ($fieldSchema) {
        $fieldSchema['name'] = $fieldname;
    }
    // default display value and attribute
    if (!is_array($fieldValue)) {
        $fieldValue = htmlencode($fieldValue);
    }
    $displayValue = $fieldValue;
    $tdAttributes = "style='text-align:left'";
    // date fields
    $isSpecialDatefield = in_array($fieldname, array('createdDate', 'updatedDate'));
    if (@$fieldSchema['type'] == 'date' || $isSpecialDatefield) {
        $showSeconds = @$fieldSchema['showSeconds'];
        $showTime = @$fieldSchema['showTime'];
        $use24Hour = @$fieldSchema['use24HourFormat'];
        // settings for createdDate and updatedDate
        if ($isSpecialDatefield) {
            $showSeconds = true;
            $showTime = true;
            $use24Hour = true;
        }
        $secondsFormat = '';
        if ($showSeconds) {
            $secondsFormat = ':s';
        }
        $timeFormat = '';
        if ($showTime) {
            if ($use24Hour) {
                $timeFormat = " - H:i{$secondsFormat}";
            } else {
                $timeFormat = " - h:i{$secondsFormat} A";
            }
        }
        $dateFormat = '';
        $dayMonthOrder = @$GLOBALS['SETTINGS']['dateFormat'];
        if ($dayMonthOrder == 'dmy') {
            $dateFormat = "jS M, Y" . $timeFormat;
        } elseif ($dayMonthOrder == 'mdy') {
            $dateFormat = "M jS, Y" . $timeFormat;
        } else {
            $dateFormat = "Y-m-d" . $timeFormat;
        }
        $displayValue = date($dateFormat, strtotime($fieldValue));
        if (!$fieldValue || $fieldValue == '0000-00-00 00:00:00') {
            $displayValue = '';
        }
    }
    // dragSortOrder fields
    if ($fieldname == 'dragSortOrder') {
        if (!userHasFieldAccess($schema[$fieldname])) {
            return;
        }
        // skip fields that the user has no access to
        $tdAttributes = "class='dragger'";
        $displayValue = "<input type='hidden' name='_recordNum' value='{$record['num']}' class='_recordNum' />";
        $displayValue .= "<img src='lib/images/drag.gif' height='6' width='19' class='dragger' title='" . t('Click and drag to change order.') . "' alt='' /><br/>";
    }
    // Category Section: name fields - pad category names to their depth
    $isCategorySection = @$schema['menuType'] == 'category' && $fieldname == 'name';
    if ($isCategorySection) {
        $depth = @$record["depth"];
        $parentNum = @$record["parentNum"];
        //$displayValue  = "<input type='hidden' name='_recordNum' value='{$record['num']}' class='_recordNum' />";
        //$displayValue .= "<input type='hidden' value='$fieldValue' class='_categoryName' />";
        //$displayValue .= "<input type='hidden' value='$depth' class='_categoryDepth' />";
        $displayValue = "<input type='hidden' value='{$parentNum}' class='_categoryParent' />";
        //$displayValue .= "<img style='float:left' src='lib/images/drag.gif' height='6' width='19' class='dragHandle' title='" .
        //                t('Click and drag to change order.').
        //                "' alt='' />";
        if (@$record['depth']) {
            $padding = str_repeat("&nbsp; &nbsp; &nbsp;", @$record['depth']);
            $displayValue .= $padding . ' - ';
        }
        $displayValue .= $fieldValue;
    }
    // display first thumbnail for upload fields
    if (@$fieldSchema['type'] == 'upload') {
        $displayValue = '';
        $upload = @$record[$fieldname][0];
        if ($upload) {
            ob_start();
            showUploadPreview($upload, 50);
            $displayValue = ob_get_clean();
        }
    }
    // display labels for list fields
    #if (@$fieldSchema['type'] == 'list' && $suffix == 'label') { // require ":label" field suffix in future to show labels, just do it automatic for now though.
    if (@$fieldSchema['type'] == 'list') {
        $displayValue = _getListOptionLabelByValue($fieldSchema, $record);
    }
    // display labels for checkboxes
    if (@$fieldSchema['type'] == 'checkbox') {
        if (@$fieldSchema['checkedValue'] || @$fieldSchema['uncheckedValue']) {
            $displayValue = $fieldValue ? @$fieldSchema['checkedValue'] : @$fieldSchema['uncheckedValue'];
        }
//.........这里部分代码省略.........
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:101,代码来源:list_functions.php


示例18: _upgradeToVersion1_10_accessLevels

function _upgradeToVersion1_10_accessLevels()
{
    global $TABLE_PREFIX;
    // error checking (check upgrade files were uploaded)
    $errors = '';
    $accessListSchema = loadSchema("_accesslist");
    $accountsSchema = loadSchema("accounts");
    if (empty($accessListSchema)) {
        $errors .= "Error: You must upload the latest /data/schema/_accesslist.ini.php before upgrading!<br/>\n";
    }
    if ($errors) {
        die($errors);
    }
    // check if already upraded
    $result = mysql_query("SELECT * FROM `{$TABLE_PREFIX}accounts` LIMIT 0,1") or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
    $record = mysql_fetch_assoc($result);
    if (!$record || !array_key_exists('tableAccessList', $record)) {
        return;
    }
    // create new access table
    $query = "CREATE TABLE IF NOT EXISTS `{$TABLE_PREFIX}_accesslist` (\n    `userNum`      int(10) unsigned NOT NULL,\n    `tableName`    varchar(255) NOT NULL,\n    `accessLevel`  tinyint(3) unsigned NOT NULL,\n    `maxRecords`   int(10) unsigned default NULL,\n    `randomSaveId` varchar(255) NOT NULL\n  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
    mysql_query($query) || die("Error creating new access table.<br/>\n MySQL error was: " . htmlencode(mysql_error()) . "\n");
    // create accessList field
    if (!@$accountsSchema['accessList']) {
        $accountsSchema['accessList'] = array('type' => 'accessList', 'label' => "Section Access", 'isSystemField' => '1', 'order' => 20);
        createMissingSchemaTablesAndFields();
        // create missing fields
        clearAlertsAndNotices();
        // don't show "created table/field" alerts
    }
    // drop tableAccessList
    if (@$accountsSchema['tableAccessList']) {
        unset($accountsSchema['tableAccessList']);
        saveSchema('accounts', $accountsSchema);
    }
    ### upgrade access levels
    $schemaTables = getSchemaTables();
    $schemaTables[] = "all";
    $result = mysql_query("SELECT * FROM `{$TABLE_PREFIX}accounts`") or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
    while ($record = mysql_fetch_assoc($result)) {
        if (!array_key_exists('tableAccessList', $record)) {
            die(__FUNCTION__ . ": Couldn't load field 'tableAccessList'!");
        }
        // convert section access to new format
        $tableNames = array();
        $tableNames['all'] = 1;
        // default all to "By Section" access
        foreach ($schemaTables as $tableName) {
            $adminAccess = preg_match("/\\b{$tableName}\\b/i", $record['tableAccessList']);
            if ($adminAccess) {
                $tableNames[$tableName] = '9';
            }
        }
        // foreach table - add to insert query
        $insertRows = '';
        $fieldNames = "userNum, tableName, accessLevel, maxRecords, randomSaveId";
        $foundAll = false;
        foreach ($tableNames as $tableName => $accessLevel) {
            if ($insertRows) {
                $insertRows .= ",\n";
            }
            $escapedUserNum = mysql_escape($record['num']);
            $escapedTableName = mysql_escape($tableName);
            $maxRecords = "NULL";
            $escapedSaveId = mysql_escape(uniqid('', true));
            $insertRows .= "('{$escapedUserNum}', '{$escapedTableName}', '{$accessLevel}', {$maxRecords}, '{$escapedSaveId}')";
        }
        // add all
        $insertQuery = "INSERT INTO `{$TABLE_PREFIX}_accesslist` ({$fieldNames}) VALUES {$insertRows};";
        // insert new access rights
        if ($insertRows) {
            mysql_query($insertQuery) or die("MySQL Error Inserting New Access Rights: " . htmlencode(mysql_error()) . "\n");
        }
    }
    // drop tableAccessList
    $query = "ALTER TABLE `{$TABLE_PREFIX}accounts` DROP COLUMN `tableAccessList`;";
    mysql_query($query) or die("MySQL Error: " . htmlencode(mysql_error()) . "\n");
}
开发者ID:afineedge,项目名称:thinkbeforeyoulaunch,代码行数:78,代码来源:upgrade_functions.php


示例19: header

header("Content-Type:text/html;charset=UTF-8");
require_once "config.php";
date_default_timezone_set('Asia/Taipei');
session_start();
$new_date = date("Y-m-d H:i:s");
$id = $_GET['id'];
$name = $_GET['name'];
$email = $_GET['email'];
$gender = $_GET['gender'];
$sql = "select * from `" . $member . "` where `fb_id` = '" . $id . "'";
$res = mysql_query($sql);
$row = mysql_fetch_array($res);
$isdel = $row['isdel'];
$num = mysql_num_rows($res);
if ($isdel == 0) {
    $_SESSION['id'] = $id;
    if ($num < 1) {
        $sql = "INSERT INTO `" . $member . "`(`fb_id`,`user_name`,`user_account`,`user_sex`,`user_birthday`,`user_idcard`,`user_otherName`,`user_email`,`user_phone`,`isdel`,`wdate`,`udate`,`login`,`sort`)VALUES('" . htmlencode($id) . "','" . htmlencode($name) . "','" . htmlencode($email) . "','" . htmlencode($gender) . "','','','','" . htmlencode($email) . "','','0','" . htmlencode($new_date) . "','" . htmlencode($new_date) . "','" . htmlencode($new_date) . "','')";
        $query = mysql_query($sql) or die("無法新增" . mysql_error());
    } else {
        $sqlu = "UPDATE `" . $member . "` SET `login` = '" . htmlencode($new_date) . "' where `fb_id` = " . $id . " ";
        $query = mysql_query($sqlu) or die("無法更新" . mysql_error());
    }
    echo '<script type="text/JavaScript">
alert("登入成功");
window.location="../index.php"
</script>';
} else {
    msgurlbox("您的帳號已停權,請洽管理者", "../index.php");
    exit;
}
开发者ID:boy22200011,项目名称:regsys,代码行数:31,代码来源:member_add.php


示例20: htmlencode

             $delpiceb8 = "y";
         }
     }
     //先刪除圖片===end===
 }
 if ($_POST["selltime1"] != "") {
     $s1 = $_POST["selltime1"];
 } else {
     $s1 = "0000-00-00";
 }
 if ($_POST["selltime2"] != "") {
     $s2 = $_POST["selltime2"];
 } else {
     $s2 = "0000-00-00";
 }
 $sql_data = "update product set `pro_num`='" . htmlencode($_POST["pro_num"]) . "',`pro_name`='" . htmlencode($_POST["pro_name"]) . "',`pro_type`='" . htmlencode($_POST["pro_type"]) . "',`word2`='" . htmlencode($_POST["word2"]) . "',`word`='" . str_replace("'", "''", $_POST["FCKeditor1"]) . "',`pro_sell`='" . $_POST["pro_sell"] . "',`selltime1`='" . $s1 . "',`selltime2`='" . $s2 . "',`pro_other`='" . $_POST["pro_other"] . "',`price1`='" . $_POST["price1"] . "',`price2`='" . $_POST["price2"] . "',`ppl`='" . $_POST["ppl"] . "',`room_type`='" . $_POST["room_type"] . "',`range`=" . $_POST["range"] . ",`t1`='" . $_POST["t1"] . "',`t2`='" . $_POST["t2"] . "',`t3`='" . $_POST["t3"] . "',`t4`='" . $_POST["t4"] . "',`t5`='" . $_POST["t5"] . "',`t6`='" . $_POST["t6"] . "',`t7`='" . $_POST["t7"] . "',`t8`='" . $_POST["t8"] . "'";
 if ($sf_file3[0] != NULL) {
     $sql_data = $sql_data . ",`pic1`='{$sf_file3['0']}'";
 } else {
     if ($delpiceb == "y") {
         $sql_data = $sql_data . ",`pic1`=''";
     }
 }
 if ($sf_file3[1] != NULL) {
     $sql_data = $sql_data . ",`pic2`='{$sf_file3['1']}'";
 } else {
     if ($delpiceb2 == "y") {
         $sql_data = $sql_data . ",`pic2`=''";
     }
 }
 if ($sf_file3[2] != NULL) {
开发者ID:boy22200011,项目名称:faus,代码行数:31,代码来源:product.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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