Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Matthew K. on March 12, 2009, 01:04:02 PM

Title: Childboards as Dropdown
Post by: Matthew K. on March 12, 2009, 01:04:02 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1691)

Brief Summary:


Childboards as Dropdown allows you to convert the normal list of Child Boards into a dropdown input to conserve space and improve the forum layout.

You can enable or disable this modification from the admin panel.  In addition, you can define a number of childboards allowed to be displayed normally, before that board is converted to the new layout.  This allows you to only convert boards with "X" amount of childboards to a dropdown so boards with few childboards still display normally.  You do have the option to over-ride and have all boards convert to the new layout however.

As of version 2.0.0, the modification was completely re-written, functions with JavaScript disabled, and covers both the BoardIndex, and the MessageIndex.

The original version of this modification was written by Rumbaar (http://www.simplemachines.org/community/index.php?action=profile;u=122766).

TinyPortal Bug Reported by: teos55 (http://www.simplemachines.org/community/index.php?action=profile;u=230574).



Features:




Changelog:


v2.0.4 (r12.22.12):
- Many improvements.
- TinyPortal Compatibility Bugfix.

v2.0.3 (r3.19.12):

v2.0.2 (r2.4.12):

v2.0.1 (r1.23.12):

v2.0.0 (r1.12.12):



Mentions:



Title: Re: Child boards as dropdown menu
Post by: heinandar on March 12, 2009, 02:35:33 PM
For DilberMC Themes??

How can i do that?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 12, 2009, 04:57:48 PM
They use a two column system right?  You'll need to replace the whole section that the theme uses to generate it's child board listing in BoardIndex.template.php with the code I've used.
Title: Re: Child boards as dropdown menu
Post by: heinandar on March 12, 2009, 05:03:18 PM
ႊThis is the original code of BoardIndexTemplate.php of DilberMC. I can't figure out.

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
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'] ? '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/onk.gif" alt="' . $txt[333] . '"/><b>' . $child['link'] . '</b>' : '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/offk.gif" alt="' . $txt[334] . '"/>' . $child['link'];
}

echo '
<table style="float:right; margin-top: 15px;" width="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td class="middletext" valign="middle" align="center" width="30%">
<b>', $txt['parent_boards'], ':</b>
';

$child_counter = 0;

if(empty($settings['child_boards_rows']))
{
echo '
</td>
<td class="middletext" valign="top">';

for(; $child_counter < ceil(count($children)/2); $child_counter++)
echo $children[$child_counter], '<br/>';
}

echo '
</td>
<td class="middletext" valign="top">';
for(; $child_counter < count($children); $child_counter++)
echo $children[$child_counter], '<br/>';
echo '
</td>
</tr>
</table>';
}
// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><span class="smalltext">
', $board['posts'], ' ', $txt[21], ' <br />
', $board['topics'],' ', $txt[330], '
</span></td>
<td class="windowbg2" valign="middle" width="22%">
<span class="smalltext">';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<b>', $txt[22], '</b>  ', $txt[525], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['smf88'], ' ', $board['last_post']['link'], '<br />
', $txt[30], ' ', $board['last_post']['time'];
echo '
</span>
</td>
</tr>';
}
echo '
</table>';
}
echo '
</div>';
}
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 12, 2009, 05:26:36 PM
For DilberMC

Find:
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
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'] ? '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/onk.gif" alt="' . $txt[333] . '"/><b>' . $child['link'] . '</b>' : '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/offk.gif" alt="' . $txt[334] . '"/>' . $child['link'];
}

echo '
<table style="float:right; margin-top: 15px;" width="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td class="middletext" valign="middle" align="center" width="30%">
<b>', $txt['parent_boards'], ':</b>
';

$child_counter = 0;

if(empty($settings['child_boards_rows']))
{
echo '
</td>
<td class="middletext" valign="top">';

for(; $child_counter < ceil(count($children)/2); $child_counter++)
echo $children[$child_counter], '<br/>';
}

echo '
</td>
<td class="middletext" valign="top">';
for(; $child_counter < count($children); $child_counter++)
echo $children[$child_counter], '<br/>';
echo '
</td>
</tr>
</table>';
}


Replace:
// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '<table>
<tr>
<td>
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . '</option>';

// Populate the dropdown with child boards
foreach ($board['children'] as $child)
{
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
}

echo '
</select>&nbsp;
</form>
</td>
</tr></table>';
}
Title: Re: Child boards as dropdown menu
Post by: heinandar on March 12, 2009, 05:45:22 PM
LoL.........Working fine....Thanks for ur help
Title: Re: Child boards as dropdown menu
Post by: tk2012 on March 12, 2009, 05:47:53 PM
FREAKIN SWEET MOD!  I love you!
Title: Re: Child boards as dropdown menu
Post by: kingkingston on March 12, 2009, 06:02:02 PM
I want to ad the mod but got this problem

1. Execute Modification ./Themes/default/BoardIndex.template.php Test failed

how do i fix it ?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 12, 2009, 06:06:28 PM
Glad you like tk2012

@ kingkingston You must have a prior modifications that has affected that area of your BoardIndex.template.php.  You'll need to look to see what has been changed and manually edit the file as needed.  Run the mod through the parser and see what it needs to find and look for that section.
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)
Title: Re: Child boards as dropdown menu
Post by: kingkingston on March 12, 2009, 06:21:54 PM
Quote from: Rumbaar on March 12, 2009, 06:06:28 PM
Glad you like tk2012

@ kingkingston You must have a prior modifications that has affected that area of your BoardIndex.template.php.  You'll need to look to see what has been changed and manually edit the file as needed.  Run the mod through the parser and see what it needs to find and look for that section.
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)

I tried it manually but i got a error,i gather this is the place i have to alter the code "attached"
Title: Re: Child boards as dropdown menu
Post by: tk2012 on March 12, 2009, 06:56:41 PM
@Rumbaar

Is the only change to the Board Index?  If someone goes into the main board, will the boards still all be shown?  I'm just trying to figure out if I can still use my Images On Board mod with this or if I have to choose between them.  I have board images for the child boards which I spent some time on.  If it just puts a dropdown on the board index, that's cool, but I still want to see the childboards if I clicked on through from the main category.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 12, 2009, 07:24:10 PM
I don't think that is a default CORE BoardIndex.template.php file, are you sure it's not from the Babylon theme?  But you should still be able to use the code by replacing the child board call.  Which has given me the idea to actually include the modification for other 'default installed' themes.
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
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'] . ')" style="color: '. $child['bcolor']. ';">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<div style="padding-top: 1px;" class="smalltext"><i>', $txt['parent_boards'], ': ', implode(', ', $children), '</i></div>';
}


Replace:
            // Show the Child Boards as drop-down menu
            if (!empty($board['children']))
            {
               echo '
            <div style="padding-top: 1px;" class="smalltext">
               <form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
                  <span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
               <select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
               <option value="">' . $txt[251] . '</option>';

            // Populate the dropdown with child boards
               foreach ($board['children'] as $child)
               {
               echo '
                     <option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
               }

               echo '
               </select>&nbsp;
               </form>
            </div>';
            }


Yes tk2012 it only affects the display of the Child boards on the 'frontpage' BoardIndex.template.php and will not alter any child board displays within the MessageIndex.template.php sections.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 12, 2009, 07:28:57 PM
Thanks for that Mod Rumbaar, although I had to manually adjust the boardIndex template  file,
as the package installer threw up an error .

I have it now running  and the boards look very clean now !!

All I want now is drop down menus for the main menu bar!

Mine have started to go off the page!! hehe
Title: Re: Child boards as dropdown menu
Post by: Smoky "Rider" Blue on March 12, 2009, 08:20:46 PM
Quote from: Rumbaar on March 12, 2009, 01:04:02 PM

Note: For 2.0 RC1 users boards can have the (!) indicator for awaiting moderation.  Due to the nature of the dropdown menu there will only be a (!) indicator and any moderation will need to be handled via the moderate section of the forum.
Moderate->Post

lol, umm rumbaar, do you have a working demo of this?? or a snapshot for the defautl rc1?? sounds kewl and helpful and would love to see what the effect looks like first..

thanks my friend!!  ;)
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 12, 2009, 08:49:48 PM
Well the screenshot in the mods download section says about it.  The only difference would be if a child board had an outstanding moderation queue then it would look like "Child 1 (!)" instead of "Child 1".  But I'll look to include a sample screenshot in future.

Sorry can't really give a 'live' demo, as it would mean the test account would have to have moderation powers.  The mod in action can be viewed at : http://www.smf2.rumbaar.net for RC1 & http://www.rumbaar.net/test/ for 1.1
Title: Re: Child boards as dropdown menu
Post by: Smoky "Rider" Blue on March 12, 2009, 08:55:06 PM
that is what im talking bout lol.. just to show me what it looks like, and you know, i like it.. great mod Rumbaar!!!  ;)
Title: Re: Child boards as dropdown menu
Post by: victoryrock on March 13, 2009, 12:43:20 AM
Can someone please tell me where I am getting an error in my installation.

File Attached.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 13, 2009, 12:51:14 AM
Anyway to change the background color?
Other than the white (for me), it's a great mod.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 13, 2009, 12:55:37 AM
@victoryrock you shouldn't be getting an error.  If so just run it through the parser and you should be able to find the spot you need to replace with the mod code.

@SgtMic You can edit the class value to match whatever you're using for your current custom template.  The first <td colspan="3" class="windowbg' values should control that.
Title: Re: Child boards as dropdown menu
Post by: victoryrock on March 13, 2009, 12:57:10 AM
Sorry, what's a parser?

Quote from: Rumbaar on March 13, 2009, 12:55:37 AM
@victoryrock you shouldn't be getting an error.  If so just run it through the parser and you should be able to find the spot you need to replace with the mod code.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 13, 2009, 01:47:33 AM
Where you download the mod from Manual Install Instructions for SMF then select your version of SMF and it gives you the code changes.
Title: Re: Child boards as dropdown menu
Post by: haito on March 13, 2009, 02:35:44 AM
nice mod... thanks rumbaar... i like it~
Title: Re: Child boards as dropdown menu
Post by: kingkingston on March 13, 2009, 04:33:21 AM
yes i am using the babylon theme
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 13, 2009, 05:15:50 AM
Quote from: kingkingston on March 12, 2009, 06:02:02 PM1. Execute Modification ./Themes/default/BoardIndex.template.php Test failed
I see that now, it's best to be upfront with the details so it makes it easier for people to give the correct assistance.  The error message you originally displayed the issue with the default CORE theme.
Title: Re: Child boards as dropdown menu
Post by: Garry1953 on March 14, 2009, 05:11:18 PM
Great mod (my site smf 2.0 RC1)
Thanks. :)
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 15, 2009, 05:42:58 AM
You're welcome.

I'm looking to expand on this and have the ability turn on/off child display options.   So can choose to have it display as a list or dropdown menu at the category level.  Got it working for 1.1, just need to look at 2.0.

Might even work on at the MessageIndex level as well.
Title: Re: Child boards as dropdown menu
Post by: heinandar on March 15, 2009, 10:41:08 AM
Hello Rumbaar

I want to dropdown child board . But Not for all Category. Can u do that ?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 15, 2009, 05:11:44 PM
@heinandar is that question in response to my last post or you didn't read it?  But that is what I've got working in 1.1 so far.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 15, 2009, 11:39:33 PM
Is there a way to give it some sort of "New" post indicator? Other than the one for the parent board.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 16, 2009, 12:09:40 AM
I'm not sure if I can bold the entries, I'll have to test that for a dropdown menu array.   But I'll be able to add additional textual information.

What would you think would be a good indicator, maybe an asterisk? *
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 16, 2009, 12:14:43 AM
That would work. Something simple.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 16, 2009, 02:25:49 AM
I'll update the package, but for those that have installed it and don't want to uninstall/install/update

1.1
Find:
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';

Replace:
if ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt[302] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';


2.0
Find:
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (!)</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';

Replace:
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']) && $child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ') (!)</option>';
elseif ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (!)</option>';
elseif ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';


It should now display the (New) indicator next to any child boards that have new posts.  It will be in the set language of the users as well.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 16, 2009, 01:22:02 PM
That worked great.

Now, how to colorize the word "new" or use an image?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 16, 2009, 05:07:08 PM
There you run into limitations to the coding you can apply to a select/option element.  Without, I'm sure, fancy javascript or if even possible in pure html/css environment.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 16, 2009, 06:16:09 PM
Never hurts to ask. LOL

Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 16, 2009, 06:36:15 PM
Never hurts, and I haven't ruled it out.  But in my initial testing and trials couldn't see a viable option.

I'll try for version 1.2, when I hopefully add the ability to turn it on/off based on Category setting.
Title: Re: Child boards as dropdown menu
Post by: PalmBeachPreps on March 17, 2009, 09:48:58 PM
QuoteExecute Modification     ./Themes/default/BoardIndex.template.php     Test failed

