• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP message_get_history函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中message_get_history函数的典型用法代码示例。如果您正苦于以下问题:PHP message_get_history函数的具体用法?PHP message_get_history怎么用?PHP message_get_history使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了message_get_history函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: print_user_picture

echo '<td align="center">';
echo print_user_picture($user1->id, SITEID, $user1->picture, 100, true, true, 'userwindow') . '<br />';
echo fullname($user1);
echo '</td>';
echo '<td align="center">';
echo '<img src="' . $CFG->wwwroot . '/pix/t/left.gif" alt="' . get_string('from') . '" />';
echo '<img src="' . $CFG->wwwroot . '/pix/t/right.gif" alt="' . get_string('to') . '" />';
echo '</td>';
echo '<td align="center">';
echo print_user_picture($user2->id, SITEID, $user2->picture, 100, true, true, 'userwindow') . '<br />';
echo fullname($user2);
echo '</td>';
echo '</tr></table>';
print_simple_box_end();
/// Get all the messages and print them
if ($messages = message_get_history($user1, $user2)) {
    $current->mday = '';
    $current->month = '';
    $current->year = '';
    $messagedate = get_string('strftimetime');
    $blockdate = get_string('strftimedaydate');
    foreach ($messages as $message) {
        $date = usergetdate($message->timecreated);
        if ($current->mday != $date['mday'] | $current->month != $date['month'] | $current->year != $date['year']) {
            $current->mday = $date['mday'];
            $current->month = $date['month'];
            $current->year = $date['year'];
            echo '<a name="' . $date['year'] . $date['mon'] . $date['mday'] . '"></a>';
            print_heading(userdate($message->timecreated, $blockdate), 'center', 4);
        }
        if ($message->useridfrom == $user1->id) {
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:history.php


示例2: message_print_message_history

/**
 * Print the message history between two users
 * @param object $user1 the current user
 * @param object $user2 the other user
 * @param string $search search terms to highlight
 * @param int $messagelimit maximum number of messages to return
 * @param string $messagehistorylink the html for the message history link or false
 * @param bool $viewingnewmessages are we currently viewing new messages?
 */
function message_print_message_history($user1,$user2,$search='',$messagelimit=0, $messagehistorylink=false, $viewingnewmessages=false) {
    global $CFG, $OUTPUT;

    echo $OUTPUT->box_start('center');
    echo html_writer::start_tag('table', array('cellpadding' => '10', 'class' => 'message_user_pictures'));
    echo html_writer::start_tag('tr');

    echo html_writer::start_tag('td', array('align' => 'center', 'id' => 'user1'));
    echo $OUTPUT->user_picture($user1, array('size' => 100, 'courseid' => SITEID));
    echo html_writer::tag('div', fullname($user1), array('class' => 'heading'));
    echo html_writer::end_tag('td');

    echo html_writer::start_tag('td', array('align' => 'center'));
    echo html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/left'), 'alt' => get_string('from')));
    echo html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/right'), 'alt' => get_string('to')));
    echo html_writer::end_tag('td');

    echo html_writer::start_tag('td', array('align' => 'center', 'id' => 'user2'));
    echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID));
    echo html_writer::tag('div', fullname($user2), array('class' => 'heading'));

    if (isset($user2->iscontact) && isset($user2->isblocked)) {
        $incontactlist = $user2->iscontact;
        $isblocked = $user2->isblocked;

        $script = null;
        $text = true;
        $icon = false;

        $strcontact = message_get_contact_add_remove_link($incontactlist, $isblocked, $user2, $script, $text, $icon);
        $strblock   = message_get_contact_block_link($incontactlist, $isblocked, $user2, $script, $text, $icon);
        $useractionlinks = $strcontact.'&nbsp;|'.$strblock;

        echo html_writer::tag('div', $useractionlinks, array('class' => 'useractionlinks'));
    }

    echo html_writer::end_tag('td');
    echo html_writer::end_tag('tr');
    echo html_writer::end_tag('table');
    echo $OUTPUT->box_end();

    if (!empty($messagehistorylink)) {
        echo $messagehistorylink;
    }

    /// Get all the messages and print them
    if ($messages = message_get_history($user1, $user2, $messagelimit, $viewingnewmessages)) {
        $tablecontents = '';

        $current = new stdClass();
        $current->mday = '';
        $current->month = '';
        $current->year = '';
        $messagedate = get_string('strftimetime');
        $blockdate   = get_string('strftimedaydate');
        foreach ($messages as $message) {
            if ($message->notification) {
                $notificationclass = ' notification';
            } else {
                $notificationclass = null;
            }
            $date = usergetdate($message->timecreated);
            if ($current->mday != $date['mday'] | $current->month != $date['month'] | $current->year != $date['year']) {
                $current->mday = $date['mday'];
                $current->month = $date['month'];
                $current->year = $date['year'];

                $datestring = html_writer::empty_tag('a', array('name' => $date['year'].$date['mon'].$date['mday']));
                $tablecontents .= html_writer::tag('div', $datestring, array('class' => 'mdl-align heading'));

                $tablecontents .= $OUTPUT->heading(userdate($message->timecreated, $blockdate), 4, 'mdl-align');
            }

            $formatted_message = $side = null;
            if ($message->useridfrom == $user1->id) {
                $formatted_message = message_format_message($message, $messagedate, $search, 'me');
                $side = 'left';
            } else {
                $formatted_message = message_format_message($message, $messagedate, $search, 'other');
                $side = 'right';
            }
            $tablecontents .= html_writer::tag('div', $formatted_message, array('class' => "mdl-left $side $notificationclass"));
        }

        echo html_writer::nonempty_tag('div', $tablecontents, array('class' => 'mdl-left messagehistory'));
    } else {
        echo html_writer::nonempty_tag('div', '('.get_string('nomessagesfound', 'message').')', array('class' => 'mdl-align messagehistory'));
    }
}
开发者ID:nfreear,项目名称:moodle,代码行数:98,代码来源:lib.php


示例3: message_print_message_history

/**
 * Print the message history between two users
 *
 * @param object $user1 the current user
 * @param object $user2 the other user
 * @param string $search search terms to highlight
 * @param int $messagelimit maximum number of messages to return
 * @param string $messagehistorylink the html for the message history link or false
 * @param bool $viewingnewmessages are we currently viewing new messages?
 */
function message_print_message_history($user1, $user2, $search = '', $messagelimit = 0, $messagehistorylink = false, $viewingnewmessages = false, $showactionlinks = true)
{
    global $CFG, $OUTPUT;
    echo $OUTPUT->box_start('center', 'message_user_pictures');
    echo $OUTPUT->box_start('user');
    echo $OUTPUT->box_start('generalbox', 'user1');
    echo $OUTPUT->user_picture($user1, array('size' => 100, 'courseid' => SITEID));
    echo html_writer::tag('div', fullname($user1), array('class' => 'heading'));
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();
    $imgattr = array('src' => $OUTPUT->pix_url('i/twoway'), 'alt' => '', 'width' => 16, 'height' => 16);
    echo $OUTPUT->box(html_writer::empty_tag('img', $imgattr), 'between');
    echo $OUTPUT->box_start('user');
    echo $OUTPUT->box_start('generalbox', 'user2');
    // Show user picture with link is real user else without link.
    if (core_user::is_real_user($user2->id)) {
        echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID));
    } else {
        echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID, 'link' => false));
    }
    echo html_writer::tag('div', fullname($user2), array('class' => 'heading'));
    if ($showactionlinks && isset($user2->iscontact) && isset($user2->isblocked)) {
        $script = null;
        $text = true;
        $icon = false;
        $strcontact = message_get_contact_add_remove_link($user2->iscontact, $user2->isblocked, $user2, $script, $text, $icon);
        $strblock = message_get_contact_block_link($user2->iscontact, $user2->isblocked, $user2, $script, $text, $icon);
        $useractionlinks = $strcontact . '&nbsp;|&nbsp;' . $strblock;
        echo html_writer::tag('div', $useractionlinks, array('class' => 'useractionlinks'));
    }
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();
    if (!empty($messagehistorylink)) {
        echo $messagehistorylink;
    }
    /// Get all the messages and print them
    if ($messages = message_get_history($user1, $user2, $messagelimit, $viewingnewmessages)) {
        $tablecontents = '';
        $current = new stdClass();
        $current->mday = '';
        $current->month = '';
        $current->year = '';
        $messagedate = get_string('strftimetime');
        $blockdate = get_string('strftimedaydate');
        foreach ($messages as $message) {
            if ($message->notification) {
                $notificationclass = ' notification';
            } else {
                $notificationclass = null;
            }
            $date = usergetdate($message->timecreated);
            if ($current->mday != $date['mday'] | $current->month != $date['month'] | $current->year != $date['year']) {
                $current->mday = $date['mday'];
                $current->month = $date['month'];
                $current->year = $date['year'];
                $datestring = html_writer::empty_tag('a', array('name' => $date['year'] . $date['mon'] . $date['mday']));
                $tablecontents .= html_writer::tag('div', $datestring, array('class' => 'mdl-align heading'));
                $tablecontents .= $OUTPUT->heading(userdate($message->timecreated, $blockdate), 4, 'mdl-align');
            }
            $formatted_message = $side = null;
            if ($message->useridfrom == $user1->id) {
                $formatted_message = message_format_message($message, $messagedate, $search, 'me');
                $side = 'left';
            } else {
                $formatted_message = message_format_message($message, $messagedate, $search, 'other');
                $side = 'right';
            }
            $tablecontents .= html_writer::tag('div', $formatted_message, array('class' => "mdl-left {$side} {$notificationclass}"));
        }
        echo html_writer::nonempty_tag('div', $tablecontents, array('class' => 'mdl-left messagehistory'));
    } else {
        echo html_writer::nonempty_tag('div', '(' . get_string('nomessagesfound', 'message') . ')', array('class' => 'mdl-align messagehistory'));
    }
}
开发者ID:Hirenvaghasiya,项目名称:moodle,代码行数:85,代码来源:lib.php


