本文整理汇总了PHP中messages::pmAutoFoldersGetYears方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::pmAutoFoldersGetYears方法的具体用法?PHP messages::pmAutoFoldersGetYears怎么用?PHP messages::pmAutoFoldersGetYears使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类messages
的用法示例。
在下文中一共展示了messages::pmAutoFoldersGetYears方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PmFolders
/**
* Возвращает автоматические папки для массовых рассылок личных менеджеров.
*
* @param string $sUid UID пользователя
* @param string $sYear год создания папки
* @param string $sOffset SQL OFFSET
* @return object xajaxResponse
*/
function PmFolders($sUid = 0, $sYear = 0, $sOffset = 0)
{
session_start();
$objResponse = new xajaxResponse();
if ($_SESSION['uid'] == $sUid) {
$aYears = messages::pmAutoFoldersGetYears($sUid);
$sHtml = '';
if ($aYears) {
$aYears = array_unique(array_merge($aYears, array($sYear)));
$sCurrYear = intval($sYear);
$nOffset = intval($sOffset);
$nFolders = messages::pmAutoFoldersCount($sUid, $sCurrYear);
$aFolders = messages::pmAutoFolders($sUid, $sCurrYear, messages::PM_AUTOFOLDERS_PP, $nOffset);
$bNext = ($nNext = $nOffset + messages::PM_AUTOFOLDERS_PP) + 1 <= $nFolders;
$bPrev = ($nPrev = $nOffset - messages::PM_AUTOFOLDERS_PP) >= 0;
$sHtml = '<h3>Ответы на платные рассылки</h3><ul class="archive-year c">';
sort($aYears);
$aYears = array_reverse($aYears);
foreach ($aYears as $sOne) {
$sClass = $sOne == $sCurrYear ? ' class="active"' : '';
$sClick = $sOne == $sCurrYear ? '' : ' onclick="xajax_PmFolders(' . $sUid . ', ' . $sOne . ', 0);"';
$sHtml .= '<li' . $sClass . '><a href="javascript:void(0);"' . $sClick . '>' . $sOne . '</a></li>';
}
$sHtml .= '</ul><ul class="archive-list c">';
foreach ($aFolders as $aOne) {
$sHtml .= '<li id="pm_folder' . $aOne['id'] . '"' . ($aOne['id'] == $pm_folder ? ' class="active"' : '') . '>
<a href="javascript:void(0);">
<span class="ar-del" onclick="pmFolderDel(' . $sUid . ', ' . $aOne['id'] . ', ' . $sCurrYear . ', ' . $nOffset . ');"></span>
<span class="ar-edit" onclick="xajax_PmFolderEdit(' . $sUid . ', ' . $aOne['id'] . ', ' . $sCurrYear . ', ' . $nOffset . ');"></span>
<span class="archive-date" onclick="pmFolderGo(' . $sCurrYear . ', ' . $aOne['id'] . ', ' . $nOffset . ')">' . date('d/m', strtotime($aOne['post_date'])) . '</span>
<span title="' . reformat($aOne['name'], 64, 0, 1) . '" class="archive-text" onclick="pmFolderGo(' . $sCurrYear . ', ' . $aOne['id'] . ', ' . $nOffset . ')"">' . reformat($aOne['name'], 64, 0, 1) . '<b></b></span>
</a>
</li>';
}
$sHtml .= '</ul>';
if ($nNext || $bPrev) {
$sHtml .= '<p class="archive-prev">
' . ($bPrev ? '<a onclick="xajax_PmFolders(' . $sUid . ', ' . $sCurrYear . ', ' . $nPrev . ');" href="javascript:void(0);" class="lnk-dot-grey">«Следующие</a>' : '') . '
' . ($bNext && $bPrev ? ' | ' : '') . '
' . ($bNext ? '<a onclick="xajax_PmFolders(' . $sUid . ', ' . $sCurrYear . ', ' . $nNext . ');" href="javascript:void(0);" class="lnk-dot-grey">Предыдущие»</a>' : '') . '
</p>';
}
}
if ($sHtml) {
$objResponse->assign('block-archives', 'innerHTML', $sHtml);
} else {
$objResponse->script('$("block-archives").destroy();');
}
}
return $objResponse;
}
示例2: if
<div class="b-chat__body b-chat__body_padtb_3_0">
<span class="b-chat__icon b-chat__icon_main"></span>
</div>
</div><div
class="b-layout__txt b-layout__txt_inline-block b-layout__txt_padleft_5 b-layout__txt_lineheight_15 b-layout__txt_valign_top">Быстрочат <span id="qchat_link_wrapper"><?php if (!(int)$_SESSION["chat"] ) {?>отключен<?} else {?>включен<?} ?></span><br /><a class="b-layout__link" href="javascript:void(0);" onclick="<?if (!(int)$_SESSION["chat"] ) {?>quickchat_on();<?} else {?>quickchat_off();<?} ?> return false;" id="qchat_swicth"><?if (!(int)$_SESSION["chat"] ) {?>Включить<?} else { ?>Отключить<?} ?></a></div>
<div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_padtop_5 b-layout__txt_padbot_20">Быстрочат позволяет быстро отвечать на сообщения прямо на той странице, где вы находитесь. <a class="b-layout__link" href="https://feedback.fl.ru">Подробнее о быстрочате</a></div>
</div>
*/
?>
<?php
/* Автоматические папки для массовых рассылок личных менеджеров */
?>
<?php
$sUid = $_SESSION['uid'];
if (in_array($sUid, $aPmUserUids) || SERVER === 'local' || SERVER === 'beta' || SERVER === 'alpha') {
$aYears = messages::pmAutoFoldersGetYears($sUid);
if ($aYears) {
$sCurrYear = $pm_year ? $pm_year : $aYears[0];
$nFolders = messages::pmAutoFoldersCount($sUid, $sCurrYear);
$nOffset = $pm_offset ? $pm_offset : 0;
$aFolders = messages::pmAutoFolders($sUid, $sCurrYear, messages::PM_AUTOFOLDERS_PP, $nOffset);
$bNext = ($nNext = $nOffset + messages::PM_AUTOFOLDERS_PP) + 1 <= $nFolders;
$bPrev = ($nPrev = $nOffset - messages::PM_AUTOFOLDERS_PP) > 0;
?>
<div id="block-archives">
<h3>Ответы на платные рассылки</h3>
<ul class="archive-year c">
<?php
foreach ($aYears as $sOne) {
$sClass = $sOne == $sCurrYear ? ' class="active"' : '';
$sClick = $sOne == $sCurrYear ? '' : ' onclick="xajax_PmFolders(' . $sUid . ', ' . $sOne . ', 0);"';