Advertisement:

Author Topic: Child Boards and 3 vertical columns  (Read 4530 times)

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Child Boards and 3 vertical columns
« on: March 17, 2009, 03:30:35 PM »
There are a few tutorials that show how to align childboard in a vertical fashion.  I've tried many and some didnt work or partially worked.

I tried the BoardIndex.template file that was offered here for download
 http://www.simplemachines.org/community/index.php?topic=288183.0
It almost worked 100%  (Some of the board were aligned to the left and not centered)


So im asking if someone can take a look at my attached BoardIndex.template.php and kindly help me get 3 vertical columns.  It would be great if someone could help me get the same CB layout found in the link that i provided above, but that's not necessary.  I only want 3 columns :)

The reason i think ive been unsuccessful is becasue im sure i have other mods installed that are keeping me from getting it right.

I hope someone can help me.

thanks



Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #1 on: March 17, 2009, 04:28:11 PM »
Give me the whole theme in a zip so I can test the thing.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #2 on: March 17, 2009, 04:34:46 PM »
The attached is my theme folder SullenMaddness.

These are the actual files from my server.

thank you, thank you, thank you

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #3 on: March 17, 2009, 04:43:51 PM »
Cool. Got it. Give me a day or so to sort this.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #4 on: March 17, 2009, 04:45:03 PM »
thanks again :)

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #5 on: March 17, 2009, 04:47:19 PM »
Not sure if it's of any value to you, but your original board index temp. that you offered in the other thread  almost works.  Perhaps i can PM you a screen shot to show you what i mean.  Some boards are left align some are in the proper place.

just let  me know if you like a shot.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #6 on: March 17, 2009, 04:59:24 PM »
Umm, I just took a look at your files and this is for 1.1. RC2. That's prehistoric. I don't even have that on my server. I'm not going to install it either because I'm not in favour of supporting obsolete versions that have known security issues. The upgrades are released for good reason. Please use them.

If you want a version for 1.1.8 I'm fine with that.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #7 on: March 17, 2009, 05:03:12 PM »
ohh, but my forum software is up to date with 1.1.8 or 1.1.9


Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #8 on: March 17, 2009, 05:04:55 PM »
If you can just tell me what code to FIND and replace, i can handle it from there :)

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #9 on: March 17, 2009, 05:21:46 PM »
Ok, I'll have a look at it if it'll run on 1.1.8.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #10 on: March 17, 2009, 05:24:24 PM »
i really appreciate  it :)

Offline onepiece

  • Full Member
  • ***
  • Posts: 698
  • Gender: Female
Re: Child Boards and 3 vertical columns
« Reply #11 on: March 18, 2009, 07:57:48 AM »
Your theme doesn't have a 'BoardIndex' template. So you'll need to edit default theme file.

Themes/default/BoardIndex.template.php

Code: (Find) [Select]
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
Code: (Replace) [Select]
<strong>', $txt['parent_boards'], '</strong>:<br />
<table>
<tr>';

foreach ($children as $key => $child)
{
if ($key % 3 == 0 && $key != 0)
echo '
</tr>
<tr>';

echo '
<td style="padding-left: 10px;">', $child, '</td>';
}

echo '
</tr>
</table>

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #12 on: March 18, 2009, 08:41:25 AM »
Hey that's much cleaner than the way I was doing it. Nice work.

Offline onepiece

  • Full Member
  • ***
  • Posts: 698
  • Gender: Female
Re: Child Boards and 3 vertical columns
« Reply #13 on: March 18, 2009, 08:57:48 AM »
Thanks. You could make it even cleaner but I'm not very fond of lists.

Code: (Find) [Select]
', implode(', ', $children), '</span>
Code: (Replace) [Select]
</span><br /><ul style="width: 50%; list-style-type: none; margin: 0;"><li style="float: left; width: 10em;">' . implode('</li><li style="float: left; width: 10em;">', $children) . '</li></ul>

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #14 on: March 18, 2009, 09:07:32 AM »
That would be better because it'd save laying out a whole table. Lists are fine as long as they're stable. Depends how they're used.

I was doing it with td's but the way I was writing it was a bit more long winded. I think he'll want an extra td though. People seem to prefer it if the Child Boards text is beside the first child board name, rather than having it sitting on top with a <br />. It's no more functional but it tends to look better.

The other thing I was doing was editing the rowspan for on/off.gif (set to 1 always) and the colspan for the tr that holds the childboards (set to 3) so it spans right across. Handy for three columns of child boards on narrower screens. I also added another on/off.gif that only records new posts in the child boards, and recoded the one for the parent boards so that it only records parent board posts. Ends up being quite nifty if I do say so myself.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #15 on: March 18, 2009, 09:18:46 AM »
Tenma, you can see the way I was doing it in the files attached here, which were made for this theme.

This was for two columns but of course doing it in three is just as easy. ;)


Madman 71, I couldn't get your theme to run on my local host (massive fatal errors due to whatever mods you have) nor could I get the original download of the theme to run on 1.1.8.

ETA: Well I could have got them running if I was prepared to re-code them completely but I thought that was a bit much.
« Last Edit: March 18, 2009, 09:21:00 AM by Antechinus »

Offline onepiece

  • Full Member
  • ***
  • Posts: 698
  • Gender: Female
Re: Child Boards and 3 vertical columns
« Reply #16 on: March 18, 2009, 09:45:22 AM »
That looks cute, good job.

You can use madman71's theme by removing these codes from index.template.php.

Code: [Select]
echo "<center><br /><h2><i>Random images from the galleries</i></h2>";
include_once 'SSI.php';
ssi_attachmentsBanner('echo', 6);
echo "</center>";

The rest is not fatal.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,297
  • Master of BBC Abuse
Re: Child Boards and 3 vertical columns
« Reply #17 on: March 18, 2009, 09:48:11 AM »
Well to be honest I was doing umpteen other things as well and as soon as I saw "fatal error" I thought stuff this for a joke. Thanks for the tip though.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #18 on: March 18, 2009, 11:04:14 AM »
Thank you to you both!!!


Tenma, your code worked!


Im so happy that i get 3 columns now.


I really appreciate both of you for assisting me.

thanks agian

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Child Boards and 3 vertical columns
« Reply #19 on: March 18, 2009, 11:15:56 AM »
And if anyone is interested i have found this:

if you take this part of Tenma's code:
Code: [Select]
($key % 3 == 0 && $key != 0)
and change the "3" to any number, that will change how many columns you get.  I just changed it to 4 and it gave me 4 columns :)


such a short & simple piece of code :)