public function vxSectionView($section_id) { // The latest version: 2 global $GOOGLE_AD_LEGAL; $Node = new Node($section_id, $this->db); _v_m_s(); echo '<div class="blank">'; _v_ico_map(); echo ' <a href="/">' . Vocabulary::site_name . '</a> > ' . $Node->nod_title_i18n . '</div>'; if ($this->User->usr_id == 1) { _v_b_l_s(); _v_ico_silk('wrench'); echo ' <span class="tip_i">ADMINISTRATIVE TOOLS | </span>'; echo ' <a href="/node/edit/' . $Node->nod_id . '.vx" class="regular"><strong>Edit</strong></a> '; _v_d_e(); } _v_b_l_s(); echo '<div style="float: right;">'; _v_btn_l($this->lang->new_topic(), '/topic/new/' . $Node->nod_id . '.vx'); echo '</div>'; $sql = "SELECT nod_id, nod_name, nod_title, nod_topics FROM babel_node WHERE nod_sid = {$Node->nod_id} ORDER BY nod_title ASC"; $rs = mysql_query($sql); $_nodes = array(); while ($_node = mysql_fetch_array($rs)) { if (!(preg_match('/^[0-9]{6}$/', $_node['nod_name']) | preg_match('/^f[0-9]{6}$/', $_node['nod_name']))) { $_nodes[] = $_node; } } mysql_free_result($rs); $total = count($_nodes); $col = floor($total / 4); $col_1 = $col * 1; $col_2 = $col * 2; $col_3 = $col * 3; $col_4 = $col * 4; echo '<img src="/img/seccap/' . $Node->nod_name . '.png" alt="' . $Node->nod_title . '" />'; _v_hr(); echo '<h1 class="silver">Latest Active Discussions</h1>'; echo '<blockquote>'; $sql = "SELECT tpc_id, tpc_title, tpc_created, tpc_posts, usr_nick, usr_gender, usr_portrait, nod_name, nod_title, nod_topics FROM babel_topic, babel_user, babel_node WHERE nod_id = tpc_pid AND nod_sid = {$Node->nod_id} AND tpc_uid = usr_id ORDER BY tpc_lasttouched DESC LIMIT 30"; $rs = mysql_query($sql); while ($_topic = mysql_fetch_array($rs)) { $img_p = $_topic['usr_portrait'] ? '/img/p/' . $_topic['usr_portrait'] . '_n.jpg' : '/img/p_' . $_topic['usr_gender'] . '_n.gif'; echo '<div style="padding: 2px;">'; echo '<img src="' . $img_p . '" align="absmiddle" border="0" class="portrait" />'; echo ' <a href="/topic/view/' . $_topic['tpc_id'] . '.html">' . make_plaintext($_topic['tpc_title']) . '</a>'; if (intval($_topic['tpc_posts'])) { echo ' <small class="fade">(' . $_topic['tpc_posts'] . ')</small>'; } echo ' <span class="tip_i"><small>Posted by <a href="/u/' . urlencode($_topic['usr_nick']) . '">' . $_topic['usr_nick'] . '</a> on ' . date('M-j G:i:s T', $_topic['tpc_created']) . '</small>'; if ($_topic['tpc_title'] != '') { echo '<small> in <a href="/go/' . $_topic['nod_name'] . '" rel="tag" class="regular">' . make_plaintext($_topic['nod_title']) . '</a> (' . $_topic['nod_topics'] . ')</small>'; } echo '</span>'; echo '</div>'; } mysql_free_result($rs); echo '</blockquote>'; echo '<h1 class="silver">Contains ' . $total . ' discussion areas</small></h1>'; echo '<table width="99%" cellpadding="0" cellspacing="0" style="font-size: 11px;">'; echo '<tr>'; echo '<td width="25%" valign="top" class="col">'; for ($i = 0; $i < $col; $i++) { if (intval($_nodes[$i]['nod_topics']) > 100) { echo '<strong style="font-size: 13px;">'; } echo '<a href="/go/' . $_nodes[$i]['nod_name'] . '" class="var" rel="tag" style="color: ' . Weblog::vxGetPortalTagColor($_nodes[$i]['nod_topics']) . ';">' . $_nodes[$i]['nod_title'] . '</a><br />'; if (intval($_nodes[$i]['nod_topics']) > 100) { echo '</strong>'; } } echo '</td>'; echo '<td width="25%" valign="top" class="col">'; for ($i = $col_1; $i < $col_2; $i++) { if (intval($_nodes[$i]['nod_topics']) > 100) { echo '<strong style="font-size: 13px;">'; } echo '<a href="/go/' . $_nodes[$i]['nod_name'] . '" class="var" rel="tag" style="color: ' . Weblog::vxGetPortalTagColor($_nodes[$i]['nod_topics']) . ';">' . $_nodes[$i]['nod_title'] . '</a><br />'; if (intval($_nodes[$i]['nod_topics']) > 100) { echo '</strong>'; } } echo '</td>'; echo '<td width="25%" valign="top" class="col">'; for ($i = $col_2; $i < $col_3; $i++) { if (intval($_nodes[$i]['nod_topics']) > 100) { echo '<strong style="font-size: 13px;">'; } echo '<a href="/go/' . $_nodes[$i]['nod_name'] . '" class="var" rel="tag" style="color: ' . Weblog::vxGetPortalTagColor($_nodes[$i]['nod_topics']) . ';">' . $_nodes[$i]['nod_title'] . '</a><br />'; if (intval($_nodes[$i]['nod_topics']) > 100) { echo '</strong>'; } } echo '</td>'; echo '<td width="24%" valign="top" class="col">'; for ($i = $col_3; $i < $total; $i++) { if (intval($_nodes[$i]['nod_topics']) > 100) { echo '<strong style="font-size: 13px;">'; } echo '<a href="/go/' . $_nodes[$i]['nod_name'] . '" class="var" rel="tag" style="color: ' . Weblog::vxGetPortalTagColor($_nodes[$i]['nod_topics']) . ';">' . $_nodes[$i]['nod_title'] . '</a><br />'; if (intval($_nodes[$i]['nod_topics']) > 100) { echo '</strong>'; } } echo '</td>'; echo '</tr>'; echo '</table>'; _v_d_e(); _v_d_e(); }