本文整理汇总了PHP中Articles::list_watchers_by_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::list_watchers_by_name方法的具体用法?PHP Articles::list_watchers_by_name怎么用?PHP Articles::list_watchers_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::list_watchers_by_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
} else {
$context['path_bar'] = array('users/' => i18n::s('People'));
}
// an anchor is mandatory
if (!is_object($anchor)) {
Logger::error(i18n::s('No anchor has been found.'));
} elseif (!$permitted) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// list all watchers
} elseif ($permitted == 'watchers') {
// page title
$context['page_title'] = sprintf(i18n::s('Watchers of %s'), $anchor->get_title());
// watchers of a page
if (!strncmp($anchor->get_reference(), 'article:', 8)) {
$users = Articles::list_watchers_by_name($anchor->item, 0, 5 * USERS_LIST_SIZE, 'raw');
} elseif (!strncmp($anchor->get_reference(), 'section:', 8)) {
$users = Sections::list_watchers_by_name($anchor->item, 0, 5 * USERS_LIST_SIZE, 'raw');
} else {
$anchors = array($anchor->get_reference());
$handle = $anchor->get_parent();
while ($handle && ($parent = Anchors::get($handle))) {
$anchors[] = $handle;
$handle = $parent->get_parent();
}
// authorized users
$restricted = NULL;
if ($anchor->is_hidden() && ($editors =& Members::list_anchors_for_member($anchors))) {
foreach ($editors as $editor) {
if (strpos($editor, 'user:') === 0) {
$restricted[] = substr($editor, strlen('user:'));
示例2: htmlspecialchars
$actual_names[] = htmlspecialchars($recipient);
}
}
Mailer::close();
// display the list of actual recipients
if ($actual_names) {
$context['text'] .= '<div>' . sprintf(i18n::s('Your message is being transmitted to %s'), Skin::finalize_list($actual_names, 'compact')) . '</div>';
} else {
$context['text'] .= '<p>' . i18n::s('No message has been sent') . '</p>';
}
// back to the page
$menu = array();
$menu[] = Skin::build_link(Articles::get_permalink($item), i18n::s('Done'), 'button');
$context['text'] .= Skin::finalize_list($menu, 'assistant_bar');
// send message to all watchers
} elseif (!($recipients = Articles::list_watchers_by_name($item, 0, 1000, 'mail'))) {
Logger::error(i18n::s('No recipient has been found.'));
// display the form
} else {
// the form to send a message
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" onsubmit="return validateDocumentPost(this)" id="main_form"><div>';
// build a nice list of recipients
$label = i18n::s('Message recipients');
$input = Skin::build_box(i18n::s('Select recipients'), $recipients, 'folded');
$fields[] = array($label, $input);
// the subject
$label = i18n::s('Message title');
if (is_object($overlay)) {
$title = $overlay->get_live_title($item);
} else {
$title = $item['title'];