本文整理汇总了PHP中htmlspecialchars_adv函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlspecialchars_adv函数的具体用法?PHP htmlspecialchars_adv怎么用?PHP htmlspecialchars_adv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlspecialchars_adv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serviceKeywordsCloud
/**
* Get keywords cloud.
* @param $sObject metatgs object to get keywords cloud for
* @param $mixedSection search section to refer when keyword is clicked, set the same as $sObject to show content withing the module only, it can be one value or array of values, leave empty to show all possible content upon keyword click
* @param $iMaxCount number of tags in keywords cloud, by default @see BX_METATAGS_KEYWORDS_IN_CLOUD
* @return tags cloud HTML string
*/
public function serviceKeywordsCloud($sObject, $mixedSection, $iMaxCount = BX_METATAGS_KEYWORDS_IN_CLOUD)
{
$o = BxDolMetatags::getObjectInstance($sObject);
$aKeywords = $o->keywordsPopularList($iMaxCount);
if (!$aKeywords) {
return '';
}
ksort($aKeywords, SORT_LOCALE_STRING);
$iFontDiff = floor($this->_iKeywordsCloudFontSizeMax - $this->_iKeywordsCloudFontSizeMin);
$iMinRating = min($aKeywords);
$iMaxRating = max($aKeywords);
$iRatingDiff = $iMaxRating - $iMinRating;
$iRatingDiff = $iRatingDiff == 0 ? 1 : $iRatingDiff;
$sSectionPart = '';
if (is_array($mixedSection)) {
$sSectionPart = '§ion[]=' . implode('§ion[]=', $mixedSection);
} elseif (is_string($mixedSection)) {
$sSectionPart = '§ion[]=' . $mixedSection;
}
$aUnits = array();
foreach ($aKeywords as $sKeyword => $iCount) {
$aUnits[] = array('size' => $this->_iKeywordsCloudFontSizeMin + floor($iFontDiff * (($iCount - $iMinRating) / $iRatingDiff)), 'href' => BX_DOL_URL_ROOT . 'searchKeyword.php?type=keyword&keyword=' . rawurlencode($sKeyword) . $sSectionPart, 'count' => $iCount, 'keyword' => htmlspecialchars_adv($sKeyword));
}
$aVars = array('bx_repeat:units' => $aUnits);
$this->addCssJs();
return BxDolTemplate::getInstance()->parseHtmlByName('metatags_keywords_cloud.html', $aVars);
}
示例2: getCategoriesView
function getCategoriesView($aTotalCategories, $sHrefTempl, $iColumns)
{
global $oSysTemplate;
if (empty($aTotalCategories)) {
return MsgBox(_t('_Empty'));
}
if (!$iColumns) {
$iColumns = 1;
}
$iCount = count($aTotalCategories);
$iRowCount = floor($iCount / $iColumns) + ($iCount % $iColumns ? 1 : 0);
$iWidthPr = floor(100 / $iColumns);
$i = 0;
$sCode = '<div class="categories_wrapper bx-def-bc-margin bx-def-font-large">';
foreach ($aTotalCategories as $sCategory => $iCatCount) {
if (!($i % $iRowCount)) {
if ($i) {
$sCode .= '</div>';
}
$sCode .= '<div class="categories_col" style="width: ' . $iWidthPr . '%">';
}
$aUnit['catHref'] = str_replace('{tag}', rawurlencode(title2uri($sCategory)), $sHrefTempl);
$aUnit['category'] = htmlspecialchars_adv($sCategory);
$aUnit['count'] = $iCatCount;
if ($this->_sCategTmplContent) {
$sCode .= $oSysTemplate->parseHtmlByContent($this->_sCategTmplContent, $aUnit);
} else {
$sCode .= $oSysTemplate->parseHtmlByName($this->_sCategTmplName, $aUnit);
}
$i++;
}
$sCode .= '</div></div>';
return $sCode;
}
示例3: getTagsView
function getTagsView($aTotalTags, $sHrefTempl)
{
global $oTemplConfig;
global $oSysTemplate;
if (empty($aTotalTags)) {
return MsgBox(_t('_Empty'));
}
$iMinFontSize = $oTemplConfig->iTagsMinFontSize;
$iMaxFontSize = $oTemplConfig->iTagsMaxFontSize;
$iFontDiff = $iMaxFontSize - $iMinFontSize;
$iMinRating = min($aTotalTags);
$iMaxRating = max($aTotalTags);
$iRatingDiff = $iMaxRating - $iMinRating;
$iRatingDiff = $iRatingDiff == 0 ? 1 : $iRatingDiff;
$sCode = '<div class="tags_wrapper">';
$aUnit = array();
foreach ($aTotalTags as $sTag => $iCount) {
$aUnit['tagSize'] = $iMinFontSize + round($iFontDiff * (($iCount - $iMinRating) / $iRatingDiff));
$aUnit['tagHref'] = str_replace('{tag}', urlencode(title2uri($sTag)), $sHrefTempl);
$aUnit['countCapt'] = _t('_Count');
$aUnit['countNum'] = $iCount;
$aUnit['tag'] = htmlspecialchars_adv($sTag);
if ($this->_sTagTmplContent) {
$sCode .= $oSysTemplate->parseHtmlByContent($this->_sTagTmplContent, $aUnit);
} else {
$sCode .= $oSysTemplate->parseHtmlByName($this->_sTagTmplName, $aUnit);
}
}
$sCode .= '</div>';
$sCode .= '<div class="clear_both"></div>';
return $sCode;
}
示例4: DesignBoxAdmin
function DesignBoxAdmin($sTitle, $sContent, $mixedTopItems = '', $sBottomItems = '', $iIndex = 1)
{
if (is_array($mixedTopItems)) {
$mixedButtons = array();
foreach ($mixedTopItems as $sId => $aAction) {
$mixedButtons[] = array('id' => $sId, 'title' => htmlspecialchars_adv(_t($aAction['title'])), 'class' => isset($aAction['class']) ? ' class="' . $aAction['class'] . '"' : '', 'icon' => isset($aAction['icon']) ? '<img' . $sClass . ' src="' . $aAction['icon'] . '" />' : '', 'href' => isset($aAction['href']) ? ' href="' . htmlspecialchars_adv($aAction['href']) . '"' : '', 'target' => isset($aAction['target']) ? ' target="' . $aAction['target'] . '"' : '', 'on_click' => isset($aAction['onclick']) ? ' onclick="' . $aAction['onclick'] . '"' : '', 'bx_if:hide_active' => array('condition' => !isset($aAction['active']) || $aAction['active'] != 1, 'content' => array()), 'bx_if:hide_inactive' => array('condition' => isset($aAction['active']) && $aAction['active'] == 1, 'content' => array()));
}
} else {
$mixedButtons = $mixedTopItems;
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_' . (int) $iIndex . '.html', array('title' => $sTitle, 'bx_repeat:actions' => $mixedButtons, 'content' => $sContent, 'bottom_items' => $sBottomItems));
}
示例5: getBuilderPage
function getBuilderPage()
{
$aPagesForTemplate = array(array('value' => '', 'title' => _t('_adm_txt_pb_select_page'), 'selected' => empty($this->_sPage) ? 'selected="selected"' : ''));
$aPages = $this->_getPages();
foreach ($aPages as $r) {
$aPagesForTemplate[] = array('value' => $r['page'], 'title' => htmlspecialchars_adv(_t($r['title'])), 'selected' => $r['page'] == $this->_sPage ? 'selected="selected"' : '');
}
$sPagesSelector = $GLOBALS['oAdmTemplate']->parseHtmlByName('mobile_builder_pages_selector.html', array('bx_repeat:pages' => $aPagesForTemplate, 'url' => bx_html_attribute(BX_DOL_URL_ADMIN . 'mobileBuilder.php')));
$sPagesSelector = $GLOBALS['oAdmTemplate']->parseHtmlByName('designbox_top_controls.html', array('top_controls' => $sPagesSelector));
if (empty($this->_sPage)) {
$this->addExternalResources();
}
return $sPagesSelector . (!empty($this->_sPage) ? parent::getBuilderPage() : MsgBox(_t('_Empty')));
}
示例6: PageCodeTemplates
function PageCodeTemplates($sResult)
{
$a = get_templates_array(true);
$aTemplates = array();
foreach ($a as $k => $r) {
$aTemplates[] = array('key' => $k, 'name' => htmlspecialchars_adv($r['name']), 'ver' => htmlspecialchars_adv($r['ver']), 'vendor' => htmlspecialchars_adv($r['vendor']), 'desc' => $r['desc'], 'bx_if:preview' => array('condition' => (bool) $r['preview'], 'content' => array('img' => $r['preview'])), 'bx_if:no_preview' => array('condition' => !$r['preview'], 'content' => array()), 'bx_if:default' => array('condition' => $k == getParam('template'), 'content' => array()), 'bx_if:make_default' => array('condition' => $k != getParam('template'), 'content' => array('key' => $k)), 'bx_if:delete' => array('condition' => $k != getParam('template') && $k != 'uni' && $k != 'alt', 'content' => array('key' => $k)));
}
$s = $sResult ? MsgBox($sResult, 10) : '';
$s .= $GLOBALS['oAdmTemplate']->parseHtmlByName('templates.html', array('bx_repeat:templates' => $aTemplates));
$sCode = DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems'], '', 11);
if ('on' == getParam('feeds_enable')) {
$sCode = $sCode . DesignBoxAdmin(_t('_adm_box_cpt_design_templates'), '<div class="RSSAggrCont" rssid="boonex_unity_market_templates" rssnum="5" member="0">' . $GLOBALS['oFunctions']->loadingBoxInline() . '</div>');
}
$GLOBALS['oAdmTemplate']->addJsTranslation(array('_Are_you_sure'));
return $sCode;
}
示例7: saveMemSettings
function saveMemSettings()
{
$aDigit = array('expire_notification_days', 'promotion_membership_days');
$aCheck = array('expire_notify_once', 'enable_promotion_membership', 'free_mode');
foreach ($aDigit as $i => $sVal) {
if ($_POST[$sVal]) {
setparam($sVal, htmlspecialchars_adv($_POST[$sVal]));
}
}
foreach ($aCheck as $i => $sVal) {
if ('on' == $_POST[$sVal]) {
setparam($sVal, 'on');
} else {
setparam($sVal, '');
}
}
}
示例8: getGeneral
protected function getGeneral()
{
$sJsObject = $this->getPageJsObject();
$oTemplate = BxDolStudioTemplate::getInstance();
$sResult = '';
$sTemplate = getParam('template');
$aTemplates = get_templates_array(true, false);
$aTmplVarsTemplates = array();
foreach ($aTemplates as $sUri => $aTemplate) {
$sIcon = $this->getModuleIcon($aTemplate, 'store');
$bIcon = strpos($sIcon, '.') === false;
$aTmplVarsTemplates[] = array('uri' => $sUri, 'title' => htmlspecialchars_adv($aTemplate['title']), 'version' => htmlspecialchars_adv($aTemplate['version']), 'vendor' => htmlspecialchars_adv($aTemplate['vendor']), 'bx_if:icon' => array('condition' => $bIcon, 'content' => array('icon' => $sIcon)), 'bx_if:image' => array('condition' => !$bIcon, 'content' => array('icon_url' => $sIcon)), 'bx_if:default' => array('condition' => $sUri == $sTemplate, 'content' => array()), 'bx_if:make_default' => array('condition' => $sUri != $sTemplate, 'content' => array('js_object' => $sJsObject, 'uri' => $sUri)));
}
$sContent = $sResult ? MsgBox($sResult, 10) : '';
$sContent .= $oTemplate->parseHtmlByName('templates.html', array('bx_repeat:templates' => $aTmplVarsTemplates));
return $oTemplate->parseHtmlByName('designer.html', array('js_object' => $this->getPageJsObject(), 'content' => $sContent));
}
示例9: get
/**
* Get member info
*/
public function get($aData)
{
switch ($this->_sObject) {
case 'sys_username':
return $aData['NickName'];
case 'sys_full_name':
return htmlspecialchars_adv($aData['FullName'] ? $aData['FullName'] : $aData['NickName']);
case 'sys_first_name':
return $aData['FirstName'] ? $aData['FirstName'] : $aData['NickName'];
case 'sys_first_name_last_name':
return $aData['FirstName'] || $aData['LastName'] ? $aData['FirstName'] . ' ' . $aData['LastName'] : $aData['NickName'];
case 'sys_last_name_firs_name':
return $aData['FirstName'] || $aData['LastName'] ? $aData['LastName'] . ' ' . $aData['FirstName'] : $aData['NickName'];
case 'sys_status_message':
return $aData['UserStatusMessage'];
case 'sys_age_sex':
$s = ('0000-00-00' == $aData['DateOfBirth'] ? '' : _t('_y/o', age($aData['DateOfBirth'])) . ' ') . _t('_' . $aData['Sex']);
if ($aData['Couple'] > 0) {
$aData2 = getProfileInfo($aData['Couple']);
$s .= '<br />' . ('0000-00-00' == $aData2['DateOfBirth'] ? '' : _t('_y/o', age($aData2['DateOfBirth'])) . ' ') . _t('_' . $aData2['Sex']);
}
return $s;
case 'sys_location':
return (empty($aData['City']) ? '' : htmlspecialchars_adv($aData['City']) . ', ') . _t($GLOBALS['aPreValues']['Country'][$aData['Country']]['LKey']);
case 'sys_avatar_2x':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . 'b' . BX_AVA_EXT : '';
case 'sys_avatar':
case 'sys_avatar_icon_2x':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . BX_AVA_EXT : '';
case 'sys_avatar_icon':
if (!$aData || !@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
return false;
}
return $aData['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aData['Avatar'] . 'i' . BX_AVA_EXT : '';
}
}
示例10: serviceIsSpam
/**
* Check text for spam.
* First it check if IP is whitelisted(or under cron execution or user is admin) - for whitelisted IPs check for spam isn't performed,
* then it checks URLs found in text for DNSURI black lists (@see BxAntispamDNSURIBlacklists),
* then it checks text in Akismet service (@see BxAntispamAkismet).
* It can send report if spam is found or tries to inform caller to block the content (depending on configuration).
*
* @param $sContent content to check for spam
* @param $sIp IP address of content poster
* @param $isStripSlashes slashes parameter:
* BX_SLASHES_AUTO - automatically detect magic_quotes_gpc setting
* BX_SLASHES_NO_ACTION - do not perform any action with slashes
* @return true if spam detected and content shouln't be recorded, false if content should be processed as usual.
*/
public function serviceIsSpam($sContent, $sIp = '', $isStripSlashes = BX_SLASHES_AUTO)
{
if (defined('BX_DOL_CRON_EXECUTE') || isAdmin()) {
return false;
}
if ($this->serviceIsIpWhitelisted($sIp)) {
return false;
}
if (get_magic_quotes_gpc() && $isStripSlashes == BX_SLASHES_AUTO) {
$sContent = stripslashes($sContent);
}
$bRet = false;
if ('on' == $this->_oConfig->getAntispamOption('uridnsbl_enable')) {
$oDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $this->_aModule);
if ($oDNSURIBlacklists->isSpam($sContent)) {
$oDNSURIBlacklists->onPositiveDetection($sContent);
$bRet = true;
}
}
if (!$bRet && 'on' == $this->_oConfig->getAntispamOption('akismet_enable')) {
$oAkismet = bx_instance('BxAntispamAkismet', array(), $this->_aModule);
if ($oAkismet->isSpam($sContent)) {
$oAkismet->onPositiveDetection($sContent);
$bRet = true;
}
}
if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_report')) {
$oProfile = BxDolProfile::getInstance();
$aPlus = array('SpammerUrl' => $oProfile->getUrl(), 'SpammerNickName' => $oProfile->getDisplayName(), 'Page' => htmlspecialchars_adv($_SERVER['PHP_SELF']), 'Get' => print_r($_GET, true), 'Post' => print_r($_POST, true), 'SpamContent' => htmlspecialchars_adv($sContent));
bx_import('BxDolEmailTemplates');
$aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('bx_antispam_spam_report', $aPlus);
if (!$aTemplate) {
trigger_error('Email template or translation missing: bx_antispam_spam_report', E_USER_ERROR);
}
sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body']);
}
if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_block')) {
return true;
}
return false;
}
示例11: table
function table($a, $sHighlight = '')
{
if ($this->_isAjaxOutput) {
$table = array();
foreach ($a as $r) {
if (!$table) {
$table[] = array_keys($r);
}
$rr = array_values($r);
if (false !== strpos($rr[0], ' ')) {
$rr[0] = str_replace(' ', '-', $rr[0]);
}
$table[] = $rr;
}
return $table;
}
$sId = md5(time() . rand());
$s = '<table id="' . $sId . '" class="bx_profiler_table">';
$th = '';
foreach ($a as $r) {
if (!$th) {
foreach ($r as $k => $v) {
$th .= "<th>{$k}</th>";
}
$s .= "<thead><tr>{$th}</tr></thead><tbody>";
}
$s .= '<tr>';
foreach ($r as $k => $v) {
$sClass = '';
if ($sHighlight && $k == $sHighlight) {
$sClass = ' class="highlight" ';
}
$s .= "<td {$sClass}>" . htmlspecialchars_adv($v) . "</td>";
}
$s .= '</tr>';
}
$s .= '</tbody></table>';
$s .= '<script type="text/javascript">$(\'#' . $sId . '\').tablesorter();</script>';
return $s;
}
示例12: showEditForm
function showEditForm($aItem)
{
?>
<form
onsubmit="if( this.form_input_html ) tinyMCE.execCommand('mceRemoveControl', false, 'form_input_html'); saveItemByPost( <?php
echo $aItem['ID'];
?>
); return false;"
onreset="if( this.form_input_html ) tinyMCE.execCommand('mceRemoveControl', false, 'form_input_html'); hideEditForm(); return false;"
name="formItemEdit" id="formItemEdit">
<table class="popup_form_wrapper">
<tr>
<td class="corner"><img src="images/op_cor_tl.png" /></td>
<td class="side_ver"><img src="images/spacer.gif" /></td>
<td class="corner"><img src="images/op_cor_tr.png" /></td>
</tr>
<tr>
<td class="side"><img src="images/spacer.gif" /></td>
<td class="container">
<div class="edit_item_table_cont">
<table class="edit_item_table" id="tmp_id_name" >
<tr>
<td class="form_label">System Name:</td>
<td>
<input type="text" class="form_input_text" name="Title" value="<?php
echo $aItem['Title'];
?>
" />
</td>
</tr>
<tr>
<td class="form_label">Description:</td>
<td><?php
echo $aItem['Desc'];
?>
</td>
</tr>
<tr>
<td class="form_label">Language Key:</td>
<td>
<input type="text" class="form_input_text" name="Caption" value="<?php
echo $aItem['Caption'];
?>
" />
</td>
</tr>
<tr>
<td class="form_label">Default Name:</td>
<td>
<input type="text" class="form_input_text" name="LangCaption" value="<?php
echo _t($aItem['Caption']);
?>
" />
</td>
</tr>
<tr>
<td class="form_label">Visible for:</td>
<td>
<input type="checkbox" name="Visible_non" value="on" <?php
echo strpos($aItem['Visible'], 'non') === false ? '' : 'checked="checked"';
?>
/> Guest
<input type="checkbox" name="Visible_memb" value="on" <?php
echo strpos($aItem['Visible'], 'memb') === false ? '' : 'checked="checked"';
?>
/> Member
</td>
</tr>
<?php
if ($aItem['Func'] == 'Echo') {
?>
<tr>
<td class="form_label">HTML-content:</td>
<td> </td>
</tr>
<tr>
<td class="form_colspan" colspan="2">
<textarea class="form_input_html" id="form_input_html" name="Content"><?php
echo htmlspecialchars_adv($aItem['Content']);
?>
</textarea>
</td>
</tr>
<?php
} elseif ($aItem['Func'] == 'RSS') {
list($sUrl, $iNum) = explode('#', $aItem['Content']);
$iNum = (int) $iNum;
?>
<tr>
<td class="form_label">Url of RSS feed:</td>
<td><input type="text" class="form_input_text" name="Url" value="<?php
echo $sUrl;
?>
" /></td>
</tr>
<tr>
<td class="form_label">Number of RSS items (0 - all):</td>
<td><input type="text" class="form_input_text" name="Num" value="<?php
//.........这里部分代码省略.........
示例13: GenPostPage
/**
* Generate User`s Blog Post Page
*
* @return HTML presentation of data
*/
function GenPostPage($iParamPostID = 0)
{
$this->iViewingPostID = $iParamPostID > 0 ? $iParamPostID : $this->iViewingPostID;
list($sCode, $bShowBlocks) = $this->getViewingPostInfo();
if (empty($this->aViewingPostInfo)) {
header("HTTP/1.1 404 Not Found");
$sMsg = _t('_sys_request_page_not_found_cpt');
$GLOBALS['oTopMenu']->setCustomSubHeader($sMsg);
return DesignBoxContent($sMsg, MsgBox($sMsg), 1);
}
$iBlogLimitChars = (int) getParam('max_blog_preview');
$sPostText = htmlspecialchars_adv(mb_substr(trim(strip_tags($this->aViewingPostInfo['PostText'])), 0, $iBlogLimitChars));
$this->_oTemplate->setPageDescription($sPostText);
if (mb_strlen($this->aViewingPostInfo['Tags']) > 0) {
$this->_oTemplate->addPageKeywords($this->aViewingPostInfo['Tags']);
}
$sRetHtml .= $sCode;
if ($bShowBlocks) {
$oBPV = new BxDolBlogsPageView($this);
$sRetHtml .= $oBPV->getCode();
}
return $sRetHtml;
}
示例14: actionBrowse
function actionBrowse($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
{
$bAlbumView = false;
if ($sParamName == 'album' && $sParamValue1 == 'owner') {
$bAlbumView = true;
$aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sParamValue, 'owner' => getID($sParamValue2)));
if (empty($aAlbumInfo)) {
$this->_oTemplate->displayPageNotFound();
} else {
if (!$this->oAlbumPrivacy->check('album_view', $aAlbumInfo['ID'], $this->_iProfileId)) {
$sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
$sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
$this->aPageTmpl['header'] = $sKey;
$this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode));
return;
}
$GLOBALS['oTopMenu']->setCustomSubHeader(_t('_sys_album_x', $aAlbumInfo['Caption']));
$GLOBALS['oTopMenu']->setCustomSubHeaderUrl(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/album/' . $aAlbumInfo['Uri'] . '/owner/' . $sParamValue2);
$GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_' . $this->_oConfig->getMainPrefix()) => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'home/', $aAlbumInfo['Caption'] => ''));
if ($aAlbumInfo['Owner'] == $this->_iProfileId && $sParamValue2 === getUsername($this->_iProfileId)) {
$this->actionAlbumsViewMy('main_objects', $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
return;
}
}
}
if ('calendar' == $sParamName) {
$sParamValue = (int) $sParamValue;
$sParamValue1 = (int) $sParamValue1;
$sParamValue2 = (int) $sParamValue2;
}
$sClassName = $this->_oConfig->getClassPrefix() . 'Search';
bx_import('Search', $this->_aModule);
$oSearch = new $sClassName($sParamName, $sParamValue, $sParamValue1, $sParamValue2);
$sRss = bx_get('rss');
if ($sRss !== false && $sRss) {
$oSearch->aCurrent['paginate']['perPage'] = 10;
header('Content-Type: text/xml; charset=UTF-8');
echo $oSearch->rss();
exit;
}
$sTopPostfix = isset($oSearch->aCurrent['restriction'][$sParamName]) || $oSearch->aCurrent['sorting'] == $sParamName ? $sParamName : 'all';
$sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_top_menu_' . $sTopPostfix);
if (!empty($sParamValue) && isset($oSearch->aCurrent['restriction'][$sParamName])) {
$sParamValue = $this->getBrowseParam($sParamName, $sParamValue);
$oSearch->aCurrent['restriction'][$sParamName]['value'] = $sParamValue;
$sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, htmlspecialchars_adv(process_pass_data($sParamValue)));
}
if ($bAlbumView) {
$oSearch->aCurrent['restriction']['allow_view']['value'] = array($aAlbumInfo['AllowAlbumView']);
$sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_browse_by_' . $sParamName, $aAlbumInfo['Caption']);
$this->_oTemplate->setPageDescription(substr(strip_tags($aAlbumInfo['Description']), 0, 255));
} else {
$oSearch->aCurrent['restriction']['not_allow_view']['value'] = array(BX_DOL_PG_HIDDEN);
}
$oSearch->aCurrent['paginate']['perPage'] = (int) $this->_oConfig->getGlParam('number_all');
$sCode = $oSearch->displayResultBlock();
if ($oSearch->aCurrent['paginate']['totalNum'] > 0) {
$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.sys_file_search_unit');
$sCode = $this->_oTemplate->parseHtmlByName('default_padding_thd.html', array('content' => $sCode));
$aAdd = array($sParamName, $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
foreach ($aAdd as $sValue) {
if (strlen($sValue) > 0) {
$sArg .= '/' . rawurlencode($sValue);
} else {
break;
}
}
$sLink = $this->_oConfig->getBaseUri() . 'browse' . $sArg;
$oPaginate = new BxDolPaginate(array('page_url' => $sLink . '&page={page}&per_page={per_page}', 'count' => $oSearch->aCurrent['paginate']['totalNum'], 'per_page' => $oSearch->aCurrent['paginate']['perPage'], 'page' => $oSearch->aCurrent['paginate']['page'], 'on_change_per_page' => 'document.location=\'' . BX_DOL_URL_ROOT . $sLink . '&page=1&per_page=\' + this.value;'));
$sPaginate = $oPaginate->getPaginate();
} else {
$sCode = MsgBox(_t('_Empty'));
}
if ($sParamName == 'calendar') {
$sCaption = _t('_' . $this->_oConfig->getMainPrefix() . '_caption_browse_by_day') . ': ' . getLocaleDate(strtotime("{$sParamValue}-{$sParamValue1}-{$sParamValue2}"), BX_DOL_LOCALE_DATE_SHORT);
}
$aMenu = array();
$sCode = DesignBoxContent($sCaption, $sCode . $sPaginate, 1, $this->_oTemplate->getExtraTopMenu($aMenu, BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri()));
if ($bAlbumView) {
$sCode = $this->getAlbumPageView($aAlbumInfo, $sCode);
}
$this->aPageTmpl['css_name'] = array('browse.css');
$this->aPageTmpl['header'] = $sCaption;
$this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode));
}
示例15: _error
function _error($sType, $sParam1 = '', $sParam2 = '')
{
header('Status: 404 Not Found');
header('HTTP/1.0 404 Not Found');
global $_page;
global $_page_cont;
$iIndex = 13;
$_page['name_index'] = $iIndex;
$_page['header'] = _t("_sys_request_" . $sType . "_not_found_cpt");
$_page_cont[$iIndex]['page_main_code'] = MsgBox(_t("_sys_request_" . $sType . "_not_found_cnt", htmlspecialchars_adv($sParam1), htmlspecialchars_adv($sParam2)));
PageCode();
exit;
}