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


PHP messages::pmAutoFolders方法代码示例

本文整理汇总了PHP中messages::pmAutoFolders方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::pmAutoFolders方法的具体用法?PHP messages::pmAutoFolders怎么用?PHP messages::pmAutoFolders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在messages的用法示例。


在下文中一共展示了messages::pmAutoFolders方法的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">&laquo;Следующие</a>' : '') . '
                ' . ($bNext && $bPrev ? '&nbsp;|&nbsp;' : '') . '
                ' . ($bNext ? '<a onclick="xajax_PmFolders(' . $sUid . ', ' . $sCurrYear . ', ' . $nNext . ');" href="javascript:void(0);" class="lnk-dot-grey">Предыдущие&raquo;</a>' : '') . '
            </p>';
            }
        }
        if ($sHtml) {
            $objResponse->assign('block-archives', 'innerHTML', $sHtml);
        } else {
            $objResponse->script('$("block-archives").destroy();');
        }
    }
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:59,代码来源:contacts.server.php

示例2: foreach

      <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);"';
                ?>
      <li <?php 
                echo $sClass;
                ?>
><a href="javascript:void(0);" <?php 
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:content.php


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