=====Source: show.php=====
last updated: 5 Aug 2007
author: KlenWell
note: the code has not yet been tested (I need to upgrade to the latest version before I'll be able to test it)
%%(php)
GetUserName();
$is_owner = $obj->UserIsOwner();
$prev_level = null;
$threaded = 0;
if ($_SESSION['show_comments'][$tag] == COMMENT_ORDER_THREADED)
{
$threaded = 1;
}
?>
'."\n";
}
}
# Alternate light/dark comment styles per level
$comment_class = '';
if ($comment['level'] % 2 == 1)
{
$comment_class = "comment-layout-1";
}
else
{
$comment_class = "comment-layout-2";
}
if ($comment['status'] == 'deleted') {
?>
HasAccess('read'))
{
$_SHOW['no_access'] = 1;
}
// Page Exists
if ( !$this->page )
{
$_SHOW['not_exists'] = 1;
}
else
{
$_SHOW['page_body'] = 1;
}
// As Revision
if ($this->page['latest'] == 'N')
{
$_SHOW['revision_info'] = 1;
}
// Revision w/ write access
if ( ($this->page['latest'] == 'N' && $this->HasAccess('write')) && ($latest = $this->LoadPage($this->tag)) )
{
$_SHOW['revision_edit_form'] = 1;
}
// Show Comment Form
if ( $this->GetConfigValue('hide_comments') != 1 )
{
// get page tag
$tag = $this->GetPageTag();
// session settings?
if ( !isset($_SESSION['show_comments'][$tag]) && $this->UserWantsComments($tag) !== FALSE )
{
$_SESSION['show_comments'][$tag] = $this->UserWantsComments($tag);
}
// GET setting takes precedence
if ( isset($_GET['show_comments']) ) #312
{
switch($_GET['show_comments'])
{
case COMMENT_NO_DISPLAY:
$_SESSION['show_comments'][$tag] = COMMENT_NO_DISPLAY;
break;
case COMMENT_ORDER_DATE_ASC:
$_SESSION['show_comments'][$tag] = COMMENT_ORDER_DATE_ASC;
break;
case COMMENT_ORDER_DATE_DESC:
$_SESSION['show_comments'][$tag] = COMMENT_ORDER_DATE_DESC;
break;
case COMMENT_ORDER_THREADED:
$_SESSION['show_comments'][$tag] = COMMENT_ORDER_THREADED;
break;
}
}
if ( isset($_SESSION['show_comments'][$tag]) && ($_SESSION['show_comments'][$tag] != COMMENT_NO_DISPLAY) )
{
$_SHOW['comment_form'] = 1;
}
else
{
$_SHOW['hidden_comments'] = 1;
}
}
// Show Comments?
$comments = $this->LoadComments($this->tag);
if ( $_SESSION['show_comments'][$tag] && $comments )
{
$_SHOW['comments'] = 1;
}
// Comment Post?
if ( $this->HasAccess('comment_post') )
{
$_SHOW['comment_post'] = 1;
}
// *** Viewer Blocks
// Page Start
if ( $_SHOW['page_start'] )
{
$_js = ( ($user = $this->GetUser()) && ($user['doubleclickedit'] == 'N') || !$this->HasAccess('write') ) ? '' : 'ondblclick="document.location=\''.$this->Href('edit').'\';" ';
$_HTML['page_start'] = <<
HTML;
}
// Generic
if ( $_SHOW['no_access'] )
{
$inner = '
'.WIKKA_ERROR_ACL_READ.'
';
$_HTML['no_access'] = <<
HTML;
}
// Page does not exist yet
if ( $_SHOW['not_exists'] )
{
$createlink = '
'.WIKKA_PAGE_CREATE_LINK_DESC.'';
$inner = '
'.sprintf(SHOW_ASK_CREATE_PAGE_CAPTION,$createlink).'
';
$_HTML['not_exists'] = <<
HTML;
}
// Revision Info
if ( $_SHOW['revision_info'] )
{
$pagelink = '
'.$this->tag.'';
$inner = '
'.sprintf(SHOW_OLD_REVISION_CAPTION,$pagelink,$this->Link($this->tag, 'revisions', $this->page['time']));
$_HTML['revision_info'] = <<
HTML;
}
// Page Body
if ( $_SHOW['page_body'] )
{
$_HTML['page_body'] = $this->Format($this->page['body'], 'wakka', 'page');
$_HTML['page_close_div'] = "\n".'
'."\n\n";
}
// Revision Edit Form
if ( $_SHOW['revision_edit_form'] )
{
$form_start = $this->FormOpen('edit');
$lid = $latest['id'];
$hvalue = $this->htmlspecialchars_ent($this->page['body']);
$svalue = SHOW_RE_EDIT_BUTTON;
$form_close = $this->FormClose();
$_HTML['revision_edit_form'] = <<
$form_start