示例#1
0
 /**
  * Обработка текстов перед выводом на экран
  *
  * @param string $str
  * @param int    $br   Параметр обработки переносов строк
  *                     0 - не обрабатывать (по умолчанию)
  *                     1 - обрабатывать
  *                     2 - вместо переносов строки вставляются пробелы
  * @param int    $tags Параметр обработки тэгов
  *                     0 - не обрабатывать (по умолчанию)
  *                     1 - обрабатывать
  *                     2 - вырезать тэги
  *
  * @return string
  */
 public static function checkout($str, $br = 0, $tags = 0)
 {
     $str = htmlentities(trim($str), ENT_QUOTES, 'UTF-8');
     if ($br == 1) {
         // Вставляем переносы строк
         $str = nl2br($str);
     } elseif ($br == 2) {
         $str = str_replace("\r\n", ' ', $str);
     }
     if ($tags == 1) {
         $str = bbcode::tags($str);
     } elseif ($tags == 2) {
         $str = bbcode::notags($str);
     }
     return trim($str);
 }
示例#2
0
 // Сохраняем тему в формате HTML                          //
 ////////////////////////////////////////////////////////////
 $text = "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n<title>" . $lng['forum'] . "</title>\n<style type='text/css'>\nbody { color: #000000; background-color: #FFFFFF }\ndiv { margin: 1px 0px 1px 0px; padding: 5px 5px 5px 5px;}\n.b {background-color: #FFFFFF; }\n.c {background-color: #EEEEEE; }\n.quote{font-size: x-small; padding: 2px 0px 2px 4px; color: #878787; border-left: 3px solid #c0c0c0;\n}\n</style></head>\n      <body><p><b><u>{$type1['text']}</u></b></p>";
 $i = 1;
 while ($arr = mysql_fetch_array($tema)) {
     $d = $i / 2;
     $d1 = ceil($d);
     $d2 = $d1 - $d;
     $d3 = ceil($d2);
     if ($d3 == 0) {
         $div = "<div class='b'>";
     } else {
         $div = "<div class='c'>";
     }
     $txt_tmp = htmlentities($arr['text'], ENT_QUOTES, 'UTF-8');
     $txt_tmp = bbcode::tags($txt_tmp);
     $txt_tmp = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $txt_tmp);
     $txt_tmp = str_replace("\r\n", "<br/>", $txt_tmp);
     $stroka = "{$div} <b>{$arr['from']}</b>(" . date("d.m.Y/H:i", $arr['time']) . ")<br/>{$txt_tmp}</div>";
     $text = "{$text} {$stroka}";
     ++$i;
 }
 $text = $text . '<p>' . $lng_forum['download_topic_note'] . ': <b>' . $set['copyright'] . '</b></p></body></html>';
 $num = time() . $id;
 $fp = fopen("../files/forum/topics/{$num}.htm", "a+");
 flock($fp, LOCK_EX);
 fputs($fp, "{$text}\r\n");
 fflush($fp);
 flock($fp, LOCK_UN);
 fclose($fp);
 @chmod("{$fp}", 0777);