Damn, damn, damn!  do i have to attempt this manually now?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 17, 2009, 10:18:48 PM
[Support] Package Manager mod install, Test Failed error (http://www.simplemachines.org/community/index.php?topic=299254.0)
Title: Re: Child boards as dropdown menu
Post by: Groundhog on March 18, 2009, 09:45:32 AM
Hi Rumbaar

Great little mod. Thanks very much for this.

However, I am using child boards within child boards (MessageIndex.template.php). I have tried to figure out what to change and tried a few things but have been unsuccessful.

Is there any chance that you can provide a bit of code for the 'MessageIndex.template.php' here also for me to manually paste in please? so that the drop down list also appears for these child boards? I'm amusing that is where it has to go?

That would be so helpful if possible.

Many Thanks
Title: Re: Child boards as dropdown menu
Post by: Antechinus on March 18, 2009, 10:13:17 AM
Quote from: SgtMic on March 13, 2009, 12:51:14 AM
Anyway to change the background color?
Other than the white (for me), it's a great mod.

Quote from: Rumbaar on March 13, 2009, 12:55:37 AM@SgtMic You can edit the class value to match whatever you're using for your current custom template.  The first <td colspan="3" class="windowbg' values should control that.
Not quite. What he'd actually have to do is assign a class to the select for that td so he could style it to suit. Something like:

<select class="child_drops" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';


And in the style.css something like:

select .child_drops
{
    background: #000000;
    color: #FFFFFF;
}


Also just curious, but wouldn't giving the select an id lead to duplicate id validation errors when you had more than one board with child boards? I would have thought they'd be better called as a class, but I may be wrong about this.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 18, 2009, 01:20:34 PM
Quote from: Antechinus on March 18, 2009, 10:13:17 AM
Quote from: SgtMic on March 13, 2009, 12:51:14 AM
Anyway to change the background color?
Other than the white (for me), it's a great mod.

Quote from: Rumbaar on March 13, 2009, 12:55:37 AM@SgtMic You can edit the class value to match whatever you're using for your current custom template.  The first <td colspan="3" class="windowbg' values should control that.
Not quite. What he'd actually have to do is assign a class to the select for that td so he could style it to suit. Something like:

<select class="child_drops" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';


And in the style.css something like:

select .child_drops
{
    background: #000000;
    color: #FFFFFF;
}


Also just curious, but wouldn't giving the select an id lead to duplicate id validation errors when you had more than one board with child boards? I would have thought they'd be better called as a class, but I may be wrong about this.

I'm using the core default theme. Which way would be the better approach?
Title: Re: Child boards as dropdown menu
Post by: Antechinus on March 18, 2009, 05:01:37 PM
They're the same approach. ;) You need to assign a class to the select in your template then add the required styling to your style.css.

Also you quoted the same post twice.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 18, 2009, 05:05:26 PM
@Groundhog Originally I had intended to have this working in the MessageIndex.template.php section as well.  I had it working for 1.1, but for 2.0 and the intermediate nature of the formating in the template files made it a little difficult to implement as I wanted.  So I just went for the BoardIndex.

Yes I think I miss-read what was displaying as 'while' in SgtMic's request.

Quote from: Antechinus on March 18, 2009, 10:13:17 AM
Also just curious, but wouldn't giving the select an id lead to duplicate id validation errors when you had more than one board with child boards? I would have thought they'd be better called as a class, but I may be wrong about this.
Yes you're probably right with the duplicate ID's, not sure what to do there.  Due to the nature of the javascript and requirement of the fixed name.  In it's previous use it was a single entry dropdown menu.  I'll have to test that a little.
Title: Re: Child boards as dropdown menu
Post by: Antechinus on March 18, 2009, 05:28:38 PM
Ok. I must admit I know hardly anything about javascript. I'll have to brush up on that a bit.
Title: Re: Child boards as dropdown menu
Post by: Groundhog on March 18, 2009, 11:57:44 PM
Ok, Rumbaar, thanks for the reply.

Quotebut for 2.0 and the intermediate nature of the formating in the template files made it a little difficult to implement as I wanted.

I don't know that much about PHP yet so are you saying that it's impossible? or is it worth me trying to find some way to get it to work? or do you think I would be wasting my time trying?

Thanks again.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 19, 2009, 12:28:36 AM
No not a waste of time and not impossible, I just got lazy.  Also due to the current RC1 nature of SMF and the changes to all the templates in 2.0 I didn't bother worrying about it yet.  Probably wait for Curves or more consistent layouts for 2.0
Title: Re: Child boards as dropdown menu
Post by: Groundhog on March 19, 2009, 12:58:46 AM
QuoteNo not a waste of time and not impossible,

I understand. I for one would appreciate the additional feature if this can be done at some point.

Thanks again for the quick responses.  :)

Update 22nd March:
I have managed to get it working on my MessageIndex.Template. The code is probably bad but it works.
http://www.HopeCentreBurundi.com
.  :)

Title: Re: Child boards as dropdown menu
Post by: creepshow77 on March 19, 2009, 11:21:32 PM
Hey there! First off let me just say, beautiful MOD!!
This cleans up my site dramatically [I run a gaming site with sections out the wazoo].

I just have one issue, I've recently switched themes to the custom "XD-Zeda" theme, and can't get this to work. I know you have to change some of the code in the .php but am not exactly sure what to change.

Here is what I have ATM in my "BoardIndex.template.php"...





                            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)

            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 '<span class="forumlink">

               <span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>

            </span>';

            }

            // Show some basic information about the number of posts, etc.

            echo '</td>

   <td class="row111" align="center" valign="middle" height="50"><span class="gensmall">', $board['topics'],'</span></td>

   <td class="row111" align="center" valign="middle" height="50"><span class="gensmall">', $board['posts'], '</span></td>

   <td class="row111" valign="middle" height="50" nowrap="nowrap" align="left"> <span class="genmed">';

               

           

            /* The board's and children's 'last_post's have:

            time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),

            link, href, subject, start (where they should go for the first unread post.),

            and member. (which has id, name, link, href, username in it.) */

            if (!empty($board['last_post']['id'])){

            echo $board['last_post']['time'] . '<br />' . $txt['smf88'] . '&nbsp;';

            echo $board['last_post']['link'] . '<br />' . $txt['vb_5'] . '&nbsp;';

            echo $board['last_post']['member']['link'];

            }

               

            echo '</span></td>

  </tr>

  <!-- END forumrow -->';

           

         }

         

      }

     

   }



  echo ' <!-- END catrow -->

        </table>' . $context['XD']['forum_wrap2'];



Not even sure if all of that is needed [new to CSS/PHP but learning fast], but any help would be pure gold to me. Thank you!

Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 20, 2009, 05:12:06 PM
There appears to be layout issues with what you've posted, there normally shouldn't be that many spaces between each line.

But you should be able to replace this:
                            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)

            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 '<span class="forumlink">

               <span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>

            </span>';

            }

With:
// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . '</option>';

// Populate the dropdown with child boards
foreach ($board['children'] as $child)
{
if ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt[302] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
}

echo '
</select>&nbsp;
</form>
</td>
</tr>';
}
But that uses the class for the default theme for the cell, so you might have to work on that to match your theme.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 06:31:35 PM
Quote from: SgtMic on March 18, 2009, 01:20:34 PM
Quote from: Antechinus on March 18, 2009, 10:13:17 AM
Quote from: SgtMic on March 13, 2009, 12:51:14 AM
Anyway to change the background color?
Other than the white (for me), it's a great mod.

Quote from: Rumbaar on March 13, 2009, 12:55:37 AM@SgtMic You can edit the class value to match whatever you're using for your current custom template.  The first <td colspan="3" class="windowbg' values should control that.
Not quite. What he'd actually have to do is assign a class to the select for that td so he could style it to suit. Something like:

<select class="child_drops" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';


And in the style.css something like:

select .child_drops
{
    background: #000000;
    color: #FFFFFF;
}


Also just curious, but wouldn't giving the select an id lead to duplicate id validation errors when you had more than one board with child boards? I would have thought they'd be better called as a class, but I may be wrong about this.

I'm using the core default theme. Which way would be the better approach?




