本文整理汇总了PHP中html_specialchars函数的典型用法代码示例。如果您正苦于以下问题:PHP html_specialchars函数的具体用法?PHP html_specialchars怎么用?PHP html_specialchars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_specialchars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFolderList
/**
* @param int $pid current folder ID
* @param int $img_list_width
* @param int $img_list_height
* @param int $img_list_sl sharpen level
* @param int[] $folders array with active folders in cp
* @param bool|string $active to pass the status to subfolders
* @return string html for folderlist
*/
public function getFolderList($pid, $img_list_width, $img_list_height, $img_list_sl, $folders, $active = 'true')
{
$pid = intval($pid);
$userID = intval($_SESSION["wcs_user_id"]);
$sql = "SELECT f_id, f_name, f_aktiv, f_public, f_uid FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . intval($pid) . " AND f_kid=0 AND f_trash=0 AND (f_public=1 OR f_uid=" . $userID . ") ORDER BY f_sort, f_name";
$data = _dbQuery($sql);
foreach ($data as $key => $val) {
$dirname = html_specialchars($val["f_name"]);
//check if depending files/dirs exist
$sql2 = "SELECT COUNT(f_id) FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . $val["f_id"] . " AND f_kid=0 AND f_trash=0 AND (f_public=1 OR f_uid=" . $userID . ") LIMIT 1";
$data2 = _dbQuery($sql2, 'COUNT');
$folders_act = "";
//curr ID is in selectedFoldersList
if (in_array($val["f_id"], $folders)) {
$folders_act = 'checked="checked"';
}
//start outputfor the row
$this->_folderlist_html .= '<li class="br_module_jqs_folderlist_li">';
//if folder active and parent not inactive
if ($val["f_aktiv"] == 1 && $active == 'true') {
$this->_folderlist_html .= '<span id="openlink' . $val["f_id"] . '" class="br_module_jqs_folderlist_openlink closed" onclick="PHPWCMS_MODULE.JQS.sendRequest(' . $val["f_id"] . ');"> </span>';
} else {
$this->_folderlist_html .= '<span class="br_module_jqs_folderlist_openlink"> </span>';
}
$this->_folderlist_html .= '<input type="checkbox" name="jqs_folders[]" value="' . $val["f_id"] . '" ' . $folders_act;
//if folder active and parent not inactive
if ($val["f_aktiv"] == 1 && $active == 'true') {
$this->_folderlist_html .= ' />' . $dirname;
$this->_folderlist_html .= '<span id="arr' . $val["f_id"] . '"></span><div id="images' . $val["f_id"] . '" style="display:none;"></div>';
} else {
$this->_folderlist_html .= ' disabled="disabled" />' . $dirname;
$this->_folderlist_html .= ' (';
//if folder itself is inactive then show image
if ($val["f_aktiv"] == 0) {
$this->_folderlist_html .= '<img style="vertical-align: text-bottom;" src="include/inc_module/mod_sliderjs/img/active_11x11a_0.gif" />';
}
$this->_folderlist_html .= ')';
//curr ID is in selectedFoldersList
if (in_array($val["f_id"], $folders)) {
//hidden field to pass the ID just in case it's selcted
$this->_folderlist_html .= '<input type="hidden" name="jqs_folders[]" value="' . $val["f_id"] . '">';
}
}
//deeper if subdir
if ($data2) {
//pass the inactive status to all subfolders
if ($val["f_aktiv"] == 0) {
$active = 'false';
}
$this->_folderlist_html .= "<ul>" . LF;
$this->getFolderList($val["f_id"], $img_list_width, $img_list_height, $img_list_sl, $folders, $active);
$this->_folderlist_html .= "</ul>" . LF;
//reset the status for following folders (of same level)
$active = 'true';
}
$this->_folderlist_html .= '</li>' . LF;
}
return $this->_folderlist_html;
}
示例2: listRecipeCategories
function listRecipeCategories($option)
{
global $_getVar;
$cat = _dbQuery('SELECT acontent_text FROM ' . DB_PREPEND . 'phpwcms_articlecontent WHERE acontent_type=26 AND acontent_trash=0');
$cat_all = '';
if ($cat) {
foreach ($cat as $temp) {
if ($temp['acontent_text']) {
if ($cat_all) {
$cat_all .= ', ';
}
$cat_all .= $temp['acontent_text'];
}
}
$cat_all = convertStringToArray($cat_all);
sort($cat_all, SORT_LOCALE_STRING);
} else {
$cat_all = array();
}
$cat = '';
unset($_getVar['recipecat']);
foreach ($cat_all as $temp) {
$cat .= ' <li><a href="' . rel_url(array('recipecat' => $temp)) . '" ';
$temp = html_specialchars($temp);
$cat .= 'title="' . $temp . '">' . $temp . '</a></li>' . LF;
}
if ($cat) {
$cat = LF . '<ul>' . LF . $cat . '</ul>' . LF;
}
if (isset($option['LISTCAT'][0])) {
$cat = $option['LISTCAT'][0] . $cat;
}
if (isset($option['LISTCAT'][1])) {
$cat .= $option['LISTCAT'][1];
}
return $cat;
}
示例3: array
//used to convert old style file uploads
$phpwcms = array();
require_once '../include/config/conf.inc.php';
require_once '../include/inc_lib/default.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/general.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/backend.functions.inc.php';
?>
<html>
<body>
<h3>Upgrade article end date 2010-12-31 23:59:59 to 2030-12-31 23:59:59</h3>
<?php
// get all articles
if ($all = _dbQuery("SELECT article_id, article_alias, article_title FROM " . DB_PREPEND . "phpwcms_article WHERE article_end='2010-12-31 23:59:59' AND article_deleted=0")) {
if (isset($all[0])) {
$sql = "UPDATE " . DB_PREPEND . "phpwcms_article SET ";
$sql .= "article_end='2030-12-31 23:59:59'";
$sql .= "WHERE article_end='2010-12-31 23:59:59' AND article_deleted=0";
$result = _dbQuery($sql, 'UPDATE');
}
foreach ($all as $key => $value) {
echo '<pre';
echo '>[ID:' . sprintf('%0' . strlen(strval(count($all))) . 's', $value['article_id']) . '] ' . html_specialchars($value['article_title'] . ' (' . $value['article_alias'] . ')');
echo '</pre>' . LF;
}
}
?>
<p><strong>Done!</strong> All articles not listed here are not touched.</p>
</body>
</html>
示例4: trim
$tabitem['content-class'] = $template_default['classes']['tab-content'];
if ($template_default['classes']['tab-content-item']) {
$tabitem['content-class'] = trim($tabitem['content-class'] . ' ' . $template_default['classes']['tab-content-item']) . '-' . $g['counter'];
}
if ($tabitem['content-class']) {
$tabitem['content-class'] = ' class="' . $tabitem['content-class'] . '"';
}
if ($template_default['classes']['tab-first'] && $g['counter'] === 1) {
$tabitem['class'] .= ' ' . $template_default['classes']['tab-first'];
}
if ($template_default['classes']['tab-last'] && $g['counter'] === $g['max']) {
$tabitem['class'] .= ' ' . $template_default['classes']['tab-last'];
}
$tabitem['class'] = trim($tabitem['class']);
$tabitem['class'] = $tabitem['class'] ? ' class="' . $tabitem['class'] . '"' : '';
$g['wrap'][] = ' <li' . $tabitem['class'] . '><a href="' . rel_url() . '#' . $tabitem['id'] . '">' . html_specialchars($tabitem['title']) . '</a></li>';
$g['cnt'][] = ' <div id="' . $tabitem['id'] . '"' . $tabitem['content-class'] . '>' . LF . $tabitem['content'] . LF . ' </div>';
$g['counter']++;
}
$g['wrap'][] = ' </ul>';
$g['wrap'][] = implode(LF, $g['cnt']);
if ($template_default['classes']['tab-container-clear']) {
$g['wrap'][] = ' <span class="' . $template_default['classes']['tab-container-clear'] . '"></span>';
}
$g['wrap'][] = '</div>';
}
$content['cptab'][$CNT_TAB] = implode(LF, $g['wrap']);
}
unset($g);
}
}
示例5: array
*/
if (strpos($content['all'], '{BREADCRUMB_ARTICLE}')) {
// Set level where to start with breadcrumb - default 0 = Root level
$_breadcrumb_start_level = 0;
// Separate Breadcrumb items with
$_breadcrumb_spacer = ' > ';
// Wrap inner link text by prefix/suffix <a> %PREFIX% Linktext %SUFFIX% </a>
$_breadcrumb_link_prefix = '<b>';
$_breadcrumb_link_suffix = '</b>';
// additional link attributes like class, rel, style
// remember there is no active link - active (last) item has no link
$_breadcrumb_link_attribute = 'class="breadcrumb-link"';
////// Do not edit below ////////
$_breadcrumb = array();
if (count($LEVEL_ID) > $_breadcrumb_start_level) {
foreach ($LEVEL_ID as $level => $item) {
if ($level < $_breadcrumb_start_level) {
continue;
}
if ($content['struct'][$item]["acat_hidden"] == false) {
$_breadcrumb[] = getStructureLevelLink($content['cat_id'] == $item && $content['list_mode'] ? $content['struct'][$item]['acat_name'] : $content['struct'][$item], $_breadcrumb_link_attribute, $_breadcrumb_link_prefix, $_breadcrumb_link_suffix);
}
}
}
// Article
if ($aktion[1]) {
$_breadcrumb[] = html_specialchars($content['article_title']);
}
$_breadcrumb = implode($_breadcrumb_spacer, array_diff($_breadcrumb, array('', NULL)));
$content['all'] = str_replace('{BREADCRUMB_ARTICLE}', $_breadcrumb, $content['all']);
}
示例6: foreach
$subgallery = ' <ul class="sub">' . LF;
foreach ($subgalleries as $sub) {
$subgallery .= ' <li class="sub">' . LF;
$subgallery .= ' <h3><a href="' . $gallery->url . '&subgallery=' . $sub['f_id'] . '">';
$subgallery .= html_specialchars($sub['f_name']) . '</a></h3>' . LF;
if ($row['f_longinfo'] != '') {
$subgallery .= ' ' . plaintext_htmlencode($sub['f_longinfo']) . LF;
}
$subgallery .= ' </li>' . LF;
}
$subgallery .= ' </ul>' . LF;
}
$galleries[$g] = ' <li class="root">' . LF;
$galleries[$g] .= ' <h2>';
if ($subgallery != '') {
$galleries[$g] .= html_specialchars($row['f_name']);
} else {
$galleries[$g] .= '<a href="' . $gallery->url . '&subgallery=' . $row['f_id'] . '">' . html_specialchars($row['f_name']) . '</a>';
}
$galleries[$g] .= '</h2>' . LF;
if ($row['f_longinfo'] != '') {
$galleries[$g] .= ' ' . plaintext_htmlencode($row['f_longinfo']) . LF;
}
$galleries[$g] .= $subgallery;
$galleries[$g] .= ' </li>';
$g++;
}
$gallery = count($galleries) ? '<ul class="gallery">' . LF . implode(LF, $galleries) . LF . '</ul>' : '';
}
$content['all'] = str_replace('{GALLERY}', '<hr /><h1>Gallery</h1>' . LF . $gallery . LF . '<hr />', $content['all']);
}
示例7: html_specialchars
$image_descr = '';
$image_css = '';
if ($thumb_image != false) {
if (isset($imagesdata[$value][$val['f_id']])) {
if (isset($imagesdata[$value][$val['f_id']][1])) {
//allow plain text only
$image_title = html_specialchars(strip_tags($imagesdata[$value][$val['f_id']][1]));
}
if (isset($imagesdata[$value][$val['f_id']][2])) {
//we allow HTML in description
//$image_descr = html_specialchars(strip_tags($imagesdata[$value][$val['f_id']][2]));
$image_descr = html_specialchars($imagesdata[$value][$val['f_id']][2]);
}
if (isset($imagesdata[$value][$val['f_id']][3])) {
//CSS Class
$image_css = html_specialchars(strip_tags($imagesdata[$value][$val['f_id']][3]));
}
}
//html output per image - image + field title + field descr + Dialog-Link
$imagelist_output .= ' <div class="jqs_div"><div class="jqs_imgdiv"><img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ';
$imagelist_output .= $thumb_image[3] . ' alt="' . $val['f_name'] . '" title="' . $val['f_name'] . '" /></div>' . LF;
$imagelist_output .= ' <div class="jqs_cntdiv"><input class="jqs_imgtitle" type="text" maxlength="255" name="jqs_images[' . $value . '][' . $val['f_id'] . '][1]" value="' . $image_title . '" placeholder="title" />';
$imagelist_output .= ' <textarea id="ta' . $value . $val['f_id'] . '" class="jqs_imgdescr" cols="8" name="jqs_images[' . $value . '][' . $val['f_id'] . '][2]" rows="3" placeholder="description">' . $image_descr . '</textarea>';
$imagelist_output .= ' <span id="' . $value . $val['f_id'] . '" class="jqs_wysiwyg_opener"><HTML></span>';
$imagelist_output .= ' <input class="jqs_imgcss" type="text" maxlength="255" name="jqs_images[' . $value . '][' . $val['f_id'] . '][3]" value="' . $image_css . '" placeholder="css-class" />';
$imagelist_output .= ' </div></div>';
}
}
$return_output = $imagelist_output;
} else {
$return_output = '';
示例8: parsePHPModules
echo '<img src="../img/famfamfam/icon_alert.gif" alt="Warning" class="icon1" />';
echo ' (check information about security risks';
echo '<a href="http://www.php.net/features.safe-mode" target="_blank">';
echo '<img src="../img/famfamfam/icon_info.gif" alt="Security risks" class="icon1" border="0" />';
echo '</a>)';
}
?>
</li>
<?php
}
?>
<li><?php
$_phpinfo = parsePHPModules();
if (isset($_phpinfo['gd']['GD Support']) && $_phpinfo['gd']['GD Support'] == 'enabled' && isset($_phpinfo['gd']['GD Version'])) {
$_phpinfo['gd_version'] = html_specialchars($_phpinfo['gd']['GD Version']);
} else {
$_phpinfo['gd_version'] = 'n.a.';
}
echo '<strong>GD';
if (function_exists('imagegd2')) {
echo '2</strong> ' . $_phpinfo['gd_version'];
echo '<img src="../img/famfamfam/icon_accept.gif" alt="GD2" class="icon1" />';
$is_gd = true;
} elseif (function_exists('imagegd')) {
echo '1</strong> ' . $_phpinfo['gd_version'];
echo '<img src="../img/famfamfam/icon_alert.gif" alt="GD1" class="icon1" />';
echo ' (GD2 is recommend)';
$is_gd = true;
} else {
echo ' not available</strong>';
示例9: implode
} else {
$fmp_data['video_tag']['fallback'] = $fmp_data['fallback'];
$fmp_data['video_tag']['footer'] = '</' . $fmp_data['fmp_set_audio'] . '>';
if (empty($phpwcms['js_in_body'])) {
$fmp_data['video_tag']['footer'] .= $fmp_data['init_videojs'];
} else {
$block['custom_htmlhead']['videojs_' . $fmp_data['id']] = ' ' . $fmp_data['init_videojs'];
}
}
$fmp_data['fallback'] = ' ' . implode(LF . ' ', $fmp_data['video_tag']);
unset($fmp_data['video'], $fmp_data['video_tag']);
// Flash Video Fallback
} elseif ($fmp_data['fallback']) {
// Load SwfObject 2.1
initSwfObject();
// build SwfObject Script Block
$block['custom_htmlhead'][$fmp_data['id']] = ' <script' . SCRIPT_ATTRIBUTE_TYPE . '>' . LF . SCRIPT_CDATA_START . LF;
$block['custom_htmlhead'][$fmp_data['id']] .= $fmp_data['jw_license_info'];
$block['custom_htmlhead'][$fmp_data['id']] .= ' var flashvars_' . $fmp_data['id'] . ' = {' . implode(', ', $fmp_data['flashvars']) . '};' . LF;
$block['custom_htmlhead'][$fmp_data['id']] .= ' var params_' . $fmp_data['id'] . ' = {' . implode(', ', $fmp_data['params']) . '};' . LF;
$block['custom_htmlhead'][$fmp_data['id']] .= ' var attributes_' . $fmp_data['id'] . ' = {' . implode(', ', $fmp_data['attributes']) . '};' . LF;
$block['custom_htmlhead'][$fmp_data['id']] .= ' swfobject.embedSWF("' . $fmp_data['player_swf'] . '", "' . $fmp_data['id'] . '", "' . $fmp_data['fmp_width'] . '", "' . $fmp_data['fmp_height'] . '", "' . $fmp_data['fmp_set_flashversion'] . '", false, flashvars_' . $fmp_data['id'] . ', params_' . $fmp_data['id'] . ', attributes_' . $fmp_data['id'] . ');';
$block['custom_htmlhead'][$fmp_data['id']] .= LF . SCRIPT_CDATA_END . LF . ' </script>';
$fmp_data['fmp_set_skin_html5'] = '';
}
// add rendering result to current listing
$fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'TITLE', html_specialchars($crow['acontent_title']));
$fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'PLAYER', $fmp_data['fallback']);
$CNT_TMP .= str_replace('{ID}', $fmp_data['id'], $fmp_data['fmp_template']);
}
示例10: isset
// Content Type Reference
$content['reference']["list"] = isset($_POST["cimage_list"]) ? $_POST["cimage_list"] : array();
$content['reference']["width"] = intval($_POST["creference_width"]) ? intval($_POST["creference_width"]) : '';
$content['reference']["height"] = intval($_POST["creference_height"]) ? intval($_POST["creference_height"]) : '';
$content['reference']["blockwidth"] = intval($_POST["creference_blockwidth"]) ? intval($_POST["creference_blockwidth"]) : '';
$content['reference']["blockheight"] = intval($_POST["creference_blockheight"]) ? intval($_POST["creference_blockheight"]) : '';
$temp_width = $content['reference']["width"];
$temp_height = $content['reference']["height"];
$content['reference']["space"] = intval($_POST["creference_space"]);
$content['reference']["pos"] = intval($_POST["creference_pos"]);
$content['reference']["border"] = intval($_POST["creference_border"]);
$content['reference']["listborder"] = intval($_POST["creference_listborder"]);
$content['reference']["basis"] = intval($_POST["creference_basis"]);
$content['reference']["caption"] = clean_slweg($_POST["creference_caption"]);
$content['reference']["zoom"] = isset($_POST["creference_zoom"]) ? intval($_POST["creference_zoom"]) : 0;
$content['reference']["text"] = html_specialchars(slweg($_POST["creference_text"]));
$content['reference']["tmpl"] = clean_slweg($_POST["creference_tmpl"]);
$content['reference']['showlist'] = 0;
if (is_array($content['reference']["list"]) && count($content['reference']["list"])) {
$img_sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE (";
$imgx = 0;
foreach ($content['reference']["list"] as $key => $value) {
unset($content['reference']["list"][$key]);
$content['reference']["list"][$key]['img_id'] = intval($value);
if ($imgx) {
$img_sql .= " OR ";
}
$img_sql .= "f_id=" . $content['reference']["list"][$key]['img_id'];
$imgx++;
}
$img_sql .= ");";
示例11: imagelisttable
break;
//center
//center
case 1:
$ecard["chooser"] = imagelisttable($ecard, "0:5:0:0", "center", 1);
break;
//right
}
$ecard["form"] = str_replace('###ECARD_CHOOSER###', $ecard["chooser"], $ecard["form"]);
if (!$ecard["send_err"]) {
$ecard["form"] = preg_replace("/<!--FORM_ERROR_START-->(.*?)<!--FORM_ERROR_END-->/si", '', $ecard["form"]);
}
$ecard["form"] = preg_replace("/name=[\\'|\"]###SENDER_NAME###[\\'|\"]/i", 'name="ecard_sender_name"', $ecard["form"]);
$ecard["form"] = preg_replace("/name=[\\'|\"]###SENDER_EMAIL###[\\'|\"]/i", 'name="ecard_sender_email"', $ecard["form"]);
$ecard["form"] = preg_replace("/name=[\\'|\"]###RECIPIENT_NAME###[\\'|\"]/i", 'name="ecard_recipient_name"', $ecard["form"]);
$ecard["form"] = preg_replace("/name=[\\'|\"]###RECIPIENT_EMAIL###[\\'|\"]/i", 'name="ecard_recipient_email"', $ecard["form"]);
$ecard["form"] = preg_replace("/name=[\\'|\"]###SENDER_MESSAGE###[\\'|\"]/i", 'name="ecard_sender_msg"', $ecard["form"]);
$ecard["form"] = str_replace('###SENDER_NAME###', isset($ecard["sender_name"]) ? html_specialchars($ecard["sender_name"]) : '', $ecard["form"]);
$ecard["form"] = str_replace('###SENDER_EMAIL###', isset($ecard["sender_email"]) ? html_specialchars($ecard["sender_email"]) : '', $ecard["form"]);
$ecard["form"] = str_replace('###RECIPIENT_NAME###', isset($ecard["recipient_name"]) ? html_specialchars($ecard["recipient_name"]) : '', $ecard["form"]);
$ecard["form"] = str_replace('###RECIPIENT_EMAIL###', isset($ecard["recipient_email"]) ? html_specialchars($ecard["recipient_email"]) : '', $ecard["form"]);
$ecard["form"] = str_replace('###SENDER_MESSAGE###', isset($ecard["sender_msg"]) ? html_specialchars($ecard["sender_msg"]) : '', $ecard["form"]);
$ecard["form"] = str_replace('###ECARD_SUBJECT###', isset($ecard["subject"]) ? html_specialchars($ecard["subject"]) : '', $ecard["form"]);
$CNT_TMP .= '<form action="' . html_specialchars($_SERVER['REQUEST_URI']) . '" method="post" name="send_ecard">';
$CNT_TMP .= $ecard["form"];
if ($ecard["selector"]) {
//add hidden form field ecard_chooser
$CNT_TMP .= '<input type="hidden" name="ecard_chooser" value="' . $ecard["selected"] . '" />';
}
$CNT_TMP .= '</form>';
}
示例12: die
* @copyright Copyright (c) 2002-2015, Oliver Georgi
* @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
* @link http://www.phpwcms.de
*
**/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// Content Type Newsletter Subscription
$content["newsletter"]["text"] = html_specialchars(clean_slweg($_POST["cnewsletter_text"]));
$content["newsletter"]["label_email"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_email"]));
$content["newsletter"]["label_name"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_name"]));
$content["newsletter"]["label_subscriptions"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_subscriptions"]));
$content["newsletter"]["all_subscriptions"] = html_specialchars(clean_slweg($_POST["cnewsletter_all_subscriptions"]));
$content["newsletter"]["button_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_button_text"]));
$content["newsletter"]["success_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_success_text"]));
$content["newsletter"]["reg_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_reg_text"]));
$content["newsletter"]["logoff_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_logoff_text"]));
$content["newsletter"]["change_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_change_text"]));
$content["newsletter"]["url1"] = clean_slweg($_POST["cnewsletter_url1"]);
$content["newsletter"]["url2"] = clean_slweg($_POST["cnewsletter_url2"]);
$content['subscription_temp'] = convertStringToArray($_POST['cnewsletter_subscription_left']);
$content["newsletter"]["subscription"] = array();
foreach ($content['subscription_temp'] as $subscr_value) {
$subscr_value = intval($subscr_value);
$content["newsletter"]["subscription"][$subscr_value] = $subscr_value;
}
$content["newsletter"]["pos"] = intval($_POST["cnewsletter_pos"]);
示例13: html_specialchars
}
$CNT_TMP .= $sitemap['before'];
if ($content['struct'][$sitemap['startid']]['acat_nositemap']) {
$sitemap['c'] = '';
if ($sitemap['catclass']) {
$sitemap['c'] .= ' class="' . $sitemap['catclass'];
if ($sitemap['classcount']) {
$sitemap['c'] .= '0';
}
$sitemap['c'] .= '"';
}
if (empty($sitemap["without_parent"])) {
$CNT_TMP .= "<ul" . $sitemap['c'] . "><li" . $sitemap['cat_style'] . ">";
$CNT_TMP .= '<a href="index.php?';
if ($content['struct'][$sitemap['startid']]['acat_alias']) {
$CNT_TMP .= $content['struct'][$sitemap['startid']]['acat_alias'];
} else {
$CNT_TMP .= 'id=' . $sitemap['startid'];
}
$CNT_TMP .= '">' . html_specialchars($content['struct'][$sitemap['startid']]['acat_name']) . '</a>';
}
if ($sitemap["display"]) {
$CNT_TMP .= build_sitemap_articlelist($sitemap['startid'], 0, $sitemap);
}
$CNT_TMP .= build_sitemap($sitemap['startid'], 0, $sitemap);
if (empty($sitemap["without_parent"])) {
$CNT_TMP .= "</li>\n</ul>";
}
}
$CNT_TMP .= $sitemap['after'];
unset($sitemap);
示例14: search
function search()
{
$this->now = now();
if (empty($this->search_words)) {
return NULL;
}
$cnt_ts_livedate = 'IF(UNIX_TIMESTAMP(pc.cnt_livedate) > 0, UNIX_TIMESTAMP(pc.cnt_livedate), pc.cnt_created)';
$cnt_ts_killdate = 'IF(UNIX_TIMESTAMP(pc.cnt_killdate) > 0, UNIX_TIMESTAMP(pc.cnt_killdate), pc.cnt_created + 31536000)';
$sql = 'SELECT pc.*, ';
$sql .= $cnt_ts_livedate . ' AS cnt_ts_livedate, ';
$sql .= $cnt_ts_killdate . ' AS cnt_ts_killdate ';
$sql .= 'FROM ' . DB_PREPEND . 'phpwcms_content pc ';
$sql_where = 'WHERE ';
$sql_where .= 'pc.cnt_status=1 AND ';
$sql_where .= "pc.cnt_module='news' AND ";
$sql_where .= $cnt_ts_livedate . ' < ' . $this->now . ' AND ';
$sql_where .= '(' . $cnt_ts_killdate . ' > ' . $this->now . ' OR cnt_archive_status = 1) ';
$sql_group = '';
// choose by category
if (count($this->search_category)) {
$cat_sql = array();
// and/or/not mode
switch ($this->search_andor) {
case 'AND':
$news_andor = ' AND ';
$news_compare = '=';
break;
case 'NOT':
$news_andor = ' AND ';
$news_compare = '!=';
break;
default:
//OR
$news_andor = ' OR ';
$news_compare = '=';
}
foreach ($this->search_category as $value) {
$cat_sql[] = 'pcat.cat_name' . $news_compare . _dbEscape($value);
}
$sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_categories pcat ON (pcat.cat_type='news' AND pcat.cat_pid=pc.cnt_id) ";
$sql_where .= 'AND (' . implode($news_andor, $cat_sql) . ') ';
$sql_group = 'GROUP BY pc.cnt_id ';
}
// language selection
if (count($this->search_language)) {
$sql_where .= "AND pc.cnt_lang IN ('" . str_replace('#', "','", _dbEscape(implode('#', $this->search_language), false)) . "') ";
}
$sql .= $sql_where;
$sql .= $sql_group;
$sql = trim($sql);
$data = _dbQuery($sql);
$search_target_url_test = strtolower(substr($this->search_target_url, 0, 4));
if ($search_target_url_test !== 'http' && $search_target_url_test !== '{sit') {
// expected alias here or aid=123 or id=123
if ($this->search_highlight) {
$this->search_target_url = rel_url(array('newsdetail' => '___NEWSDETAIL__', 'highlight' => '___HIGHLIGHT__'), array('searchstart', 'searchwords'), $this->search_target_url);
} else {
$this->search_target_url = rel_url(array('newsdetail' => '___NEWSDETAIL__'), array('highlight', 'searchstart', 'searchwords'), $this->search_target_url);
}
$search_replace_newsdetail = true;
} else {
$search_replace_newsdetail = strpos($this->search_target_url, '___NEWSDETAIL__') !== false ? true : false;
$this->search_target_url = html_specialchars($this->search_target_url);
}
if ($this->search_highlight_words && is_array($this->search_highlight_words)) {
$s_highlight_words = rawurlencode(implode(' ', $this->search_highlight_words));
} else {
$s_highlight_words = '';
}
foreach ($data as $value) {
$s_result = array();
$s_text = $value['cnt_text'] . ', ' . $value['cnt_teasertext'] . ', ' . $value['cnt_place'] . ', ';
$s_text .= $value['cnt_subtitle'] . ', ' . $value['cnt_title'];
if ($this->search_username) {
$s_text .= ', ' . $value['cnt_editor'];
}
$value['cnt_object'] = @unserialize($value['cnt_object']);
if (!empty($value['cnt_object']['cnt_searchoff'])) {
continue;
}
if (isset($value['cnt_object']['cnt_category'])) {
if ($this->search_keyword) {
$s_text .= ' ' . $value['cnt_object']['cnt_category'];
}
if ($this->search_caption) {
$s_text .= ' ' . $value['cnt_object']['cnt_image']['caption'];
$s_text .= ' ' . $value['cnt_object']['cnt_files']['caption'];
}
}
$s_text = preg_replace('/<script[^>]*>.*?<\\/script>/is', '', $s_text);
// strip all <script> Tags
$s_text = str_replace(array('~', '|', ':', 'http', '//', '_blank', ' '), ' ', $s_text);
$s_text = clean_search_text($s_text);
preg_match_all('/' . $this->search_words . '/is', $s_text, $s_result);
$s_count = count($s_result[0]);
//set search_result to 0
if ($s_count && SEARCH_TYPE_AND) {
$s_and_or = array();
foreach ($s_result[0] as $svalue) {
$s_and_or[strtolower($svalue)] = 1;
//.........这里部分代码省略.........
示例15: get_cached_image
$thumb_img .= ' alt="' . $caption[1] . '"' . $caption[3] . ' />';
if ($crow["acontent_image"][8]) {
$zoominfo = get_cached_image(array("target_ext" => $crow["acontent_image"][3], "image_name" => $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($crow["acontent_image"][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
if ($zoominfo != false) {
$popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
if (!empty($caption[2][0])) {
$open_link = $caption[2][0];
$return_false = '';
} else {
$open_link = $popup_img;
$return_false = 'return false;';
}
$thumb_img = '<a href="' . $popup_img . '" onclick="window.open(\'' . $open_link . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');" . $return_false . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
}
} else {
if ($caption[2][0]) {
$thumb_img = '<a href="' . $caption[2][0] . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
}
}
}
}
// now render whole recipe
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_QUESTION', html_specialchars($crow["acontent_text"]));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_ANSWER', $crow["acontent_html"]);
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_IMAGE', $thumb_img);
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_CAPTION', $caption[0]);
$crow["acontent_form"]['faq_template'] = str_replace('{FAQ_ID}', $crow['acontent_id'], $crow["acontent_form"]['faq_template']);
$CNT_TMP .= $crow["acontent_form"]['faq_template'];
unset($image, $caption);