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


PHP Surfer::get_link方法代码示例

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


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

示例1: get_comment_notification

 public function get_comment_notification($item)
 {
     global $context;
     // build a tease notification for simple members
     // sanity check
     if (!isset($item['anchor']) || !($anchor = Anchors::get($item['anchor']))) {
         throw new Exception('no anchor for this comment');
     }
     // headline
     $headline = sprintf(i18n::c('%s has replied'), Surfer::get_link());
     $content = BR;
     // shape these
     $tease = Skin::build_mail_content($headline, $content);
     // a set of links
     $menu = array();
     // call for action
     $link = $context['url_to_home'] . $context['url_to_root'] . Comments::get_url($item['id'], 'view');
     $menu[] = Skin::build_mail_button($link, i18n::c('View the reply'), TRUE);
     // link to the container
     $menu[] = Skin::build_mail_button($anchor->get_url(), $anchor->get_title(), FALSE);
     // finalize links
     $tease .= Skin::build_mail_menu($menu);
     // assemble all parts of the mail
     $mail = array();
     $mail['subject'] = sprintf(i18n::c('%s: %s'), i18n::c('Reply in the discussion'), strip_tags($anchor->get_title()));
     $mail['notification'] = Comments::build_notification($item);
     // full notification
     $mail['tease'] = Mailer::build_notification($tease, 1);
     return $mail;
 }
开发者ID:rair,项目名称:yacs,代码行数:30,代码来源:thread.php

示例2: sprintf

 // propagate the invitation to the overlay, if applicable
 if (is_callable(array($overlay, 'invite'))) {
     $overlay->invite($user['id']);
 }
 // this person has no valid email address
 if (!$user['email'] || !preg_match(VALID_RECIPIENT, $user['email'])) {
     continue;
 }
 // use this email address
 if ($user['full_name']) {
     $recipient = Mailer::encode_recipient($user['email'], $user['full_name']);
 } else {
     $recipient = Mailer::encode_recipient($user['email'], $user['nick_name']);
 }
 // headline
 $headline = sprintf(i18n::c('%s has invited you to %s'), Surfer::get_link(), '<a href="' . Sections::get_permalink($item) . '">' . $item['title'] . '</a>');
 // build the full message
 if (isset($_REQUEST['message'])) {
     $message = '<div>' . $_REQUEST['message'] . '</div>';
 } else {
     $message = '<p>' . i18n::c('I would like to invite you to the following page.') . '</p>' . '<p><a href="' . Sections::get_permalink($item) . '">' . $item['title'] . '</a></p>';
 }
 // change content for message poster
 if (strpos(Surfer::from(), $user['email']) !== FALSE) {
     $message = '<hr /><p>' . i18n::c('This is a copy of the message you have sent, for your own record.') . '</p><p>' . join(', ', $actual_names) . '</p><hr />' . $message;
 }
 // allow the overlay to filter message content
 if (is_callable(array($overlay, 'filter_invite_message'))) {
     $message = $overlay->filter_invite_message($message);
 }
 // assemble main content of this message
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:invite.php

