News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Drop down box for child boards..

Started by sager, November 12, 2006, 11:18:33 AM

Previous topic - Next topic

sager

I am new bie here so plz consider,

I want to integrate a drop down box for child boards please help......

2nd. An intergrated shout box just like vbulletin.... i am tired of integrating the existing shoutboxes tht are available... is there a shoutbox tht doesnt need hardcoding manually.... ?

codenaught

There are three shoutboxe mods that I see:

http://mods.simplemachines.org/index.php?mod=22
http://mods.simplemachines.org/index.php?mod=412
http://mods.simplemachines.org/index.php?mod=294

It shouldn't be hard to install any of them, but if you need help you can ask in the mod's support topic.

As for the dropdown, can you be more specific? Do you want the list of child boards on the board index replaced with a dropdown of the child boards? It might help if you tell us what version of SMF you are using.
Dev Consultant
Former SMF Doc Coordinator

sager

ok i will again try to implement sb....

yes i want the childboards to appear in drop down boxes in the main borad.. my version is rc3

sager


codenaught

Okay, how's this?

Try the following.

Open Themes/theme_name/BoardIndex.template.php

Find:

if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
</td>
</tr>';
}


Change to:

if (!empty($board['children']))
{
echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">

<form action="', $scripturl, '"><span class="smalltext"><b>', $txt['parent_boards'], '</b>:

<select onchange="this.form.submit()" name="board">';
foreach($board['children'] as $child)
{
echo ' <option value="', $child['id'], '.0">', $child['name'], '</option>';
}

echo ' </select>
                               <input type="submit" value="Go" /></span></form>
</td>
</tr>';
}


Please let me know how I can adjust it to fit your needs, such as location of the dropdown. Also if you are not using the default theme it is quite possible you may not find the exact code posted above that you need to search for.
Dev Consultant
Former SMF Doc Coordinator

sager

sexy wrk bro. :D :D :D :D.. love it... well i dnt care about the looks part.... but it has come out nice.. you can check it here.. managementjuice.com/forum


you can make it a mod....

2nd thing is there any mod where i can  have customized profile fields during registration.....

codenaught

I'm glad you like it and got it working. :)

For custom profile fields during registration, if you use this mod, you can have them filled out during registration.
Dev Consultant
Former SMF Doc Coordinator

Advertisement: