本文整理汇总了PHP中ArtefactTypeComment类的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeComment类的具体用法?PHP ArtefactTypeComment怎么用?PHP ArtefactTypeComment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArtefactTypeComment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
require_once get_config('docroot') . 'artefact/lib.php';
$configdata = $instance->get('configdata');
$configdata['viewid'] = $instance->get('view');
$configdata['simpledisplay'] = true;
// This can be either an image or profileicon. They both implement
// render_self
$result = '';
$artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
if ($artefactid) {
$artefact = $instance->get_artefact_instance($artefactid);
$result = $artefact->render_self($configdata);
$result = $result['html'];
require_once get_config('docroot') . 'artefact/comment/lib.php';
require_once get_config('docroot') . 'lib/view.php';
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing);
}
$smarty = smarty_core();
if ($artefactid) {
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:folder:folder.tpl');
}
示例2: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
$result = '';
$artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
if ($artefactid) {
require_once get_config('docroot') . 'artefact/lib.php';
$artefact = $instance->get_artefact_instance($artefactid);
$configdata['hidetitle'] = true;
$configdata['countcomments'] = true;
$configdata['viewid'] = $instance->get('view');
$configdata['blockid'] = $instance->get('id');
$result = $artefact->render_self($configdata);
$result = $result['html'];
require_once get_config('docroot') . 'artefact/comment/lib.php';
require_once get_config('docroot') . 'lib/view.php';
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing);
}
$smarty = smarty_core();
if ($artefactid) {
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:blogpost:blogpost.tpl');
}
示例3: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
// this will make sure to unserialize it for us
$configdata['viewid'] = $instance->get('view');
$result = '';
$artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
if ($artefactid) {
$artefact = $instance->get_artefact_instance($artefactid);
if (!file_exists($artefact->get_path())) {
return;
}
$result = clean_html(file_get_contents($artefact->get_path()));
require_once get_config('docroot') . 'artefact/comment/lib.php';
require_once get_config('docroot') . 'lib/view.php';
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing);
}
$smarty = smarty_core();
if ($artefactid) {
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:html:html.tpl');
}
示例4: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
// this will make sure to unserialize it for us
if (!isset($configdata['artefactid'])) {
return '';
}
$id = $configdata['artefactid'];
$image = $instance->get_artefact_instance($id);
$wwwroot = get_config('wwwroot');
$viewid = $instance->get('view');
if ($image instanceof ArtefactTypeProfileIcon) {
$src = $wwwroot . 'thumb.php?type=profileiconbyid&id=' . $id;
$description = $image->get('title');
} else {
$src = $wwwroot . 'artefact/file/download.php?file=' . $id . '&view=' . $viewid;
$description = $image->get('description');
}
if (!empty($configdata['width'])) {
$src .= '&maxwidth=' . $configdata['width'];
}
require_once get_config('docroot') . 'artefact/comment/lib.php';
require_once get_config('docroot') . 'lib/view.php';
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($image, $view, $instance->get('id'), true, $editing);
$smarty = smarty_core();
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$smarty->assign('url', $wwwroot . 'artefact/artefact.php?artefact=' . $id . '&view=' . $viewid);
$smarty->assign('src', $src);
$smarty->assign('description', $description);
$smarty->assign('showdescription', !empty($configdata['showdescription']) && !empty($description));
return $smarty->fetch('blocktype:image:image.tpl');
}
示例5: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
global $USER;
if ($editing) {
$smarty = smarty_core();
$smarty->assign('editing', get_string('ineditordescription1', 'blocktype.comment/comment'));
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
// Feedback list pagination requires limit/offset params
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$showcomment = param_integer('showcomment', null);
// Create the "make feedback private form" now if it's been submitted
if (param_variable('make_public_submit', null)) {
pieform(ArtefactTypeComment::make_public_form(param_integer('comment')));
} else {
if (param_variable('delete_comment_submit_x', null)) {
pieform(ArtefactTypeComment::delete_comment_form(param_integer('comment')));
}
}
$view = new View($instance->get('view'));
$submittedgroup = (int) $view->get('submittedgroup');
if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_views($submittedgroup, $USER->get('id'))) {
$releaseform = true;
} else {
$releaseform = false;
}
// If the view has comments turned off, tutors can still leave
// comments if the view is submitted to their group.
if (!empty($releaseform) || $view->user_comments_allowed($USER)) {
$addfeedbackpopup = true;
}
safe_require('artefact', 'comment');
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->showcomment = $showcomment;
$commentoptions->view = $instance->get_view();
$feedback = ArtefactTypeComment::get_comments($commentoptions);
$smarty = smarty_core();
$smarty->assign('feedback', $feedback);
if (isset($addfeedbackpopup)) {
$smarty->assign('enablecomments', 1);
$smarty->assign('addfeedbackpopup', $addfeedbackpopup);
}
$html = $smarty->fetch('blocktype:comment:comment.tpl');
return $html;
}
示例6: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
safe_require('artefact', 'file');
safe_require('artefact', 'comment');
$artefact = $instance->get_artefact_instance($configdata['artefactid']);
$viewid = $instance->get('view');
$text = ArtefactTypeFolder::append_view_url($artefact->get('note'), $viewid);
$information = ArtefactTypeFolder::append_view_url($artefact->get('description'), $viewid);
$literature = $configdata['literature'];
$smarty = smarty_core();
$smarty->assign('text', $text);
$smarty->assign('information', $information);
$smarty->assign('literature', $literature);
$attachments = $artefact->get_attachments();
if ($attachments) {
require_once get_config('docroot') . 'artefact/lib.php';
foreach ($attachments as &$attachment) {
$f = artefact_instance_from_id($attachment->id);
$attachment->size = $f->describe_size();
$attachment->iconpath = $f->get_icon(array('id' => $attachment->id, 'viewid' => isset($options['viewid']) ? $options['viewid'] : 0));
$attachment->viewpath = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $attachment->id . '&view=' . (isset($viewid) ? $viewid : 0);
$attachment->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
if (isset($viewid)) {
$attachment->downloadpath .= '&view=' . $viewid;
}
}
$smarty->assign('attachments', $attachments);
$smarty->assign('count', count($attachments));
}
require_once get_config('docroot') . 'lib/view.php';
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing);
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$smarty->assign('blockid', $instance->get('id'));
return $smarty->fetch('blocktype:eselmagraduation:content.tpl');
}
return '';
}
示例7: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
safe_require('artefact', 'file');
safe_require('artefact', 'comment');
$artefact = $instance->get_artefact_instance($configdata['artefactid']);
$viewid = $instance->get('view');
$text = ArtefactTypeFolder::append_view_url($artefact->get('description'), $viewid);
$smarty = smarty_core();
$smarty->assign('text', $text);
$attachments = $artefact->get_attachments();
if ($attachments) {
require_once get_config('docroot') . 'artefact/lib.php';
foreach ($attachments as &$attachment) {
$f = artefact_instance_from_id($attachment->id);
$attachment->size = $f->describe_size();
$attachment->iconpath = $f->get_icon(array('id' => $attachment->id, 'viewid' => isset($options['viewid']) ? $options['viewid'] : 0));
$attachment->viewpath = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $attachment->id . '&view=' . (isset($viewid) ? $viewid : 0);
$attachment->downloadpath = get_config('wwwroot') . 'artefact/file/download.php?file=' . $attachment->id;
if (isset($viewid)) {
$attachment->downloadpath .= '&view=' . $viewid;
}
}
$smarty->assign('attachments', $attachments);
$smarty->assign('count', count($attachments));
}
if ($artefact->get('allowcomments')) {
$commentcount = ArtefactTypeComment::count_comments(null, array($configdata['artefactid']));
$commentcount = isset($commentcount[$configdata['artefactid']]) ? $commentcount[$configdata['artefactid']]->comments : 0;
$artefacturl = get_config('wwwroot') . 'artefact/artefact.php?view=' . $viewid . '&artefact=' . $configdata['artefactid'];
$smarty->assign('artefacturl', $artefacturl);
$smarty->assign('commentcount', $commentcount);
}
return $smarty->fetch('blocktype:textbox:content.tpl');
}
return '';
}
示例8: render_instance
public static function render_instance(BlockInstance $instance, $editing = false)
{
$configdata = $instance->get('configdata');
$viewid = $instance->get('view');
$artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
if (empty($artefactid)) {
return '';
}
$result = self::get_js_source();
require_once get_config('docroot') . 'artefact/lib.php';
$artefact = $instance->get_artefact_instance($artefactid);
$defaultwidth = get_config_plugin('blocktype', 'internalmedia', 'width') ? get_config_plugin('blocktype', 'internalmedia', 'width') : 300;
$defaultheight = get_config_plugin('blocktype', 'internalmedia', 'height') ? get_config_plugin('blocktype', 'internalmedia', 'height') : 300;
$width = !empty($configdata['width']) ? hsc($configdata['width']) : $defaultwidth;
$height = !empty($configdata['height']) ? hsc($configdata['height']) : $defaultheight;
$mimetype = $artefact->get('filetype');
$mimetypefiletypes = self::get_allowed_mimetype_filetypes();
if (!isset($mimetypefiletypes[$mimetype])) {
return get_string('typeremoved', 'blocktype.file/internalmedia');
}
$callbacks = self::get_all_filetype_players();
$result .= '<div class="mediaplayer-container center"><div class="mediaplayer">' . call_static_method('PluginBlocktypeInternalmedia', $callbacks[$mimetypefiletypes[$mimetype]], $artefact, $instance, $width, $height) . '</div></div>';
if ($artefactid) {
require_once get_config('docroot') . 'artefact/comment/lib.php';
require_once get_config('docroot') . 'lib/view.php';
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing);
}
$smarty = smarty_core();
if ($artefactid) {
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:internalmedia:internalmedia.tpl');
}
示例9: define
*
* @package mahara
* @subpackage artefact-comment
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
define('INTERNAL', 1);
define('MENUITEM', 'myportfolio');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
define('TITLE', get_string('editcomment', 'artefact.comment'));
safe_require('artefact', 'comment');
$id = param_integer('id');
$viewid = param_integer('view');
$comment = new ArtefactTypeComment($id);
if ($USER->get('id') != $comment->get('author')) {
throw new AccessDeniedException(get_string('canteditnotauthor', 'artefact.comment'));
}
$onview = $comment->get('onview');
if ($onview && $onview != $viewid) {
throw new NotFoundException(get_string('commentnotinview', 'artefact.comment', $id, $viewid));
}
$maxage = (int) get_config_plugin('artefact', 'comment', 'commenteditabletime');
$editableafter = time() - 60 * $maxage;
$goto = $comment->get_view_url($viewid, false);
if ($comment->get('ctime') < $editableafter) {
$SESSION->add_error_msg(get_string('cantedittooold', 'artefact.comment', $maxage));
redirect($goto);
}
$lastcomment = ArtefactTypeComment::last_public_comment($viewid, $comment->get('onartefact'));
示例10: create_comment
/**
* Creates a comment from the given entry
*
* @param SimpleXMLElement $entry The entry to create the comment from
* @param PluginImportLeap $importer The importer
* @return array A list of artefact IDs created, to be used with the artefact mapping.
*/
private static function create_comment(SimpleXMLElement $entry, PluginImportLeap $importer)
{
$createdartefacts = array();
$comment = new ArtefactTypeComment();
$comment->set('title', (string) $entry->title);
$description = PluginImportLeap::get_entry_content($entry, $importer);
$type = isset($entry->content['type']) ? (string) $entry->content['type'] : 'text';
if ($type == 'text') {
$description = format_whitespace($description);
}
$comment->set('description', $description);
if ($published = strtotime((string) $entry->published)) {
$comment->set('ctime', $published);
}
if ($updated = strtotime((string) $entry->updated)) {
$comment->set('mtime', $updated);
}
$private = PluginImportLeap::is_correct_category_scheme($entry, $importer, 'audience', 'Private');
$comment->set('private', (int) $private);
$comment->set('owner', $importer->get('usr'));
if (isset($entry->author->name) && strlen($entry->author->name)) {
$comment->set('authorname', $entry->author->name);
} else {
$comment->set('author', $importer->get('usr'));
}
if (empty(self::$tempview)) {
self::create_temporary_view($importer->get('usr'));
}
$comment->set('onview', self::$tempview);
$comment->set('tags', PluginImportLeap::get_entry_tags($entry));
$comment->commit();
array_unshift($createdartefacts, $comment->get('id'));
return $createdartefacts;
}
示例11: sorttablebycolumn
$data['ecommenters'] = $extcommenters;
$data['mcomments'] = $membercomments;
$data['ecomments'] = $extcomments;
$data['comments'] = $commenters;
$data['baseurl'] = $needsubdomain ? $view->get_url(true) : $wwwroot . $view->get_url(false);
}
if (in_array($sort, array('title', 'sharedby', 'mcomments', 'ecomments'))) {
sorttablebycolumn($sharedviews, $sort, $direction);
}
$sharedviews = array_slice($sharedviews, $offset, $limit);
list($searchform, $groupviews, $unusedpagination) = View::views_by_owner($group->id);
$groupviews = $groupviews->data;
$groupviewscount = count($groupviews);
foreach ($groupviews as &$data) {
$view = new View($data['id']);
$comments = ArtefactTypeComment::get_comments(0, 0, null, $view);
$extcommenters = 0;
$membercommenters = 0;
$extcomments = 0;
$membercomments = 0;
$commenters = array();
foreach ($comments->data as $c) {
if (empty($c->author)) {
if (!isset($commenters[$c->authorname])) {
$commenters[$c->authorname] = array();
}
$commenters[$c->authorname]['commenter'] = $c->authorname;
$commenters[$c->authorname]['count'] = isset($commenters[$c->authorname]['count']) ? $commenters[$c->authorname]['count'] + 1 : 1;
if ($commenters[$c->authorname]['count'] == 1) {
$extcommenters++;
}
示例12: __construct
/**
* @param array $data Parameters:
* - viewid (int)
* - commentid (int)
*/
public function __construct($data, $cron = false)
{
parent::__construct($data, $cron);
$comment = new ArtefactTypeComment($this->commentid);
$this->overridemessagecontents = true;
if ($onartefact = $comment->get('onartefact')) {
// feedback on artefact
$userid = null;
require_once get_config('docroot') . 'artefact/lib.php';
$artefactinstance = artefact_instance_from_id($onartefact);
if ($artefactinstance->feedback_notify_owner()) {
$userid = $artefactinstance->get('owner');
}
if (empty($this->url)) {
$this->url = get_config('wwwroot') . 'view/artefact.php?artefact=' . $onartefact . '&view=' . $this->viewid;
}
} else {
// feedback on view.
$onview = $comment->get('onview');
if (!($viewrecord = get_record('view', 'id', $onview))) {
throw new ViewNotFoundException(get_string('viewnotfound', 'error', $onview));
}
$userid = $viewrecord->owner;
if (empty($this->url)) {
$this->url = get_config('wwwroot') . 'view/view.php?id=' . $onview;
}
}
if (empty($userid)) {
return;
}
$this->users = activity_get_users($this->get_id(), array($userid));
$title = $onartefact ? $artefactinstance->get('title') : $viewrecord->title;
$this->urltext = $title;
$body = $comment->get('description');
$posttime = strftime(get_string('strftimedaydatetime'), $comment->get('ctime'));
$user = $this->users[0];
$lang = empty($user->lang) || $user->lang == 'default' ? get_config('lang') : $user->lang;
// Internal
$this->message = strip_tags(str_shorten_html($body, 200, true));
// Comment deleted notification
if ($deletedby = $comment->get('deletedby')) {
$this->strings = (object) array('subject' => (object) array('key' => 'commentdeletednotificationsubject', 'section' => 'artefact.comment', 'args' => array($title)));
$deletedmessage = ArtefactTypeComment::deleted_messages();
$removedbyline = get_string_from_language($lang, $deletedmessage[$deletedby], 'artefact.comment');
$this->message = $removedbyline . ":\n" . $this->message;
// Email
$this->users[0]->htmlmessage = get_string_from_language($lang, 'feedbackdeletedhtml', 'artefact.comment', $title, $removedbyline, $body, $this->url, $title);
$this->users[0]->emailmessage = get_string_from_language($lang, 'feedbackdeletedtext', 'artefact.comment', $title, $removedbyline, trim(html2text($body)), $title, $this->url);
return;
}
$this->strings = (object) array('subject' => (object) array('key' => 'newfeedbacknotificationsubject', 'section' => 'artefact.comment', 'args' => array($title)));
$this->url .= '&showcomment=' . $comment->get('id');
// Email
$author = $comment->get('author');
$authorname = empty($author) ? $comment->get('authorname') : display_name($author, $user);
$this->users[0]->htmlmessage = get_string_from_language($lang, 'feedbacknotificationhtml', 'artefact.comment', $authorname, $title, $posttime, $body, $this->url);
$this->users[0]->emailmessage = get_string_from_language($lang, 'feedbacknotificationtext', 'artefact.comment', $authorname, $title, $posttime, trim(html2text($body)), $this->url);
}
示例13: define
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
define('INTERNAL', 1);
define('PUBLIC', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
require_once get_config('libroot') . 'view.php';
require_once get_config('libroot') . 'pieforms/pieform.php';
safe_require('artefact', 'comment');
$extradata = json_decode(param_variable('extradata'));
if (!can_view_view($extradata->view)) {
json_reply('local', get_string('noaccesstoview', 'view'));
}
if (!empty($extradata->artefact) && !artefact_in_view($extradata->artefact, $extradata->view)) {
json_reply('local', get_string('accessdenied', 'error'));
}
$limit = param_integer('limit', 10);
$offset = param_integer('offset');
$artefact = null;
if (!empty($extradata->artefact)) {
$artefact = artefact_instance_from_id($extradata->artefact);
}
$view = new View($extradata->view);
$commentoptions = ArtefactTypeComment::get_comment_options();
$commentoptions->limit = $limit;
$commentoptions->offset = $offset;
$commentoptions->view = $view;
$commentoptions->artefact = $artefact;
$data = ArtefactTypeComment::get_comments($commentoptions);
json_reply(false, array('data' => $data));
示例14: delete
public function delete()
{
safe_require('artefact', 'comment');
db_begin();
ArtefactTypeComment::delete_view_comments($this->id);
delete_records('view_access', 'view', $this->id);
delete_records('view_autocreate_grouptype', 'view', $this->id);
delete_records('view_tag', 'view', $this->id);
delete_records('view_visit', 'view', $this->id);
delete_records('collection_view', 'view', $this->id);
delete_records('usr_watchlist_view', 'view', $this->id);
if ($blockinstanceids = get_column('block_instance', 'id', 'view', $this->id)) {
require_once get_config('docroot') . 'blocktype/lib.php';
foreach ($blockinstanceids as $id) {
$bi = new BlockInstance($id);
$bi->delete();
}
}
handle_event('deleteview', $this->id);
delete_records('view_rows_columns', 'view', $this->id);
delete_records('view', 'id', $this->id);
if (!empty($this->owner) && $this->is_submitted()) {
// There should be no way to delete a submitted view,
// but unlock its artefacts just in case.
ArtefactType::update_locked($this->owner);
}
require_once 'embeddedimage.php';
EmbeddedImage::delete_embedded_images('description', $this->id);
$this->deleted = true;
db_commit();
}
示例15: array_unshift
array_unshift($artefactpath, array('url' => get_config('wwwroot') . 'view/artefact.php?artefact=' . $parent . '&view=' . $viewid, 'title' => $parentobj->display_title()));
}
$parent = $parentobj->get('parent');
}
$artefactpath[] = array('url' => '', 'title' => $artefact->display_title());
// Feedback
$feedback = ArtefactTypeComment::get_comments($limit, $offset, $showcomment, $view, $artefact);
$javascript = <<<EOF
var viewid = {$viewid};
addLoadEvent(function () {
paginator = {$feedback->pagination_js}
});
EOF;
if ($artefact->get('allowcomments')) {
$anonfeedback = !$USER->is_logged_in() && view_has_token($viewid, get_cookie('viewaccess:' . $viewid));
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments')));
}
$objectionform = pieform(objection_form());
if ($notrudeform = $view->notrude_form()) {
$notrudeform = pieform($notrudeform);
}
$viewbeingwatched = (int) record_exists('usr_watchlist_view', 'usr', $USER->get('id'), 'view', $viewid);
$headers = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
$hasfeed = false;
$feedlink = '';
// add a link to the ATOM feed in the header if the view is public
if ($artefact->get('artefacttype') == 'blog' && $view->is_public()) {
$hasfeed = true;
$feedlink = get_config('wwwroot') . 'artefact/blog/atom.php?artefact=' . $artefactid . '&view=' . $viewid;
$headers[] = '<link rel="alternate" type="application/atom+xml" href="' . $feedlink . '" />';
}