示例3: build_notification

 /**
  * build a notification related to a section
  *
  * This function builds a mail message that displays:
  * - an image of the contributor (if possible)
  * - a headline mentioning the contribution
  * - the full content of the section
  * - a button linked to the section
  * - a link to the containing section, if any
  *
  * Note: this function returns legacy HTML, not modern XHTML, because this is what most
  * e-mail client software can afford.
  *
  * @param string either 'apply', 'create' or 'update'
  * @param array attributes of the item
  * @param object overlay of the item, if any
  * @return string text to be send by e-mail
  */
 public static function build_notification($action, $item, $overlay = NULL)
 {
     global $context;
     // get the main anchor
     $anchor = Anchors::get($item['anchor']);
     // compute page title
     if (is_object($overlay)) {
         $title = Codes::beautify_title($overlay->get_text('title', $item));
     } else {
         $title = Codes::beautify_title($item['title']);
     }
     // headline template
     switch ($action) {
         case 'apply':
             $template = i18n::c('%s is requesting access to %s');
             break;
         case 'create':
             $template = i18n::c('%s has created section %s');
             break;
         case 'update':
             $template = i18n::c('%s has updated section %s');
             break;
     }
     // headline
     $headline = sprintf($template, Surfer::get_link(), '<a href="' . Sections::get_permalink($item) . '">' . $title . '</a>');
     // panel content
     $content = '';
     // signal restricted and private articles
     if ($item['active'] == 'N') {
         $title = PRIVATE_FLAG . $title;
     } elseif ($item['active'] == 'R') {
         $title = RESTRICTED_FLAG . $title;
     }
     // insert page title
     $content .= '<h3><span>' . $title . '</span></h3>';
     // insert anchor prefix
     if (is_object($anchor)) {
         $content .= $anchor->get_prefix();
     }
     // the introduction text, if any
     if (is_object($overlay)) {
         $content .= Skin::build_block($overlay->get_text('introduction', $item), 'introduction');
     } elseif (isset($item['introduction']) && trim($item['introduction'])) {
         $content .= Skin::build_block($item['introduction'], 'introduction');
     }
     // get text related to the overlay, if any
     if (is_object($overlay)) {
         $content .= $overlay->get_text('view', $item);
     }
     // filter description, if necessary
     if (is_object($overlay)) {
         $description = $overlay->get_text('description', $item);
     } else {
         $description = $item['description'];
     }
     // the beautified description, which is the actual page body
     if ($description) {
         // use adequate label
         if (is_object($overlay) && ($label = $overlay->get_label('description'))) {
             $content .= Skin::build_block($label, 'title');
         }
         // beautify the target page
         $content .= Skin::build_block($description, 'description', '', $item['options']);
     }
     // attachment details
     $details = array();
     // info on related sections
     if ($count = Sections::count_for_anchor('section:' . $item['id'])) {
         $details[] = sprintf(i18n::nc('%d section', '%d sections', $count), $count);
     }
     // info on related articles
     if ($count = Articles::count_for_anchor('section:' . $item['id'])) {
         $details[] = sprintf(i18n::nc('%d page', '%d pages', $count), $count);
     }
     // info on related files
     if ($count = Files::count_for_anchor('section:' . $item['id'], TRUE)) {
         // the actual list of files attached to this section
         if (preg_match('/\\bfiles_by_title\\b/i', $item['options'])) {
             $items = Files::list_by_title_for_anchor('section:' . $item['id'], 0, 300, 'compact');
         } else {
             $items = Files::list_by_date_for_anchor('section:' . $item['id'], 0, 300, 'compact');
         }
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:sections.php

示例4: elseif

    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation in demonstration mode.'));
    // process submitted data
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    // recipient(s) address(es)
    $to = array();
    foreach ($_REQUEST['selected_users'] as $address) {
        $to[] = $address;
    }
    // message subject
    $subject = '';
    if (isset($_REQUEST['subject'])) {
        $subject = strip_tags($_REQUEST['subject']);
    }
    // headline
    $headline = sprintf(i18n::c('%s is notifying you from %s'), Surfer::get_link(), '<a href="' . Categories::get_permalink($item) . '">' . $item['title'] . '</a>');
    // enable yacs codes in messages
    $message = Codes::beautify($_REQUEST['message']);
    // assemble main content of this message
    $message = Skin::build_mail_content($headline, $message);
    // a set of links
    $menu = array();
    // call for action
    $link = Categories::get_permalink($item);
    if (!is_object($overlay) || !($label = $overlay->get_label('permalink_command', 'categories', FALSE))) {
        $label = i18n::c('View the category');
    }
    $menu[] = Skin::build_mail_button($link, $label, TRUE);
    // link to the container
    if (is_object($anchor)) {
        $link = $context['url_to_home'] . $context['url_to_root'] . $anchor->get_url();
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:mail.php

示例5: array

 }
 // follow-up commands
 $menu = array();
 if (is_object($anchor) && $anchor->is_viewable()) {
     $menu[] = Skin::build_link($anchor->get_url(), i18n::s('Done'), 'button');
 }
 // the page now appears in the watch list
 if (Members::check($track, 'user:' . Surfer::get_id())) {
     // we are tracking a user
     if (!strncmp($track, 'user:', 5)) {
         // notify a person that is followed
         if (($user = Users::get(str_replace('user:', '', $track))) && isset($user['email']) && $user['email'] && $user['without_alerts'] != 'Y') {
             // contact target user by e-mail
             $subject = sprintf(i18n::c('%s is following you'), strip_tags(Surfer::get_name()));
             // headline
             $headline = sprintf(i18n::c('%s is following you'), Surfer::get_link());
             // information
             $message = '<p>' . sprintf(i18n::c('%s will receive notifications when you will update your followers at %s'), Surfer::get_name(), $context['site_name']) . '</p>';
             // assemble main content of this message
             $message = Skin::build_mail_content($headline, $message);
             // a set of links
             $menu = array();
             // call for action
             $link = Surfer::get_permalink();
             $menu[] = Skin::build_mail_button($link, ucfirst(strip_tags(Surfer::get_name())), TRUE);
             // finalize links
             $message .= Skin::build_mail_menu($menu);
             // enable threading
             $headers = Mailer::set_thread('user:' . $item['id']);
             // sent by the server
             Mailer::notify(NULL, $user['email'], $subject, $message, $headers);
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:track.php

示例6: build_notification

 /**
  * build a notification for a new comment
  *
  * This function builds a mail message that features:
  * - an image of the contributor (if possible)
  * - a headline mentioning the contribution
  * - the full content of the new comment
  * - a button linked to the reply page
  * - a link to the containing page
  *
  * Note: this function returns legacy HTML, not modern XHTML, because this is what most
  * e-mail client software can afford.
  *
  * @param array attributes of the new item
  * @return string text to be send by e-mail
  */
 public static function build_notification($item)
 {
     global $context;
     // sanity check
     if (!isset($item['anchor']) || !($anchor = Anchors::get($item['anchor']))) {
         throw new Exception('no anchor for this comment');
     }
     // headline
     $headline = sprintf(i18n::c('%s has contributed to %s'), Surfer::get_link(), '<a href="' . $anchor->get_url() . '">' . $anchor->get_title() . '</a>');
     // content
     $content = Codes::beautify($item['description']);
     // this is an approval
     if ($item['type'] == 'approval') {
         $content = Skin::build_block(i18n::s('You have provided your approval'), 'note') . $content;
     }
     // shape these
     $text = Skin::build_mail_content($headline, $content);
     // a set of links
     $menu = array();
     // flat thread of contributions if possible
     if (isset($item['previous_id']) && $item['previous_id']) {
         $previous_id = $item['previous_id'];
     } else {
         $previous_id = $item['id'];
     }
     // call for action
     $link = $context['url_to_home'] . $context['url_to_root'] . Comments::get_url($previous_id, 'reply');
     $menu[] = Skin::build_mail_button($link, i18n::c('Reply'), TRUE);
     // link to the container
     $menu[] = Skin::build_mail_button($anchor->get_url(), $anchor->get_title(), FALSE);
     // finalize links
     $text .= Skin::build_mail_menu($menu);
     // the full message
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:51,代码来源:comments.php

示例7: remember

 /**
  * remember an action once it's done
  *
  * To be overloaded into derived class
  *
  * @param string the action 'insert', 'update' or 'delete'
  * @param array the hosting record
  * @param string reference of the hosting record (e.g., 'article:123')
  * @return FALSE on error, TRUE otherwise
  */
 function remember($action, $host, $reference)
 {
     global $context;
     // remember the id of the master record
     $id = $host['id'];
     // set default values for this editor
     Surfer::check_default_editor($this->attributes);
     // we use the existing back-end for dates
     include_once $context['path_to_root'] . 'dates/dates.php';
     // build the update query
     switch ($action) {
         case 'delete':
             // no need to notify participants after the date planned for the event, nor if the event has been initiated
             if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp'] > gmstrftime('%Y-%m-%d %H:%M') && isset($this->attributes['status']) && $this->attributes['status'] != 'started' && $this->attributes['status'] != 'stopped') {
                 // send a cancellation message to participants
                 $query = "SELECT user_email FROM " . SQL::table_name('enrolments') . " WHERE (anchor LIKE '" . $reference . "') AND (approved LIKE 'Y')";
                 $result = SQL::query($query);
                 while ($item = SQL::fetch($result)) {
                     // sanity check
                     if (!preg_match(VALID_RECIPIENT, $item['user_email'])) {
                         continue;
                     }
                     // message title
                     $subject = sprintf('%s: %s', i18n::c('Cancellation'), strip_tags($this->anchor->get_title()));
                     // headline
                     $headline = sprintf(i18n::c('%s has cancelled %s'), Surfer::get_link(), $this->anchor->get_title());
                     // message to reader
                     $message = $this->get_invite_default_message('CANCEL');
                     // assemble main content of this message
                     $message = Skin::build_mail_content($headline, $message);
                     // threads messages
                     $headers = Mailer::set_thread($this->anchor->get_reference());
                     // get attachment from the overlay
                     $attachments = $this->get_invite_attachments('CANCEL');
                     // post it
                     Mailer::notify(Surfer::from(), $item['user_email'], $subject, $message, $headers, $attachments);
                 }
             }
             // delete dates for this anchor
             Dates::delete_for_anchor($reference);
             // also delete related enrolment records
             $query = "DELETE FROM " . SQL::table_name('enrolments') . " WHERE anchor LIKE '" . $reference . "'";
             SQL::query($query);
             break;
         case 'insert':
             // bind one date to this record
             if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp']) {
                 $fields = array();
                 $fields['anchor'] = $reference;
                 $fields['date_stamp'] = $this->attributes['date_stamp'];
                 // update the database
                 if (!($fields['id'] = Dates::post($fields))) {
                     Logger::error(i18n::s('Impossible to add an item.'));
                     return FALSE;
                 }
             }
             // enroll page creator
             include_once $context['path_to_root'] . 'shared/enrolments.php';
             enrolments::confirm($reference);
             // reload the anchor through the cache to reflect the update
             if ($reference) {
                 $this->anchor = Anchors::get($reference, TRUE);
             }
             // send a confirmation message to event creator
             $query = "SELECT * FROM " . SQL::table_name('enrolments') . " WHERE (anchor LIKE '" . $reference . "')";
             $result = SQL::query($query);
             while ($item = SQL::fetch($result)) {
                 // a user registered on this server
                 if ($item['user_id'] && ($watcher = Users::get($item['user_id']))) {
                     // sanity check
                     if (!preg_match(VALID_RECIPIENT, $item['user_email'])) {
                         continue;
                     }
                     // use this email address
                     if ($watcher['full_name']) {
                         $recipient = Mailer::encode_recipient($watcher['email'], $watcher['full_name']);
                     } else {
                         $recipient = Mailer::encode_recipient($watcher['email'], $watcher['nick_name']);
                     }
                     // message title
                     $subject = sprintf(i18n::c('Meeting: %s'), strip_tags($this->anchor->get_title()));
                     // headline
                     $headline = sprintf(i18n::c('you have arranged %s'), '<a href="' . $context['url_to_home'] . $context['url_to_root'] . $this->anchor->get_url() . '">' . $this->anchor->get_title() . '</a>');
                     // message to reader
                     $message = $this->get_invite_default_message('PUBLISH');
                     // assemble main content of this message
                     $message = Skin::build_mail_content($headline, $message);
                     // a set of links
                     $menu = array();
                     // call for action
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:event.php

示例8: build_notification

 /**
  * build a notification for a new file upload
  *
  * If action is 'upload', this function builds a mail message that features:
  * - an image of the uploader (if possible)
  * - a headline mentioning the upload
  * - a button linked to the file page
  * - a link to the containing page
  * - the full history of all file modifications
  *
  * If action is 'multiple', then the function will use $item['message'] and
  * $item['anchor'] to shape the full notification message.
  *
  * Note: this function returns legacy HTML, not modern XHTML, because this is what most
  * e-mail client software can afford.
  *
  * @param string either 'upload' or 'multiple'
  * @param array attributes of the new item
  * @return string text to be send by e-mail
  */
 public static function build_notification($action = 'upload', $item)
 {
     global $context;
     // are we processing one or several items?
     switch ($action) {
         case 'multiple':
             // several files have been uploaded at once
             // headline
             $headline = sprintf(i18n::c('Several files have been added by %s'), Surfer::get_link());
             // the list of uploaded files is provided by caller
             $message = $item['message'];
             break;
         case 'upload':
             // one file has been uploaded
         // one file has been uploaded
         default:
             // headline
             $headline = sprintf(i18n::c('A file has been added by %s'), Surfer::get_link());
             // several components in this message
             $details = array();
             // make it visual
             if (isset($item['thumbnail_url']) && $item['thumbnail_url']) {
                 $details[] = '<img src="' . $context['url_to_home'] . $item['thumbnail_url'] . '" />';
             } else {
                 $details[] = '<img src="' . $context['url_to_home'] . $context['url_to_root'] . Files::get_icon_url($item['file_name']) . '" />';
             }
             // other details
             if ($item['title']) {
                 $details[] = $item['title'];
             }
             if ($item['file_name']) {
                 $details[] = $item['file_name'];
             }
             if ($item['file_size']) {
                 $details[] = $item['file_size'] . ' bytes';
             }
             if (is_array($details)) {
                 $message = '<p>' . implode(BR, $details) . "</p>\n";
             }
             break;
     }
     // shape the notification
     $text = Skin::build_mail_content($headline, $message);
     // a set of links
     $menu = array();
     // link to the file
     if (isset($item['id'])) {
         $link = Files::get_permalink($item);
         $menu[] = Skin::build_mail_button($link, i18n::c('View file details'), TRUE);
     }
     // link to the container
     if (isset($item['anchor']) && ($anchor = Anchors::get($item['anchor']))) {
         $link = $context['url_to_home'] . $context['url_to_root'] . $anchor->get_url();
         $menu[] = Skin::build_mail_button($link, $anchor->get_title(), $action == 'multiple');
     }
     // finalize links
     $text .= Skin::build_mail_menu($menu);
     // file history
     if (isset($item['description']) && ($description = trim($item['description']))) {
         // finalize file history
         $text .= '<p> </p>' . '<table border="0" cellpadding="2" cellspacing="10">' . '<tr>' . '<td>' . '<font face="Helvetica, Arial, sans-serif" color="navy">' . sprintf(i18n::c('%s: %s'), i18n::c('History'), '') . '</font>' . '</td>' . '</tr>' . '<tr>' . '<td style="font-size: 10px">' . '<font face="Helvetica, Arial, sans-serif" color="navy">' . Codes::beautify($description) . '</font>' . '</td>' . '</tr>' . '</table>';
     }
     // the full message
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:85,代码来源:files.php

示例9: build_notification

 /**
  * build a notification related to an article
  *
  * The action can be one of the following:
  * - 'apply' - surfer would like to get access to the page
  * - 'publish' - either a published page has been posted, or a draft page has been published
  * - 'submit' - a draft page has been posted
  * - 'update' - a page (draft or published) has been modified
  *
  * This function builds a mail message that displays:
  * - an image of the contributor (if possible)
  * - a headline mentioning the contribution
  * - the full content of the new comment
  * - a button linked to the reply page
  * - a link to the containing page
  *
  * Note: this function returns legacy HTML, not modern XHTML, because this is what most
  * e-mail client software can afford.
  *
  * @param string either 'apply', 'publish', 'submit' or 'update'
  * @param array attributes of the item
  * @param object overlay of the item, if any
  * @return string text to be send by e-mail
  */
 public static function build_notification($action = 'publish', $item, $overlay = NULL)
 {
     global $context;
     // sanity check
     if (!isset($item['anchor']) || !($anchor = Anchors::get($item['anchor']))) {
         throw new Exception('no anchor for this article');
     }
     // compute page title
     if (is_object($overlay)) {
         $title = Codes::beautify_title($overlay->get_text('title', $item));
     } else {
         $title = Codes::beautify_title($item['title']);
     }
     // headline link to section
     $headline_link = '<a href="' . $context['url_to_home'] . $context['url_to_root'] . $anchor->get_url() . '">' . $anchor->get_title() . '</a>';
     // headline template
     switch ($action) {
         case 'apply':
             $template = i18n::c('%s is requesting access to %s');
             $headline_link = '<a href="' . Articles::get_permalink($item) . '">' . $title . '</a>';
             break;
         case 'publish':
             $template = i18n::c('%s has posted a page in %s');
             break;
         case 'submit':
             $template = i18n::c('%s has submitted a page in %s');
             break;
         case 'update':
             $template = i18n::c('%s has updated a page in %s');
             break;
     }
     // headline
     $headline = sprintf($template, Surfer::get_link(), $headline_link);
     // panel content
     $content = '';
     // more insight on this page
     $prefix = $suffix = '';
     // signal articles to be published
     if (!isset($item['publish_date']) || $item['publish_date'] <= NULL_DATE || $item['publish_date'] > gmstrftime('%Y-%m-%d %H:%M:%S')) {
         $prefix .= DRAFT_FLAG;
     }
     // signal restricted and private articles
     if ($item['active'] == 'N') {
         $prefix .= PRIVATE_FLAG;
     } elseif ($item['active'] == 'R') {
         $prefix .= RESTRICTED_FLAG;
     }
     // flag expired articles
     if (isset($item['expiry_date']) && $item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
         $prefix .= EXPIRED_FLAG . ' ';
     }
     // signal locked articles
     if (isset($item['locked']) && $item['locked'] == 'Y' && Articles::is_owned($item, $anchor)) {
         $suffix .= ' ' . LOCKED_FLAG;
     }
     // insert page title
     $content .= '<h3><span>' . $prefix . $title . $suffix . '</span></h3>';
     // insert anchor prefix
     if (is_object($anchor)) {
         $content .= $anchor->get_prefix();
     }
     // the introduction text, if any
     if (is_object($overlay)) {
         $content .= Skin::build_block($overlay->get_text('introduction', $item), 'introduction');
     } elseif (isset($item['introduction']) && trim($item['introduction'])) {
         $content .= Skin::build_block($item['introduction'], 'introduction');
     }
     // get text related to the overlay, if any
     if (is_object($overlay)) {
         $content .= $overlay->get_text('diff', $item);
     }
     // filter description, if necessary
     if (is_object($overlay)) {
         $description = $overlay->get_text('description', $item);
     } else {
         $description = $item['description'];
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:articles.php

示例10: build_notification

 /**
  * format a notification to be send by e-mail
  *
  * This function appends a reason string, and format the full content
  * as template provided by the skin.
  *
  * Depending of the reason, the notification will have the following kind of trail:
  * - 0 - no trail
  * - 1 - you are watching the container
  * - 2 - you are watching the poster
  *
  * You can change function build_mail_message() in your skin.php to use a customized template.
  *
  * @param string bare message content
  * @param int reason for notification
  * @return string text to be put in message
  */
 public static function build_notification($text, $reason = 0)
 {
     global $context;
     // decode the reason
     switch ($reason) {
         case 0:
             // no trail
         // no trail
         default:
             break;
         case 1:
             // you are watching some container
             $text .= '<p>&nbsp;</p><p>' . sprintf(i18n::c('This message has been generated automatically by %s since the new item has been posted in a web space that is part of your watch list. If you wish to stop some notifications please review watched elements listed in your user profile.'), $context['site_name']) . '</p>';
             break;
         case 2:
             // you are watching the poster
             $text .= '<p>&nbsp;</p><p>' . sprintf(i18n::c('This message has been generated automatically by %s since you are following the person who posted the new item. If you wish to stop these automatic alerts please visit the user profile below and click on Stop notifications.'), $context['site_name']) . '</p>' . '<p>' . Surfer::get_link() . '</p>';
             break;
     }
     // job done
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:39,代码来源:mailer.php

示例11: sprintf

 // ensure that the enrolled person can access private pages
 if ($anchor->is_hidden()) {
     Members::assign('user:' . $user['id'], $anchor->get_reference());
 }
 // confirm enrolment by e-mail
 if ($user['email'] && preg_match(VALID_RECIPIENT, $user['email'])) {
     // use this email address
     if ($user['full_name']) {
         $recipient = Mailer::encode_recipient($user['email'], $user['full_name']);
     } else {
         $recipient = Mailer::encode_recipient($user['email'], $user['nick_name']);
     }
     // mail subject
     $subject = sprintf(i18n::c('%s: %s'), i18n::c('Meeting'), strip_tags($anchor->get_title()));
     // headline
     $headline = sprintf(i18n::c('%s has confirmed your participation to %s'), Surfer::get_link(), '<a href="' . $context['url_to_home'] . $context['url_to_root'] . $anchor->get_url() . '">' . $anchor->get_title() . '</a>');
     // message confirmation
     $message = $overlay->get_invite_default_message('PUBLISH');
     // assemble main content of this message
     $message = Skin::build_mail_content($headline, $message);
     // a set of links
     $menu = array();
     // call for action
     $link = $context['url_to_home'] . $context['url_to_root'] . $anchor->get_url();
     $menu[] = Skin::build_mail_button($link, $anchor->get_title(), TRUE);
     // finalize links
     $message .= Skin::build_mail_menu($menu);
     // threads messages
     $headers = Mailer::set_thread($anchor->get_reference());
     // get attachments from the overlay, if any
     $attachments = $overlay->get_invite_attachments('PUBLISH');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:enroll.php

示例12: array

 $context['page_title'] = i18n::s('Welcome!');
 //
 // panels
 //
 $panels = array();
 //
 // main panel
 //
 $information = '';
 // lay fields in a table
 $information .= Skin::table_prefix('form');
 $lines = 1;
 // a link to the user profile
 $cells = array();
 $cells[] = i18n::s('Your profile');
 $cells[] = 'left=' . Surfer::get_link();
 $information .= Skin::table_row($cells, $lines++);
 // the email field
 if (Surfer::get_email_address()) {
     $cells = array();
     $cells[] = i18n::s('Your address');
     $cells[] = 'left=' . Surfer::get_email_address();
     $information .= Skin::table_row($cells, $lines++);
 }
 // the capability field - associate, member, or subscriber
 $cells = array();
 $cells[] = i18n::s('Your status');
 if (Surfer::is_associate()) {
     $cells[] = 'left=' . i18n::s('As an associate of this community, you may contribute freely to any part of this server.');
 } elseif (Surfer::is_member()) {
     $cells[] = 'left=' . i18n::s('As a member of this community, you may access freely most pages of this server.');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:login.php

示例13: strip_tags

 }
 // message subject
 $subject = '';
 if (isset($_REQUEST['subject'])) {
     $subject = strip_tags($_REQUEST['subject']);
 }
 // enable yacs codes in messages
 $message = Codes::beautify($_REQUEST['message']);
 // nothing to do
 if (!$subject || !$message) {
     Logger::error('Please provide a subject and some text for your message.');
     $with_form = TRUE;
     // do the post
 } else {
     // headline
     $headline = sprintf(i18n::c('%s has sent a message to you'), Surfer::get_link());
     // assemble main content of this message
     $message = Skin::build_mail_content($headline, $message);
     // a set of links
     $menu = array();
     // call for action
     $link = $context['url_to_home'] . $context['url_to_root'] . Users::get_url(Surfer::get_id(), 'mail');
     $menu[] = Skin::build_mail_button($link, i18n::c('Reply'), TRUE);
     // link to surfer profile
     $link = Surfer::get_permalink();
     $menu[] = Skin::build_mail_button($link, Surfer::get_name(), FALSE);
     // finalize links
     $message .= Skin::build_mail_menu($menu);
     // threads messages
     $headers = Mailer::set_thread('user:' . $item['id']);
     // send the message
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:mail.php


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