Esempio n. 1
0
        public function Content($attachid, $page, $rpath = '', $issave = false)
        {
            $i = 0;
            $comments = $this->pdh->get('comment', 'filtered_list', array($page, $attachid));
            $myrootpath = $issave ? clean_rootpath($rpath) : $this->root_path;
            $this->bbcode->SetSmiliePath($myrootpath . 'images/smilies');
            // The delete form
            $html = '<form id="comment_delete" name="comment_delete" action="' . $this->root_path . 'exchange.php' . $this->SID . '&amp;out=comments" method="post">';
            $html .= '</form>';
            // the content Box
            $html .= '<div class="contentBox">';
            $html .= '<div class="boxHeader"><h1>' . $this->user->lang('comments') . '</h1></div>';
            $html .= '<div class="boxContent">';
            $out = '';
            if (is_array($comments)) {
                foreach ($comments as $row) {
                    // Avatar
                    $avatarimg = $this->pdh->get('user', 'avatarimglink', array($row['userid']));
                    // output
                    $out[] .= '<div class="' . ($i % 2 ? 'rowcolor2' : 'rowcolor1') . ' clearfix">
								<div class="floatLeft" style="overflow: hidden; width: 15%;">
									<div class="comment_avatar"><img src="' . ($avatarimg ? $this->pfh->FileLink($avatarimg, false, 'absolute') : $myrootpath . 'images/no_pic.png') . '" alt="Avatar" /></div>
								</div>
								<div class="floatLeft" style="overflow: hidden; width: 85%;">
									<span class="small bold">' . htmlspecialchars($row['username']) . ' am ' . $this->time->user_date($row['date'], true) . '</span>';
                    if ($this->isAdmin or $row['userid'] == $this->UserID) {
                        $out[] .= '<div class="comments_delete small bold floatRight hand" ><img src="' . $myrootpath . 'images/global/delete.png" alt="" />';
                        $out[] .= '<div style="display:none" class="comments_page">' . $page . '</div>';
                        $out[] .= '<div style="display:none" class="comments_deleteid">' . $row['id'] . '</div>';
                        $out[] .= '<div style="display:none" class="comments_attachid">' . $attachid . '</div>';
                        $out[] .= '<div style="display:none" class="comments_myrootpath">' . $myrootpath . '</div>';
                        $out[] .= '</div>';
                    }
                    $out[] .= '<br class="clear"/><span class="comment_text">' . $this->bbcode->MyEmoticons($this->bbcode->toHTML($row['text'])) . '</span><br/>
									</div>
								</div><br/>';
                    $i++;
                }
            }
            if (isset($out) && is_array($out) && count($out) > 0) {
                foreach ($out as $vvalues) {
                    $html .= $vvalues;
                }
            } else {
                $html .= $this->user->lang('comments_empty');
            }
            $html .= '</div></div>';
            return $html;
        }
Esempio n. 2
0
 /**
  * getContent
  * get the content of the shoutbox
  *
  * @param  string   $orientation  orientation vertical/horizontal
  * @param  string   $rpath        root path
  *
  * @returns  string
  */
 public function getContent($orientation, $rpath = '')
 {
     // get shoutbox ids to display
     $shoutbox_ids = $this->getShoutboxOutEntries();
     //Clean Root Path
     $rpath = clean_rootpath($rpath);
     // empty output
     $htmlOut = '';
     // get the layout
     $layout_file = $this->root_path . 'plugins/shoutbox/includes/styles/sb_' . $orientation . '.class.php';
     if (file_exists($layout_file)) {
         include_once $layout_file;
         $class_name = 'sb_' . $orientation;
         $shoutbox_style = registry::register($class_name, array($shoutbox_ids));
     }
     // get content
     if ($shoutbox_style) {
         $htmlOut .= $shoutbox_style->getContent($rpath);
     }
     return $htmlOut;
 }