示例#3
0
// JohnCMS                Mobile Content Management System                    //
// Project site:          http://johncms.com                                  //
// Support site:          http://gazenwagen.com                               //
////////////////////////////////////////////////////////////////////////////////
// Lead Developer:        Oleg Kasyanov   (AlkatraZ)  alkatraz@gazenwagen.com //
// Development Team:      Eugene Ryabinin (john77)    john77@gazenwagen.com   //
//                        Dmitry Liseenko (FlySelf)   flyself@johncms.com     //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
Подробная информация, контактные данные
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng['information'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['information'] . '</div>';
if ($user['id'] == $user_id || $rights >= 7 && $rights > $user['rights']) {
    echo '<div class="topmenu"><a href="profile.php?act=edit&amp;user='******'id'] . '">' . $lng['edit'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2"><p>' . '<h3><img src="../images/contacts.png" width="16" height="16" class="left" />&#160;' . $lng_profile['personal_data'] . '</h3>' . '<ul>';
if (file_exists('../files/users/photo/' . $user['id'] . '_small.jpg')) {
    echo '<a href="../files/users/photo/' . $user['id'] . '.jpg"><img src="../files/users/photo/' . $user['id'] . '_small.jpg" alt="' . $user['name'] . '" border="0" /></a>';
}
echo '<li><span class="gray">' . $lng_profile['name'] . ':</span> ' . (empty($user['imname']) ? '' : $user['imname']) . '</li>' . '<li><span class="gray">' . $lng_profile['birt'] . ':</span> ' . (empty($user['dayb']) ? '' : sprintf("%02d", $user['dayb']) . '.' . sprintf("%02d", $user['monthb']) . '.' . $user['yearofbirth']) . '</li>' . '<li><span class="gray">' . $lng_profile['city'] . ':</span> ' . (empty($user['live']) ? '' : $user['live']) . '</li>' . '<li><span class="gray">' . $lng_profile['about'] . ':</span> ' . (empty($user['about']) ? '' : '<br />' . functions::smileys(bbcode::tags($user['about']))) . '</li>' . '</ul></p><p>' . '<h3><img src="../images/mail.png" width="16" height="16" class="left" />&#160;' . $lng_profile['communication'] . '</h3><ul>' . '<li><span class="gray">' . $lng_profile['phone_number'] . ':</span> ' . (empty($user['mibile']) ? '' : $user['mibile']) . '</li>' . '<li><span class="gray">E-mail:</span> ';
if (!empty($user['mail']) && $user['mailvis'] || $rights >= 7 || $user['id'] == $user_id) {
    echo $user['mail'] . ($user['mailvis'] ? '' : '<span class="gray"> [' . $lng_profile['hidden'] . ']</span>');
}
echo '</li>' . '<li><span class="gray">ICQ:</span> ' . (empty($user['icq']) ? '' : $user['icq']) . '</li>' . '<li><span class="gray">Skype:</span> ' . (empty($user['skype']) ? '' : $user['skype']) . '</li>' . '<li><span class="gray">Jabber:</span> ' . (empty($user['jabber']) ? '' : $user['jabber']) . '</li>' . '<li><span class="gray">' . $lng_profile['site'] . ':</span> ' . (empty($user['www']) ? '' : bbcode::tags($user['www'])) . '</li>' . '</ul></p></div>' . '<div class="phdr"><a href="profile.php?user='******'id'] . '">' . $lng['back'] . '</a></div>';
示例#4
0
        echo " Kil ";
        break;
}
// Label Online / Offline
echo time() > $res['lastdate'] + 300 ? '<span class="red"> [Off]</span>' : '<span class="green"> [ON]</span>';
echo '</tr>';
echo '</table>';
echo '</div>';
echo '<div class="textx">';
// pengguna Status
if (!empty($res['status'])) {
    echo '<div class="status"><img src="../images/star.gif" alt=""/>&#160;' . $res['status'] . '</div>';
}
$text = htmlentities($res['text'], ENT_QUOTES, 'UTF-8');
$text = nl2br($text);
$text = bbcode::tags($text);
if ($set_user['smileys']) {
    $text = functions::smileys($text, $res['rights'] >= 1 ? 1 : 0);
}
echo $text . '</div></div>';
// Quote dan Reply post
echo '<hr />';
echo '<table class="forumb" width="100%">';
echo '<td align="left" valign="top">';
if ($res['ip_via_proxy']) {
    echo 'IP 1 : ' . long2ip($res['ip']) . '<br /> ' . 'IP 2 : ' . long2ip($res['ip_via_proxy']) . '<br />UA : ' . $res['soft'] . '';
} else {
    echo 'IP : ' . long2ip($res['ip']) . '<br />UA : ' . $res['soft'] . '';
}
echo '</td>';
if ($user_id && $user_id != $res['user_id']) {
示例#5
0
 private function news()
 {
     global $lng;
     if ($this->settings['view'] > 0) {
         $reqtime = $this->settings['days'] ? time() - $this->settings['days'] * 86400 : 0;
         $req = mysql_query("SELECT * FROM `news` WHERE `time` > '{$reqtime}' ORDER BY `time` DESC LIMIT " . $this->settings['quantity']);
         if (mysql_num_rows($req) > 0) {
             $i = 0;
             $news = '';
             while (($res = mysql_fetch_array($req)) !== false) {
                 $text = $res['text'];
                 // Если текст больше заданного предела, обрезаем
                 if (mb_strlen($text) > $this->settings['size']) {
                     $text = mb_substr($text, 0, $this->settings['size']);
                     $text = htmlentities($text, ENT_QUOTES, 'UTF-8');
                     $text .= ' <a href="news/index.php">' . $lng['next'] . '...</a>';
                 } else {
                     $text = htmlentities($text, ENT_QUOTES, 'UTF-8');
                 }
                 // Если включены переносы, то обрабатываем
                 if ($this->settings['breaks']) {
                     $text = str_replace("\r\n", "<br/>", $text);
                 }
                 // Обрабатываем тэги
                 if ($this->settings['tags']) {
                     $text = bbcode::tags($text);
                 } else {
                     $text = bbcode::notags($text);
                 }
                 // Обрабатываем смайлы
                 if ($this->settings['smileys']) {
                     $text = functions::smileys($text);
                 }
                 // Определяем режим просмотра заголовка - текста
                 $news .= '<div class="news"><div class ="textx">';
                 switch ($this->settings['view']) {
                     case 2:
                         $news .= '<a href="news/index.php">' . $res['name'] . '</a>';
                         break;
                     case 3:
                         $news .= $text;
                         break;
                     default:
                         $news .= '<b>' . $res['name'] . '</b><br />' . $text;
                 }
                 // Ссылка на каменты
                 if (!empty($res['kom']) && $this->settings['view'] != 2 && $this->settings['kom'] == 1) {
                     $mes = mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 'm' AND `refid` = '" . $res['kom'] . "'");
                     $komm = mysql_result($mes, 0) - 1;
                     if ($komm >= 0) {
                         $news .= '<br /><a href="../forum/?id=' . $res['kom'] . '">' . $lng['discuss'] . '</a> (' . $komm . ')';
                     }
                 }
                 $news .= '</div></div>';
                 ++$i;
             }
             return $news;
         } else {
             return false;
         }
     }
 }
示例#6
0
     } elseif ($arank <= 600) {
         $arank = 'Catroxs Holic';
     } elseif ($arank <= 850) {
         $arank = 'Catroxs Addict';
     } elseif ($arank <= 1200) {
         $arank = 'Catroxs Maniak';
     } elseif ($arank <= 3200) {
         $arank = 'Catroxs Geek';
     } elseif ($arank <= 4500) {
         $arank = 'Catroxs Freak';
     } elseif ($arank >= 5000) {
         $arank = 'Made in Catroxs';
     }
 }
 if (!empty($res['pangkat'])) {
     $jenenge = '' . bbcode::tags($res['pangkat']) . '';
 } else {
     $jenenge = '' . $arank . '';
 }
 $user_rights = array(0 => '' . $jenenge . '', 3 => 'Moderator', 6 => 'Senior Moderator', 7 => 'Admin', 9 => 'Super Admin');
 echo @$user_rights[$res['rights']];
 // Menampilkan Status
 if (!empty($res['status'])) {
     echo '<div class="status">' . $res['status'] . '</div>';
 }
 echo '</td>';
 // total post
 echo '<td align="right" valign="top">';
 echo '&#160;Post : <a href="' . $home . '/users/profile.php?act=activity&amp;user='******'user_id'] . '">' . $res['postforum'] . '</a>';
 echo '</td></tr></table></div><div class="textx">';
 /*