/** * bb_get_new_topic_link() - Get the link to the form for a new topic * * @since 1.0 * @param mixed The arguments for this function. * @return string The link to the new topic form */ function bb_get_new_topic_link($args = null) { $defaults = array('text' => __('Add New »'), 'forum' => 0, 'tag' => ''); if ($args && is_string($args) && false === strpos($args, '=')) { $args = array('text' => $args); } $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP); if ($forum && ($forum = bb_get_forum($forum))) { $url = get_forum_link($forum->forum_id) . '#postform'; } elseif ($tag && ($tag = bb_get_tag($tag))) { $url = bb_get_tag_link($tag->tag) . '#postform'; } elseif (bb_is_forum()) { global $forum; $url = get_forum_link($forum->forum_id) . '#postform'; } elseif (bb_is_tag()) { global $tag; $url = bb_get_tag_link($tag) . '#postform'; } elseif (bb_is_topic()) { $url = get_forum_link() . '#postform'; } elseif (bb_is_front()) { $url = bb_get_uri(null, array('new' => 1)); } if (!bb_is_user_logged_in()) { $url = bb_get_uri('bb-login.php', array('re' => $url), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_USER_FORMS); } elseif (bb_is_forum() || bb_is_topic()) { if (!bb_current_user_can('write_topic', get_forum_id())) { return; } } else { if (!bb_current_user_can('write_topics')) { return; } } if ($url = esc_attr(apply_filters('new_topic_url', $url, $args))) { return '<a href="' . $url . '" class="new-topic">' . $text . '</a>' . "\n"; } }
function show_topic($db, $topic_id, $user_id, $limit = 25) { echo breadcrumb($db, $topic_id, 'P'); if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $start = ($page - 1) * $limit; if (isset($_SESSION['user_id'])) { echo topic_reply_bar($db, $topic_id, get_forum_id($db, $topic_id)); } $sql = 'SELECT SQL_CALC_FOUND_ROWS p.id, p.subject, p.body, p.date_posted, p.date_updated, u.name as author, u.id as author_id, u.signature as sig, c.post_count as postcount, p.forum_id as forum_id, f.forum_moderator as moderator, p.update_id, u2.name as updated_by FROM frm_forum f JOIN frm_posts p ON f.id = p.forum_id JOIN frm_users u ON u.id = p.author_id LEFT JOIN frm_users u2 ON u2.id = p.update_id LEFT JOIN frm_post_count c ON u.id = c.user_id WHERE p.topic_id = ' . $topic_id . ' OR p.id = ' . $topic_id . ' ORDER BY p.topic_id, p.date_posted LIMIT ' . $start . ', ' . $limit; $result = mysql_query($sql, $db) or die(mysql_error($db)); $page_links = paginate($db, $limit); if (mysql_num_rows($result) == 0) { $msg = "There are currently no posts. Would you " . "like to be the first person to create a thread?"; $title = "No Posts..."; $dest = "frm_compose.php?forumid=" . $forum_id; echo msg_box($msg, $title, $dest); } else { echo '<table style="width: 80%;">'; echo '<tr>'; echo '<th>Author</th>'; echo '<th style="width: 85%;">Post</th>'; echo '</tr>'; $rowclass = ''; while ($row = mysql_fetch_array($result)) { $lastupdate = ''; $editlink = ''; $dellink = ''; $replylink = ' '; $pcount = ''; $pdate = ''; $sig = ''; $body = $row['body']; if (isset($_SESSION['user_id'])) { $replylink = '<a href="frm_compose.php?forumid=' . $row['forum_id'] . '&topicid=' . $topic_id . '&reid=' . $row['id'] . '">REPLY</a> '; } else { $replylink = ''; } if ($row['update_id'] > 0) { $lastupdate = '<p>Last updated: ' . $row['date_updated'] . ' by ' . $row['updated_by'] . '</p>'; } if ($user_id == $row['author_id'] || $user_id == $row['moderator'] || isset($_SESSION['access_lvl']) && $_SESSION['access_lvl'] > 2) { $editlink = '<a href="frm_compose.php?a=edit&post=' . $row['id'] . '">EDIT</a> '; $dellink = '<a href="frm_transact_affirm.php?' . 'action=deletepost&id=' . $row['id'] . '">DELETE</a> '; } $pcount = '<br/>Posts: ' . ($row['postcount'] == '' ? 0 : $row['postcount']); $pdate = $row['date_posted']; $sig = ($row['sig'] != '' ? '<p class="sig">' . bbcode($db, nl2br($row['sig'])) : '') . '</p>'; $rowclass = $rowclass == 'odd_row' ? 'even_row' : 'odd_row'; echo '<tr class="' . $rowclass . '">'; echo '<td>' . $row['author']; echo $pcount; echo '</td><td><p>'; if (isset($_SESSION['user_id']) && $_SESSION['last_login'] < $row['date_posted']) { echo NEWPOST . ' '; } if (isset($_GET['page'])) { $pagelink = '&page=' . $_GET['page']; } else { $pagelink = ''; } echo '<a name="post' . $row['id'] . '" href="frm_view_topic.php?t=' . $topic_id . $pagelink . '#post' . $row['id'] . '">' . POSTLINK . '</a>'; if (isset($row['subject'])) { echo ' <strong>' . $row['subject'] . '</strong>'; } echo '</p><p>' . bbcode($db, nl2br(htmlspecialchars($body))) . '</p>'; echo $sig; echo $lastupdate; echo '</td>'; echo '</tr><tr class="' . $rowclass . '">'; echo '<td>' . $pdate . '</td>'; echo '<td style="text-align: right;">'; echo $replylink; echo $editlink; echo $dellink; echo '</td></tr>'; } echo '</table>'; echo $pagelink; echo '<p>' . NEWPOST . ' = New Post '; echo POSTLINK . ' = Post link (use to bookmark)</p>'; } }
/** * Get or create team forum */ function get_or_create_team_forum($details, $parent_pid, $owner_gid) { // Get forum ID $fid = get_forum_id(PREFIX_FORUM . $details['t_name'], $parent_pid); if ($fid !== false) { return $fid; } // Not found? Create new $fid = create_forum(PREFIX_FORUM . $details['t_name'], $parent_pid, DESC_TEAM_FORUM); if (!$fid) { return false; } // Synchronize all forum permissions update_all_forum_permissions(); // Return forum ID return $fid; }
$hmenu = $extented_forum_menu . $extented_forum_menu_sufix; $design = new design($title, $hmenu, 1); $design->header(); $topicId = escape($menu->get(2), "integer"); $postId = escape($menu->get(3), "integer"); $tpl = new tpl('forum/report_post'); // wenn einer der beiden parameter leer ist if (empty($topicId) || empty($postId)) { $tpl->out("error_no_ids"); // wenn dieser beitrag nicht existiert } else { if (!post_exists($postId)) { $tpl->out("no_such_post"); } else { // PM Versenden $getmodids = getmod_ids(get_forum_id($topicId)); if (empty($getmodids)) { // An den Admin schicken if (isset($_SESSION["authid"])) { $fromUser = $_SESSION["authid"]; } else { $fromUser = 0; } $tpl->set("NAME", get_n($fromUser)); $tpl->set("BEITRAG", get_topic_title($topicId)); $tpl->set("PID", $postId); $tpl->set("TID", $topicId); sendpm($fromUser, 1, $tpl->get("pm_betreff"), $tpl->get("pm_content"), 0); // weiterleitung wd("index.php?forum-showposts-" . $topicId, $tpl->get("weiterleitung")); } else {