示例4: message_print_message_history

/**
 * Print the message history between two users
 *
 * @param object $user1 the current user
 * @param object $user2 the other user
 * @param string $search search terms to highlight
 * @param int $messagelimit maximum number of messages to return
 * @param string $messagehistorylink the html for the message history link or false
 * @param bool $viewingnewmessages are we currently viewing new messages?
 */
function message_print_message_history($user1, $user2 ,$search = '', $messagelimit = 0, $messagehistorylink = false, $viewingnewmessages = false, $showactionlinks = true) {
    global $OUTPUT, $PAGE;

    $PAGE->requires->yui_module(
        array('moodle-core_message-toolbox'),
        'M.core_message.toolbox.deletemsg.init',
        array(array())
    );

    echo $OUTPUT->box_start('center', 'message_user_pictures');
    echo $OUTPUT->box_start('user');
    echo $OUTPUT->box_start('generalbox', 'user1');
    echo $OUTPUT->user_picture($user1, array('size' => 100, 'courseid' => SITEID));
    echo html_writer::tag('div', fullname($user1), array('class' => 'heading'));
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();

    $imgattr = array('src' => $OUTPUT->pix_url('i/twoway'), 'alt' => '', 'width' => 16, 'height' => 16);
    echo $OUTPUT->box(html_writer::empty_tag('img', $imgattr), 'between');

    echo $OUTPUT->box_start('user');
    echo $OUTPUT->box_start('generalbox', 'user2');
    // Show user picture with link is real user else without link.
    if (core_user::is_real_user($user2->id)) {
        echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID));
    } else {
        echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID, 'link' => false));
    }
    echo html_writer::tag('div', fullname($user2), array('class' => 'heading'));

    if ($showactionlinks && isset($user2->iscontact) && isset($user2->isblocked)) {

        $script = null;
        $text = true;
        $icon = false;

        $strcontact = message_get_contact_add_remove_link($user2->iscontact, $user2->isblocked, $user2, $script, $text, $icon);
        $strblock   = message_get_contact_block_link($user2->iscontact, $user2->isblocked, $user2, $script, $text, $icon);
        $useractionlinks = $strcontact.'&nbsp;|&nbsp;'.$strblock;

        echo html_writer::tag('div', $useractionlinks, array('class' => 'useractionlinks'));
    }
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();
    echo $OUTPUT->box_end();

    if (!empty($messagehistorylink)) {
        echo $messagehistorylink;
    }

    /// Get all the messages and print them
    if ($messages = message_get_history($user1, $user2, $messagelimit, $viewingnewmessages)) {
        $tablecontents = '';

        $current = new stdClass();
        $current->mday = '';
        $current->month = '';
        $current->year = '';
        $messagedate = get_string('strftimetime');
        $blockdate   = get_string('strftimedaydate');
        $messagenumber = 0;
        foreach ($messages as $message) {
            $messagenumber++;
            if ($message->notification) {
                $notificationclass = ' notification';
            } else {
                $notificationclass = null;
            }
            $date = usergetdate($message->timecreated);
            if ($current->mday != $date['mday'] | $current->month != $date['month'] | $current->year != $date['year']) {
                $current->mday = $date['mday'];
                $current->month = $date['month'];
                $current->year = $date['year'];

                $datestring = html_writer::empty_tag('a', array('name' => $date['year'].$date['mon'].$date['mday']));
                $tablecontents .= html_writer::tag('div', $datestring, array('class' => 'mdl-align heading'));

                $tablecontents .= $OUTPUT->heading(userdate($message->timecreated, $blockdate), 4, 'mdl-align');
            }

            if ($message->useridfrom == $user1->id) {
                $formatted_message = message_format_message($message, $messagedate, $search, 'me');
                $side = 'left';
            } else {
                $formatted_message = message_format_message($message, $messagedate, $search, 'other');
                $side = 'right';
            }

            // Check if it is a read message or not.
            if (isset($message->timeread)) {
//.........这里部分代码省略.........
开发者ID:nickbert77,项目名称:moodle,代码行数:101,代码来源:lib.php


示例5: message_print_message_history

function message_print_message_history($user1, $user2, $search = '', $messagelimit = 0, $messagehistorylink = false, $viewingnewmessages = false)
{
    global $CFG, $OUTPUT;
    echo $OUTPUT->box_start('center');
    echo '<table cellpadding="10" class="message_user_pictures"><tr>';
    echo '<td align="center" id="user1">';
    echo $OUTPUT->user_picture($user1, array('size' => 100, 'courseid' => SITEID));
    echo '<div class="heading">' . fullname($user1) . '</div>';
    echo '</td>';
    echo '<td align="center">';
    echo '<img src="' . $OUTPUT->pix_url('t/left') . '" alt="' . get_string('from') . '" />';
    echo '<img src="' . $OUTPUT->pix_url('t/right') . '" alt="' . get_string('to') . '" />';
    echo '</td>';
    echo '<td align="center" id="user2">';
    echo $OUTPUT->user_picture($user2, array('size' => 100, 'courseid' => SITEID));
    echo '<div class="heading">' . fullname($user2) . '</div>';
    if (isset($user2->iscontact) && isset($user2->isblocked)) {
        $incontactlist = $user2->iscontact;
        $isblocked = $user2->isblocked;
        $script = null;
        $text = true;
        $icon = false;
        $strcontact = message_get_contact_add_remove_link($incontactlist, $isblocked, $user2, $script, $text, $icon);
        $strblock = message_get_contact_block_link($incontactlist, $isblocked, $user2, $script, $text, $icon);
        $useractionlinks = $strcontact . '&nbsp;|' . $strblock;
        echo html_writer::tag('div', $useractionlinks, array('class' => 'useractionlinks'));
    }
    echo '</td>';
    echo '</tr></table>';
    echo $OUTPUT->box_end();
    if (!empty($messagehistorylink)) {
        echo $messagehistorylink;
    }
    /// Get all the messages and print them
    if ($messages = message_get_history($user1, $user2, $messagelimit, $viewingnewmessages)) {
        $tablecontents = '';
        $current = new stdClass();
        $current->mday = '';
        $current->month = '';
        $current->year = '';
        $messagedate = get_string('strftimetime');
        $blockdate = get_string('strftimedaydate');
        foreach ($messages as $message) {
            if ($message->notification) {
                $notificationclass = ' notification';
            } else {
                $notificationclass = null;
            }
            $date = usergetdate($message->timecreated);
            if ($current->mday != $date['mday'] | $current->month != $date['month'] | $current->year != $date['year']) {
                $current->mday = $date['mday'];
                $current->month = $date['month'];
                $current->year = $date['year'];
                $tablecontents .= '<div class="mdl-align heading"><a name="' . $date['year'] . $date['mon'] . $date['mday'] . '"></a>';
                $tablecontents .= $OUTPUT->heading(userdate($message->timecreated, $blockdate), 4, 'center') . '</div>';
            }
            if ($message->useridfrom == $user1->id) {
                $tablecontents .= "<div class='mdl-left left {$notificationclass}'>" . message_format_message($message, $user1, $messagedate, $search, 'me') . '</div><br />';
            } else {
                $tablecontents .= "<div class='mdl-left right {$notificationclass}'>" . message_format_message($message, $user2, $messagedate, $search, 'other') . '</div><br />';
            }
        }
        echo html_writer::nonempty_tag('div', $tablecontents, array('class' => 'mdl-left messagehistory'));
    } else {
        echo html_writer::nonempty_tag('div', '(' . get_string('nomessagesfound', 'message') . ')', array('class' => 'mdl-align messagehistory'));
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:67,代码来源:lib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP message_get_providers_for_user函数代码示例发布时间:2022-05-15
下一篇:
PHP message_get_fragment函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap