News:

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

Main Menu

Childboards as Dropdown

Started by Matthew K., March 12, 2009, 01:04:02 PM

Previous topic - Next topic

Matthew K.

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.

lord alibaski

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

Matthew K.

Modify the language strings in ./Themes/default/languages/cad_languages/main.english.php

lord alibaski

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


Matthew K.

Look in ./Themes/default/languages/index.english.php off the top of my head iirc.

TheListener

Good to have a mod which keeps the forum looking tidy.

:)

Matthew K.



Matthew K.

* Labradoodle-360 tosses Old One a cane and then runs away

Kyrianchigozie

please how can i edit and remove the "chilldboard and children board that shows. i want the dropdown to start with the content . thanks

TheListener

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.

Kyrianchigozie

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

br360

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';

MyTime

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.

MyTime

I still can't get this too work, any advice?

shadav

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

shadav

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 --//

Wellwisher

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)

Wellwisher

#258
@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:

shadav

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

Advertisement: