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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 463
  • Total: 464
  • @rjen

[Block] Board Index Menu

Started by IchBin, August 23, 2007, 02:31:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vivasvan

#50
I need something like this expandable...

my guild is on 5 servers.  i want a list as follows

+arkenstone
+brandywine
+landroval
+elendilmir
+Vilya

and when i click on a server name it expands

+Arkenstone
- Brandywine
  -Leader: Tawar
  -Member: Homer
  -Member: Homer2
+Landroval
+Elendilmir
+Vilya

could i do this..and how?  PS... this list needs to go into a HTML area on the tolkien theme. It seems to be outside the left block on my site

www.orderofmiddleearth.com   

I goto Admin>Current Theme then it allows me to write HTML into this box.

IchBin

Vivasvan, what you're asking for would have to be hard code in HTML with some type of drop down. This is a php snippet, and it won't be possible to put it into any HTML box to make it work like you're asking.

As for the previous poster, I'm out of town for the weekend, so if I get a chance I'll try to figure the code out.

platinumUWE

#52
hi was wondering if this possible just to show the boards we have no childboards etc just the names of the main boards ive tried messing with it just getting lots of errors any help be appreciated.

dont really need all the other info but a list of all my boards.

regards
Plat

edit: got it myself thankyou

IchBin

Ah, did someone still need this script to make a column menu? I almost forgot about this. Let me know, as I'm sure I can still work the code out.

alving

i still need it, sir..

cheers

IchBin

#55
Ok, this code will create a two columned layout. I haven't added any special style to the table, so if you need more done, just add a different class to the <td>'s. You can change the number of columns by changing this line if ($columns % 2 != 0){. Change the number 2 to represent how many columns you want.

global $db_prefix, $context, $user_info;

// Find the boards/cateogories they can see.
$request = db_query("
SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.numTopics, b.childLevel
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['jump_to'] = array();
$this_cat = array('id' => -1);
while ($row = mysql_fetch_assoc($request))
{
if ($this_cat['id'] != $row['ID_CAT'])
{
$this_cat = &$context['jump_to'][];
$this_cat['id'] = $row['ID_CAT'];
$this_cat['name'] = $row['catName'];
$this_cat['boards'] = array();
}

$this_cat['boards'][] = array(
'id' => $row['ID_BOARD'],
'name' => $row['boardName'],
'child_level' => $row['childLevel'],
'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board'],
'topics' => $row['numTopics']
);
}
mysql_free_result($request);

echo '
<table >
<tr>';
$first = true;
$columns = -1;
foreach ($context['jump_to'] as $category){
foreach ($category['boards'] as $board){
$columns++;
if ($columns % 2 != 0){

echo '
<td class="normaltext"><a href="',$scripturl,'?board=', $board['id'], '">', $board['name'], '</a></td>';

}
else{
echo '
</tr>
<tr>
<td class="normaltext"><a href="',$scripturl,'?board=', $board['id'], '">', $board['name'], '</a></td>';

}
}

}
echo '
</tr>
</table>';

alving

hi ichbin, 

thanks for the code but it is not working properly.  at the moment, eventhough i changed 2 to any number, the code still displays the board links in one horizontal row.. 

IchBin

Works for me on my site. Would you like me to take a look at it on your site? PM me with a temp admin account if you'd like. Not much I can do to fix it for you, if its working on my site.

IchBin

Fixed the code in the post above, and fixed the code on your site. Sorry about that. Don't know why I left some things out.

Smoky

you are a very good fixer ICH..  ;)

This website is proudly hosted on Crocweb Cloud Website Hosting.