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


PHP COM_getEncodingt函数代码示例

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


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

示例1: __construct

 public function __construct()
 {
     global $_SYSTEM;
     $this->encoding = COM_getEncodingt();
     if (isset($_SYSTEM['html_filter']) && $_SYSTEM['html_filter'] == 'htmlawed') {
         $this->setFilterMethod('htmlawed');
     }
     if (isset($_CONF['htmlfilter_default'])) {
         $this->setAllowedElements($_CONF['htmlfilter_default']);
     }
 }
开发者ID:spacequad,项目名称:glfusion,代码行数:11,代码来源:filter.class.php

示例2: ADMIN_getListField_ratings

/**
 * used for the list of users in admin/user.php
 *
 */
function ADMIN_getListField_ratings($fieldname, $fieldvalue, $A, $icon_arr)
{
    global $_CONF, $_TABLES, $LANG_ADMIN, $LANG04, $LANG28, $LANG_GF98, $_FF_CONF;
    $retval = '';
    switch ($fieldname) {
        case 'grade':
            $retval = intval($fieldvalue);
            break;
        case 'rating':
            $retval = '<input type="text" name="new_rating-' . $A['uid'] . '" value="' . intval($A['rating']) . '" size="5" />';
            break;
        case 'voter_id':
            $uname = DB_getItem($_TABLES['users'], 'username', 'uid=' . $A['voter_id']);
            $retval = COM_createLink($uname, $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?vid=' . $A['voter_id']);
            break;
        case 'user_id':
            $uname = DB_getItem($_TABLES['users'], 'username', 'uid=' . $A['user_id']);
            if ($uname == '') {
                $retval = COM_createLink($A['user_id'], $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?uid=' . $A['user_id']);
            } else {
                $retval = COM_createLink($uname, $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?uid=' . $A['user_id']);
            }
            break;
        case 'topic_id':
            if (intval($A['topic_id']) > 0) {
                $res = DB_query("SELECT id,pid,forum,subject,comment,status FROM {$_TABLES['ff_topic']} WHERE id=" . $A['topic_id']);
                list($id, $pid, $forum, $subject, $comment, $status) = DB_fetchArray($res);
                $testText = FF_formatTextBlock($comment, 'text', 'text', $status);
                $testText = strip_tags($testText);
                $lastpostinfogll = htmlspecialchars(preg_replace('#\\r?\\n#', '<br>', strip_tags(substr($testText, 0, $_FF_CONF['contentinfo_numchars']) . '...')), ENT_QUOTES, COM_getEncodingt());
                if ($subject == '') {
                    $subject = '<em>' . $LANG_GF98['no_subject_defined'] . '</em>';
                }
                $retval = '<a class="' . COM_getTooltipStyle() . '" style="text-decoration:none;" href="' . $_CONF['site_url'] . '/forum/viewtopic.php?showtopic=' . ($pid == 0 ? $id : $pid) . '&amp;topic=' . $id . '#' . $id . '" title="' . $subject . '::' . $lastpostinfogll . '" rel="nofollow">' . $subject . '</a>';
            } elseif ($A['topic_id'] == -1) {
                $retval = $LANG_GF98['admin_set_value'];
            } else {
                $retval = $LANG_GF98['no_topic_defined'];
            }
            break;
        case 'username':
            $retval = COM_createLink($fieldvalue, $_CONF['site_admin_url'] . '/plugins/forum/userrating_detail.php?uid=' . $A['uid']);
            break;
        case $_TABLES['users'] . '.uid':
            $retval = $A['uid'];
            break;
        default:
            $retval = $fieldvalue;
            break;
    }
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:56,代码来源:userrating_detail.php

示例3: _getReferer

function _getReferer()
{
    global $_CONF;
    if (isset($_POST['referer'])) {
        $referer = COM_sanitizeUrl($_POST['referer']);
    } else {
        if (isset($_SERVER['HTTP_REFERER'])) {
            $referer = COM_sanitizeUrl($_SERVER['HTTP_REFERER']);
        } else {
            $referer = '';
        }
    }
    $sLength = strlen($_CONF['site_url']);
    if (substr($referer, 0, $sLength) != $_CONF['site_url']) {
        $referer = $_CONF['site_url'] . '/forum/index.php';
    }
    $referer = @htmlspecialchars($referer, ENT_COMPAT, COM_getEncodingt());
    if (strstr($referer, 'comment.php') !== false) {
        if (isset($_REQUEST['sid']) && isset($_REQUEST['type'])) {
            $referer = PLG_getCommentUrlId($type);
        }
    }
    return $referer;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:24,代码来源:comment.php

示例4: _ff_getListField_gettopic

function _ff_getListField_gettopic($fieldname, $fieldvalue, $A, $icon_arr)
{
    global $_CONF, $_USER, $_TABLES, $LANG_ADMIN, $LANG04, $LANG28, $_IMAGE_TYPE;
    global $_FF_CONF, $_SYSTEM, $LANG_GF02, $LANG_GF03;
    USES_lib_html2text();
    $dt = new Date('now', $_USER['tzid']);
    $retval = '';
    switch ($fieldname) {
        case 'author':
            $retval = $A['name'];
            break;
        case 'date':
            $dt->setTimestamp($fieldvalue);
            $retval = $dt->format($_FF_CONF['default_Datetime_format'], true);
            break;
        case 'lastupdated':
            $dt->setTimestamp($fieldvalue);
            $retval = $dt->format($_FF_CONF['default_Datetime_format'], true);
            break;
        case 'subject':
            $testText = FF_formatTextBlock($A['comment'], 'text', 'text', $A['status']);
            $testText = strip_tags($testText);
            $html2txt = new html2text($testText, false);
            $testText = trim($html2txt->get_text());
            $lastpostinfogll = htmlspecialchars(preg_replace('#\\r?\\n#', '<br>', strip_tags(substr($testText, 0, $_FF_CONF['contentinfo_numchars']) . '...')), ENT_QUOTES, COM_getEncodingt());
            $retval = '<span class="' . COM_getTooltipStyle() . '" style="text-decoration:none;" title="' . $A['subject'] . '::' . $lastpostinfogll . '">' . $fieldvalue . '</span>';
            break;
        case 'select':
            $retval = '[&nbsp;<a href="#" onclick="insert_topic(\'' . $A['id'] . '\'); return false;">' . $LANG_GF03['select'] . '</a>&nbsp;]';
            break;
        default:
            $retval = $fieldvalue;
            break;
    }
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:36,代码来源:gettopic.php

示例5: array

    $log = 'error.log';
}
$display = '';
$menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$display = COM_startBlock($LANG_LOGVIEW['log_viewer'], '', COM_getBlockTemplate('_admin_block', 'header')) . ADMIN_createMenu($menu_arr, $LANG_LOGVIEW['info'], $_CONF['layout_url'] . '/images/icons/log_viewer.' . $_IMAGE_TYPE);
$display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/logviewer.php" class="uk-form"><div>' . $LANG_LOGVIEW['logs'] . ':&nbsp;&nbsp;&nbsp;' . '<select name="log">';
foreach (glob($_CONF['path_log'] . '*.log') as $file) {
    $file = basename($file);
    $display .= '<option value="' . $file . '"';
    if ($log === $file) {
        $display .= ' selected="selected"';
    }
    $display .= '>' . $file . '</option>';
}
$display .= '</select>&nbsp;&nbsp;&nbsp;&nbsp;' . '<button type="submit" name="viewlog" value="' . $LANG_LOGVIEW['view'] . '" class="uk-button">' . $LANG_LOGVIEW['view'] . '</button>' . '&nbsp;&nbsp;&nbsp;&nbsp;' . '<button type="submit" name="clearlog" value="' . $LANG_LOGVIEW['clear'] . '" class="uk-button" onclick="return confirm(\'' . $MESSAGE[76] . '\');">' . $LANG_LOGVIEW['clear'] . '</button>' . '</div></form>';
if (isset($_POST['clearlog'])) {
    if (@unlink($_CONF['path_log'] . $log)) {
        $timestamp = strftime("%c");
        @file_put_contents($_CONF['path_log'] . $log, "{$timestamp} - Log File Cleared " . PHP_EOL, FILE_APPEND);
        $_POST['viewlog'] = 1;
    }
}
if (isset($_POST['viewlog'])) {
    $display .= '<p><strong>' . $LANG_LOGVIEW['log_file'] . ': ' . $log . '</strong></p>' . '<div style="margin:10px 0 5px;border-bottom:1px solid #cccccc;"></div>' . '<pre style="overflow:scroll; height:500px;">' . htmlentities(file_get_contents($_CONF['path_log'] . $log), ENT_NOQUOTES, COM_getEncodingt()) . '</pre>';
}
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$output = COM_createHTMLDocument($display, array('pagetitle' => $LANG_LOGVIEW['log_viewer']));
header('Content-Type: text/html; charset=' . COM_getEncodingt());
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
COM_output($output);
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:31,代码来源:logviewer.php

示例6: addLinkScript

 /**
  * Add a JavaScript source to a page
  *
  * This adds a javascript source file to a page - The URL should not have
  * the <link> attribute.
  *
  * @param  string   $href       The URL to the javascript file
  * @param  int      $priority   Load priority
  * @param  string   $mime       The mime type of the stylesheet, 'text/css'
  *                              used if no other type passed.
  *
  * @access public
  * @return nothing
  */
 public function addLinkScript($href, $priority = HEADER_PRIO_NORMAL, $mime = 'text/javascript')
 {
     $link = '<script type="' . $mime . '" src="' . @htmlspecialchars($href, ENT_QUOTES, COM_getEncodingt()) . '"';
     $link .= "></script>" . LB;
     $this->_header['script'][$priority][] = $link;
 }
开发者ID:NewRoute,项目名称:glfusion,代码行数:20,代码来源:output.class.php

示例7: _applyTitleFilter

 /**
  * Apply filters to the title element
  *
  * @param  string $title
  * @return string
  */
 private function _applyTitleFilter($title)
 {
     $retval = strip_tags(COM_checkWords($title, 'story'));
     $retval = GLText::remove4byteUtf8Chars($retval);
     $retval = htmlspecialchars($retval, ENT_QUOTES, COM_getEncodingt());
     return $retval;
 }
开发者ID:mystralkk,项目名称:geeklog,代码行数:13,代码来源:story.class.php

示例8: prepareStringForDB

function prepareStringForDB($message, $postmode = "html", $censor = TRUE, $htmlfilter = TRUE)
{
    global $_FF_CONF;
    if ($censor) {
        $message = COM_checkWords($message);
    }
    if ($postmode == 'html') {
        if ($htmlfilter) {
            // Need to call addslahes again as COM_checkHTML stips it out
            $message = DB_escapeString(COM_checkHTML($message));
        } else {
            $message = DB_escapeString($message);
        }
    } else {
        $message = DB_escapeString(@htmlspecialchars($message, ENT_QUOTES, COM_getEncodingt()));
    }
    return $message;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:18,代码来源:migrate.php

示例9: DB_fetchArray

     for ($i = 1; $i <= $nrows; $i++) {
         $P = DB_fetchArray($result);
         $fres = DB_query("SELECT grp_id,rating_view FROM {$_TABLES['ff_forums']} WHERE forum_id=" . (int) $P['forum']);
         list($forumgrpid, $view_rating) = DB_fetchArray($fres);
         $groupname = DB_getItem($_TABLES['groups'], 'grp_name', "grp_id=" . (int) $forumgrpid);
         if (SEC_inGroup($groupname)) {
             if ($_FF_CONF['enable_user_rating_system'] && !COM_isAnonUser()) {
                 if ($view_rating > $user_rating) {
                     continue;
                 }
             }
             if ($_FF_CONF['use_censor']) {
                 $P['subject'] = COM_checkWords($P['subject']);
             }
             $postdate = COM_getUserDateTimeFormat($P['date']);
             $link = '<a href="' . $_CONF['site_url'] . '/forum/viewtopic.php?forum=' . $P['forum'] . '&amp;showtopic=' . $P['id'] . '&amp;highlight=' . htmlentities($html_query, ENT_QUOTES, COM_getEncodingt()) . '">';
             $report->set_var(array('post_start_ahref' => $link, 'post_subject' => $P['subject'], 'post_end_ahref' => '</a>', 'post_date' => $postdate[0], 'post_replies' => $P['replies'], 'post_views' => $P['views'], 'csscode' => $csscode));
             $report->parse('rrow', 'reportrow', true);
             if ($csscode == 2) {
                 $csscode = 1;
             } else {
                 $csscode++;
             }
         }
     }
 }
 if ($forum == 0) {
     $link = '<p><a href="' . $_CONF['site_url'] . '/forum/index.php">' . $LANG_GF02['msg175'] . '</a></p>';
     $report->set_var('bottomlink', $link);
 } else {
     $link = '<p><a href="' . $_CONF['site_url'] . '/forum/index.php?forum=' . $forum . '">' . $LANG_GF02['msg175'] . '</a></p>';
开发者ID:spacequad,项目名称:glfusion,代码行数:31,代码来源:index.php

示例10: gfm_getoutput

function gfm_getoutput($id)
{
    global $_TABLES, $LANG_GF01, $LANG_GF02, $_CONF, $_FF_CONF, $_USER;
    $dt = new Date('now', $_USER['tzid']);
    $id = COM_applyFilter($id, true);
    $result = DB_query("SELECT * FROM {$_TABLES['ff_topic']} WHERE id=" . (int) $id);
    $A = DB_fetchArray($result);
    if ($A['pid'] == 0) {
        $pid = $id;
    } else {
        $pid = $A['pid'];
    }
    $permalink = $_CONF['site_url'] . '/forum/viewtopic.php?topic=' . $id . '#' . $id;
    $A['name'] = COM_checkWords($A['name']);
    $A['name'] = @htmlspecialchars($A['name'], ENT_QUOTES, COM_getEncodingt());
    $A['subject'] = COM_checkWords($A['subject']);
    $A['subject'] = @htmlspecialchars($A["subject"], ENT_QUOTES, COM_getEncodingt());
    $A['comment'] = _ff_FormatForEmail($A['comment'], $A['postmode']);
    $notifymsg = sprintf($LANG_GF02['msg27'], '<a href="' . $_CONF['site_url'] . '/forum/notify.php">' . $_CONF['site_url'] . '/forum/notify.php</a>');
    $dt->setTimestamp($A['date']);
    $date = $dt->format('F d Y @ h:i a');
    if ($A['pid'] == '0') {
        $postid = $A['id'];
    } else {
        $postid = $A['pid'];
    }
    $T = new Template($_CONF['path'] . 'plugins/forum/templates');
    $T->set_file('email', 'notifymessage.thtml');
    $T->set_var(array('post_id' => $postid, 'topic_id' => $A['id'], 'post_subject' => $A['subject'], 'post_date' => $date, 'post_name' => $A['name'], 'post_comment' => $A['comment'], 'notify_msg' => $notifymsg, 'site_name' => $_CONF['site_name'], 'online_version' => sprintf($LANG_GF02['view_online'], $permalink), 'permalink' => $permalink));
    $T->parse('output', 'email');
    $message = $T->finish($T->get_var('output'));
    $T = new Template($_CONF['path'] . 'plugins/forum/templates');
    $T->set_file('email', 'notifymessage_text.thtml');
    $T->set_var(array('post_id' => $postid, 'topic_id' => $A['id'], 'post_subject' => $A['subject'], 'post_date' => $date, 'post_name' => $A['name'], 'post_comment' => $A['comment'], 'notify_msg' => $notifymsg, 'site_name' => $_CONF['site_name'], 'online_version' => sprintf($LANG_GF02['view_online'], $_CONF['site_url'] . '/forum/viewtopic.php?showtopic=' . $postid . '&lastpost=true#' . $A['id'])));
    $T->parse('output', 'email');
    $msgText = $T->finish($T->get_var('output'));
    $html2txt = new html2text($msgText, false);
    $messageText = $html2txt->get_text();
    return array($message, $messageText);
}
开发者ID:spacequad,项目名称:glfusion,代码行数:40,代码来源:format.inc.php

示例11: COM_makeClickableLinksCallback

/**
* Callback function to help format links in COM_makeClickableLinks
*
* @param    string  $http   set to 'http://' when not already in the url
* @param    string  $link   the url
* @return   string          link enclosed in <a>...</a> tags
*
*/
function COM_makeClickableLinksCallback($http, $link)
{
    global $_CONF;
    static $encoding = null;
    if ($encoding === null) {
        $encoding = COM_getEncodingt();
    }
    // When $link ends with a period, the period will be moved out of the link
    // text (bug #0001675)
    if (substr($link, -1) === '.') {
        $link = substr($link, 0, -1);
        $end = '.';
    } else {
        $end = '';
    }
    if ($_CONF['linktext_maxlen'] > 0) {
        $text = COM_truncate($link, $_CONF['linktext_maxlen'], '...', 10);
    } else {
        $text = $link;
    }
    $text = htmlspecialchars($text, ENT_QUOTES, $encoding);
    return '<a href="' . $http . $link . '">' . $text . '</a>' . $end;
}
开发者ID:mistgrass,项目名称:geeklog-japan,代码行数:31,代码来源:lib-common.php

示例12: _bbcode_htmlspecialchars

function _bbcode_htmlspecialchars($text)
{
    return @htmlspecialchars($text, ENT_QUOTES, COM_getEncodingt());
}
开发者ID:spacequad,项目名称:glfusion,代码行数:4,代码来源:lib-bbcode.php

示例13: trim

 }
 $metaDesc = trim($shortComment) . $tailString;
 $outputHandle->addMeta('property', 'og:site_name', urlencode($_CONF['site_name']));
 $outputHandle->addMeta('property', 'og:locale', isset($LANG_LOCALE) ? $LANG_LOCALE : 'en_US');
 $outputHandle->addMeta('property', 'og:title', $pagetitle);
 $outputHandle->addMeta('property', 'og:type', 'article');
 $outputHandle->addMeta('property', 'og:url', $permalink);
 if (preg_match('/<img[^>]+src=([\'"])?((?(1).+?|[^\\s>]+))(?(1)\\1)/si', $story->DisplayElements('introtext'), $arrResult)) {
     $outputHandle->addMeta('property', 'og:image', $arrResult[2]);
 } else {
     if (preg_match('/<img[^>]+src=([\'"])?((?(1).+?|[^\\s>]+))(?(1)\\1)/si', $story->DisplayElements('bodytext'), $arrResult)) {
         $outputHandle->addMeta('property', 'og:image', $arrResult[2]);
     }
 }
 $outputHandle->addMeta('property', 'og:description', @htmlspecialchars($metaDesc, ENT_QUOTES, COM_getEncodingt()));
 $outputHandle->addMeta('name', 'description', @htmlspecialchars($metaDesc, ENT_QUOTES, COM_getEncodingt()));
 if (isset($_GET['msg'])) {
     $msg = (int) COM_applyFilter($_GET['msg'], true);
     if ($msg > 0) {
         $plugin = '';
         if (isset($_GET['plugin'])) {
             $plugin = COM_applyFilter($_GET['plugin']);
         }
         $pageBody .= COM_showMessage($msg, $plugin, '', 0, 'info');
     }
 }
 DB_query("UPDATE {$_TABLES['stories']} SET hits = hits + 1 WHERE (sid = '" . DB_escapeString($story->getSid()) . "') AND (date <= NOW()) AND (draft_flag = 0)");
 // Display whats related
 $story_template = new Template($_CONF['path_layout'] . 'article');
 $story_template->set_file('article', 'article.thtml');
 $story_template->set_var('site_admin_url', $_CONF['site_admin_url']);
开发者ID:NewRoute,项目名称:glfusion,代码行数:31,代码来源:article.php

示例14: PAYPAL_popupMsg

/**
 *  Display a popup text message
 *
 *  @param string $msg Text to display 
 */
function PAYPAL_popupMsg($msg)
{
    global $_CONF;
    $msg = htmlspecialchars($msg, ENT_QUOTES, COM_getEncodingt());
    $popup = COM_showMessageText($msg);
    return $popup;
}
开发者ID:NewRoute,项目名称:paypal,代码行数:12,代码来源:paypal_functions.inc.php

示例15: PAYPAL_getAdminField_Workflow

/**
*   Get an individual field for the options admin list.
*
*   @param  string  $fieldname  Name of field (from the array, not the db)
*   @param  mixed   $fieldvalue Value of the field
*   @param  array   $A          Array of all fields from the database
*   @param  array   $icon_arr   System icon array (not used)
*   @param  object  $EntryList  This entry list object
*   @return string              HTML for field display in the table
*/
function PAYPAL_getAdminField_Workflow($fieldname, $fieldvalue, $A, $icon_arr)
{
    global $_CONF, $_PP_CONF, $LANG_PP;
    $retval = '';
    switch ($fieldname) {
        case 'enabled':
        case 'notify_buyer':
            if ($fieldvalue == '1') {
                $switch = ' checked="checked"';
                $enabled = 1;
            } else {
                $switch = '';
                $enabled = 0;
            }
            $retval .= "<input type=\"checkbox\" {$switch} value=\"1\" name=\"{$fieldname}_check\" \n                id=\"tog{$fieldname}{$A['id']}\"\n                onclick='PP_toggle(this,\"{$A['id']}\",\"{$fieldname}\"," . "\"{$A['rec_type']}\",\"" . PAYPAL_ADMIN_URL . "\");' />" . LB;
            break;
        case 'orderby':
            $url = PAYPAL_ADMIN_URL . "/index.php?id={$A['id']}&amp;type={$A['rec_type']}&amp;wfmove=";
            $retval = COM_createLink('<img src="' . PAYPAL_URL . '/images/up.png" height="16" width="16" border="0" />', $url . 'up') . COM_createLink('<img src="' . PAYPAL_URL . '/images/down.png" height="16" width="16" border="0" />', $url . 'down');
            break;
        case 'wf_name':
            $retval = $LANG_PP[$fieldvalue];
            break;
        case 'name':
            $retval = $LANG_PP['orderstatus'][$fieldvalue];
            break;
        default:
            $retval = htmlspecialchars($fieldvalue, ENT_QUOTES, COM_getEncodingt());
            break;
    }
    return $retval;
}
开发者ID:NewRoute,项目名称:paypal,代码行数:42,代码来源:index.php


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