本文整理汇总了PHP中html_entity_decode_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP html_entity_decode_utf8函数的具体用法?PHP html_entity_decode_utf8怎么用?PHP html_entity_decode_utf8使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_entity_decode_utf8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display()
{
$tour = new Tour();
global $sugar_config;
// $ss = new Sugar_Smarty();
$db = DBManagerFactory::getInstance();
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
$record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
$tour->retrieve($record);
$template = file_get_contents('modules/Tours/tpls/exports/template-dos.htm');
$template = str_replace('${SITE_URL}', $sugar_config['site_url'], $template);
$template = str_replace('${TOUR_NOTE}', html_entity_decode_utf8($tour->description), $template);
$template = str_replace('${CODE}', $tour->tour_code, $template);
$template = str_replace('${NAME}', $tour->name, $template);
$template = str_replace('${TRANSPORT}', $tour->transport2, $template);
$template = str_replace('${START_DATE}', $tour->start_date, $template);
$template = str_replace('${DURATION}', $tour->duration, $template);
// Hieu fix issue 1438
if ($tour->picture) {
$main_picture = '
<!--[if gte vml 1]>
<o:wrapblock>
<v:shape id="Picture_x0020_11"
o:spid="_x0000_s1028" type="#_x0000_t75"
alt=""
style=\'position:absolute;margin-left:0;margin-top:0;width:470.55pt;height:234pt;
z-index:251657216;visibility:visible;mso-wrap-style:square;
mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;
mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
mso-wrap-distance-bottom:0;mso-position-horizontal:center;
mso-position-horizontal-relative:margin;mso-position-vertical:absolute;
mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;
mso-width-relative:page;mso-height-relative:page\'>
<v:imagedata src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
o:title="phan%20thiet%20beach"/>
<o:lock v:ext="edit" aspectratio="f"/>
<w:wrap type="topAndBottom" anchorx="margin"/>
</v:shape><![endif]--><![if !vml]><img width=627 height=312
src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
alt=""
v:shapes="Picture_x0020_11"><![endif]><!--[if gte vml 1]></o:wrapblock>
<![endif]-->
';
} else {
$main_picture = '';
}
$template = str_replace('${PICTURE}', $main_picture, $template);
// End issue 1438
$template = str_replace('${TOUR_PROGRAM_LINES}', html_entity_decode_utf8($tour->get_data_to_expor2word()), $template);
$size = strlen($template);
$filename = "TOUR_PROGRAM_" . $tour->name . ".doc";
ob_end_clean();
header("Cache-Control: private");
header("Content-Type: application/force-download;");
header("Content-Disposition:attachment; filename=\"{$filename}\"");
header("Content-length:{$size}");
echo $template;
ob_flush();
}
示例2: get_table_flash_bbcode_pkids
function get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field)
{
global $db;
$ids = array();
$sql = "SELECT $id_field, $content_field, $uid_field, $bitfield_field
FROM $table_name
WHERE $content_field LIKE '%[/flash:%'
AND $bitfield_field <> ''";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$uid = $row[$uid_field];
// thanks support toolkit
$content = html_entity_decode_utf8($row[$content_field]);
set_var($content, $content, 'string', true);
$content = utf8_normalize_nfc($content);
$bitfield_data = $row[$bitfield_field];
if (!is_valid_flash_bbcode($content, $uid) && has_flash_enabled($bitfield_data))
{
$ids[] = (int) $row[$id_field];
}
}
$db->sql_freeresult($result);
return $ids;
}
示例3: WF_filter_math
function WF_filter_math($text, $editor)
{
global $TAGS;
$output = '';
$n0 = 0;
// Search for '«math'. If it is not found, the
// content is returned without any modification
$n1 = strpos($text, $TAGS->in_mathopen);
if ($n1 === FALSE) {
return $text;
// directly return the content
}
// filtering
while ($n1 !== FALSE) {
$output .= substr($text, $n0, $n1 - $n0);
$n0 = $n1;
$n1 = strpos($text, $TAGS->in_mathclose, $n0);
if (!$n1) {
break;
}
$n1 = $n1 + strlen($TAGS->in_mathclose);
// Getting the substring «math ... «/math»
$sub = substr($text, $n0, $n1 - $n0);
// remove html entities (such as ")
//Solves BUG 25670 of php 4.3, solved at version 5
if (version_compare(phpversion(), "5.0.0", ">=")) {
$sub = html_entity_decode($sub, ENT_COMPAT, $TAGS->ucharset);
// needs php 4.3 to work, php 5.0 if charset is utf (bug 25670)
} else {
if (strtolower($TAGS->ucharset) == "utf-8") {
$sub = html_entity_decode_utf8($sub);
} else {
$sub = html_entity_decode($sub, ENT_COMPAT, $TAGS->ucharset);
}
}
// replacing '«' by '<'
$sub = str_replace($TAGS->in_open, $TAGS->out_open, $sub);
// replacing '»' by '>'
$sub = str_replace($TAGS->in_close, $TAGS->out_close, $sub);
// replacing '§' by '&'
$sub = str_replace($TAGS->in_entity, $TAGS->out_entity, $sub);
// generate the image code
$sub = WF_math_image($sub, $editor);
// appending the modified substring
$output .= $sub;
$n0 = $n1;
// searching next '«math'
$n1 = strpos($text, $TAGS->in_mathopen, $n0);
}
$output .= substr($text, $n0);
return $output;
}
示例4: __construct
function __construct()
{
parent::SugarView();
global $current_user;
if (!$current_user->isDeveloperForModule("Leads")) {
die("Unauthorized Access to Administration");
}
$this->jsonHelper = getJSONobj();
$this->parser = new ConvertLayoutMetadataParser("Contacts");
if (isset($_REQUEST['updateConvertDef']) && $_REQUEST['updateConvertDef'] && !empty($_REQUEST['data'])) {
$this->parser->updateConvertDef(object_to_array_recursive($this->jsonHelper->decode(html_entity_decode_utf8($_REQUEST['data']))));
// clear the cache for this module only
MetaDataManager::refreshModulesCache(array('Leads'));
}
}
示例5: preDisplay
function preDisplay()
{
parent::preDisplay();
$tour = new Tour();
$html = file_get_contents("custom/modules/Tours/tpls/basic_pdf.tpl");
$html = str_replace("{NAME}", $this->bean->name, $html);
$desc = html_entity_decode_utf8($this->bean->description);
$desc = $tour->removeHtmlTags($desc);
$html = str_replace("{TOUR_NOTE}", $desc, $html);
$picture = '<img width="627" height="312" src="modules/images/' . $this->bean->picture . '">';
$html = str_replace("{PICTURE}", $picture, $html);
$html = str_replace("{CODE}", $this->bean->tour_code, $html);
$html = str_replace("{DURATION}", $this->bean->duration, $html);
$html = str_replace("{TRANSPORT}", $this->bean->transport2, $html);
$html = str_replace("{START_DATE}", $this->bean->start_date, $html);
$program = html_entity_decode_utf8($tour->get_data_to_export2pdf($_GET['record']));
$html = str_replace("{TOUR_PROGRAM_LINES}", $program, $html);
// Xuat ra pdf
$mpdf = new mPDF("vi");
$mpdf->SetFooter('{PAGENO}');
$mpdf->WriteHTML($html);
$mpdf->Output("Tour.pdf", "D");
exit;
}
示例6: output
function output() {
global $user;
$umode = strtoupper($this->mode);
$items = '';
foreach ($this->xml as $item)
{
$items .= "\t" . '<item>
' . (isset($item['author']) ? '<author>' . $item['author'] . '</author>' : '') . '
<title><![CDATA[' . html_entity_decode_utf8($item['title']) . ']]></title>
<link>' . $item['link'] . '</link>
<guid>' . $item['link'] . '</guid>
<description><![CDATA[' . html_entity_decode_utf8($item['description']) . ']]></description>
<pubDate>' . date('D, d M Y H:i:s \G\M\T', $item['pubdate']) . '</pubDate>
</item>' . nr();
}
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>' . html_entity_decode_utf8(lang('rss_' . $umode)) . '</title>
<link>http://www.rockrepublik.net/</link>
<description><![CDATA[' . html_entity_decode_utf8(lang('rss_desc_' . $umode)) . ']]></description>
<lastBuildDate>' . date('D, d M Y H:i:s \G\M\T', $this->xml[0]['pubdate']) . '</lastBuildDate>
<webMaster>info@rockrepublik.net</webMaster>
' . $items . '</channel>
</rss>';
sql_close();
exit;
}
示例7: convert_color
}
}
$FLIR['color'] = convert_color($FStyle['cColor']);
if ($FLIR['bkg_transparent']) {
$FLIR['bkgcolor'] = array('red' => abs($FLIR['color']['red'] - 100), 'green' => abs($FLIR['color']['green'] - 100), 'blue' => abs($FLIR['color']['blue'] - 100));
} else {
$FLIR['bkgcolor'] = convert_color($FStyle['cBackground'], false, 'FFFFFF');
}
$FLIR['opacity'] = is_number($FStyle['cOpacity'], true) ? $FStyle['cOpacity'] * 100 : 100;
if ($FLIR['opacity'] > 100 || $FLIR['opacity'] < 0) {
$FLIR['opacity'] = 100;
}
$FLIR['text'] = $_GET['text'] != '' ? str_replace(array('{amp}nbsp;', '{amp}', '{plus}'), array(' ', '&', '+'), trim($_GET['text'], "\t\n\r")) : 'null';
$FLIR['cache'] = get_cache_fn(md5(($FLIR['mode'] == 'wrap' ? $FLIR['maxwidth'] : '') . $FLIR['font'] . (print_r($FStyle, true) . $FLIR['text'])), $FLIR['output']);
$FLIR['text_encoded'] = $FLIR['text'];
$FLIR['text'] = $FLIR['original_text'] = strip_tags(html_entity_decode_utf8($FLIR['text']));
$SPACE_BOUNDS = false;
if (is_number($FStyle['cSpacing'], true, false, true)) {
$SPACE_BOUNDS = bounding_box(' ');
$spaces = ceil($FStyle['cSpacing'] / $SPACE_BOUNDS['width']);
if ($spaces > 0) {
$FLIR['text'] = space_out($FLIR['text'], $spaces);
define('SPACING_GAP', $spaces);
}
if ($FLIR['postscript']) {
$FLIR['ps']['kerning'] = $FStyle['cSpacing'] / $FLIR['size'] * 1000;
}
}
if ($FLIR['postscript'] && isset($FStyle['space_width'])) {
$FLIR['ps']['space'] = $FStyle['space_width'] / $FLIR['size'] * 1000;
}
示例8: unset
$numPending = (int) $numPending;
// get latest post info
unset($thisThread);
$kunena_db->setQuery("SELECT m.thread, COUNT(*) AS totalmessages\n FROM #__fb_messages AS m\n LEFT JOIN #__fb_messages AS mm ON m.thread=mm.thread\n WHERE m.id='{$singlerow->id_last_msg}'\n GROUP BY m.thread");
$thisThread = $kunena_db->loadObject();
if (!is_object($thisThread)) {
$thisThread = new stdClass();
$thisThread->totalmessages = 0;
$thisThread->thread = 0;
}
$latestthreadpages = ceil($thisThread->totalmessages / $fbConfig->messages_per_page);
$latestthread = $thisThread->thread;
$latestname = $singlerow->mname;
$latestcatid = stripslashes($singlerow->catid);
$latestid = $singlerow->id_last_msg;
$latestsubject = html_entity_decode_utf8(stripslashes($singlerow->subject));
$latestuserid = $singlerow->userid;
?>
<tr class = "<?php
echo '' . $boardclass . '' . $tabclass[$k] . '';
?>
" id="fb_cat<?php
echo $singlerow->id;
?>
">
<td class = "td-1" align="center">
<?php
$tmpIcon = '';
$cxThereisNewInForum = 0;
if ($fbConfig->shownew && $kunena_my->id != 0) {
示例9: html_entity_decode_utf8
?>
:
<label for="exactname"><input type="checkbox" name="exactname" value="1" <?php
if ($exactname) {
echo $checked;
}
?>
/>
<?php
echo _KUNENA_SEARCH_EXACT;
?>
</label>
</div>
<div id="userfield" style="line-height: 28px">
<input class="fbs input" type="text" name="searchuser" value="<?php
echo html_entity_decode_utf8($searchuser);
?>
" style="width:250px"/>
<select class="fbs" name="starteronly">
<option value="0"<?php
if ($starteronly == 0) {
echo $selected;
}
?>
><?php
echo _KUNENA_SEARCH_USER_POSTED;
?>
</option>
<!--<option value="1"<?php
if ($starteronly == 1) {
示例10: forums
/**
* Get the forum index
* @since Version 3.2
* @version 3.2
* @return array
* @todo Include newest post username, user id, post id, thread name, thread id
*/
public function forums()
{
$query = "SELECT * FROM nuke_bbforums";
if ($this->db instanceof \sql_db) {
if ($rs = $this->db->query($query)) {
while ($row = $rs->fetch_assoc()) {
$row['forum_name'] = html_entity_decode_utf8($row['forum_name']);
$this->forums[$row['forum_id']] = $row;
}
return $this->forums;
} else {
trigger_error("phpBB Index : Could not retrieve forums");
return false;
}
} else {
foreach ($this->db->fetchAll($query) as $row) {
$row['forum_name'] = html_entity_decode_utf8($row['forum_name']);
$this->forums[$row['forum_id']] = $row;
}
return $this->forums;
}
}
示例11: FormatTitle
/**
* Format a title
* @since Version 3.9.1
* @param string $text
* @return $text
*/
public static function FormatTitle($text = NULL)
{
if (is_null($text)) {
return $text;
}
$timer = Debug::getTimer();
Debug::RecordInstance();
$text = htmlentities($text, ENT_COMPAT, "UTF-8");
$text = str_replace("™™", "™", $text);
if (function_exists("html_entity_decode_utf8")) {
$text = html_entity_decode_utf8($text);
}
$text = stripslashes($text);
if (substr($text, 0, 4) == "Re: ") {
$text = substr($text, 4, strlen($text));
}
if (substr($text, -1) == ".") {
$text = substr($text, 0, -1);
}
Debug::logEvent(__METHOD__, $timer);
return $text;
}
示例12: load
/**
* Load the forum
* @since Version 3.9.1
* @return \Railpage\Forums\Forum
* @param int|string $id
* @param boolean $getParent
*/
public function load($id = false, $getParent = false)
{
if ($id === false) {
throw new InvalidArgumentException("No valid forum ID or shortname was provided");
}
$this->url = new Url(sprintf("/f-f%d.htm", $id));
if (filter_var($id, FILTER_VALIDATE_INT)) {
#$query = "SELECT * FROM nuke_bbforums f LEFT JOIN (nuke_bbtopics t, nuke_bbposts p, nuke_bbposts_text pt) ON (f.forum_last_post_id = p.post_id AND p.topic_id = t.topic_id AND pt.post_id = p.post_id) WHERE f.forum_id = ? LIMIT 1";
$query = "SELECT f.*, p.post_time, p.poster_id, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid,\r\n t.topic_id, t.topic_title, t.topic_time,\r\n f.forum_name, f.forum_desc\r\n FROM nuke_bbforums AS f\r\n LEFT JOIN nuke_bbposts AS p ON f.forum_last_post_id = p.post_id\r\n LEFT JOIN nuke_bbtopics AS t ON p.topic_id = t.topic_id\r\n LEFT JOIN nuke_bbposts_text AS pt ON pt.post_id = p.post_id\r\n WHERE f.forum_id = ?";
$row = $this->db->fetchRow($query, $id);
}
if (isset($row) && is_array($row)) {
$this->id = $row['forum_id'];
$this->catid = $row["cat_id"];
$this->name = function_exists("html_entity_decode_utf8") ? html_entity_decode_utf8($row["forum_name"]) : $row['forum_name'];
$this->description = function_exists("html_entity_decode_utf8") ? html_entity_decode_utf8($row["forum_desc"]) : $row['forum_desc'];
$this->status = $row["forum_status"];
$this->order = $row["forum_order"];
$this->posts = $row["forum_posts"];
$this->topics = $row["forum_topics"];
$this->last_post = $row["forum_last_post_id"];
$this->last_post_id = $this->last_post;
$this->last_post_time = $row['post_time'];
$this->last_post_user_id = $row['poster_id'];
$this->last_post_username = $row['post_username'];
$this->last_post_subject = $row['post_subject'];
$this->last_post_text = $row['post_text'];
$this->last_post_bbcodeuid = $row['bbcode_uid'];
$this->last_post_topic_id = $row['topic_id'];
$this->last_post_topic_title = $row['topic_title'];
$this->last_post_topic_time = $row['topic_time'];
$this->acl_resource = sprintf("railpage.forums.forum:%d", $this->id);
if ($getParent) {
$this->category = ForumsFactory::CreateCategory($this->catid);
}
if (filter_var($row['forum_parent'], FILTER_VALIDATE_INT) && $row['forum_parent'] > 0) {
$this->Parent = new Forum($row['forum_parent']);
}
}
}
示例13: translate
}
$xtpl->assign("VALUE", $focus->contract_value);
if (!empty($focus->currency)) {
$xtpl->assign("CURRENCY", translate('currency_dom', '', $focus->currency));
} else {
$xtpl->assign("CURRENCY", '');
}
if (!empty($focus->deparment)) {
$xtpl->assign("DEPARMENT", translate('deparment_dom', '', $focus->deparment));
} else {
$xtpl->assign("DEPARMENT", '');
}
if (!empty($focus->type)) {
$xtpl->assign('TYPE', translate('tourprogram_type_dom', '', $focus->type));
} else {
$xtpl->assign('TYPE', '');
}
$xtpl->assign("DESCRIPTION", nl2br(html_entity_decode_utf8($focus->description)));
$xtpl->assign("TOUR_PROGRAM_LINE_DETAIL", $focus->getDetailViewHTMLTourProgramDetail($focus->id));
// $xtpl->assign("TOUR_PROGRAM_LINE_DETAIL", '');
$xtpl->parse("main");
$xtpl->out("main");
require_once 'include/SubPanel/SubPanelTiles.php';
$subpanel = new SubPanelTiles($focus, 'Tours');
// ob_end_clean();
echo $subpanel->display();
/* $str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;*/
示例14: str_replace
$template = str_replace("{START_DATE}", $row['start_date'],$template);
$template = str_replace("{END_DATE}", $row['end_date'],$template);
$template = str_replace("{VALUE}", $row['contract_value'],$template);
$template = str_replace("{CURRENCY}", translate('currency_dom','',$row['currency']),$template);
$template = str_replace("{DIVISION}", translate('division_dom','',$row['division']),$template);
$template = str_replace("{ASSIGNED_TO}", $row['first_name'].' '.$row['last_name'],$template);
$template = str_replace("{OPERATOR}", $row['operator'],$template);
$template = str_replace("{DESCRIPTION}", html_entity_decode(nl2br( $row['description'])),$template);
$template = str_replace("{TOUR_PROGRAM_LINE_DETAIL}", $tour->get_data_to_expor2word($record),$template);*/
$template = str_replace('${CODE}', $tour->tour_code, $template);
$template = str_replace('${NAME}', $tour->name, $template);
$template = str_replace('${TRANSPORT}', $tour->transport2, $template);
$template = str_replace('${START_DATE}', $tour->start_date, $template);
$template = str_replace('${DURATION}', $tour->duration, $template);
$template = str_replace('${PICTURE}', $sugar_config['site_url'] . "/modules/images/" . $tour->picture, $template);
$template = str_replace('${TOUR_PROGRAM_LINES}', html_entity_decode_utf8($tour->get_data_to_expor2word()), $template);
$size = strlen($template);
/*$filename = "TOUR_PROGRAM_".$tour->name.".doc";
ob_end_clean();
header("Cache-Control: private");
header("Content-Type: application/force-download;");
header("Content-Disposition:attachment; filename=\"$filename\"");
header("Content-length:$size");
echo $template;
ob_flush();*/
//added 09-06-2012
$filename = "TOUR_PROGRAM_" . $tour->name;
/*$mpdf=new mPDF();
$mpdf->WriteHTML($template);
$mpdf->Output($filename, "D");//D=Download; I-Internal - xem trực tiếp file*/
示例15: GenerateChiTietTruongTrinh
function GenerateChiTietTruongTrinh()
{
global $sugar_config;
$result = $this->get_tour_program_lines($this->id);
$html = "";
$i = 1;
while ($row = $this->db->fetchByAssoc($result)) {
$notes = $row['notes'] ? "(" . $row['notes'] . ")" : "";
$html .= "<div>";
$html .= "<strong style='text-decoration:underline'>Ngày {$i}: " . $row['name'] . "</strong> " . $notes . "<br/>";
$html .= "<div style='min-height: 154px'>";
$html .= html_entity_decode_utf8($row['description']);
$html .= "<img width='196' style='float:right' src='" . $sugar_config['site_url'] . "/modules/images/" . $row['picture'] . "' alt='Image'/>";
$html .= "</div>";
$html .= "</div>";
$i++;
}
//echo $html;
return $html;
}