TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 136
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 99
  • Total: 99

Navigation

Started by GiL-GaLaD, December 19, 2007, 04:03:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GiL-GaLaD

How would you create a navigation for your forum ( like a link to every forum or category)


falguni1

you that snippet it is best.

GiL-GaLaD


GiL-GaLaD

Sorry, but when I placed this into the phpbox It came up with :
Parse error: syntax error, unexpected '<' in /home/blizzcra/public_html/roc/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 1

This is for the Navigation box from IchBin : http://www.tinyportal.net/index.php?topic=18318.0

GiL-GaLaD

Sorry, here is my forum:
roc.blizzcraft.org

IchBin

Did you put <php tags in it? Its not supposed to have those if you did. If not, please copy and paste your code here so I can see exactly what you have.

GiL-GaLaD

#7
<pre style="margin-top: 0pt; display: inline;"> global $db_prefix, $context, $user_info;<br /><br /> // Find the boards/cateogories they can see.<br /> $request = db_query("<br /> SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel<br /> FROM {$db_prefix}boards AS b<br /> LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)<br /> WHERE $user_info[query_see_board]", __FILE__, __LINE__);<br /> $context['jump_to'] = array();<br /> $this_cat = array('id' => -1);<br /> while ($row = mysql_fetch_assoc($request))<br /> {<br /> if ($this_cat['id'] != $row['ID_CAT'])<br /> {<br /> $this_cat = &$context['jump_to'][];<br /> $this_cat['id'] = $row['ID_CAT'];<br /> $this_cat['name'] = $row['catName'];<br /> $this_cat['boards'] = array();<br /> }<br /><br /> $this_cat['boards'][] = array(<br /> 'id' => $row['ID_BOARD'],<br /> 'name' => $row['boardName'],<br /> 'child_level' => $row['childLevel'],<br /> 'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],<br /> 'topics' => $row['numTopics']<br /> );<br /> }<br /> mysql_free_result($request);<br /><br /> foreach ($context['jump_to'] as $category){<br /> // edit the following line if you want to change the style of the category text. <br /> echo '<span style="line-height: 10px; font-weight: bold;" class="normaltext" ><b>', strtoupper($category['name']), '</b></span><br />'; <br /> <br /> foreach ($category['boards'] as $board){<br />            if (!$board['child_level']){<br /> //edit the following line for the regular board text<br /> echo '<a href="',$scripturl,'?board=', $board['id'], '">', $board['name'], '</a><br />';<br /> //this line you can edit for the topics count text<br /> echo '<span class="smalltext" style="margin-left: 10px;">', $board['topics'],' ', $txt[330], '</span><br />';<br /> }<br /> else{<br /> //this line you can edit to change the child board text<br /> echo '<a class="normaltext" style="margin-left: 20px;" href="',$scripturl,'?board=', $board['id'], '">', $board['name'],'</a><br />';<br /> }<br />         <br /> }<br /> }</pre>

IchBin

You have so many things wrong with that code that I can't even begin to tell you what to do. Make sure you are putting it in a phpbox block. Copy and paste the code exactly from the post, into your phpbox and it should work.

GiL-GaLaD

Thanks, it works now. One fast question, is there a way for the Categories to have a little more space? The code is amazing but they seem clustered. Roc.blizzcraft.org

This website is proudly hosted on Crocweb Cloud Website Hosting.