本文整理汇总了PHP中bb_code函数的典型用法代码示例。如果您正苦于以下问题:PHP bb_code函数的具体用法?PHP bb_code怎么用?PHP bb_code使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bb_code函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
# Skype : vantuzilla #
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
header('Content-type: application/json');
header('Content-Disposition: inline; filename="private.json";');
$key = !empty($_REQUEST['key']) ? check($_REQUEST['key']) : null;
$count = !empty($_REQUEST['count']) ? abs(intval($_REQUEST['count'])) : 10;
if (!empty($key)) {
$user = DB::run()->queryFetch("SELECT * FROM `users` WHERE `users_apikey`=? LIMIT 1;", array($key));
if (!empty($user)) {
$query = DB::run()->query("SELECT * FROM `inbox` WHERE `inbox_user`=? ORDER BY `inbox_time` DESC LIMIT " . $count . ";", array($user['users_login']));
$inbox = $query->fetchAll();
$total = count($inbox);
if ($total > 0) {
$messages = array();
foreach ($inbox as $data) {
$data['inbox_text'] = bb_code(str_replace('<img src="/images/', '<img src="' . $config['home'] . '/images/', $data['inbox_text']));
$messages[] = array('author' => $data['inbox_author'], 'text' => $data['inbox_text'], 'time' => $data['inbox_time']);
}
echo json_encode(array('total' => $total, 'messages' => $messages));
} else {
echo json_encode(array('error' => 'nomessages'));
}
} else {
echo json_encode(array('error' => 'nouser'));
}
} else {
echo json_encode(array('error' => 'nokey'));
}
示例2: get_link
<a href="' . get_link('Poster', 'Guild', array('action' => 'edit', 'p' => $Post_ID)) . '"><span alt="Editer" title="Editer ce message" >✓</span></a></td></tr>';
} else {
echo '<td>
Posté à ' . $d->format('H\\hi \\l\\e d M y') . '
</td></tr>';
}
$d = new datetime($Account_Inscription);
//Détails sur le Account qui a posté
echo '<tr><td>
<img src="./images/avatars/' . $Account_Avatar . '" alt="" />
<br />Membre inscrit le ' . $d->format('d/m/Y') . '
<br />Messages : ' . $Account_Post . '<br />
Localisation : ' . $Account_localisation . '</td>';
//Message
echo '<td>' . bb_code($Post_texte) . '
<br /><hr />' . bb_code($Account_Signature) . '</td></tr>';
}
//Fin de la boucle ! \o/
?>
</table>
<?php
echo '<p>Page : ';
for ($i = 1; $i <= $nombreDePages; $i++) {
//On affiche pas la page actuelle en lien
echo $i == $numpage ? $i : '<a href="' . get_link('Topic', 'Guild', array('t' => $Topic_ID, 'page' => $i)) . '">' . $i . '</a> ';
}
echo '</p>';
}
//Fin du if qui vérifiait si le topic contenait au moins un message
}
示例3: show_title
show_title('Список всех комментариев ' . nickname($uz));
$total = DB::run()->querySingle("SELECT count(*) FROM `commphoto` WHERE `commphoto_user`=?;", array($uz));
if ($total > 0) {
if ($start >= $total) {
$start = last_page($total, $config['postgallery']);
}
$page = floor(1 + $start / $config['postgallery']);
$config['newtitle'] = 'Список всех комментариев ' . nickname($uz) . ' (Стр. ' . $page . ')';
$querycomm = DB::run()->query("SELECT `commphoto`.*, `photo_title` FROM `commphoto` LEFT JOIN `photo` ON `commphoto`.`commphoto_gid`=`photo`.`photo_id` WHERE `commphoto_user`=? ORDER BY `commphoto_time` DESC LIMIT " . $start . ", " . $config['postgallery'] . ";", array($uz));
while ($data = $querycomm->fetch()) {
echo '<div class="b"><img src="/images/img/balloon.gif" alt="image" /> <b><a href="comments.php?act=viewcomm&gid=' . $data['commphoto_gid'] . '&cid=' . $data['commphoto_id'] . '">' . $data['photo_title'] . '</a></b>';
if (is_admin()) {
echo ' — <a href="comments.php?act=del&id=' . $data['commphoto_id'] . '&uz=' . $uz . '&start=' . $start . '&uid=' . $_SESSION['token'] . '">Удалить</a>';
}
echo '</div>';
echo '<div>' . bb_code($data['commphoto_text']) . '<br />';
echo 'Написал: ' . profile($data['commphoto_user']) . '</b> <small>(' . date_fixed($data['commphoto_time']) . ')</small><br />';
if (is_admin() || empty($config['anonymity'])) {
echo '<span class="data">(' . $data['commphoto_brow'] . ', ' . $data['commphoto_ip'] . ')</span>';
}
echo '</div>';
}
page_strnavigation('comments.php?act=comments&uz=' . $uz . '&', $config['postgallery'], $start, $total);
} else {
show_error('Комментариев еще нет!');
}
break;
############################################################################################
## Переход к сообщение ##
############################################################################################
############################################################################################
示例4: account_msg_read
function account_msg_read($id)
{
global $db;
$msg = $db->fetch_assoc('SELECT `touser`, `fromuser`, `title`, `msg`, `del`, `fromdel`, `datum`, `readed` FROM ' . DB_PRE . 'ecp_messages WHERE msgID = ' . $id);
if (isset($msg['touser'])) {
if ($msg['touser'] == $_SESSION['userID']) {
if (!$msg['readed']) {
$db->query('UPDATE ' . DB_PRE . 'ecp_messages SET readed = 1 WHERE msgID = ' . $id);
}
$tpl = new smarty();
$tpl->assign('in', 1);
$tpl->assign('id', $id);
$tpl->assign('userid', $msg['fromuser']);
$tpl->assign('msg', bb_code(nl2br($msg['msg'])));
$tpl->assign('del', $msg['del']);
$tpl->assign('datum', date(LONG_DATE, $msg['datum']));
if ($msg['fromuser']) {
$row = @$db->fetch_assoc('SELECT username, country FROM ' . DB_PRE . 'ecp_user WHERE ID= ' . $msg['fromuser']);
$tpl->assign('username', $row['username']);
$tpl->assign('country', $row['country']);
}
$tpl->assign('title', $msg['title']);
ob_start();
$tpl->display(DESIGN . '/tpl/account/message_read.html');
$content = ob_get_contents();
ob_end_clean();
main_content(MESSAGE, $content, '', 1);
} elseif ($msg['fromuser'] == $_SESSION['userID']) {
$tpl = new smarty();
$tpl->assign('id', $id);
$tpl->assign('msg', bb_code(nl2br($msg['msg'])));
$tpl->assign('userid', $msg['touser']);
$tpl->assign('fromdel', $msg['fromdel']);
$tpl->assign('datum', date(LONG_DATE, $msg['datum']));
$row = @$db->fetch_assoc('SELECT username, country FROM ' . DB_PRE . 'ecp_user WHERE ID= ' . $msg['touser']);
$tpl->assign('username', $row['username']);
$tpl->assign('country', $row['country']);
$tpl->assign('title', $msg['title']);
ob_start();
$tpl->display(DESIGN . '/tpl/account/message_read.html');
$content = ob_get_contents();
ob_end_clean();
main_content(MESSAGE, $content, '', 1);
} else {
table(ERROR, NO_ACCESS_RIGHTS);
account_msgbox();
}
} else {
table(ERROR, NO_ENTRIES_ID);
account_msgbox();
}
}
示例5: array
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryhist = DB::run()->query("SELECT * FROM `banhist` WHERE `ban_user`=? ORDER BY `ban_time` DESC LIMIT " . $start . ", " . $config['listbanhist'] . ";", array($uz));
echo '<form action="banhist.php?act=del&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">';
while ($data = $queryhist->fetch()) {
echo '<div class="b">';
echo '<div class="img">' . user_avatars($data['ban_user']) . '</div>';
echo '<b>' . profile($data['ban_user']) . '</b> ' . user_online($data['ban_user']) . ' ';
echo '<small>(' . date_fixed($data['ban_time']) . ')</small><br />';
echo '<input type="checkbox" name="del[]" value="' . $data['ban_id'] . '" /> ';
echo '<a href="zaban.php?act=editban&uz=' . $data['ban_user'] . '">Изменить</a></div>';
echo '<div>';
if (!empty($data['ban_type'])) {
echo 'Причина: ' . bb_code($data['ban_reason']) . '<br />';
echo 'Срок: ' . formattime($data['ban_term']) . '<br />';
}
switch ($data['ban_type']) {
case '1':
$stat = '<span style="color:#ff0000">Забанил</span>:';
break;
case '2':
$stat = '<span style="color:#ffa500">Изменил</span>:';
break;
default:
$stat = '<span style="color:#00cc00">Разбанил</span>:';
}
echo $stat . ' ' . profile($data['ban_send']) . '<br />';
echo '</div>';
}
示例6: bb_code
?>
&id=<?php
echo $data['posts_id'];
?>
"><?php
echo $data['topics_title'];
?>
</a></b>
(<?php
echo $data['topics_posts'];
?>
)
</div>
<div>
<?php
echo bb_code($data['posts_text']);
?>
<br />
Написал: <?php
echo nickname($data['posts_user']);
?>
<?php
echo user_online($data['posts_user']);
?>
<small>(<?php
echo date_fixed($data['posts_time']);
?>
)</small><br />
<?php
示例7: bb_code
case '3':
echo '<img src="/images/img/error.gif" alt="Закрыто" /> <b><span style="color:#ff0000">Закрыто</span></b>';
break;
default:
echo '<img src="/images/img/faq.gif" alt="Под вопросом" /> <b><span style="color:#ffa500">Под вопросом</span></b>';
}
echo '</div>';
echo '<div class="right"><a href="offers.php?act=edit&id=' . $id . '">Редактировать</a> / ';
echo '<a href="offers.php?act=reply&id=' . $id . '">Ответить</a></div>';
echo '<div>' . bb_code($queryoff['offers_text']) . '<br />';
echo 'Добавлено: ' . profile($queryoff['offers_user']) . ' (' . date_fixed($queryoff['offers_time']) . ')<br />';
echo '<a href="/pages/offers.php?act=comments&id=' . $id . '">Комментарии</a> (' . $queryoff['offers_comments'] . ') ';
echo '<a href="/pages/offers.php?act=end&id=' . $id . '">»</a></div><br />';
if (!empty($queryoff['offers_text_reply'])) {
echo '<div class="b"><b>Официальный ответ</b></div>';
echo '<div class="q">' . bb_code($queryoff['offers_text_reply']) . '<br />';
echo profile($queryoff['offers_user_reply']) . ' (' . date_fixed($queryoff['offers_time_reply']) . ')</div><br />';
}
} else {
show_error('Ошибка! Данного предложения или проблемы не существует!');
}
echo '<img src="/images/img/back.gif" alt="image" /> <a href="offers.php?type=' . $type . '">Вернуться</a><br />';
break;
############################################################################################
## Ответ на предложение ##
############################################################################################
############################################################################################
## Ответ на предложение ##
############################################################################################
case 'reply':
$queryoff = DB::run()->queryFetch("SELECT * FROM `offers` WHERE `offers_id`=? LIMIT 1;", array($id));
示例8: forum_thread
function forum_thread($bid, $id, $order = 'ASC', $quote = false)
{
global $db, $installed, $countries;
$thread = $db->fetch_assoc('SELECT `threadID`, `bID`, `threadname`, `vonID`, ' . DB_PRE . 'ecp_forum_threads.posts, `sticky`, ' . DB_PRE . 'ecp_forum_threads.closed,
`fsurveyID`, `rating`, `ratingvotes`, a.boardparentID, a.name, a.isforum, a.closed as forumclosed,
a.rightsread, a.postcom, a.editcom, a.votesurvey, a.downloadattch, a.threadclose,
a.threaddel, a.threadmove, a.threadpin, a.editmocom, a.delcom, b.rightsread as parentRead, b.name as boardparentName FROM ' . DB_PRE . 'ecp_forum_threads LEFT JOIN ' . DB_PRE . 'ecp_forum_boards AS a ON (bID = a.boardID) LEFT JOIN ' . DB_PRE . 'ecp_forum_boards AS b ON (b.boardID = a.boardparentID) WHERE threadID = ' . $id . ' AND bID = ' . $bid);
if (isset($thread['threadID']) and find_access($thread['rightsread']) and find_access($thread['parentRead']) and $thread['isforum']) {
$comments = array();
$db->query('UPDATE ' . DB_PRE . 'ecp_forum_threads SET views = views + 1 WHERE threadID = ' . $id);
$limits = get_sql_limit($thread['posts'] + 1, LIMIT_FORUM_COMMENTS);
$result = $db->query('SELECT `comID`, ' . DB_PRE . 'ecp_forum_comments.userID, `postname`, a.rID, rankname, iconname, `adatum`, `comment`, `edits`, `editdatum`, `edituserID`, ' . DB_PRE . 'ecp_forum_comments.IP, `attachs`, a.username, a.sex, a.signatur, a.country, comments, d.money, a.avatar, b.username as editfrom, lastklick as online
FROM `' . DB_PRE . 'ecp_forum_comments`
LEFT JOIN ' . DB_PRE . 'ecp_user as a ON (' . DB_PRE . 'ecp_forum_comments.userID = a.ID)
LEFT JOIN ' . DB_PRE . 'ecp_user as b ON (' . DB_PRE . 'ecp_forum_comments.edituserID = b.ID)
LEFT JOIN ' . DB_PRE . 'ecp_user_stats as d ON (' . DB_PRE . 'ecp_forum_comments.userID = d.userID)
LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (a.rID = rankID)
LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = ' . DB_PRE . 'ecp_forum_comments.userID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ')
WHERE boardID = ' . $bid . ' AND tID = ' . $id . '
GROUP BY comID
ORDER BY adatum ' . $order . '
LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
while ($row = mysql_fetch_assoc($result)) {
if (isset($_SESSION['userID'])) {
if (isset($_SESSION['lastforum'][$id]) and $_SESSION['lastforum'][$id] < $row['adatum']) {
$row['new'] = true;
} elseif (!isset($_SESSION['lastforum'][$id]) and $_SESSION['lastforum']['time'] < $row['adatum']) {
$row['new'] = true;
}
}
$row['adatum'] = forum_make_date($row['adatum']);
$row['nr'] = ++$limits[1];
$row['comments'] = format_nr($row['comments']);
$row['countryname'] = @$countries[$row['country']];
$row['quote'] = $row['comment'];
$row['comment'] = bb_code($row['comment']);
$row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
if ($row['edits']) {
$row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
}
if ($row['attachs']) {
$anhaenge = array();
$db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $bid . ' AND `tID` = ' . $id . ' AND `mID` = ' . $row['comID']);
while ($sub = $db->fetch_assoc()) {
$sub['size'] = goodsize($sub['size']);
$anhaenge[] = $sub;
}
$row['attchs'] = $anhaenge;
}
$comments[] = $row;
}
if (isset($_SESSION['userID'])) {
if (!isset($_SESSION['lastforum'][$id])) {
@$_SESSION['lastforum']['boards'][$bid]['new']--;
}
$_SESSION['lastforum']['boards'][$bid]['time'] = time();
$_SESSION['lastforum'][$id] = time();
}
$tage = (time() - $installed) / 86400;
$db->query('SELECT uID, username FROM ' . DB_PRE . 'ecp_online LEFT JOIN ' . DB_PRE . 'ecp_user ON (ID=uID) WHERE forum = 1 AND fboardID = ' . $bid . ' AND fthreadID = ' . $id . ' AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ' ORDER BY username ASC');
$members = 0;
$guests = 0;
$member = '';
while ($row = $db->fetch_assoc()) {
if ($row['uID']) {
$members++;
$member .= ', <a href="?section=user&id=' . $row['uID'] . '">' . $row['username'] . '</a>';
} else {
$guests++;
}
}
$tpl = new smarty();
$tpl->assign('bewertung', $thread['ratingvotes'] != 0 ? str_replace(array('{anzahl}', '{avg}'), array(format_nr($thread['ratingvotes']), format_nr($thread['rating'], 2)), FORUM_RATING_VAL) : FORUM_NO_RATINGS);
if (!@$_SESSION['userID'] or $db->result(DB_PRE . 'ecp_forum_ratings', 'COUNT(rateID)', 'userID = ' . $_SESSION['userID'] . ' AND tID = ' . $id)) {
$tpl->assign('rating', get_forum_rating($thread['rating']));
}
if ($limits[0] > 1) {
$seiten = makepagelink_ajax('?section=forum&action=thread&boardID=' . $bid . '&threadID=' . $id, 'return load_forum_com_page(' . $id . ', ' . $bid . ', {nr}, \'' . $order . '\');', @$_GET['page'], $limits[0]);
$tpl->assign('seiten', $seiten);
}
$tpl->assign('order', $order);
$tpl->assign('vonID', $thread['vonID']);
$tpl->assign('sticky', $thread['sticky']);
$tpl->assign('forenlinks', forum_get_fast_links());
$tpl->assign('postcom', find_access($thread['postcom']));
$tpl->assign('editcom', find_access($thread['editcom']));
$tpl->assign('threadclose', find_access($thread['threadclose']));
$tpl->assign('threaddel', find_access($thread['threaddel']));
$tpl->assign('threadmove', find_access($thread['threadmove']));
$tpl->assign('threadpin', find_access($thread['threadpin']));
$tpl->assign('editmocom', find_access($thread['editmocom']));
$tpl->assign('delcom', find_access($thread['delcom']));
$tpl->assign('closed', $thread['closed']);
$tpl->assign('bclosed', $thread['forumclosed']);
$tpl->assign('comments', @$comments);
$tpl->assign('name', $thread['threadname']);
$tpl->assign('abo', $db->result(DB_PRE . 'ecp_forum_abo', 'COUNT(aboID)', 'userID = ' . (int) @$_SESSION['userID'] . ' AND thID = ' . $id));
$tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . ($thread['boardparentID'] ? '<a href="?section=forum&action=subboard&boardID=' . $thread['boardparentID'] . '">' . $thread['boardparentName'] . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' : '') . '<a href="?section=forum&action=board&boardID=' . $bid . '">' . $thread['name'] . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> <img src="templates/' . DESIGN . '/images/forum_thread_pin.png" id="pin_icon" alt="' . FORUM_STICKY . '" title="' . FORUM_STICKY . '"' . ($thread['sticky'] ? '' : ' style="display: none;"') . ' /> <img src="templates/' . DESIGN . '/images/forum_icon_thread_closed.png" id="closed_icon" alt="' . FORUM_THREAD_CLOSED . '" title="' . FORUM_THREAD_CLOSED . '"' . ($thread['closed'] ? '' : ' style="display: none;"') . ' /> ' . $thread['threadname']);
$tpl->assign('members', substr($member, 2));
$tpl->assign('thread', 1);
//.........这里部分代码省略.........
示例9: header
# Skype : vantuzilla #
#---------------------------------------------#
require_once '../includes/start.php';
require_once '../includes/functions.php';
require_once '../includes/header.php';
header('Content-type: application/json');
header('Content-Disposition: inline; filename="forum.json";');
$key = !empty($_REQUEST['key']) ? check($_REQUEST['key']) : null;
$id = !empty($_REQUEST['id']) ? abs(intval($_REQUEST['id'])) : null;
if (!empty($key)) {
$user = DB::run()->queryFetch("SELECT * FROM `users` WHERE `users_apikey`=? LIMIT 1;", array($key));
if (!empty($user)) {
$topic = DB::run()->queryFetch("SELECT * FROM `topics` WHERE `topics_id`=? LIMIT 1;", array($id));
if (!empty($topic)) {
$querypost = DB::run()->query("SELECT * FROM `posts` WHERE `posts_topics_id`=? ORDER BY `posts_time` ASC;", array($id));
$posts = $querypost->fetchAll();
$messages = array();
foreach ($posts as $post) {
$post['posts_text'] = bb_code(str_replace('<img src="/images/', '<img src="' . $config['home'] . '/images/', $post['posts_text']));
$messages[] = array('author' => $post['posts_user'], 'text' => $post['posts_text'], 'time' => $post['posts_time']);
}
echo json_encode(array('id' => $topic['topics_id'], 'author' => $topic['topics_author'], 'title' => $topic['topics_title'], 'messages' => $messages));
} else {
echo json_encode(array('error' => 'notopic'));
}
} else {
echo json_encode(array('error' => 'nouser'));
}
} else {
echo json_encode(array('error' => 'nokey'));
}
示例10: explode
$start = 0;
}
if ($total < $start + $config['privatpost']) {
$end = $total;
} else {
$end = $start + $config['privatpost'];
}
for ($i = $start; $i < $end; $i++) {
$num = $total - $i - 1;
$data = explode("|", $file[$i]);
echo '<div class="b">';
echo user_avatars($data[0]);
echo 'Получатель: <b><a href="anketa.php?uz=' . $data[0] . '&' . SID . '">' . nickname($data[0]) . '</a></b> (' . date_fixed($data[2]) . ')<br />';
echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
echo '<a href="privat.php?action=submit&uz=' . $data[0] . '&' . SID . '">Написать еще</a></div>';
echo '<div>Текст письма: ' . bb_code($data[1]) . '</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('privat.php?action=output&', $config['privatpost'], $start, $total);
page_strnavigation('privat.php?action=output&', $config['privatpost'], $start, $total);
echo '<br /><br /><img src="../images/img/error.gif" alt="image" /> <a href="privat.php?action=alloutdel&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить ящик</a>';
} else {
show_error('Отправленных писем еще нет!');
}
} else {
show_error('Отправленных писем еще нет!');
}
echo '<br /><img src="../images/img/mail.gif" alt="image" /> <a href="privat.php?action=submit&' . SID . '">Написать письмо</a><br />';
}
############################################################################################
## Отправка сообщений ##
示例11: array
if (empty($start)) {
$queryreads = DB::run()->querySingle("SELECT `read_ip` FROM `readblog` WHERE `read_blog`=? AND `read_ip`=? LIMIT 1;", array($id, $ip));
if (empty($queryreads)) {
$expiresread = SITETIME + 3600 * $config['blogexpread'];
DB::run()->query("DELETE FROM `readblog` WHERE `read_time`<?;", array(SITETIME));
DB::run()->query("INSERT INTO `readblog` (`read_blog`, `read_ip`, `read_time`) VALUES (?, ?, ?);", array($id, $ip, $expiresread));
DB::run()->query("UPDATE `blogs` SET `blogs_read`=`blogs_read`+1 WHERE `blogs_id`=? LIMIT 1;", array($id));
}
}
// --------------
if ($start < 0 || $start >= $total) {
$start = 0;
}
$end = $total < $start + 1 ? $total : $start + 1;
for ($i = $start; $i < $end; $i++) {
$blogs['text'] = bb_code($text[$i]) . '<br />';
}
$tags = preg_split('/[\\s]*[,][\\s]*/', $blogs['blogs_tags']);
$arrtags = '';
foreach ($tags as $key => $value) {
$comma = empty($key) ? '' : ', ';
$arrtags .= $comma . '<a href="tags.php?act=search&tags=' . urlencode($value) . '">' . $value . '</a>';
}
render('blog/blog_view', array('blogs' => $blogs, 'tags' => $arrtags, 'start' => $start, 'total' => $total));
} else {
show_error('Текста статьи еще нет!');
}
} else {
show_error('Ошибка! Данной статьи не существует!');
}
render('includes/back', array('link' => 'index.php', 'title' => 'К блогам'));
示例12: get_sql_limit
$limits = get_sql_limit($thread['posts'] + 1, LIMIT_FORUM_COMMENTS);
$result = $db->query('SELECT `comID`, ' . DB_PRE . 'ecp_forum_comments.userID, a.rID, rankname, iconname, `postname`, `adatum`, `comment`, `edits`, `editdatum`, `edituserID`, ' . DB_PRE . 'ecp_forum_comments.IP, `attachs`, a.username, a.sex, a.signatur, a.country, comments, d.money, a.avatar, b.username as editfrom, lastklick as online
FROM `' . DB_PRE . 'ecp_forum_comments`
LEFT JOIN ' . DB_PRE . 'ecp_user as a ON (' . DB_PRE . 'ecp_forum_comments.userID = a.ID)
LEFT JOIN ' . DB_PRE . 'ecp_user as b ON (' . DB_PRE . 'ecp_forum_comments.edituserID = b.ID)
LEFT JOIN ' . DB_PRE . 'ecp_user_stats as d ON (' . DB_PRE . 'ecp_forum_comments.userID = d.userID)
LEFT JOIN ' . DB_PRE . 'ecp_ranks ON (a.rID = rankID)
LEFT JOIN ' . DB_PRE . 'ecp_online ON (uID = ' . DB_PRE . 'ecp_forum_comments.userID AND lastklick > ' . (time() - SHOW_USER_ONLINE) . ')
WHERE boardID = ' . $bid . ' AND tID = ' . $id . '
GROUP BY comID
ORDER BY adatum ' . (@$_GET['order'] == 'DESC' ? 'DESC' : 'ASC') . '
LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
while ($row = mysql_fetch_assoc($result)) {
$row['adatum'] = forum_make_date($row['adatum']);
$row['nr'] = ++$limits[1];
$row['comment'] = bb_code($row['comment']);
$row['comments'] = format_nr($row['comments']);
$row['countryname'] = @$countries[$row['country']];
$row['quote'] = $row['comment'];
$row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
if ($row['edits']) {
$row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
}
if ($row['attachs']) {
$anhaenge = array();
$db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $bid . ' AND `tID` = ' . $id . ' AND `mID` = ' . $row['comID']);
while ($sub = $db->fetch_assoc()) {
$sub['size'] = goodsize($sub['size']);
$anhaenge[] = $sub;
}
$row['attchs'] = $anhaenge;
示例13: count
$total = DB::run()->querySingle("SELECT count(*) FROM `photo`;");
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
echo '<form action="gallery.php?act=del&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">';
$queryphoto = DB::run()->query("SELECT * FROM `photo` ORDER BY `photo_time` DESC LIMIT " . $start . ", " . $config['fotolist'] . ";");
while ($data = $queryphoto->fetch()) {
echo '<div class="b">';
echo '<img src="/images/img/gallery.gif" alt="image" /> ';
echo '<b><a href="/gallery/index.php?act=view&gid=' . $data['photo_id'] . '&start=' . $start . '">' . $data['photo_title'] . '</a></b> (' . read_file(BASEDIR . '/upload/pictures/' . $data['photo_link']) . ')<br />';
echo '<input type="checkbox" name="del[]" value="' . $data['photo_id'] . '" /> <a href="gallery.php?act=edit&start=' . $start . '&gid=' . $data['photo_id'] . '">Редактировать</a>';
echo '</div>';
echo '<div><a href="/gallery/index.php?act=view&gid=' . $data['photo_id'] . '&start=' . $start . '">' . resize_image('upload/pictures/', $data['photo_link'], $config['previewsize'], array('alt' => $data['photo_title'])) . '</a><br />';
if (!empty($data['photo_text'])) {
echo bb_code($data['photo_text']) . '<br />';
}
echo 'Добавлено: ' . profile($data['photo_user']) . ' (' . date_fixed($data['photo_time']) . ')<br />';
echo '<a href="/gallery/index.php?act=comments&gid=' . $data['photo_id'] . '">Комментарии</a> (' . $data['photo_comments'] . ') ';
echo '<a href="/gallery/index.php?act=end&gid=' . $data['photo_id'] . '">»</a>';
echo '</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_strnavigation('gallery.php?', $config['fotolist'], $start, $total);
echo 'Всего фотографий: <b>' . $total . '</b><br /><br />';
} else {
show_error('Фотографий еще нет!');
}
if (is_admin(array(101))) {
echo '<img src="/images/img/reload.gif" alt="image" /> <a href="gallery.php?act=restatement&uid=' . $_SESSION['token'] . '">Пересчитать</a><br />';
}
示例14: news_comment_message
function news_comment_message($comment)
{
return stripslashes(bb_code($comment['Comment_Message']));
}
示例15: check
$act = check($_GET['act']);
} else {
$act = 'index';
}
show_title('Блокнот');
if (is_user()) {
switch ($act) {
############################################################################################
## Главная страница ##
############################################################################################
case "index":
$note = DB::run()->queryFetch("SELECT * FROM `notebook` WHERE `note_user`=? LIMIT 1;", array($log));
echo 'Здесь вы можете хранить отрывки сообщений или любую другую важную информацию<br /><br />';
if (!empty($note['note_text'])) {
echo '<div>Личная запись:<br />';
echo bb_code($note['note_text']) . '</div><br />';
echo 'Последнее изменение: ' . date_fixed($note['note_time']) . '<br /><br />';
} else {
show_error('Запись пустая или отсутствует!');
}
echo '<img src="/images/img/edit.gif" alt="image" /> <a href="notebook.php?act=edit">Редактировать</a><br />';
break;
############################################################################################
## Редактирование записи ##
############################################################################################
############################################################################################
## Редактирование записи ##
############################################################################################
case "edit":
$note = DB::run()->queryFetch("SELECT * FROM `notebook` WHERE `note_user`=? LIMIT 1;", array($log));
echo '<div class="form">';