本文整理汇总了PHP中Story::DisplayElements方法的典型用法代码示例。如果您正苦于以下问题:PHP Story::DisplayElements方法的具体用法?PHP Story::DisplayElements怎么用?PHP Story::DisplayElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Story
的用法示例。
在下文中一共展示了Story::DisplayElements方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: service_submit_story
//.........这里部分代码省略.........
$upload->setMogrifyPath($_CONF['path_to_mogrify']);
} elseif ($_CONF['image_lib'] == 'netpbm') {
// using netPBM
$upload->setNetPBM($_CONF['path_to_netpbm']);
} elseif ($_CONF['image_lib'] == 'gdlib') {
// using the GD library
$upload->setGDLib();
}
$upload->setAutomaticResize(true);
if ($_CONF['keep_unscaled_image'] == 1) {
$upload->keepOriginalImage(true);
} else {
$upload->keepOriginalImage(false);
}
if (isset($_CONF['jpeg_quality'])) {
$upload->setJpegQuality($_CONF['jpeg_quality']);
}
}
$upload->setAllowedMimeTypes(array('image/gif' => '.gif', 'image/jpeg' => '.jpg,.jpeg', 'image/pjpeg' => '.jpg,.jpeg', 'image/x-png' => '.png', 'image/png' => '.png'));
if (!$upload->setPath($_CONF['path_images'] . 'articles')) {
$output = COM_showMessageText($upload->printErrors(false), $LANG24[30]);
$output = COM_createHTMLDocument($output, array('pagetitle' => $LANG24[30]));
echo $output;
exit;
}
// NOTE: if $_CONF['path_to_mogrify'] is set, the call below will
// force any images bigger than the passed dimensions to be resized.
// If mogrify is not set, any images larger than these dimensions
// will get validation errors
$upload->setMaxDimensions($_CONF['max_image_width'], $_CONF['max_image_height']);
$upload->setMaxFileSize($_CONF['max_image_size']);
// size in bytes, 1048576 = 1MB
// Set file permissions on file after it gets uploaded (number is in octal)
$upload->setPerms('0644');
$filenames = array();
$end_index = $index_start + $upload->numFiles() - 1;
for ($z = $index_start; $z <= $end_index; $z++) {
$curfile = current($_FILES);
if (!empty($curfile['name'])) {
$pos = strrpos($curfile['name'], '.') + 1;
$fextension = substr($curfile['name'], $pos);
$filenames[] = $sid . '_' . $z . '.' . $fextension;
}
next($_FILES);
}
$upload->setFileNames($filenames);
reset($_FILES);
$upload->uploadFiles();
if ($upload->areErrors()) {
$retval = COM_showMessageText($upload->printErrors(false), $LANG24[30]);
$output = COM_createHTMLDocument($output, array('pagetitle' => $LANG24[30]));
echo $retval;
exit;
}
reset($filenames);
for ($z = $index_start; $z <= $end_index; $z++) {
DB_query("INSERT INTO {$_TABLES['article_images']} (ai_sid, ai_img_num, ai_filename) VALUES ('{$sid}', {$z}, '" . current($filenames) . "')");
next($filenames);
}
}
if ($_CONF['maximagesperarticle'] > 0) {
$errors = $story->checkAttachedImages();
if (count($errors) > 0) {
$output .= COM_startBlock($LANG24[54], '', COM_getBlockTemplate('_msg_block', 'header'));
$output .= $LANG24[55] . LB . '<ul>' . LB;
foreach ($errors as $err) {
$output .= '<li>' . $err . '</li>' . LB;
}
$output .= '</ul>' . LB;
$output .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
$output .= storyeditor($sid);
$output = COM_createHTMLDocument($output, array('pagetitle' => $LANG24[54]));
echo $output;
exit;
}
}
}
$result = $story->saveToDatabase();
if ($result == STORY_SAVED) {
// see if any plugins want to act on that story
if (!empty($args['old_sid']) && $args['old_sid'] != $sid) {
PLG_itemSaved($sid, 'article', $args['old_sid']);
} else {
PLG_itemSaved($sid, 'article');
}
// update feed(s)
COM_rdfUpToDateCheck('article', $story->DisplayElements('tid'), $sid);
COM_rdfUpToDateCheck('comment');
STORY_updateLastArticlePublished();
CMT_updateCommentcodes();
if ($story->type == 'submission') {
$output = COM_refresh($_CONF['site_admin_url'] . '/moderation.php?msg=9');
} else {
$output = PLG_afterSaveSwitch($_CONF['aftersave_story'], COM_buildURL("{$_CONF['site_url']}/article.php?story={$sid}"), 'story', 9);
}
/* @TODO Set the object id here */
$svc_msg['id'] = $sid;
return PLG_RET_OK;
}
}
示例2: mailstory
/**
* Email story to a friend
*
* @param string $sid id of story to email
* @param string $to name of person / friend to email
* @param string $toemail friend's email address
* @param string $from name of person sending the email
* @param string $fromemail sender's email address
* @param string $shortmsg short intro text to send with the story
* @return string Meta refresh
*
* Modification History
*
* Date Author Description
* ---- ------ -----------
* 4/17/01 Tony Bibbs Code now allows anonymous users to send email
* and it allows user to input a message as well
* Thanks to Yngve Wassvik Bergheim for some of
* this code
*
*/
function mailstory($sid, $to, $toemail, $from, $fromemail, $shortmsg)
{
global $_CONF, $_TABLES, $LANG01, $LANG08;
require_once $_CONF['path_system'] . 'lib-story.php';
$storyurl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid);
if ($_CONF['url_rewrite']) {
$retval = COM_refresh($storyurl . '?msg=85');
} else {
$retval = COM_refresh($storyurl . '&msg=85');
}
// check for correct $_CONF permission
if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['emailstoryloginrequired'] == 1)) {
return $retval;
}
// check if emailing of stories is disabled
if ($_CONF['hideemailicon'] == 1) {
return $retval;
}
// check mail speedlimit
COM_clearSpeedlimit($_CONF['speedlimit'], 'mail');
if (COM_checkSpeedlimit('mail') > 0) {
return $retval;
}
$story = new Story();
$result = $story->loadFromDatabase($sid, 'view');
if ($result != STORY_LOADED_OK) {
return COM_refresh($_CONF['site_url'] . '/index.php');
}
$shortmsg = COM_stripslashes($shortmsg);
$mailtext = sprintf($LANG08[23], $from, $fromemail) . LB;
if (strlen($shortmsg) > 0) {
$mailtext .= LB . sprintf($LANG08[28], $from) . $shortmsg . LB;
}
// just to make sure this isn't an attempt at spamming users ...
$result = PLG_checkforSpam($mailtext, $_CONF['spamx']);
if ($result > 0) {
COM_updateSpeedlimit('mail');
COM_displayMessageAndAbort($result, 'spamx', 403, 'Forbidden');
}
$mailtext .= '------------------------------------------------------------' . LB . LB . COM_undoSpecialChars($story->displayElements('title')) . LB . strftime($_CONF['date'], $story->DisplayElements('unixdate')) . LB;
if ($_CONF['contributedbyline'] == 1) {
$author = COM_getDisplayName($story->displayElements('uid'));
$mailtext .= $LANG01[1] . ' ' . $author . LB;
}
$introtext = $story->DisplayElements('introtext');
$bodytext = $story->DisplayElements('bodytext');
$introtext = COM_undoSpecialChars(strip_tags($introtext));
$bodytext = COM_undoSpecialChars(strip_tags($bodytext));
$introtext = str_replace(array("\n\r", "\r"), LB, $introtext);
$bodytext = str_replace(array("\n\r", "\r"), LB, $bodytext);
$mailtext .= LB . $introtext;
if (!empty($bodytext)) {
$mailtext .= LB . LB . $bodytext;
}
$mailtext .= LB . LB . '------------------------------------------------------------' . LB;
if ($story->DisplayElements('commentcode') == 0) {
// comments allowed
$mailtext .= $LANG08[24] . LB . COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid . '#comments');
} else {
// comments not allowed - just add the story's URL
$mailtext .= $LANG08[33] . LB . COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid);
}
$mailto = COM_formatEmailAddress($to, $toemail);
$mailfrom = COM_formatEmailAddress($from, $fromemail);
$subject = 'Re: ' . COM_undoSpecialChars(strip_tags($story->DisplayElements('title')));
$sent = COM_mail($mailto, $subject, $mailtext, $mailfrom);
if ($sent && isset($_POST['cc']) && $_POST['cc'] == 'on') {
$ccmessage = sprintf($LANG08[38], $to);
$ccmessage .= "\n------------------------------------------------------------\n\n" . $mailtext;
$sent = COM_mail($mailfrom, $subject, $ccmessage, $mailfrom);
}
COM_updateSpeedlimit('mail');
// Increment numemails counter for story
DB_query("UPDATE {$_TABLES['stories']} SET numemails = numemails + 1 WHERE sid = '{$sid}'");
if ($_CONF['url_rewrite']) {
$retval = COM_refresh($storyurl . '?msg=' . ($sent ? '27' : '85'));
} else {
$retval = COM_refresh($storyurl . '&msg=' . ($sent ? '27' : '85'));
}
//.........这里部分代码省略.........
示例3: _createMailStory
function _createMailStory($sid)
{
global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG01, $LANG08;
USES_lib_story();
$story = new Story();
$args = array('sid' => $sid, 'mode' => 'view');
$output = STORY_LOADED_OK;
$result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
if ($result == PLG_RET_OK) {
/* loadFromArray cannot be used, since it overwrites the timestamp */
reset($story->_dbFields);
while (list($fieldname, $save) = each($story->_dbFields)) {
$varname = '_' . $fieldname;
if (array_key_exists($fieldname, $output)) {
$story->{$varname} = $output[$fieldname];
}
}
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true, 'error') . COM_siteFooter();
echo $display;
exit;
} elseif ($output == STORY_INVALID_SID) {
COM_404();
} else {
$T = new Template($_CONF['path_layout'] . 'article');
$T->set_file('article', 'mailable.thtml');
list($cacheFile, $style_cache_url) = COM_getStyleCacheLocation();
$T->set_var('direction', $LANG_DIRECTION);
$T->set_var('css_url', $style_cache_url);
$T->set_var('page_title', $_CONF['site_name'] . ': ' . $story->displayElements('title'));
$T->set_var('story_title', $story->DisplayElements('title'));
$T->set_var('story_subtitle', $story->DisplayElements('subtitle'));
$story_image = $story->DisplayElements('story_image');
if ($story_image != '') {
$T->set_var('story_image', $story_image);
} else {
$T->unset_var('story_image');
}
if ($_CONF['hidestorydate'] != 1) {
$T->set_var('story_date', $story->displayElements('date'));
}
if ($_CONF['contributedbyline'] == 1) {
$T->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$T->set_var('author', $authorname);
$T->set_var('story_author', $authorname);
$T->set_var('story_author_username', $story->DisplayElements('username'));
}
$T->set_var('story_introtext', $story->DisplayElements('introtext'));
$T->set_var('story_bodytext', $story->DisplayElements('bodytext'));
$T->set_var('site_name', $_CONF['site_name']);
$T->set_var('site_slogan', $_CONF['site_slogan']);
$T->set_var('story_id', $story->getSid());
$articleUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid());
if ($story->DisplayElements('commentcode') >= 0) {
$commentsUrl = $articleUrl . '#comments';
$comments = $story->DisplayElements('comments');
$numComments = COM_numberFormat($comments);
$T->set_var('story_comments', $numComments);
$T->set_var('comments_url', $commentsUrl);
$T->set_var('comments_text', $numComments . ' ' . $LANG01[3]);
$T->set_var('comments_count', $numComments);
$T->set_var('lang_comments', $LANG01[3]);
$comments_with_count = sprintf($LANG01[121], $numComments);
if ($comments > 0) {
$comments_with_count = COM_createLink($comments_with_count, $commentsUrl);
}
$T->set_var('comments_with_count', $comments_with_count);
}
$T->set_var('lang_full_article', $LANG08[33]);
$T->set_var('article_url', $articleUrl);
COM_setLangIdAndAttribute($T);
$T->parse('output', 'article');
$htmlMsg = $T->finish($T->get_var('output'));
return $htmlMsg;
}
}
示例4: elseif
}
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display .= COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG_ACCESS['storydenialmsg'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')) . COM_siteFooter();
} elseif ($output == STORY_INVALID_SID) {
$display .= COM_refresh($_CONF['site_url'] . '/index.php');
} elseif ($mode == 'print' && $_CONF['hideprintericon'] == 0) {
$story_template = COM_newTemplate($_CONF['path_layout'] . 'article');
$story_template->set_file('article', 'printable.thtml');
if (XHTML != '') {
$story_template->set_var('xmlns', ' xmlns="http://www.w3.org/1999/xhtml"');
}
$story_template->set_var('direction', $LANG_DIRECTION);
$story_template->set_var('page_title', $story->DisplayElements('page_title'));
$story_template->set_var('story_title', $story->DisplayElements('title'));
header('Content-Type: text/html; charset=' . COM_getCharset());
if (!empty($_CONF['frame_options'])) {
header('X-FRAME-OPTIONS: ' . $_CONF['frame_options']);
}
$story_template->set_var('story_date', $story->displayElements('date'));
if ($_CONF['contributedbyline'] == 1) {
$story_template->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$story_template->set_var('author', $authorname);
$story_template->set_var('story_author', $authorname);
$story_template->set_var('story_author_username', $story->DisplayElements('username'));
}
$introtext = $story->DisplayElements('introtext');
$bodytext = $story->DisplayElements('bodytext');
示例5: elseif
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true, 'error') . COM_siteFooter();
echo $display;
exit;
} elseif ($output == STORY_INVALID_SID) {
COM_404();
} elseif ($mode == 'print' && $_CONF['hideprintericon'] == 0) {
$story_template = new Template($_CONF['path_layout'] . 'article');
$story_template->set_file('article', 'printable.thtml');
list($cacheFile, $style_cache_url) = COM_getStyleCacheLocation();
$story_template->set_var('direction', $LANG_DIRECTION);
$story_template->set_var('css_url', $style_cache_url);
$story_template->set_var('page_title', $_CONF['site_name'] . ': ' . $story->displayElements('title'));
$story_template->set_var('story_title', $story->DisplayElements('title'));
if ($_CONF['hidestorydate'] != 1) {
$story_template->set_var('story_date', $story->displayElements('date'));
}
if ($_CONF['contributedbyline'] == 1) {
$story_template->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$story_template->set_var('author', $authorname);
$story_template->set_var('story_author', $authorname);
$story_template->set_var('story_author_username', $story->DisplayElements('username'));
}
$story_template->set_var('story_introtext', $story->DisplayElements('introtext'));
$story_template->set_var('story_bodytext', $story->DisplayElements('bodytext'));
$story_template->set_var('site_name', $_CONF['site_name']);
$story_template->set_var('site_slogan', $_CONF['site_slogan']);
$story_template->set_var('story_id', $story->getSid());
示例6: COUNT
}
$msql = "SELECT s.*, UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . $userfields . ", t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s LEFT JOIN {$_TABLES['users']} AS u ON s.uid=u.uid " . "LEFT JOIN {$_TABLES['topics']} AS t on s.tid=t.tid WHERE " . $sql . "ORDER BY featured DESC," . $orderBy . " LIMIT {$offset}, {$limit}";
$result = DB_query($msql);
$nrows = DB_numRows($result);
$data = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} AS s WHERE" . $sql);
$D = DB_fetchArray($data);
$num_pages = ceil($D['count'] / $limit);
$articleCounter = 0;
if ($A = DB_fetchArray($result)) {
$story = new Story();
$story->loadFromArray($A);
if ($_CONF['showfirstasfeatured'] == 1) {
$story->_featured = 1;
}
// display first article
if ($story->DisplayElements('featured') == 1) {
$pageBody .= STORY_renderArticle($story, 'y');
$pageBody .= PLG_showCenterblock(CENTERBLOCK_AFTER_FEATURED, $page, $topic);
} else {
$pageBody .= PLG_showCenterblock(CENTERBLOCK_AFTER_FEATURED, $page, $topic);
$pageBody .= STORY_renderArticle($story, 'y');
}
$articleCounter++;
// get remaining stories
while ($A = DB_fetchArray($result)) {
$pageBody .= PLG_displayAdBlock('story', $articleCounter);
$story = new Story();
$story->loadFromArray($A);
$pageBody .= STORY_renderArticle($story, 'y');
$articleCounter++;
}
示例7: elseif
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true, 'error') . COM_siteFooter();
echo $display;
exit;
} elseif ($output == STORY_INVALID_SID) {
COM_404();
} elseif ($mode == 'print' && $_CONF['hideprintericon'] == 0) {
$story_template = new Template($_CONF['path_layout'] . 'article');
$story_template->set_file('article', 'printable.thtml');
list($cacheFile, $style_cache_url) = COM_getStyleCacheLocation();
$story_template->set_var('direction', $LANG_DIRECTION);
$story_template->set_var('css_url', $style_cache_url);
$story_template->set_var('page_title', $_CONF['site_name'] . ': ' . $story->displayElements('title'));
$story_template->set_var('story_title', $story->DisplayElements('title'));
$story_template->set_var('story_subtitle', $story->DisplayElements('subtitle'));
$story_image = $story->DisplayElements('story_image');
if ($story_image != '') {
$story_template->set_var('story_image', $story_image);
} else {
$story_template->unset_var('story_image');
}
if ($_CONF['hidestorydate'] != 1) {
$story_template->set_var('story_date', $story->displayElements('date'));
}
if ($_CONF['contributedbyline'] == 1) {
$story_template->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$story_template->set_var('author', $authorname);
$story_template->set_var('story_author', $authorname);
示例8: service_submit_story
//.........这里部分代码省略.........
$output .= COM_siteFooter();
echo $output;
exit;
}
// NOTE: if $_CONF['path_to_mogrify'] is set, the call below will
// force any images bigger than the passed dimensions to be resized.
// If mogrify is not set, any images larger than these dimensions
// will get validation errors
$upload->setMaxDimensions($_CONF['max_image_width'], $_CONF['max_image_height']);
$upload->setMaxFileSize($_CONF['max_image_size']);
// size in bytes, 1048576 = 1MB
// Set file permissions on file after it gets uploaded (number is in octal)
$upload->setPerms('0644');
$filenames = array();
$sql = "SELECT MAX(ai_img_num) + 1 AS ai_img_num FROM " . $_TABLES['article_images'] . " WHERE ai_sid = '" . DB_escapeString($sid) . "'";
$result = DB_query($sql, 1);
$row = DB_fetchArray($result);
$ai_img_num = $row['ai_img_num'];
if ($ai_img_num < 1) {
$ai_img_num = 1;
}
for ($z = 0; $z < $_CONF['maximagesperarticle']; $z++) {
$curfile['name'] = '';
if (isset($_FILES['file']['name'][$z])) {
$curfile['name'] = $_FILES['file']['name'][$z];
}
if (!empty($curfile['name'])) {
$pos = strrpos($curfile['name'], '.') + 1;
$fextension = substr($curfile['name'], $pos);
$filenames[] = $sid . '_' . $ai_img_num . '.' . $fextension;
$ai_img_num++;
} else {
$filenames[] = '';
}
}
$upload->setFileNames($filenames);
$upload->uploadFiles();
//@TODO - better error handling
if ($upload->areErrors()) {
$retval = COM_siteHeader('menu', $LANG24[30]);
$retval .= COM_showMessageText($upload->printErrors(false), $LANG24[30], true);
$retval .= STORY_edit($sid, 'error');
$retval .= COM_siteFooter();
echo $retval;
exit;
}
for ($z = 0; $z < $_CONF['maximagesperarticle']; $z++) {
if ($filenames[$z] != '') {
$sql = "SELECT MAX(ai_img_num) + 1 AS ai_img_num FROM " . $_TABLES['article_images'] . " WHERE ai_sid = '" . DB_escapeString($sid) . "'";
$result = DB_query($sql, 1);
$row = DB_fetchArray($result);
$ai_img_num = $row['ai_img_num'];
if ($ai_img_num < 1) {
$ai_img_num = 1;
}
DB_query("INSERT INTO {$_TABLES['article_images']} (ai_sid, ai_img_num, ai_filename) VALUES ('" . DB_escapeString($sid) . "', {$ai_img_num}, '" . DB_escapeString($filenames[$z]) . "')");
}
}
}
if ($_CONF['maximagesperarticle'] > 0) {
$errors = $story->checkImages();
if (count($errors) > 0) {
$output = COM_siteHeader('menu', $LANG24[54]);
$eMsg = $LANG24[55] . '<p>';
for ($i = 1; $i <= count($errors); $i++) {
$eMsg .= current($errors) . '<br />';
next($errors);
}
//@TODO - use return here...
$output .= COM_showMessageText($eMsg, $LANG24[54], true);
$output .= STORY_edit($sid, 'error');
$output .= COM_siteFooter();
echo $output;
exit;
}
}
}
$result = $story->saveToDatabase();
if ($result == STORY_SAVED) {
// see if any plugins want to act on that story
if (!empty($args['old_sid']) && $args['old_sid'] != $sid) {
PLG_itemSaved($sid, 'article', $args['old_sid']);
} else {
PLG_itemSaved($sid, 'article');
}
// update feed(s) and Older Stories block
COM_rdfUpToDateCheck('article', $story->DisplayElements('tid'), $sid);
COM_olderStuff();
if ($story->type == 'submission') {
COM_setMessage(9);
echo COM_refresh($_CONF['site_admin_url'] . '/moderation.php');
exit;
} else {
$output = PLG_afterSaveSwitch($_CONF['aftersave_story'], COM_buildURL("{$_CONF['site_url']}/article.php?story={$sid}"), 'story', 9);
}
/* @TODO Set the object id here */
$svc_msg['id'] = $sid;
return PLG_RET_OK;
}
}
示例9: array
$story->_username = $output['username'];
$story->_fullname = $output['fullname'];
}
if ($output == STORY_PERMISSION_DENIED) {
$display = COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied']);
$display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_ACCESS['accessdenied']));
} elseif ($output == STORY_INVALID_SID) {
COM_handle404();
} elseif ($mode === 'print' && $_CONF['hideprintericon'] == 0) {
$story_template = COM_newTemplate($_CONF['path_layout'] . 'article');
$story_template->set_file('article', 'printable.thtml');
if (XHTML != '') {
$story_template->set_var('xmlns', ' xmlns="http://www.w3.org/1999/xhtml"');
}
$story_template->set_var('direction', $LANG_DIRECTION);
$story_template->set_var('page_title', $story->DisplayElements('page_title'));
$story_template->set_var('story_title', $story->DisplayElements('title'));
header('Content-Type: text/html; charset=' . COM_getCharset());
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
if (!empty($_CONF['frame_options'])) {
header('X-FRAME-OPTIONS: ' . $_CONF['frame_options']);
}
$story_template->set_var('story_date', $story->displayElements('date'));
if ($_CONF['contributedbyline'] == 1) {
$story_template->set_var('lang_contributedby', $LANG01[1]);
$authorname = COM_getDisplayName($story->displayElements('uid'));
$story_template->set_var('author', $authorname);
$story_template->set_var('story_author', $authorname);
$story_template->set_var('story_author_username', $story->DisplayElements('username'));
}