Can somebody give me  laymans terms, operations for changing the colour of the box from white to green... I`ve tried altering some of the CSS for default (which my forum uses on 1.1.8 ) without success..

many thanks in advance for any help
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 21, 2009, 06:41:47 PM
I haven't been able to figure that out either yet. Nor have I really had the time to try.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 06:50:33 PM
nor have I and its annoying for my members as we use green backgrounds with yellow text..... when you have a white background the yellow text is lost/or very hard to read.


Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 21, 2009, 07:09:12 PM
You place an inline style for the select option values

<option value="" style="background-color: green;color: yellow;">' . $txt[251] . '</option>';
echo '
<option value="?board=', $child['id'], '.0" style="background-color: green;color: yellow;">' , $child['name'] , ' (' , $txt[302] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0" style="background-color: green;color: yellow;">' , $child['name'] , '</option>';
That will change all to green background with yellow text.

But Antechinus's solution should have worked as well.

Defined class in select area, then in style.css
select.child_drop
{
font-size: 90%;
font-weight: normal;
color: green;
background-color: yellow;
font-family: verdana, sans-serif;
}
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 07:15:16 PM
QuoteYou place an inline style for the select option values

Forgive me Rumbaar, I am extremely thick but where should this code go.. boardindex.template ?
and wherabouts.


Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 21, 2009, 07:24:44 PM
Yes, in the edited code the mod installed into your BoardIndex.template.php file.

The benefit of Antechinus's method is that you can control the style of the box via one area, so you wont have to edit three parts of the template each time.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 07:47:20 PM
well , I tried placing Antechinus's code in the boardIndex.template then the CSS part in and I now have a blank screen on the forum.

So have reverted back to my original boardindex template and CSS

I would very much appreciate it if you could let me know exactly where the parts of the code go
( as like select / add before /add after/ replace with  )

As at the moment it is a bit hit and miss, I am no coder.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 21, 2009, 07:50:39 PM
The css part goes in your themes style.css, you're putting it in there correct?  You should be able to copy and paste what I posted directly into your.css file.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 07:57:43 PM
Yeah I have the css part in ok copied and pasted ... it is in fact the boardindex.template part that i need in the correct place, surely it does not just go at the bottom or top of the script?

I pasted it here....

// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . '</option>';
// My insertion
<select class="child_drops" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';
//end insertion





Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 21, 2009, 08:05:32 PM
I've pasted only the .css portion of the code. I installed it the end of the style.css.
Did not work. Does it need to be anywhere specific in that file?
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 08:17:00 PM
SgtMic: I think you also need to insert the code for the boardindex.template as well

this bit:               
<select class="child_drops" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';


where it actually goes into the boardindex.template script  is beyond my knowledge!


I noticed that rumbaar used select.child_drop whilst Antechinus uses select.child_drops in the style sheet.

perhaps that may be why it does not work


Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 21, 2009, 08:19:52 PM
I thought it was use one or the other. LOL
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 21, 2009, 08:21:01 PM
All you need to do with the code already inserted by the mod is:

Find:
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex >
Replace
<select class="child_drop" name="jumpto" id="jumpto" onchange="if (this.selectedIndex >
Insert into themes style.css (adjust color and settings to match your themes current 'select' style):
select.child_drop
{
   font-size: 90%;
   font-weight: normal;
   color: green;
   background-color: yellow;
   font-family: verdana, sans-serif;
}


Save it all, fresh the page (making sure to get the new style.css ctrl+F5) and it should be yellow text with green background.
Title: Re: Child boards as dropdown menu
Post by: Kreator on March 21, 2009, 08:36:27 PM
Thank you very very much its working now ... though its yellow background with Green text!!
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 21, 2009, 08:42:37 PM
:) well you can change the style information to your needs.  I'm sure the green isn't the same as you want either.  You can use the #000000 numbers there.
Title: Re: Child boards as dropdown menu
Post by: SgtMic on March 21, 2009, 11:29:13 PM
Hey!! It works. LOL

Thanks Rumbaar.
Title: Re: Child boards as dropdown menu
Post by: mgrmgr on March 27, 2009, 08:22:28 PM
Thanks for this mod - a nice thing to have.

I read you are trying to make it board dependant - that would help me a lot. Just keep us posted.

Another problem I have: what about "third level" child boards? like

board 1
  sub bord 1.1
  sub board 1.2 (up to here it's ok)
    sub board 1.2.1
    sub board 1.2.2
    sub board 1.2.3

in this case there should also be a drop down list visible in sub board 1.2 - alas the "sub sub boards 1.2.1 - 1.2.3 are displayed "normal" :(
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 28, 2009, 04:49:42 AM
Yes as a mentioned, I wanted to have it in the MessageIndex.template.php that would affect those sub-child boards.
Title: Re: Child boards as dropdown menu
Post by: mgrmgr on March 29, 2009, 08:24:08 AM
Thank you - that is an incentive to wait for that version :)
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on March 29, 2009, 02:02:50 PM
This is a really cool mod.  I'm really liking the things that I have for RC1 in Default.  Unfortunately, there is one little change to the code already from another mod.  I'm using the Colorize Boards mod and I'm wondering how I can use your mod, but allow it to pull the color I assigned to certain child boards from that mod?

In the code that I am supposed to find in your mod, there is one small edit in there which I'm guessing allows this:

Quote
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')" style="color: '.$child['bcolor']. ';">' . $child['name'] . '</a>';

Is it possible to put this bold edit into your replace code? 

If so, where would I do that?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 29, 2009, 05:37:39 PM
You can't, to the best of my knowledge, assign inline style information to select (dropdown) HTML code.  This was the reason I had to use the (New) indicator than say a bolding of the name to indicate new post within a child board.
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on March 29, 2009, 05:44:45 PM
Cool deal.

I have it installed right now and was trying to fool with it a little. 
(Which means I was having fun changing things around blindly watching parse errors on the screen! LOL)

Your mod itself is working fine without me messing with it.   ;D
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 29, 2009, 06:38:50 PM
I'm not sure if a class could be assigned to each OPTION field and then that could be used to control it's appearance.  I know the whole box can be altered.  I might look into that as well.

Quote from: mgrmgr on March 29, 2009, 08:24:08 AM
Thank you - that is an incentive to wait for that version :)
I wouldn't wait, I'm sure if and when I do it.  it will be easy enough to upgrade to that version.
Title: Re: Child boards as dropdown menu
Post by: Tien on April 14, 2009, 08:53:42 AM
How do I change the size of the dropdown box? Or is there anyway that I can set a specific length or size for the dropdown box?
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on April 15, 2009, 02:31:10 AM
Try taking a look at the w3schools entry on the SELECT HTML attribute:
http://www.w3schools.com/TAGS/tag_Select.asp

You can possible assign a class and alter the size and attributes of the drop-down box.  I think as for length it's auto sizes to the largest entry.
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on April 16, 2009, 01:19:07 AM
Quote from: C4G-TK on March 29, 2009, 02:02:50 PM
This is a really cool mod.  I'm really liking the things that I have for RC1 in Default.  Unfortunately, there is one little change to the code already from another mod.  I'm using the Colorize Boards mod and I'm wondering how I can use your mod, but allow it to pull the color I assigned to certain child boards from that mod?

In the code that I am supposed to find in your mod, there is one small edit in there which I'm guessing allows this:

Quote
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')" style="color: '.$child['bcolor']. ';">' . $child['name'] . '</a>';

Is it possible to put this bold edit into your replace code? 

If so, where would I do that?

Quote from: Rumbaar on March 29, 2009, 05:37:39 PM
You can't, to the best of my knowledge, assign inline style information to select (dropdown) HTML code.  This was the reason I had to use the (New) indicator than say a bolding of the name to indicate new post within a child board.

Actually, this has been bothering me because I wanted the Child Boards in the dropdown to show the color that I assigned them and the way they were displayed as if they were a link.  It can be done.

The bolded section from my above quote is from the Colorize Boards modification and what you need to do is add it four times to your code in order for it to display the colors inside the dropdown.

I tried it in firefox and IE7 and it worked correctly.  For those of you who want to use this mod PLUS the colorize boards mod and have the color display on the boardindex correctly and not just as black text, do this:

add the bolded sections to Rumbaar's code here:
Quote
// Populate the dropdown with child boards
               foreach ($board['children'] as $child)
               {
                  // Has it posts awaiting approval?
                  if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']) && $child['new'])
               echo '
                     <option value="?board=', $child['id'], '.0" style="color: '.$child['bcolor']. ';">' , $child['name'] , ' (' , $txt['new'] , ') (!)</option>';
               elseif ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
               echo '
                     <option value="?board=', $child['id'], '.0" style="color: '.$child['bcolor']. ';">' , $child['name'] , ' (!)</option>';
               elseif ($child['new'])
               echo '
                     <option value="?board=', $child['id'], '.0" style="color: '.$child['bcolor']. ';">' , $child['name'] , ' (' , $txt['new'] , ')</option>';
               else
               echo '
                     <option value="?board=', $child['id'], '.0" style="color: '.$child['bcolor']. ';">' , $child['name'] , '</option>';
               }

I hope that I am not out of line by posting this here.  I just wanted people to know that it can and will work if you want to use both mods together.  You just need to make those additions to your code.  I attached an example below of what it will do.  I made one child board the shows red and one that shows green (as assigned in Admin >Boards  and then assigned the color by using the Colorize Boards modification).

Title: Re: Child boards as dropdown menu
Post by: Rumbaar on April 16, 2009, 07:43:34 PM
Never out of line, I'll have to revisit the 'new' post indicator and look to just make it bold.  Should be able too, with the same inline styling you've done.  Strange I wonder how I tried before to do it.

Nice work.
Title: Re: Child boards as dropdown menu
Post by: Patriot89 on May 29, 2009, 11:17:03 AM
I'm using the Default theme and it looks like the attached picture..


Is there a way to fix the black?

Title: Re: Child boards as dropdown menu
Post by: Rumbaar on May 30, 2009, 10:56:40 PM
That is not the default theme, as it's not black.  Not sure what you mean, but try looking at your themes style.css information for that section.

What exactly do you want to 'fix' in regards to the black?
Title: Re: Child boards as dropdown menu
Post by: Patriot89 on May 31, 2009, 02:06:57 AM
It is the default theme, I just changed the colors via the style.css file. The black I would like to be the charcoal color like the rest of that row.
Title: Re: Child boards as dropdown menu
Post by: perplexed on May 31, 2009, 07:44:21 AM
nice mod :)  I have lots of child boards lol  I might try this one - thanks
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on May 31, 2009, 06:03:42 PM
Well that appears to be a separate cell to the one that is normally affected by the mod, look to alter that cells affecting style information to match the desired color.
Title: Re: Child boards as dropdown menu
Post by: Chit-Chat ChatterBox Boss on June 07, 2009, 05:54:52 AM
getting both of these errors.


Undefined variable: js_operations
Apply Filter: Only show the errors from this file
File: /home/XXXXXXX/public_html/Themes/default/Packages.template.php
Line: 321



Invalid argument supplied for foreach()
Apply Filter: Only show the errors from this file
File: /home/XXXXXXX/public_html/Themes/default/Packages.template.php
Line: 321
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on June 07, 2009, 07:31:22 PM
That doesn't appear to be a mod specific error.  Looks like an issue with the Package.template.php when viewing installed/available packages.
Title: Re: Child boards as dropdown menu
Post by: Chit-Chat ChatterBox Boss on June 07, 2009, 07:34:01 PM
well the other part of the error said it came from the mod (the url) ... but its cool I cleared the errors and if they reappear I will repost it fully
Title: Re: Child boards as dropdown menu
Post by: Chit-Chat ChatterBox Boss on June 07, 2009, 11:11:52 PM
Everything seems great now. Only thing is like what was mentioned before. I can't wait till the update or someone to say how to add this to the secondary level or 3rd level of childboards. This makes the front page look nice but the next level is all crap looking because this mod doesn't affect it  :-\
Title: Re: Child boards as dropdown menu
Post by: exner2009 on July 04, 2009, 04:42:02 PM
.The Mod i am trying to install is the    http://custom.simplemachines.org/mods/index.php?mod=1691  ,  heres what iv,e done , i downloaded the mod  to desktop , uploaded it through packages in admin panel , installed without errors , and now works fine on default theme, but i would like to use the Classic YaBB SE Theme. so i  tryed to install script into  BoardIndex.template.php . of the classic theme , and got the errors mentioned in last post. Before installing script into theme, i parsed  the mod for my version of smf, and it gave me the script to delete and the script to replace, but by doing this i had no luck. It works great with the default theme, but thats not the theme i would like to use. Thanks for your reply , maybe you can figure this out.
Show the Child Boards as drop-down menu is the name of  the mod. Here Is what my board index template looks like.









Title: Re: Child boards as dropdown menu
Post by: Dr.Stinglock on July 19, 2009, 10:46:03 AM
No problems here, with SMF 2.0 RC1-1 .

Awesome plugin!
Title: Re: Child boards as dropdown menu
Post by: Ken. on August 21, 2009, 03:48:13 PM
Very nice Mod Rumbaar.
It works like a charm for my site and is really handy because of the large number of child boards on the site.  :)
Title: Re: Child boards as dropdown menu
Post by: TheListener on October 15, 2009, 06:17:27 PM
I used to hate child boards but thanks to this mod they look nice and tidy.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on October 15, 2009, 11:10:15 PM
Ha, you're welcome.  Glad it is of use for you.
Title: Re: Child boards as dropdown menu
Post by: chinx on October 21, 2009, 11:00:19 PM
Hi

Great work. Thank you for all the effort you put into doing creative stuff for SMF!
I'd like to know if there is a mod or some way to show 'posts' right under boards - like (Board >> Post) instead of (Board >> Topic >> Post). Would it be possible to create this as an option to apply this to specific Boards?

Thank you
Title: Re: Child boards as dropdown menu
Post by: meehan09 on October 25, 2009, 08:35:25 AM
Ive installed this mod today and all seems to be working fine


But the drop down menu is very small and the text in it is small too, can this be increased so is bigger in size


screen shot attachted for example off the small drop down menus and text ( i just want this larger and the text larger so more visable )


Hope somone can help, thanks in advance,

Paul
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on October 26, 2009, 12:35:05 AM
@chinx Not sure what you are asking, but I'm sure it's out of the scope of this mod.

@meehan09 If it's not the norm, it could be taking CSS information from your custom theme and reducing the size of the display.  I'd try FireFox and Web Developer addon to target that area and see what CSS is affecting it.  Then you can try and alter it to increase/change the font size and display.
Title: Re: Child boards as dropdown menu
Post by: TheListener on October 26, 2009, 12:51:49 AM
From what I saw of Meehans screenshot it looks as though that is the norm.

Mine is the same.
Title: Re: Child boards as dropdown menu
Post by: meehan09 on October 26, 2009, 12:08:08 PM
If you look here : herpuniverse.com they have a larger drop down and text area witch is much more better and visable?

I wouldnt know where to start with the CSS thing, If you could take a look at the forum above and then my forum : www.exoticforums.co.uk


And is it possible get mine same has herpuniverse?


Hope you can help me here, thanks in advance :)
Title: Re: Child boards as dropdown menu
Post by: meehan09 on October 28, 2009, 07:54:45 AM
anyone help me with this please??? thanks in advance  ;D
Title: Re: Child boards as dropdown menu
Post by: Groundhog on October 28, 2009, 08:23:11 AM
meehan09

Not exactly sure how I did it but my (child of child) boards have the larger boxes and text the only difference that I can see is that in BoardIndex.template I have:

<td class="windowbg3 smalltext">

But In my MessageIndex.template.php I have put:

<p class="windowbg3 smalltext children"> </p>

For instance:

<table style="background-color: rgb(224, 225, 232); width: 100%;">
  <tbody>
    <tr>
      <td>
      <p class="windowbg3 smalltext children"> </p>
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex >


Don't know if this is related ?
Title: Re: Child boards as dropdown menu
Post by: louize1986 on October 28, 2009, 12:09:53 PM
Great mod  :D
Title: Re: Child boards as dropdown menu
Post by: meehan09 on October 28, 2009, 12:15:11 PM
Iam not sure how to do that, if somone can take a look at both my files

MessageIndex.template and BoardIndex.template ( attachted below )


If you could modify thease so it shows in bigger box with larger text like the site ive seen here : herpuniverse.com


Thanks in advance  :D

Title: Re: Child boards as dropdown menu
Post by: Groundhog on October 28, 2009, 12:30:14 PM
I just changed the following line in your BoardIndex.template from:

<td class="windowbg3 smalltext">

To

<td class="windowbg3">

And it appears to work for me using your BoardIndex.template on my site but I may have a different css file from you.

You could try it and see though.

I have reattached your BoardIndex.template.
Title: Re: Child boards as dropdown menu
Post by: meehan09 on October 29, 2009, 08:48:23 AM
Ahhhh i see, worked a treat using the files you attachted  ;D


Thankyou very much Groundhog  8)
Title: Re: Child boards as dropdown menu
Post by: Groundhog on October 29, 2009, 11:57:40 AM
meehan09

Actually, it helped me too as I wanted the text bigger in my own child drop-down on BoardIndex page but hadn't tried.  8)
Title: Re: Child boards as dropdown menu
Post by: legostrat on December 10, 2009, 10:14:34 AM
I'm running 2.0 RC2.   Is there any way to install this mod?  I've tried the parser but it just says that the mod isn't compatible.  Can I use the parser instructions for a different 2.0 version?

Thanks
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on December 10, 2009, 03:54:02 PM
You certainly can, but there are major changes.  Just make sure you place it in the correct place.  I personally haven't tried it yet or thought too much about updating, which I should.
Title: Re: Child boards as dropdown menu
Post by: legostrat on December 10, 2009, 09:41:19 PM
Which version would you suggest parsing it for?

Edit - Never mind, I got it to work for 2.0 RC2.

Looks great!

I also placed the code in MessageIndex.template.php and it works there too.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on December 11, 2009, 07:20:43 PM
They might have changed it {templates}, but I remember having issues with it being in the MessageIndex for SMF2 so didn't include it in the initial release.
Title: Re: Child boards as dropdown menu
Post by: legostrat on December 12, 2009, 12:59:57 AM
Interesting...  It seems to not have any problems on my forum.  Then again, I'm using a custom theme, if that means anything.
Title: Re: Child boards as dropdown menu
Post by: Ken. on December 12, 2009, 08:12:36 AM
Quote from: legostrat on December 10, 2009, 09:41:19 PM
Which version would you suggest parsing it for?

Edit - Never mind, I got it to work for 2.0 RC2.

Looks great!

I also placed the code in MessageIndex.template.php and it works there too.

Care to share complete details how you made it work in RC2?  :)
Title: Re: Child boards as dropdown menu
Post by: legostrat on December 12, 2009, 04:09:14 PM
Quote from: Ken. on December 12, 2009, 08:12:36 AM
Care to share complete details how you made it work in RC2?  :)

I'm stressing over finals right now, but as soon as they're over, I'll make sure that I post how I got it.  :)
Title: Re: Child boards as dropdown menu
Post by: legostrat on December 18, 2009, 11:49:58 AM
Woo Hoo!  Finals are over!  :D  I can finally work on my forum some more...

Anyhow, here's how I got the dropdown menus to work on my forum.  You can see them working if you click on the link in my signature.

Here's how to make them work.

Replace this:

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
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)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > $child['unapproved_posts'] ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '
<tr>
<td class="windowbg3 smalltext largepadding"><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td>
</tr>';


with this:

// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '
<tr>
<td class="windowbg3 smalltext">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext1"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';

// Populate the dropdown with child boards
foreach ($board['children'] as $child)
{
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']) && $child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ') (!)</option>';
elseif ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (!)</option>';
elseif ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
}


Though, make sure you make a backup before you make that change.  I'm pretty sure it'll work, but not entirely sure. :)
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on January 15, 2010, 05:28:36 PM
Two questions:

1 - As shown with the yellow arrows in the picture, how would I make the dropdown a set width?  I would like to make mine look more uniform on the page instead of each dropdown being a separate size.

2 - As shown in the purple oval in the picture, how would I extend the container that displays the words "Child Boards" along with the dropdown?  It would visually look better if it didn't end, but stretch across to the right side where the last post info ends.
Title: Re: Child boards as dropdown menu
Post by: TheListener on January 15, 2010, 06:50:50 PM
Quote from: legostrat on December 18, 2009, 11:49:58 AM
Woo Hoo!  Finals are over!  :D  I can finally work on my forum some more...

Anyhow, here's how I got the dropdown menus to work on my forum.  You can see them working if you click on the link in my signature.

Here's how to make them work.

Replace this:

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
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)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > $child['unapproved_posts'] ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '
<tr>
<td class="windowbg3 smalltext largepadding"><strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '</td>
</tr>';


with this:

// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '
<tr>
<td class="windowbg3 smalltext">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext1"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt['select_destination'] . '</option>';

// Populate the dropdown with child boards
foreach ($board['children'] as $child)
{
// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']) && $child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ') (!)</option>';
elseif ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (!)</option>';
elseif ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt['new'] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
}


Though, make sure you make a backup before you make that change.  I'm pretty sure it'll work, but not entirely sure. :)

It worked for me.

www.parascifi.com is where you can see the change.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on January 17, 2010, 10:49:07 PM
In the <select code you might be able to input a fix width parameter to force it not to take the largest text as it's width ie style="width: 100px;"

example
<select style="width: 100px;" name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
Or even width="100px" but I'm not sure if all browser will respect the defined width.
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on January 18, 2010, 10:45:02 PM
Thanks, I got the dropdown to the correct size.

Any advice on how to do the second part?  Trying to get the background to extend to meet the end of the Last Post info box.  Right now it stops where the Post Topics box starts.
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on January 18, 2010, 11:43:49 PM
That's a theme issue or a colspan issue.  Where it might not be spanning into the next cells correctly or not defined correctly.
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on January 18, 2010, 11:50:21 PM
Thanks Rumbaar!
Title: Re: Child boards as dropdown menu
Post by: gbsothere on March 23, 2010, 08:49:15 PM
Hi, Rumbaar, and thank you for a very useful mod!

I found this while I was gleaning this thread to see if the drop downs could be turned on and off at the board level:

Quote from: Rumbaar on March 15, 2009, 05:42:58 AM
You're welcome.

I'm looking to expand on this and have the ability turn on/off child display options.   So can choose to have it display as a list or dropdown menu at the category level.  Got it working for 1.1, just need to look at 2.0.

Might even work on at the MessageIndex level as well.


That was a while back, but I did notice that you said you have it working for 1.1.x.  Does the zip currently on the mod page contain that change and I'm just not finding how to turn the drop downs on and off at board level?

I ask because I have to create a new board tomorrow on my forum that will have to have a large number of child boards but, overall, most of my boards only have one or two and I would like to restrict the drop downs to boards that have many childboards, rather than a scant few.

I apologize if it's staring me in the face and I'm just missing it.   :) 


EDITING on my way to bed:  SMF 1.1.11, Default theme  (Mod works correctly, no errors; I just wondered about this particular facet of it.)
Title: Re: Child boards as dropdown menu
Post by: gbsothere on March 24, 2010, 09:01:17 PM



*giving this a hopeful 24 hour bump*



Anyone?





Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 25, 2010, 12:53:08 AM
It was so long between coding on this, I'd be at a loss to remember to what stage I got too in that task.  I'll say I'll try to look at my testing and coding to see if I ever got this to work.  Now I don't know if I added a flag to the board settings or if I hard coded it as an option.  It takes a lot for me to get motivated to look at my coding, so I can't guarantee anything.  I'm quite lazy which doesn't help.

Hopefully I wrote the code changes and had it in my work area, I did notice a .txt file this other day with instructions.
Title: Re: Child boards as dropdown menu
Post by: gbsothere on March 25, 2010, 08:01:10 AM
I understand and thanks for looking into it.  It's a great mod. 
Title: Re: Child boards as dropdown menu
Post by: TheListener on March 25, 2010, 08:05:09 AM
This is one of my favourite mods.

The board looks so tidy when using this mod I am surprised more people don't use it.

As for least favourite: Yep I have these too.
Title: Re: Child boards as dropdown menu
Post by: ahmad2005 on April 18, 2010, 01:15:15 PM
I cant not install this mod in my site . it shows that ,
"
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
"

and when i click the install now button its shows that " ERROR

The requested URL could not be retrieved

The following error was encountered while trying to retrieve the

Zero Sized Reply

Squid did not receive any data for this request.

Your cache administrator is webmaster.


Generated Sun, 18 Apr 2010 17:07:40 GMT by demil1.byetcluster.com (Lusca/LUSCA_HEAD-r14499) "

What can i do now ??? my site address is forum.eee-lab.com
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on April 18, 2010, 06:03:03 PM
Are you able to install any other mods via the same method?

Download the file, upload it via your Package Manager and see how you go.   Also if you got that big warning message why would you still click install now?  Knowing full well that it wouldn't install correctly even if it did work!
Title: Re: Child boards as dropdown menu
Post by: juliegreen on April 19, 2010, 06:07:52 PM
Quote from: Rumbaar on April 18, 2010, 06:03:03 PM
Are you able to install any other mods via the same method?

Download the file, upload it via your Package Manager and see how you go.   Also if you got that big warning message why would you still click install now?  Knowing full well that it wouldn't install correctly even if it did work!

will you update it to current version of smf?
thank you
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on April 19, 2010, 08:26:57 PM
I should work just fine for the 1.x line of SMF, even the latest version.
Title: Re: Child boards as dropdown menu
Post by: mgrmgr on April 20, 2010, 08:52:40 AM
Hi Rumbaar,

just a question - sorry two:

- selectable board dependent (should be manageable with a new board permission?)

- dropdown for sub-sub boards (see http://www.simplemachines.org/community/index.php?topic=298651.msg1993680#msg1993680).

I checked the last version, still no messageindex changes :(

I'd love to install this mod in our production version 1.1.11
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on April 20, 2010, 06:18:49 PM
Firstly it should work 'out of box' with a production 1.1.11 version of SMF, there have been (to my knowledge) changes to the affected files since my initial release of the mod.

As for the questions/requests.  I lost interest/motivation to update any more of this mod, more so after the actions of recent times by key personnel on the site.

Finally if someone who wants to actively take over and update/modify this mod then I'm more than happy to pass it onto them.
Title: Re: Child boards as dropdown menu
Post by: ukhalik2 on May 24, 2010, 12:56:29 PM
please update this mod  for smf 2.0 rc3 if possible..
Title: Re: Child boards as dropdown menu
Post by: C4G-TK on May 24, 2010, 04:41:00 PM
Quote from: ukhalik2 on May 24, 2010, 12:56:29 PM
please update this mod  for smf 2.0 rc3 if possible..

It works on RC3 as posted in reply #109.
Many times, if you read the thread which in this case was just 7 pages, you'll find a lot of information as well as updates from other members who got it working on other versions.

CLICK HERE (http://www.simplemachines.org/community/index.php?topic=298651.msg2410719#msg2410719)  The edits were done in BoardIndex.template.php

I have it working on my RC3 forum without any problems.  You just need to manually perform the ONE edit listed at that link.  I hope that helps.
Title: Re: Child boards as dropdown menu
Post by: Sheepy on June 13, 2010, 12:38:20 PM
Nice mod.  Had to modify a bit to work on 2.0 RC3, but it makes our forum much cleaner.  Well done.  :D
Title: Re: Child boards as dropdown menu
Post by: Cutter65 on September 22, 2010, 09:38:26 AM
I installed this mod on my 2.0 RC3 forum. It works good but im using the Catamosphere theme and I need to change the color of the bar to match the theme. Dose anyone know how and what I need to edit to fix this? Here is a pic of how the dropdown looks.

Thanks!
Title: Re: Child boards as dropdown menu
Post by: Cutter65 on September 26, 2010, 03:23:37 PM
Quote from: Rumbaar on March 21, 2009, 08:21:01 PM
All you need to do with the code already inserted by the mod is:

Find:
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex >
Replace
<select class="child_drop" name="jumpto" id="jumpto" onchange="if (this.selectedIndex >
Insert into themes style.css (adjust color and settings to match your themes current 'select' style):
select.child_drop
{
   font-size: 90%;
   font-weight: normal;
   color: green;
   background-color: yellow;
   font-family: verdana, sans-serif;
}


Save it all, fresh the page (making sure to get the new style.css ctrl+F5) and it should be yellow text with green background.

Im trying to get my dropdown menu box color changed. The theme I am using doesn't have a style.css or BoardIndex.template.php of its own so I added the above code to the default theme.

There is no change when I added the edits. I cleared the server cach and web browser temp files.

Even if I switch to the default theme it didn't change either.

This is on 2.0 RC3

Anyone have any idea's on this?
Title: Re: Child boards as dropdown menu
Post by: Cutter65 on October 04, 2010, 12:56:10 PM
Bump!
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on October 10, 2010, 05:32:11 PM
That code, from memory, was only for the actual dropdown box not the holding element.  You need to look at your themes CSS and it's most likely the entry for 'windowbg3' that is defining that gray outside area.
Title: Re: Child boards as dropdown menu
Post by: TheListener on December 13, 2010, 10:43:21 AM
Hey Rumbaar

Any reason as to why the mod wont work on RC4?

I have been having problems installing this mod as it seems to conflict with the Avatar on Board mod.  :(
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on March 14, 2011, 05:03:18 PM
Wow I should really look at this thread more often :(

I have no idea, I guess they've changed the code layout in RC4.  I would post saying I'd try to look at it, but I doubt I would.
Title: Re: Child boards as dropdown menu
Post by: savy118 on June 09, 2011, 12:52:18 PM
Hi im running RC5 2.0, if i set RC5 version to run at earlier version just to install it, does any one think i may have future problems if it does work, or is there a child mod for rc5 2.0 i keep searching but keep getting this mod top of search results , or is there a different name, but really like the look of this one tho.

regards

savy
Title: Re: Child boards as dropdown menu
Post by: Rumbaar on June 10, 2011, 01:39:11 AM
I don't think there were major template changes, and the changes are so small that I don't think it could cause any long term issues if it installs without problems.
Title: Re: Child boards as dropdown menu
Post by: savy118 on June 10, 2011, 08:15:58 AM
Hi rumbaar,

Yeah i just tried to install it, under compatable version but got a warning sign saying there was errors and proceed with caution if i know what im doing,

thats a real shame "what a great mod you have the only one on here"

Thanks for reply rumbaar

savy
Title: Re: Child boards as dropdown menu
Post by: savy118 on June 10, 2011, 12:50:57 PM
ok i installed it just to see if it would install, i had a warning am i sure but just tried any way the errors it noticed inj rc5 was all theme based, but testing mine offline for now.

when i installed by an earlier version , it installed ok and i got a message saying sucessfully installed from smf rc5.

but me problem is i cant find it now, does this autamaticly apply drop down when i create a child board or have i got to switch something on lol.


thanks

savy  ;D

Title: Re: Child boards as dropdown menu
Post by: Rumbaar on June 14, 2011, 06:19:36 PM
It should display automatically from memory, or there might be an option to enable it per board.  It's been so long, I can't remember ... oops.

But as SMF 2.0 gold has been released I should serious look to get this finalized and working for 2.0.  As their shouldn't be any major template changes now.
Title: Re: Child boards as dropdown menu
Post by: savy118 on June 14, 2011, 06:29:12 PM
sounds good for making things look neater rumbaar,

good luck with it , it will probably be the only mod on here.

savy
Title: Re: Child boards as dropdown menu
Post by: rölyef on June 20, 2011, 12:55:49 PM
2.0 version, please :)
Title: Re: Child boards as dropdown menu
Post by: TheListener on August 07, 2011, 11:15:44 PM
Quote from: rölyef on June 20, 2011, 12:55:49 PM
2.0 version, please :)

The mod works if manually installed.
Title: Re: Child boards as dropdown menu
Post by: Matthew K. on January 10, 2012, 12:53:28 PM
Going to be providing an update for this modification shortly. Rumbaar has graciously allowed me to take over the modification with my plans of updating :)
Title: Re: Child boards as dropdown menu
Post by: Matthew K. on January 13, 2012, 01:18:21 AM
Modification completely rewritten. Works for BoardIndex and MessageIndex both now, in addition to not needing JavaScript to use it.

Also there are two very handy settings added via hooks, so there are only three edits all of which are for the template.

I'll being releasing another patch within the next couple days.
Title: Re: Childboards as Dropdown
Post by: teos55 on January 18, 2012, 08:59:29 AM
SMF 2.0.2  Simple Portal 2.3.4  Default theme  laguage  other then english utf8

installed the mod. 

Now, I donot have the options displayed in the miscellaneous settings for this mod.

I see the dropdowns in the forum but not executable, only displays no actions taken upon selection.

So I decided to copy main english.php  to my language-utf8.php

all the permissions are ok.

But still nothing displayed on the miscellanous and having errors in errorlog like:

Undefined index: lab360_go  in boardindex.template. php

Undefined index: lab360_board_childeren in boardinedx.template.php

Undefined index: lab360_select_child in boardindex.template.php



What am I missing ?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 18, 2012, 11:06:26 AM
The options not being available in the admin panel is an issue if you have other settings in the panel also - It's something I have to fix.

The undefined errors are telling you that the text strings aren't defined...most likely an edit or two were not done.
Title: Re: Childboards as Dropdown
Post by: teos55 on January 18, 2012, 11:16:40 AM
     I've uninstalled and wating for the final fix. Most probably everybody has some mod settings in miscellanous.
I've got no error messages during the installation assuming that all editing done via the mod ...
Title: Re: Childboards as Dropdown
Post by: Kreator on January 18, 2012, 01:24:43 PM
Quote from: Labradoodle-360 on January 18, 2012, 11:06:26 AM
The options not being available in the admin panel is an issue if you have other settings in the panel also - It's something I have to fix.

The undefined errors are telling you that the text strings aren't defined...most likely an edit or two were not done.

I have the same problem also, nothing in admin although the child-Boards are showing -- I have renamed them though to Sub-Boards
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 18, 2012, 01:34:48 PM
I'll release a patch today.
Title: Re: Childboards as Dropdown
Post by: lord alibaski on January 20, 2012, 07:56:00 PM
Quote from: Kreator on January 18, 2012, 01:24:43 PM
I have renamed them though to Sub-Boards

I renamed mine too but if you dont want it to say "select a childboard" then edit the main.english.php file in the resources/cad language folder.

Like this
// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Select a Sub-Forum';


Title: Re: Childboards as Dropdown
Post by: Kreator on January 21, 2012, 05:54:01 AM
Just a note: Now getting errors in Errorlog:

8: Undefined index: lab360_go

8: Undefined index: lab360_board_children

8: Undefined index: lab360_select_child

Quote from: Labradoodle-360 on January 18, 2012, 01:34:48 PM
I'll release a patch today.

Still waiting.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 21, 2012, 12:09:29 PM
I'm On Hiatus for a reason. Real life comes first.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 23, 2012, 01:39:56 AM
Modification Updated. Version 2.0.1 Released.

Here's the changelog.
Quote from: ReadmeChangelog:


v2.0.1 (r1.23.12):

  • !bugfix: Settings conflict with other modifications. (!./resources/hooks.php)

v2.0.0 (r1.12.12):

  • + Complete rewrite
  • ! Modification Renamed

Sorry for the delay in releasing, as I said, Real LifeTM has to come first.
Title: Re: Childboards as Dropdown
Post by: Ken. on January 23, 2012, 05:34:34 PM
Nice Mod, very useful.  8)

But... my install and setup work OK, but when one of the drop down links is selected nothing happens.
http://www.ourfamilyforum.org/FamilyForum/index.php?action=forum (http://www.ourfamilyforum.org/FamilyForum/index.php?action=forum)

Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 23, 2012, 05:36:03 PM
Hey there Ken.! :)

Thanks for the feedback.

It appears that not all of the modifications were completed, can you go through the files this modification edits and make sure they were completed?
Title: Re: Childboards as Dropdown
Post by: Ken. on January 23, 2012, 10:04:35 PM
Quote from: Labradoodle-360 on January 23, 2012, 05:36:03 PM
Hey there Ken.! :)

Thanks for the feedback.

It appears that not all of the modifications were completed, can you go through the files this modification edits and make sure they were completed?

Hey to you too.  ;D

Will do on the file edits.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 23, 2012, 10:05:24 PM
It appears that the strings are missing from the dropdown, which tells me the language is not being loaded from the Source file, which is also where the JavaScript for the redirect is embedded, so without that, you'll get this problem.
Title: Re: Childboards as Dropdown
Post by: Ken. on January 24, 2012, 07:46:13 AM
Just checked the edits and all of them were/are in place.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 24, 2012, 01:07:50 PM
Is the directory "cad_source" in ./Sources? Is the file "main.php" in ./Sources/cad_source?
Title: Re: Childboards as Dropdown
Post by: Ken. on January 24, 2012, 03:10:25 PM
Quote from: Labradoodle-360 on January 24, 2012, 01:07:50 PM
Is the directory "cad_source" in ./Sources? Is the file "main.php" in ./Sources/cad_source?

Yes to both...
the "cad_source" directory is in ./Sources and the file "main.php" is in ./Sources/cad_source
Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 24, 2012, 04:16:47 PM
Going to send you a PM.
Title: Re: Childboards as Dropdown
Post by: Ken. on January 25, 2012, 07:49:25 AM
Quote from: Labradoodle-360 on January 24, 2012, 04:16:47 PM
Going to send you a PM.

OK... reply sent.
Title: Re: Childboards as Dropdown
Post by: Dave J on February 01, 2012, 01:45:51 PM
I installed and had the same problem that the first window of the drop box is blank.

I was getting this error amongst others for this mod:

/8: Undefined index: lab360_go
File: /public_html/Themes/default/languages/Post.english.php (main sub template - eval?)
Line: 259


After coping the text from '/resources/cad_language/main.english.php' to  '/Themes/default/languages/post.english.php' the text appeared as it should.

The only problem now is that once you select a child board it does not go anywhere.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 01, 2012, 01:52:48 PM
Can you attach your Load.php please?
Title: Re: Childboards as Dropdown
Post by: Dave J on February 04, 2012, 03:22:26 AM
Quote from: Labradoodle-360 on February 01, 2012, 01:52:48 PM
Can you attach your Load.php please?

I had attached the Load.php file but now the test board is messing around so I'm going to relace the exitsting files with a backup set and try this again, if I still have problems I'll let you know.

Thank you very much for the prompt reply by the way.
Title: Re: Childboards as Dropdown
Post by: Dave J on February 04, 2012, 06:22:48 AM
Ok I have now reverted back to a stable point and have re-installed the mod again with the same results.

This time I have not made changes to the language code as before and I have attached my load.php file.

I will send you a PM with login details so you can see it for yourself.

Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 04, 2012, 12:24:39 PM
The issue is in regards to this modification not being compatible with Portals. I completely forgot about the conflicts this might have, and left it out of the equation. I already "have" a fix, I just need to actually package it up.
Title: Re: Childboards as Dropdown
Post by: Dave J on February 04, 2012, 02:27:54 PM
Quote from: Labradoodle-360 on February 04, 2012, 12:24:39 PM
The issue is in regards to this modification not being compatible with Portals. I completely forgot about the conflicts this might have, and left it out of the equation. I already "have" a fix, I just need to actually package it up.


Ok no problem Labradoodle I'll just wait...thanks for the update
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 04, 2012, 03:09:15 PM
Childboards as Dropdown 2.0.2 released!

Here's the change-log for anyone interested:
Quote from: ReadmeChangelog:


v2.0.2 (r2.4.12):

  • + now compatible with portals. (!./modifications.xml)
  • + phpDocumentor utilized for all mod functions. (!./cad_source/main.php, !./cad_source/resources/hooks.php)

v2.0.1 (r1.23.12):

  • !bugfix: Settings conflict with other modifications. (!./resources/hooks.php)

v2.0.0 (r1.12.12):

  • + Complete rewrite
  • ! Modification Renamed

Please uninstall the old version and install the new version if you are using a Portal as the new version contains a bugfix to make the mod compatible with the use of portals.
Title: Re: Childboards as Dropdown
Post by: Ken. on February 04, 2012, 03:37:41 PM
Thanks Labradoodle-360.  8)
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 04, 2012, 03:47:48 PM
Thanks for letting me access your forum's FTP to figure out how dumb I was ;D
Title: Re: Childboards as Dropdown
Post by: Ken. on February 04, 2012, 04:43:13 PM
Quote from: Labradoodle-360 on February 04, 2012, 03:47:48 PM
Thanks for letting me access your forum's FTP to figure out how dumb I was ;D

That wasn't the intent but, UR welcome.
Actually, we thought it was rather smart that you were able to solve the riddle so quickly.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 04, 2012, 04:43:43 PM
Well thanks. lol
Title: Re: Childboards as Dropdown
Post by: Dave J on February 04, 2012, 07:26:54 PM
Great work Labradoodle all works fine for me now. Thank you very much
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 04, 2012, 07:56:47 PM
No problem
Title: Re: Childboards as Dropdown
Post by: Bugo on February 19, 2012, 02:02:03 AM
Russian translation.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 19, 2012, 02:02:41 AM
Thanks dude, I'll throw out a patch with those soon :)
Title: Re: Childboards as Dropdown
Post by: TheListener on March 10, 2012, 04:13:48 PM
A long time overdue.

Well done kiddo.

The reason I like this mod is due to the way it makes the boards look much tidier.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on March 11, 2012, 12:12:13 AM
Thanks, hope you like it :) I had fun with the update.
Title: Re: Childboards as Dropdown
Post by: TheListener on March 11, 2012, 12:24:34 AM
Quote from: Old Fossil on March 10, 2012, 04:13:48 PM


The reason I like this mod
Title: Re: Childboards as Dropdown
Post by: Tonyvic on March 11, 2012, 09:19:52 AM
Many thanks for the Mod, it will be really useful.
I have however come across a problem with my live forum, so started a 'Test forum' today.
The test forum has had nothing added apart from 3 child-boards to the original 'General Discussion' board. I then installed the 2.0.2 version of the mod.
All works perfectly until any collapsed category is expanded, at that point the words 'Select a Childboard' vanish as well as the words 'Board Children' in the dropdown (although the colon remains). The Chilboard titles in the dropdown appear and work ok.

Errors in log:
http://www.naturist-corner.co.uk/trymods/index.php?action=collapse;c=1;sa=expand;c28f6c08988=aa77e8033b2275e5f6290587dba894bb8: Undefined index: lab360_goFile: /home/sites/naturist-corner.co.uk/public_html/trymods/Themes/default/BoardIndex.template.php
Line: 237

http://www.naturist-corner.co.uk/trymods/index.php?action=collapse;c=1;sa=expand;c28f6c08988=aa77e8033b2275e5f6290587dba894bb8: Undefined index: lab360_board_childrenFile: /home/sites/naturist-corner.co.uk/public_html/trymods/Themes/default/BoardIndex.template.php
Line: 229

http://www.naturist-corner.co.uk/trymods/index.php?action=collapse;c=1;sa=expand;c28f6c08988=aa77e8033b2275e5f6290587dba894bb8: Undefined index: lab360_select_childFile: /home/sites/naturist-corner.co.uk/public_html/trymods/Themes/default/BoardIndex.template.php
Line: 228


Any help would be appreciated.
Tony 
Title: Re: Childboards as Dropdown
Post by: Matthew K. on March 11, 2012, 01:00:33 PM
That's a bug, thanks! I'll patch it today.
Title: Re: Childboards as Dropdown
Post by: Tonyvic on March 11, 2012, 03:14:52 PM
Thanks very much! 8)

Tony
Title: Re: Childboards as Dropdown
Post by: Matthew K. on March 19, 2012, 08:33:13 PM
Childboards as Dropdown version 2.0.3 finally released, patching a bug that was reported by Tonyvic (http://www.simplemachines.org/community/index.php?action=profile;u=310538)! Here is the change-log:
Quote from: Changelog
v2.0.3 (r3.19.12):

  • ! bugfix: modification breaks when collapsing categories, and throws undefined errors. (!~./modifications.xml)
  • Special thanks to Tonyvic for reporting the bug.
Title: Re: Childboards as Dropdown
Post by: TheListener on March 19, 2012, 08:40:48 PM
Well done kiddo.

Great stuff.
Title: Re: Childboards as Dropdown
Post by: TheListener on March 19, 2012, 08:47:32 PM
Parse error: syntax error, unexpected '{' in /home/broadsta/public_html/Sources/Load.php on line 1956

ahem.

Edited to add:

The following code in Sources/Load was the error.

//-- Labradoodle-360; Childboards as Dropdown
if ((empty($context['current_action']) || !empty($context['current_action']) && ($context['current_action'] === 'forum' || $_GET['action'] == 'collapse') && empty($_GET['topic']))
require_once($sourcedir . '/cad_source/main.php');
loadChildboards_as_Dropdown();
}
// End Labradoodle-360; Childboards as Dropdown --//
Title: Re: Childboards as Dropdown
Post by: Matthew K. on March 19, 2012, 09:33:42 PM
I have no clue what you're talking about? :P Redownload 2.0.3 ;)
Title: Re: Childboards as Dropdown
Post by: Tonyvic on March 21, 2012, 12:59:23 AM
Quote from: Labradoodle-360 on March 19, 2012, 08:33:13 PM
Childboards as Dropdown version 2.0.3 finally released, patching a bug that was reported by Tonyvic (http://www.simplemachines.org/community/index.php?action=profile;u=310538)! Here is the change-log:
Quote from: Changelog
v2.0.3 (r3.19.12):

  • ! bugfix: modification breaks when collapsing categories, and throws undefined errors. (!~./modifications.xml)
  • Special thanks to Tonyvic for reporting the bug.

Many thanks Labradoodle, perfect! :)

Tony
Title: Re: Childboards as Dropdown
Post by: Matthew K. on March 21, 2012, 01:01:11 AM
Not a problem Tony, thanks for reporting it :)

Best Regards,
Matthew
Title: Re: Childboards as Dropdown
Post by: Sunchaser on July 21, 2012, 09:39:16 AM
Hi i installed your mod here: http://testforum.medieval-europe.eu

All seems ok, except i can't find the options to configure the boards:

http://prntscr.com/cgct9

This probably because we are using a skin. Can you help me in doing the modification to fix the problem?

thanks.

UPDATE: I found out that the installation didn't make the directory resource under Sources/cad_sources. I created the directory and copied the file: hooks.php and index.php

Now i see this:

http://prntscr.com/cgd53

Still missing the combo :)

UPDATE: Seems the problem is in this piece of jquery code:


if (loaded_childboard_attr == "checked") {
                                }
                                else {
                                        $("#lab360_childboard_strict").slideUp("slow");
                                        $("#lab360_childboard_strict_dd").slideUp("slow");
                                }
                                $("#lab360_childboard_dropdown").change(function() {
                                        var childboard_attr = $(this).attr("checked");
                                        if (childboard_attr == "checked") {
                                                $("#lab360_childboard_strict").slideDown("slow");
                                                $("#lab360_childboard_strict_dd").slideDown("slow");
                                        }
                                        else {
                                                $("#lab360_childboard_strict").slideUp("slow");
                                                $("#lab360_childboard_strict_dd").slideUp("slow");
                                        }
                                });


when the combobox is checked, seems the SlideUp function doesn't work.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on July 21, 2012, 12:20:30 PM
You're missing source files.

./Sources/cad_source:
Title: Re: Childboards as Dropdown
Post by: Sunchaser on July 31, 2012, 12:31:36 PM
No, becausse i added them manually. The installation process somehow didn't create the directory resources but create a 'file' resources.

When i created them, the options are there but when i enter, they are hidden regardless if the checkbox is clicked or not. So i commented that part of code.

Title: Re: Childboards as Dropdown
Post by: Matthew K. on August 02, 2012, 02:37:53 AM
Hmm...that's not good. What is hidden regardless of the option?
Title: Re: Childboards as Dropdown
Post by: Sunchaser on August 03, 2012, 10:45:16 AM
Everything; When i enter the configuration panel, the panel displays just for a few seconds then it it his hidden, regardless of the checkbox value.

Title: Re: Childboards as Dropdown
Post by: Matthew K. on August 03, 2012, 11:44:09 AM
Can you shoot me a link to your forum in a PM with an admin login so I can inspect the page and see what I can figure out?
Title: Re: Childboards as Dropdown
Post by: Sunchaser on August 09, 2012, 10:40:57 AM
Ok, here is a screenshot:



I need a bit of time because i have to set a test environment for you.

Title: Re: Childboards as Dropdown
Post by: teos55 on September 03, 2012, 03:32:31 AM
smf 2.0.2   simple portal 2.3.5  default theme

Recently intalled the mod, wondering where the string " select a childboard" comes from.  I need to translate it to my own
language.

OK found the language file in /Themes/default/languages/cad_language/main.english.php
Title: Re: Childboards as Dropdown
Post by: Matthew K. on September 03, 2012, 12:25:27 PM
Glad you found it :) Enjoy!
Title: Re: Childboards as Dropdown
Post by: lord alibaski on September 03, 2012, 02:37:44 PM
Hi labradoodle

Not been on here for a while but I'm glad to see your still supporting this mod.

Got a little problem with it this has only happened last couple of days and I haven't installed any other mods since this one.



I put this problem here
http://www.simplemachines.org/community/index.php?topic=485611.msg3400074#msg3400074

Have you any idea!

Thanks

Lord Alibaski
Title: Re: Childboards as Dropdown
Post by: Matthew K. on September 04, 2012, 01:14:10 AM
Hey there!

As Kays said on that other topic, if it doesn't work with this modification, it's just how this mod works. Although I do believe I added some sort of "new" compatibility.
Title: Re: Childboards as Dropdown
Post by: phpshiva on September 20, 2012, 06:11:45 AM
i got little problem missing some till the end
how can i fix this ?
see pics
Title: Re: Childboards as Dropdown
Post by: Matthew K. on September 20, 2012, 09:16:06 AM
What's your problem? The dropdown is too far down?
Title: Re: Childboards as Dropdown
Post by: phpshiva on September 20, 2012, 10:18:09 AM
no as you can see its not as far as the rest of it its missing a part
it seems the bar is not long enough
Title: Re: Childboards as Dropdown
Post by: Matthew K. on September 20, 2012, 10:04:57 PM
Doesn't look it's missing anything to me...what is it missing?
Title: Re: Childboards as Dropdown
Post by: phpshiva on September 21, 2012, 03:41:36 AM
it needs to be as long as ware you see laatste berichten its only where the child part is its not looking good its not till the end of the rest of the board
Title: Re: Childboards as Dropdown
Post by: br360 on October 01, 2012, 03:56:32 PM
Quote from: lord alibaski on January 20, 2012, 07:56:00 PM
Quote from: Kreator on January 18, 2012, 01:24:43 PM
I have renamed them though to Sub-Boards

I renamed mine too but if you dont want it to say "select a childboard" then edit the main.english.php file in the resources/cad language folder.

Like this
// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Select a Sub-Forum';


That worked, but when I scroll down, I still get "Board Children:"



How do I change that to sub board as well?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on October 01, 2012, 04:39:18 PM
I'd have to look at the other text strings...don't remember off the top of my head. Look in the language file for the modification.
Title: Re: Childboards as Dropdown
Post by: br360 on October 01, 2012, 05:23:59 PM
It was also in the  main.english.php file in the resources/cad language folder. (the line right underneath) The code below worked.

// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Select a Sub-Forum';
$txt['lab360_board_children'] = 'Sub-Forum';
$txt['lab360_go'] = 'Go!';


The problem now, is that I'm getting these errors:

https://mysite.com/index.php?action=reminder.
8: Undefined index: lab360_goFile: /home/content/65/9385465/html/Themes/default/languages/SearchFocus.english.php (main sub template - eval?)
Line:240 or
Line:241 or
Line: 249
Title: Re: Childboards as Dropdown
Post by: Matthew K. on October 01, 2012, 05:27:29 PM
Attach your main.english.php file.
Title: Re: Childboards as Dropdown
Post by: br360 on October 01, 2012, 05:31:30 PM
Here you go:

<?php
/**
 * Childboards as Dropdown
 *
 * @file ./cad_language/main.english.php
 * @author Labradoodle-360
 * @copyright Matthew Kerle 2012
 *
 * @version 2.0.3
 */

// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Select a Sub-Forum';
$txt['lab360_board_children'] = 'Sub-Forum';
$txt['lab360_go'] = 'Go!';

// Admin Panel Strings.
global $modSettings;
$txt['lab360_childboard_header'] = 'Childboards as Dropdown';
$txt['lab360_childboard_desc'] = '<strong>Childboards as Dropdown</strong> allows you to replace the SMF-standardized childboard list, with an input dropdown to clean up the layout substantially.';
$txt['lab360_childboard_dropdown'] = 'Enable Childboards as Dropdown:';
$txt['lab360_childboard_limit'] = 'Boards Containing > <em>' . (isset($modSettings['lab360_childboard_limit']) ? $modSettings['lab360_childboard_limit'] : 0) . '</em> Children Become a Dropdown:';
$txt['lab360_childboard_limit_desc'] = '<em>0 = All Boards</em>';
$txt['lab360_copyright'] = '<a href="http://custom.simplemachines.org/mods/index.php?mod=1691" target="_self">Childboards as Dropdown</a> | Copyright ' date('Y') . ' - <a href="http://www.simplemachines.org/community/index.php?action=profile;u=182638" target="_blank">Matthew Kerle</a>';
Title: Re: Childboards as Dropdown
Post by: Matthew K. on October 01, 2012, 05:42:59 PM
You shouldn't be having any issues on ?action=reminder...this mod isn't active on that page.
Title: Re: Childboards as Dropdown
Post by: br360 on October 01, 2012, 07:23:17 PM
It's weird. I  myself had a few errors right when I changed the name to sub-boards, but over the last hour, I haven't been able to duplicate it, and it is working like it should.

Strange though; I currently have about 200 members on line, yet I am still only getting the above error in my log from just one person ( oddly enough, like 40 errors from him though over the last 10 minutes.)
Title: Re: Childboards as Dropdown
Post by: Matthew K. on October 01, 2012, 07:59:07 PM
Remove all the errors and see if it comes back or not.
Title: Re: Childboards as Dropdown
Post by: br360 on October 10, 2012, 02:02:20 AM
My apologies for not responding earlier. I had some corrupt files, so I've been manually deleting some mods.  Unfortunately this one was one of the newest I installed, so I had to delete it.

To answer your question though;  I did clear all errors, and then the error appeared again like 10 times by just one other person. Weird. I pm'd the person, let him know that I was getting some errors, and asked him what he had been doing, or if he was getting any errors at all. His response was that no errors were showing on his end;  just that he was on the forum with his phone, and he wasn't getting that good of a connection. Not sure if that helps at all, but I thought I would at least share that. lol

Anyway, even though it's not currently installed, it is a great mod. Thank You.

Title: Re: Childboards as Dropdown
Post by: Matthew K. on October 10, 2012, 02:06:48 AM
Interesting...let me know if this comes up again eh? Thanks!
Title: Re: Childboards as Dropdown
Post by: teos55 on December 12, 2012, 12:41:39 PM
SMF 2.0.2  Sp2.3.5  default theme

  Today my error log filled up with below message :

"http://111111.org/index.php?action=register+%5BPLM=0%5D%5BR%5D+GET+http://111111.org/index.php?action=register+%5B0,17822,20850%5D+-%3E+%5BR%5D+POST+http://1111111.org/index.php?action=register+%5B0,21225,2574%5D+-%3E+%5BR%5D+POST+http://111111.org/index.php?action=register2+%5B0,0,18038%5D+-%3E+%5BL%5D+GET+http://1111111.org/index.php?action=login+%5B0,16129,19032%5D+-%3E+%5BL%5D+POST+http://111111.org/index.php?action=login2+%5B13126,0,19131%5D

8: Undefined index: lab360_go
File: /home/1111/public_html/Themes/default/BoardIndex.template.php
Liner: 255"


also :

undefined index : lab360_board_children  line 247

undefined index: lab360_select_child  line 246

and so on ...


the lines around :  235-272

//-- Labradoodle-360; Childboards as Dropdown
global $modSettings;
if (!empty($modSettings['lab360_childboard_dropdown']) && (isset($modSettings['lab360_childboard_limit']) && ($modSettings['lab360_childboard_limit'] == 0 || count(array_keys($board['children'])) > $modSettings['lab360_childboard_limit']) || !isset($modSettings['lab360_childboard_limit'])))
{
unset($children);
echo '
<tr id="board_', $board['id'], '_children">
<td colspan="3" class="children windowbg">
<form action="', $scripturl, '?" method="get">
<strong>', $txt['parent_boards'], ':</strong>&nbsp;
<select name="board" id="board" onchange="javascript:jsRedirect(this);">
<option value="">', $txt['lab360_select_child'], '</option>
<optgroup label="', $txt['lab360_board_children'], ':">';
foreach ($board['children'] as $key => $value)
{
echo '<option value="', $key, '">', $value['name'], $value['new'] ? '&#42;' : '', '</option>';
}
echo '</optgroup>
</select>
<noscript>
<input type="submit" value="', $txt['lab360_go'], '" class="button_submit" />
</noscript>
</form>
</td>
</tr>
';
}
else
{
echo '
<tr id="board_', $board['id'], '_children">
<td colspan="3" class="children windowbg">
<strong>', $txt['parent_boards'], ':</strong> ', implode(', ', $children), '
</td>
</tr>
';
}
// End Labradoodle-360; Childboards as Dropdown --//



  Nothing chenged for months. Since this is guest request, I suspected somebody trying to force my site .

nb:  I copied main main.engligh.php to  main.mylanguage-utf8.php during th installation. But the premission was 644 wheres as
main.english.php was 666.

  I changed it to 666 today.

Any recommendations, what is wrong ?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 13, 2012, 09:41:42 AM
It looks like your website could have been hit by a spambot or something. I would suggest clearing the errors in your error log, and then see if those errors show up again or not. If they do, definitely let me know. Also, I apologize for the late reply here, been pretty busy with school and such.
Title: Re: Childboards as Dropdown
Post by: teos55 on December 13, 2012, 09:48:08 AM
No problem with the delay :-)

  I cleared the error log and waiting for the event to occur ?

nb. I only copied main.english.php to main.mylang-utf8.php  and not main.mylang.php  during the installation.

   Now I copied.  does this make any change ?  ( I' m using utf8 )
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 13, 2012, 09:50:49 AM
As long as you're using UTF-8, the non-UTF-8 language file will not have any affect, as long as the UTF-8 exists, of course, otherwise it does use the non-UTF-8 twin.
Title: Re: Childboards as Dropdown
Post by: teos55 on December 21, 2012, 01:21:20 PM
Problem still exists.

From error log of today:

http://12345.org/index.php?action=tpmod;dl8: Undefined index: lab360_goFile: /home/12345/public_html/Themes/default/BoardIndex.template.php
Line: 255


http://12345.org/index.php?action=tpmod;dl8: Undefined index: lab360_board_childrenFile: /home/12345/public_html/Themes/default/BoardIndex.template.php
Line: 247
   
http://12345.org/index.php?action=tpmod;dl8: Undefined index: lab360_select_childFile: /home/12345/public_html/Themes/default/BoardIndex.template.php
Line: 246


and goes on.

Can you pls guide how to debug this ?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 21, 2012, 11:35:57 PM
Hey there, sorry to hear the issues are still showing up.

Are you willing to shoot me a PM with a link, administrative login and FTP details so I can debug it and then provide a new patch for this modification?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 11:26:35 AM
Hello teos55. Thank you for allowing me to utilize your forum to look into the issue. As I have figured out the issue, please change the account password in addition to your FTP password so I no longer have access.

The issue is in regard to TinyPortal and a custom action that the modification uses that still defaults to the BoardIndex (when my mod loads), so the text-strings are being called when they "shouldn't" be in scope as far as my code is concerned, but in reality should be available.

I will push out an updated version today with the TinyPortal bugfix. Thank you once again.

Best Regards,
Labradoodle-360
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 11:29:44 AM
Just to remind that it is Simple Portal not Tiny Portal.  Maybe doesnt make any difference.
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 11:37:41 AM
The portal you currently have installed is SimplePortal, however, you still have TinyPortal code on your forum.

You don't have to believe me...the error that's showing up comes from:
index.php?action=tpmod

I did a search in both SimplePortal and TinyPortal files, this comes from TinyPortal:
'forum' => array('BoardIndex.php', 'BoardIndex'),
'tpmod' => array('TPmodules.php', 'TPmodules'),
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 11:41:27 AM
That is interesting,  I tried to uninstall Tinyportal (maybe months ago) manualy, maybe some artifacts remained. I'll clean them.
Thanks for the info.

nb.  by the way, which index file is it ?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 11:44:30 AM
Not a problem. Be sure to look for an update shortly here.
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 11:52:38 AM
Maybe missed my modfication, which index.php is it ? 

Downloaded index.php from /public.html just now,   there is no referance to tpmod or tpmodule in it.

Did you do the cleaning on behalf of me ?  If so thanks ...
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 12:05:19 PM
Look for "tpmod", I did not uninstall the edit because I didn't know if you still wanted TinyPortal.
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 12:28:29 PM
Sorry, it was typo ... it should read  "tpmod"

I searched both of them right now, and search gives "not found" . I'll attach my index.php
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 12:46:03 PM
Sorry for misunderstanding or quick reading.  Looking in the wrong php. It should be boardindex.php

I'll check immediately.


nb.  ftp'd all my source php files to my local disk.

searched with  fileseek V2.1.3  for string" tpmod" ...  Do not exist ...

Am I still missing something, or misunderstanding ?

Also checked with cpanel file manager search tool ... No "tpmod" in /public_html



Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 01:07:37 PM
Childboards as Dropdown version 2.0.4 released! Addresses a bug reported by teos55 (http://www.simplemachines.org/community/index.php?action=profile;u=230574) and makes many improvements. Upgrade is highly suggested if you're using TinyPortal, beyond that they're just under the hood changes.

Project is now hosted on GitHub (Childboards-as-Dropdown) (https://github.com/Labradoodle-360/Childboards-as-Dropdown).

Link to Mod: http://custom.simplemachines.org/mods/index.php?mod=1691
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 01:52:36 PM
Uninstalled 2.03 and installed 2.0.4

No errors so far, thanks ...

  Still the "tpmod" issue is unclear for me ..  Which php files to look ..  Can you pls clerify ...
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 01:55:15 PM
Not a problem. My guess is that tpmod really should be doing something else, but it's not because the action doesn't exist in $actionArray, which would mean something else is calling it. Try doing a search for "tpmod" in all of your forum directory.

If it's actually supposed to do something else (which I didn't think about) this patch would somewhat be inaccurate.
Title: Re: Childboards as Dropdown
Post by: teos55 on December 22, 2012, 02:08:04 PM
With fileseek v2.1.3  I searched  /sources   /themes  and /themes/default/languages 

NO match... 

I also gone through the DB search and only find below entry for "tpmod" in table smf_package_servers

search output attached.  May I delet this table entry ?
Title: Re: Childboards as Dropdown
Post by: Matthew K. on December 22, 2012, 02:11:14 PM
That shouldn't affect anything. I'm going to contact IchBin about this and see what his thoughts are.
Title: Re: Childboards as Dropdown
Post by: teos55 on January 07, 2013, 08:30:09 AM
SMF 2.0.3  Default theme  curve  simple portal  2.3.5

  Some bot is trying to execute /index.php?action=sitemap;xml  and  I'm using "SEO sitemap and XML sitemap" mod which uses
kitseositemap.xml.

  So fails, which is normal ...

  But the strange thing is that I receive ;

h t t p://mysite . org/index.php?action=sitemap;xml
8: Undefined index: lab360_cad
File: /home/myuser/public_html/Themes/default/BoardIndex.template.php
Satır: 231


h t t p://mysite . org/index.php?action=sitemap;xm
l8: Undefined index: lab360_cad
File: /home/myuser/public_html/Themes/default/BoardIndex.template.php
Satır: 240

h t tp://mysite . org/index.php?action=sitemap;xml
8: Undefined index: lab360_cad
File: /home/myuser/public_html/Themes/default/BoardIndex.template.php
Satır: 232



Every sitemap request generates above message set.


My boardindex.template.php attached.   Seems there is something wrong in t it.

Can you pls help ?





Title: Re: Childboards as Dropdown
Post by: Matthew K. on January 07, 2013, 03:20:23 PM
The piece that is failing is from Load.php, it seems like my last major version has a fairly big logical flaw, so I probably should shoot out an update fairly soon.
Title: Re: Childboards as Dropdown
Post by: lord alibaski on February 05, 2013, 12:04:08 PM
Hi Labradoodle-360

Thanks for the last update though I just tested it via wamp and it coming up with these errors in some themes.



Also tried to edit the main.english.php to this

<?php
/**
 * Childboards as Dropdown
 *
 * @file ./cad_language/main.english.php
 * @author Labradoodle-360
 * @copyright Matthew Kerle 2012-2013
 *
 * @version 2.0.4
 */

global $modSettings;
$txt['lab360_cad'] = array(
'select_child' => 'Select a Sub-Forum',
'board_children' => 'Sub-Forums',
'go' => 'Go!',
'childboard_limit_desc' => '<em>0 = All Boards</em>'
);

$txt['lab360_childboard_header'] = 'Childboards as Dropdown';
$txt['lab360_childboard_desc'] = '<strong>Childboards as Dropdown</strong> allows you to replace the SMF standardized childboard list with an input dropdown to clean up the layout substantially.';
$txt['lab360_childboard_dropdown'] = 'Enable Childboards as Dropdown:';
$txt['lab360_childboard_limit'] = 'Boards Containing > <em>' . (isset($modSettings['lab360_childboard_limit']) ? $modSettings['lab360_childboard_limit'] : 0) . '</em> Children Become a Dropdown:';
$txt['lab360_copyright'] = '<a href="http://custom.simplemachines.org/mods/index.php?mod=1691">Childboards as Dropdown</a> | Copyright ' date('Y') . ' - <a href="http://matthewkerle.com/">Matthew Kerle</a>';


but it doesn't work like it did with this version.

<?php
/**
 * Childboards as Dropdown
 *
 * @file ./cad_language/main.english.php
 * @author Labradoodle-360
 * @copyright Matthew Kerle 2012
 *
 * @version 2.0.3
 */

// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Select a Sub-Forum';
$txt['lab360_board_children'] = 'Board Children';
$txt['lab360_go'] = 'Go!';

// Admin Panel Strings.
global $modSettings;
$txt['lab360_childboard_header'] = 'Childboards as Dropdown';
$txt['lab360_childboard_desc'] = '<strong>Childboards as Dropdown</strong> allows you to replace the SMF-standardized childboard list, with an input dropdown to clean up the layout substantially.';
$txt['lab360_childboard_dropdown'] = 'Enable Childboards as Dropdown:';
$txt['lab360_childboard_limit'] = 'Boards Containing > <em>' . (isset($modSettings['lab360_childboard_limit']) ? $modSettings['lab360_childboard_limit'] : 0) . '</em> Children Become a Dropdown:';
$txt['lab360_childboard_limit_desc'] = '<em>0 = All Boards</em>';
$txt['lab360_copyright'] = '<a href="http://custom.simplemachines.org/mods/index.php?mod=1691" target="_self">Childboards as Dropdown</a> | Copyright ' date('Y') . ' - <a href="http://www.simplemachines.org/community/index.php?action=profile;u=182638" target="_blank">Matthew Kerle</a>';
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 05, 2013, 11:44:38 PM
Unfortunately, I don't support any other theme besides Curve by default. This wouldn't be too difficult to hack into core, or really other themes, you'd just need to understand what my one modification does.
Title: Re: Childboards as Dropdown
Post by: lord alibaski on February 06, 2013, 12:16:32 AM
k m8 thats not a problem it does work with a few other themes.

Any idea on the other issue though?

1st asked here
http://www.simplemachines.org/community/index.php?topic=298651.msg3257381#msg3257381

What I would like to do is change the Child boards to Sub-Forums and Select at childboard to Select a Sub-Forum.

Thanks
Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 06, 2013, 01:00:51 AM
Modify the language strings in ./Themes/default/languages/cad_languages/main.english.php
Title: Re: Childboards as Dropdown
Post by: lord alibaski on February 06, 2013, 03:52:20 PM
Quote from: Labradoodle-360 on February 06, 2013, 01:00:51 AM
Modify the language strings in ./Themes/default/languages/cad_languages/main.english.php

Thanks for that worked perfect.

Only one more thing is it possible to change the Child Boards title name to Sub_Forums?



Thanks

Lord Alibaski

Title: Re: Childboards as Dropdown
Post by: Matthew K. on February 06, 2013, 04:27:48 PM
Look in ./Themes/default/languages/index.english.php off the top of my head iirc.
Title: Re: Childboards as Dropdown
Post by: TheListener on April 06, 2013, 06:10:49 PM
Good to have a mod which keeps the forum looking tidy.

:)
Title: Re: Childboards as Dropdown
Post by: Matthew K. on April 06, 2013, 06:47:30 PM
Thanks Old One :)
Title: Re: Childboards as Dropdown
Post by: TheListener on April 06, 2013, 06:49:16 PM
Quote from: Labradoodle-360 on April 06, 2013, 06:47:30 PM
Thanks Old One :)

Cheeky kid

:P
Title: Re: Childboards as Dropdown
Post by: Matthew K. on April 08, 2013, 01:50:41 PM
/me tosses Old One a cane and then runs away
Title: Re: Childboards as Dropdown
Post by: Kyrianchigozie on February 06, 2014, 05:50:22 PM
please how can i edit and remove the "chilldboard and children board that shows. i want the dropdown to start with the content . thanks
Title: Re: Childboards as Dropdown
Post by: TheListener on February 06, 2014, 06:10:41 PM
Quote from: Kyrianchigozie on February 06, 2014, 05:50:22 PM
please how can i edit and remove the "chilldboard and children board that shows. i want the dropdown to start with the content . thanks
That is not the point of the dropdown.

The dropdown shows the childboard topics not the posts within the childboards.
Title: Re: Childboards as Dropdown
Post by: Kyrianchigozie on February 07, 2014, 08:38:40 PM
sir i think you did not understand me. I mean the childboard shows 'select childboards' i dont want it to show 'select childboard' i wana edit it like choose suboard, somthing ike that. Were can i edit ti? Thanks
Title: Re: Childboards as Dropdown
Post by: br360 on February 08, 2014, 02:50:09 AM
Quote from: Kyrianchigozie on February 07, 2014, 08:38:40 PM
sir i think you did not understand me. I mean the childboard shows 'select childboards' i dont want it to show 'select childboard' i wana edit it like choose suboard, somthing ike that. Were can i edit ti? Thanks

In this file-  languages/cad_language/main.english.php

Find:
// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'select childboard';


replace with:

// BoardIndex & MessageIndex Strings.
$txt['lab360_select_child'] = 'Choose Suboard';


If you also want to replace the "Board Children" part (next line down)

Find:
$txt['lab360_board_children'] = 'Board Children';

Replace with:
$txt['lab360_board_children'] = 'Sub Board';
Title: Re: Childboards as Dropdown
Post by: MyTime on December 11, 2014, 07:00:42 PM
I love this mod, I used it on my old theme, but now I downloaded it again on this site with this theme, and it's not working. It's coming up with this

      Execute Modification   ./Themes/zGames/BoardIndex.template.php   Test failed
   1.   Replace   ./Themes/zGames/BoardIndex.template.php   Test failed
   Execute Modification   ./Themes/zGames/MessageIndex.template.php   Test failed
   1.   Replace   ./Themes/zGames/MessageIndex.template.php   Test failed

I tried to replace the code with what it tells me to, but I can't find out were exactly to insert the new code, I tried to look in the files but they weren't able to pick up some phrases to find were to put the code in.
Title: Re: Childboards as Dropdown
Post by: MyTime on December 15, 2014, 06:57:46 PM
I still can't get this too work, any advice?
Title: Re: Childboards as Dropdown
Post by: shadav on June 29, 2020, 05:45:40 PM
just wanted to say thanks for this.....really helped a lot where 2 of my boards have 20 sub boards
this helped the index page out a lot :D

one thing though....

there is no setting in the admin to change the number to show....only a checkbox to enable/disable the mod
Title: Re: Childboards as Dropdown
Post by: shadav on August 15, 2020, 01:05:27 AM
question :)
is it supposed to show the new tag next to the subcategory if there's new posts in it?
if yes, then I need help  :P
if no, then I still need help  :laugh:

here's what I have in boardindex.template.php
//-- Labradoodle-360; Childboards as Dropdown
global $modSettings;
if (!empty($modSettings['lab360_childboard_dropdown']) && (isset($modSettings['lab360_childboard_limit']) && ($modSettings['lab360_childboard_limit'] == 0 || count(array_keys($board['children'])) > $modSettings['lab360_childboard_limit']) || !isset($modSettings['lab360_childboard_limit'])))
{
unset($children);
echo '
<p id="board_', $board['id'], '_children" class="children">
<form action="', $scripturl, '?" method="get">
<select name="board" id="board" onchange="javascript:jsRedirect(this);" style="width: 150px;">
<option value="">', $txt['lab360_cad']['select_child'], '</option>';
foreach ($board['children'] as $key => $value)
{
echo '<option value="', $key, '">', $value['name'], $value['new'] ? '&#42;' : '', '</option>';
}
echo '</optgroup>
</select>
<noscript>
<input type="submit" value="', $txt['lab360_cad']['go'], '" class="button_submit" />
</noscript>
</form>
</p>';
}
else
{
echo '
<p id="board_', $board['id'], '_children" class="children">
<span class="child-ts">', $txt['parent_boards'], '</span>: ', implode(', ', $children), '
</p>';
}
// End Labradoodle-360; Childboards as Dropdown --//
Title: Re: Childboards as Dropdown
Post by: Wellwisher on August 17, 2020, 03:05:37 PM
FINALLY! Got this mod working on my theme - be it after 'much' tinkering around.

The only issue I had was that this mod wasn't able to add the following code correctly into the boardindex.template.php. So I had to adjust a few things to get it working properly:



//-- Labradoodle-360; Childboards as Dropdown
global $modSettings;
if (!empty($modSettings['lab360_childboard_dropdown']) && (isset($modSettings['lab360_childboard_limit']) && ($modSettings['lab360_childboard_limit'] == 0 || count(array_keys($board['children'])) > $modSettings['lab360_childboard_limit']) || !isset($modSettings['lab360_childboard_limit'])))
{
unset($children);
echo '
<p id="board_', $board['id'], '_children" class="children">
<form action="', $scripturl, '?" method="get">
<select name="board" id="board" onchange="javascript:jsRedirect(this);" style="width: 150px;">
<option value="">', $txt['lab360_cad']['select_child'], '</option>';
foreach ($board['children'] as $key => $value)
{
echo '<option value="', $key, '">', $value['name'], $value['new'] ? '&#42;' : '', '</option>';
}
echo '</optgroup>
</select>
<noscript>
<input type="submit" value="', $txt['lab360_cad']['go'], '" class="button_submit" />
</noscript>
</form>
</p>';
}
else
{
echo '
<p id="board_', $board['id'], '_children" class="children">
<span class="child-ts">', $txt['parent_boards'], '</span>: ', implode(', ', $children), '
</p>';
}
// End Labradoodle-360; Childboards as Dropdown --//




@shadav stalked your profile posts to find out how you made the childboard drop down list   O:) :laugh:

@Matthew K. Like @shadav was saying, is there anyway to add the "new post" icons next to the boards? That would be awesome!  ;D 8)
Title: Re: Childboards as Dropdown
Post by: Wellwisher on August 17, 2020, 04:42:37 PM
@shadav

I am not sure how your down list looks but on mine, the "New" icon is replaced with an asterisk (*). So basically if my drop-down list has an asterisk next to a sub-board, then it means there's new posts in that board (As shown on the image attached).

I managed to figure out how to add "New" symbol as text by doing the following modification:

On your current theme, find code in boardindex.template.php



echo '<option value="', $key, '">', $value['name'], $value['new'] ? '&#42;' : '', '</option>';



Replace with:




echo '<option value="', $key, '">', $value['name'], $value['new'] ? ' [New]' : '', '</option>';




8) 8) 8)

End result - see attached:
Title: Re: Childboards as Dropdown
Post by: shadav on August 17, 2020, 06:08:41 PM
thanks but still not working  for me ???

Quote from: Wellwisher on August 17, 2020, 03:05:37 PM@shadav stalked your profile posts to find out how you made the childboard drop down list   O:) :laugh:

:laugh:  ;D you could have asked, probably would have been easier  :P
Title: Re: Childboards as Dropdown
Post by: shadav on August 17, 2020, 08:18:10 PM
Quote from: Wellwisher on August 17, 2020, 04:42:37 PM
@shadav

I am not sure how your down list looks but on mine, the "New" icon is replaced with an asterisk (*). So basically if my drop-down list has an asterisk next to a sub-board, then it means there's new posts in that board (As shown on the image attached).

I managed to figure out how to add "New" symbol as text by doing the following modification:

On your current theme, find code in boardindex.template.php



echo '<option value="', $key, '">', $value['name'], $value['new'] ? '&#42;' : '', '</option>';



Replace with:




echo '<option value="', $key, '">', $value['name'], $value['new'] ? ' [New]' : '', '</option>';




8) 8) 8)

End result - see attached:

I can't get anything to show up on my site
but if you want the image to show, you could try replacing [New] with
<img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />
it should work, I would think....
Title: Re: Childboards as Dropdown
Post by: Arantor on August 17, 2020, 08:40:53 PM
Nope, can't put images inside dropdowns.

You *could* possibly do some really funky things with CSS and backgrounds on elements but it's not recommended as select elements are not consistently styleable across browsers.
Title: Re: Childboards as Dropdown
Post by: Wellwisher on August 17, 2020, 09:29:08 PM
Quote from: Arantor on August 17, 2020, 08:40:53 PM

Nope, can't put images inside dropdowns.


@Arantor that was my next thought tbh.  8) However, I already love the result thus far with your help:

Final result:



@shadav Tried that, nothing showed. Let me know if you managed to find a way of adding the image. Here's the code that Arantor kindly offered for pushing the "New" icon to the left (as seen in the picture):

Quote from: Arantor on August 17, 2020, 07:47:56 PM


echo '<option value="', $key, '">', $value['new'] ? ' [New]' : '', $value['name'], '</option>';



CSS is the way forward because you can target each "option" and because the board value is always different. You should be able to use css "content:before"

e.g:



option[value=two] {background-color: yellow;}

[/quote]
Title: Re: Childboards as Dropdown
Post by: Wellwisher on August 17, 2020, 10:44:42 PM
Crap:

Adding images via CSS may be tricky too (check out my JSfiddle mock-up).  Where the "option value" is "Alphabetic" we can target the yellow background color with CSS. However, where the value is "numeric", we're NOT able to target it.

Since the SMF board ID's are "numeric values" it will be a problem using CSS to target it.

https://jsfiddle.net/f8qtrLbk/2/
Title: Re: Childboards as Dropdown
Post by: Arantor on August 18, 2020, 04:14:31 AM
Add a class to the options that are new, or data attributes. But rendering of images in selects in any form, whether it's with before or background images is woefully inconsistent, or at least used to be so, haven't looked f it's now better (but given some other stuff I see, I suspect not)
Title: Re: Childboards as Dropdown
Post by: GL700Wing on May 15, 2022, 08:20:29 AM
I don't actually use this mod but I am working on a new mod that integrates with it.

I noticed this mod hasn't been updated for SMF 2.1 yet but because I know some people like @shadav are probably waiting for it (and because I want to finish my new mod) I decided to work out what changes were needed to get it to work with SMF 2.1 (fortunately only minor changes were needed to the installation original code) - one change of note is that 'child' boards in SMF 2.0 are referred to as 'sub-boards' in SMF 2.1.

To repackage the existing release of the mod to work with either SMF 2.0 or SMF 2.1 you'll need to do the following:
1.  Download and unzip the current Childboards-as-Dropdown.2.0.4.zip (https://custom.simplemachines.org/index.php?action=download;mod=1691;attach=214357) mod package file.
2.  Overwrite the existing 'package-info.xml' file with the attached file of the same name.
3.  Save the attached 'modifications-smf21.xml' and 'resources.zip' files to the mod package directory/folder.
4.  Unzip the 'resources.zip' file and confirm overwriting the file 'resources/cad_language/main.english.php'.
5.  Delete the 'resources.zip' file.
6.  Recreate the mod package zip file (eg, 'Childboards-as-Dropdown.2.0.4.zip').
7.  Install on either your SMF 2.0 or SMF 2.1 forum.
8.  Enjoy!
Title: Re: Childboards as Dropdown
Post by: Antechinus on May 15, 2022, 08:29:22 AM
Nice work. :)
Title: Re: Childboards as Dropdown
Post by: Shades. on May 15, 2022, 12:35:48 PM
Quote from: GL700Wing on May 15, 2022, 08:20:29 AMI noticed this mod hasn't been updated for SMF 2.1 yet but because I know some people like @shadav are probably waiting for it (and because I want to finish my new mod) I decided to work out what changes were needed to get it to work with SMF 2.1 (fortunately only minor changes were needed to the installation original code) - one change of note is that 'child' boards in SMF 2.0 are referred to as 'sub-boards' in SMF 2.1.

Thank you! 8)