コード例 #1
0
 function display()
 {
     global $db, $apx, $user, $set;
     $apx->lang->drop('comments', 'comments');
     $page = $this->getpage(array('p'));
     //Seitenzahlen
     list($count) = $db->first("SELECT count(id) FROM " . PRE . "_comments WHERE ( module='" . addslashes($this->module) . "' AND mid='" . $this->mid . "' AND active='1' )");
     pages($page, $count, $this->set['epp'], 'comp', 'COMMENT');
     //Sortierreihenfolge
     if ($this->set['order'] == 1) {
         $order = "a.time ASC";
     } else {
         $order = "a.time DESC";
     }
     //Kommentare auslesen
     $data = $db->fetch("SELECT a.* FROM " . PRE . "_comments AS a WHERE ( module='" . addslashes($this->module) . "' AND a.mid='" . $this->mid . "' AND a.active='1' ) ORDER BY " . $order . " " . getlimit($this->set['epp'], 'comp'));
     if (!count($data)) {
         return;
     }
     //Nummerierungs-Anfang
     if ($this->set['epp']) {
         if ($this->set['order'] == 0) {
             $entrynumber = $count - ($_REQUEST['comp'] - 1) * $this->set['epp'];
         } else {
             $entrynumber = 1 + ($_REQUEST['comp'] - 1) * $this->set['epp'];
         }
     } else {
         if ($this->set['order'] == 0) {
             $entrynumber = $count;
         } else {
             $entrynumber = 1;
         }
     }
     foreach ($data as $res) {
         ++$i;
         if ($res['userid'] && !isset($userinfo[$res['userid']])) {
             $userinfo[$res['userid']] = $user->get_info($res['userid'], 'username,email,pub_hidemail,homepage,avatar,avatar_title,signature,lastactive,pub_invisible,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10');
         }
         if ($res['userid'] && $userinfo[$res['userid']]) {
             $tabledata[$i]['USERID'] = $res['userid'];
             $tabledata[$i]['NAME'] = replace($userinfo[$res['userid']]['username']);
             $tabledata[$i]['EMAIL'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], $userinfo[$res['userid']]['email']));
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$userinfo[$res['userid']]['pub_hidemail'], cryptMail($userinfo[$res['userid']]['email'])));
             $tabledata[$i]['HOMEPAGE'] = replace($userinfo[$res['userid']]['homepage']);
             $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo[$res['userid']]);
             $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo[$res['userid']]);
             $tabledata[$i]['SIGNATURE'] = $user->mksig($userinfo[$res['userid']]);
             $tabledata[$i]['ONLINE'] = iif(!$userinfo[$res['userid']]['pub_invisible'] && $userinfo[$res['userid']]['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
             $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
             //Custom-Felder
             for ($ii = 1; $ii <= 10; $ii++) {
                 $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = $set['user']['cusfield_names'][$ii - 1];
                 $tabledata[$i]['CUSTOM' . $ii] = compatible_hsc($userinfo[$res['userid']]['custom' . $ii]);
             }
         } else {
             $tabledata[$i]['NAME'] = replace($res['username']);
             $tabledata[$i]['EMAIL'] = replace($res['email']);
             $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($res['email']));
             $tabledata[$i]['HOMEPAGE'] = replace($res['homepage']);
         }
         //Text
         $text = $res['text'];
         if ($this->set['badwords']) {
             $text = badwords($text);
         }
         $text = replace($text, 1);
         if ($this->set['breakline']) {
             $text = wordwrapHTML($text, $this->set['breakline'], "\n");
         }
         if ($this->set['allowsmilies']) {
             $text = dbsmilies($text);
         }
         if ($this->set['allowcode']) {
             $text = dbcodes($text);
         }
         //Titel
         $title = $res['title'];
         if ($this->set['breakline']) {
             $title = wordwrap($title, $this->set['breakline'], "\n", 1);
         }
         if ($this->set['badwords']) {
             $title = badwords($title);
         }
         $title = replace($title);
         $tabledata[$i]['TEXT'] = $text;
         $tabledata[$i]['TITLE'] = $title;
         $tabledata[$i]['TIME'] = $res['time'];
         $tabledata[$i]['NUMBER'] = $entrynumber;
         //Admin-Links
         if ($_COOKIE[$set['main']['cookie_pre'] . '_admin_userid'] && $_COOKIE[$set['main']['cookie_pre'] . '_admin_password']) {
             $tabledata[$i]['EDITLINK'] = HTTPDIR . 'admin/action.php?action=comments.edit&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
             $tabledata[$i]['DELETELINK'] = HTTPDIR . 'admin/action.php?action=comments.del&amp;module=' . $this->module . '&amp;mid=' . $this->mid . '&amp;id=' . $res['id'] . '&amp;outer=1';
         }
         //Melden
         $link_report = "javascript:popupwin('misc.php?action=comments_report&amp;id=" . $res['id'] . "&amp;url='+escape(window.location.href),500,300);";
         $tabledata[$i]['REPORTLINK'] = $link_report;
         //Kommentarnummer
         if ($this->set['order'] == 0) {
             --$entrynumber;
         } else {
             ++$entrynumber;
         }
     }
     return $tabledata;
 }
コード例 #2
0
ファイル: guestbook.php プロジェクト: bigfraggle/open-apexx
     $tabledata[$i]['ONLINE'] = iif(!$userinfo[$res['userid']]['pub_invisible'] && $userinfo[$res['userid']]['lastactive'] + $set['user']['timeout'] * 60 >= time(), 1, 0);
     $tabledata[$i]['ISONLINE'] = $tabledata[$i]['ONLINE'];
 } else {
     $tabledata[$i]['NAME'] = replace($res['username']);
     $tabledata[$i]['EMAIL'] = replace($res['email']);
     $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($res['email']));
     $tabledata[$i]['HOMEPAGE'] = replace($res['homepage']);
 }
 //Text
 $text = $res['text'];
 if ($set['guestbook']['badwords']) {
     $text = badwords($text);
 }
 $text = replace($text, 1);
 if ($set['guestbook']['breakline']) {
     $text = wordwrapHTML($text, $set['guestbook']['breakline'], "\n", 1);
 }
 if ($set['guestbook']['allowsmilies']) {
     $text = dbsmilies($text);
 }
 if ($set['guestbook']['allowcode']) {
     $text = dbcodes($text);
 }
 //Titel
 $title = $res['title'];
 if ($set['guestbook']['breakline']) {
     $title = wordwrap($title, $set['guestbook']['breakline'], "\n", 1);
 }
 if ($set['guestbook']['badwords']) {
     $title = badwords($title);
 }