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


PHP Sections::build_notification方法代码示例

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


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

示例1: elseif

}
// not found -- help web crawlers
if (!isset($item['id'])) {
    include $context['path_to_root'] . 'error.php';
    // permission denied
} elseif (!$permitted) {
    // make it clear to crawlers
    if (Surfer::is_crawler()) {
        Safe::header('Status: 401 Unauthorized', TRUE, 401);
    } elseif (!Surfer::is_logged()) {
        Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode(Sections::get_permalink($item)));
    } elseif (isset($_REQUEST['requested']) && ($requested = Users::get($_REQUEST['requested'])) && $requested['email']) {
        // prepare the mail message
        $to = Mailer::encode_recipient($requested['email'], $requested['full_name']);
        $subject = sprintf(i18n::c('%s: %s'), i18n::c('Request'), strip_tags($item['title']));
        $message = Sections::build_notification('apply', $item, $overlay);
        $headers = Mailer::set_thread('section:' . $item['id']);
        // allow for skinnable template
        $message = Skin::build_mail_message($message);
        // build multiple parts, for HTML rendering
        $message = Mailer::build_multipart($message);
        // send the message to requested user
        if (Mailer::post(Surfer::from(), $to, $subject, $message, NULL, $headers)) {
            $text = sprintf(i18n::s('Your request has been transmitted to %s. Check your mailbox for feed-back.'), Skin::build_link(Users::get_permalink($requested), Codes::beautify_title($requested['full_name']), 'user'));
            $context['text'] .= Skin::build_block($text, 'note');
        }
        // follow-up navigation
        $context['text'] .= '<div>' . i18n::s('Where do you want to go now?') . '</div>';
        $menu = array();
        $menu[] = Skin::build_link($context['url_to_root'], i18n::s('Front page'), 'button');
        $menu[] = Skin::build_link(Surfer::get_permalink(), i18n::s('My profile'), 'span');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:view.php

示例2: elseif

     }
     // create a new section
 } elseif (!($_REQUEST['id'] = Sections::post($_REQUEST))) {
     $item = $_REQUEST;
     $with_form = TRUE;
     // successful post
 } else {
     // post an overlay, with the new section id --don't stop on error
     if (is_object($overlay)) {
         $overlay->remember('insert', $_REQUEST, 'section:' . $_REQUEST['id']);
     }
     // notification to send by e-mail
     $mail = array();
     $anchor_title = is_object($anchor) ? strip_tags($anchor->get_title()) : i18n::s('Root');
     $mail['subject'] = sprintf(i18n::c('%s: %s'), $anchor_title, strip_tags($_REQUEST['title']));
     $mail['notification'] = Sections::build_notification('create', $_REQUEST);
     $mail['headers'] = Mailer::set_thread('section:' . $_REQUEST['id']);
     // touch the related anchor
     if (is_object($anchor)) {
         // send to watchers of this anchor
         if (isset($_REQUEST['notify_watchers']) && $_REQUEST['notify_watchers'] == 'Y') {
             $anchor->alert_watchers($mail, 'section:create', $_REQUEST['active'] == 'N');
         }
         // update anchors
         $anchor->touch('section:create', $_REQUEST['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y');
     }
     // send to followers of this user
     if (isset($_REQUEST['notify_followers']) && $_REQUEST['notify_followers'] == 'Y' && Surfer::get_id() && $_REQUEST['active'] != 'N') {
         $mail['message'] = Mailer::build_notification($mail['notification'], 2);
         Users::alert_watchers('user:' . Surfer::get_id(), $mail);
     }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:edit.php


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