Arrange boards according to how many columns

Started by SFF Forum, May 08, 2011, 06:24:36 AM

Previous topic - Next topic

SFF Forum

Hello,everyone,i ask for some codes for my big forum.

My problem is there are many boards in my forum so that members have to pull down  the whole

page to find which boards he wants.

I need some code for Arranging boards in  CATEGORY setting

show in picture:

it can set  CATEGORY1  has 2 columns

CATEGORY2 has 3 columns , it is said that i can set how many columns in which CATEGORY  that will

show on  index.I think it is very useful for every big forum

My forum: SMF1.1.13 default theme



Hope for your help,thanks
I Love Simple Machines Forum .

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Thank you Joker™, but my forum is SMF1.1.13,i don't know if your code wrote for SMF 2.0 RC5 works for it.
I Love Simple Machines Forum .

Joker™

Ohh forgot to read you forum version. So what theme are you using?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Otherwise that one is not my need,i don't need CATEGORY by column,i only need boards in
CATEGORY by column,you can see what i need by attachmed image,and i use SMF1.1.13 befault theme
I Love Simple Machines Forum .

SFF Forum

I Love Simple Machines Forum .

Joker™

The thread I posted above was just the code idea ;). I'll look into this in morning for sure.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

I Love Simple Machines Forum .

Joker™

Ok made this so far

Make backup of your file before editing it


Open themes\default\BoardIndex.template.php
Code (Find:) Select
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">


Code (Replace it with:) Select
<div class="tborder boardsep" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">



Code (Find:) Select
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">';

/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '



Code (Replace it with:) Select
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '<div class="boardborder"><table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">




This code is bit below the above code
Code (Find:) Select
</tr>';
}
}
echo '
</table>';
                             }


Code (Replace it with:) Select
</tr>';
}
echo '
</table></div>';
}
}





In style.css at this code at the end
.boardsep
{
clear: both;
}

.boardborder {
    background-color: #FFFFFF;
    border: 1px solid #696969;
    float: left;
    padding: 1px;
    width: 49%;
margin: 3px 0 5px 5px;
}
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

I Love Simple Machines Forum .

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Thank you dute,you have a big success,but it is not very good,i will give you a demo site by PM,it is more tidy than you made,i think you can do better after you have a demo
I Love Simple Machines Forum .

Joker™

Will look after this tomorrow, hope you can wait till then :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Quote from: Joker™ on May 09, 2011, 03:34:48 PM
Will look after this tomorrow, hope you can wait till then :).

Of cause i can,thank you very much

I Love Simple Machines Forum .

SFF Forum

I add the full forum souce for you so that can help you

Firstly, you need to install UCenter

//=========================================
// UCenter Installation Guide
//=========================================

1. Upload /upload/*.*  to your server /uc [for security reason, you can rename to anything else]

2. You may need to modify folder permissions to 777 if your system is *nix
        ./data
        ./data/avatar
        ./data/backup
        ./data/cache
        ./data/logs
        ./data/tmp
        ./data/view

3. visit http://yourdomain.com/UC/install/, fill in mysql info and admin info

4. Make sure to remove install folder  after installation is done

5. Done

Secondly,install DZ7.2.

Now you have a new forum by DZ,

Go to Admin Panel http://yourdomain.com/admincp.php

Forum==>Category==>Edit==>Forum Horizontal Display: there you can set the numbers of columns ,

you can add some boards first , after the setting above,go back to forum index and you can see how it shows,

Hope that can help you

I Love Simple Machines Forum .

SFF Forum

#15
I find a SMF theme :
http://custom.simplemachines.org/themes/index.php?lemma=1358
but it is SMF 2.0

You can make it to smf1.1.13.it is what i need,thanks
I Love Simple Machines Forum .

Illori

it is not easy to convert a theme to another version, and it can not be converted without the authors approval.

SFF Forum

OK,i think it just needs change some codes on smf1.1.13  default  theme ,i just need the layout not all theme
I Love Simple Machines Forum .

Illori

and the layout needs approval from the author as it is their theme, and it has a copyright on all the code involved in that theme as well as the art. it would be easier to just upgrade to 2.0 so you can use the theme.

SFF Forum

#19
If i upgrade to 2.0 and use the theme,i have to change a lot,i spended a lot of work on my using theme and it is a wonderful theme for me,what i need is to change the layout not the theme,also the mods,all are problem

http://custom.simplemachines.org/themes/index.php?lemma=1358
i think there can have some good ideas to make another one,just like my first post in this topic
I Love Simple Machines Forum .

Illori

as i said above that theme and any other you find on the mod site or anywhere on the internet has a copyright and therefore you need approval of the author to use any code from it or art from it in another theme. so you are best to ask for a new theme to be created based on what you have, if it is made by someone other then you, again you need the authors approval, and add the features you want to that theme.

SFF Forum

#21
OK,i found two theme/source can make the layout like that,they are discuz.net and the author of http://custom.simplemachines.org/themes/index.php?lemma=1358 ,we can't say they copy each other,there are differecence between of them,they have their copyright.There,why not make a new one for SMF,new idea,have difference with them,powered by SMF,and SMF owns the copyright?
I Love Simple Machines Forum .

Illori

smf will not own any copyright for anything but what the team creates, I dont see the team taking their time to create a theme just for you with a format that most dont need or want. even if the themes you are looking at are similar that does not mean they have the same code to create the theme, which is fine, but you still need approval from the author if you want to copy their EXACT code.

SFF Forum

QuoteI dont see the team taking their time to create a theme just for you with a format that most dont need or want.

Firstly,everyone posting on SMF Coding Discussion board is want to make his personal problem solved also on any other boards of this forum, not to solve other people's problem.
Secondly,i don't think this is not a useful function.When you have 50 boards on your forum(my forum has 108 boards),it is a long page for index page so that you have to pull down the whole page to view all board,so the function is very important and useful for every big forum
I Love Simple Machines Forum .

Illori

and not every smf forum is that large or setup the way yours is, so given that smf is not going to take time to work on a major theme change or even a new one just for a very small group of users. the team has a lot of things to work on and things like this are not anywhere near the top of the list of things to do. Right now the team is trying to get 2.0 out the door, I dont see anytime soon that they would even consider working on a theme 1.1.1* when they have other things that need work done to keep development moving in the right direction.

SFF Forum

#25
Is my wrong to make a big forum using smf,or smf do not want their users to set up a big forum?I don't think so.

I post here is want to get help to solove my problem,if i get help i thank you.But i don't want to get such complain that my forum is too big to get help.Also i don't command you must solove my problem,if you can't help me i will think about other ideas or give up SMF(Although i used smf for 3 years)

I Love Simple Machines Forum .

SFF Forum

#26
If SMF want to make it out the door it needs complete more functions and work for public(any user group),such as vBulletin and Discuz,there maybe you hadn't heard Discuz before beacause it is a chinese forum source,but they will develop  English version sooner or later.  if you have used Discuz you will know it is the best forum source and it has all useful functions for all
I Love Simple Machines Forum .

IchBin™

Maybe Joker is willing to do this for you. But IMO you are beyond just basic support here. This is probably something you should post in the help wanted board. Using codes from other people's mods is fine if it is only to be used for you and not distributed to others. But when you start posting others code and modified files for all to download, well then permission needs to be sought from the Authors of the code.
IchBin™        TinyPortal

SFF Forum

Quote from: IchBin™ on May 10, 2011, 10:58:18 AM
Maybe Joker is willing to do this for you. But IMO you are beyond just basic support here. This is probably something you should post in the help wanted board. Using codes from other people's mods is fine if it is only to be used for you and not distributed to others. But when you start posting others code and modified files for all to download, well then permission needs to be sought from the Authors of the code.

Yes,i understand,thank you
I Love Simple Machines Forum .

kat

Please understand, too, that if the link in your sig isn't removed, PDQ, it will be removed, for you.

Joker™

I'm not in mood of reading all the replies in this thread but we were able to split the boards apart now not we need to just polish the area ;). Let's see how far can I adjust the things in it, but for sure seems to a nice theme idea with only one complication (as K@ pointed out to me)

- What if the board description is too long?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Quote from: Joker™ on May 11, 2011, 09:14:20 AM
I'm not in mood of reading all the replies in this thread but we were able to split the boards apart now not we need to just polish the area ;). Let's see how far can I adjust the things in it, but for sure seems to a nice theme idea with only one complication (as K@ pointed out to me)

- What if the board description is too long?

yes,this board layout http://custom.simplemachines.org/themes/index.php?lemma=1358 (justboards_andcats) is really a good job,

I think if the board description is too long, i will make it short  because it is not very important
I Love Simple Machines Forum .

Joker™

#32
Thanks for the theme link, but better to make new design :P. Till this point I've reached upto this layout (see screen shot attached), any suggestions?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

#33
Really very good,it is better if the admin can set the numbers of column on admin pandel
;D

And i am worried about if these two board have different size,for example one board has child board and the child board showed on board index,and the other don't have,can they arrange in a line?

I Love Simple Machines Forum .

Joker™

That would require some nice coding and as I'm pretty busy these days so you can't except such thing from my side till 20th. If someone can help you in it, it would be great.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

#35
OK,And i am worried about if these two board have different size,for example one board has child board and the child board showed on board index,and the other don't have,can they arrange in a line?And are all boards will have the same size with the big size board,if they have it is better
I Love Simple Machines Forum .

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Thank you,i think it is what i need.Wainting for your new codes......
I Love Simple Machines Forum .

Joker™

#38
Remove all the previous edits I have asked you to make regarding this, now

Make backup of file first before editing it

themes\Default\BoardIndex.template.php


Code (Find:) Select
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">



Code (Replace it with:) Select
<div class="tborder boardsep" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">



Code (Find and remove:) Select
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">';




Code (Find:) Select
foreach ($category['boards'] as $board)
{
echo '


Code (Replace it with:) Select
foreach ($category['boards'] as $board)
{
echo '<table class="boardborder" cellspacing="0" cellpadding="0">




Code (Find:) Select
</tr>';
}
}
echo '
</table>';
}


Code (Replace it with:) Select
</tr>';
}

echo '
</table>';
}
}




In style.css


Code (Add this at end:) Select
.boardsep
{
clear: both;
}

.boardborder {
border: 1px solid #696969;
width: 50%;
margin: 3px 0 7px;
float: left;
padding: 2px;
height: 55px;
}



I hope I wrote the edits correctly :P.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

I Love Simple Machines Forum .

SFF Forum

#40
Joker™,you did a lot of job and is great.But i am sorry to show my testing result for the new codes.

The two boards can't stay in a line when the last poster's name is a long one or there are two/three words ,it can make the board too large.

And when the board has many child boards it can make the board too large,too.

It seems that it can't work well on smf for my layout with your newest code.

So please think about this theme, http://custom.simplemachines.org/themes/index.php?lemma=1358 (justboards_andcats) if you can.It can slove all these problem



I Love Simple Machines Forum .

Joker™

To solve your problem we can remove the topics and post count column and put the numbers in the foot of board name. This will give us an opportunity to increase the size of last post column.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Quote from: Joker™ on May 12, 2011, 10:01:02 AM
To solve your problem we can remove the topics and post count column and put the numbers in the foot of board name. This will give us an opportunity to increase the size of last post column.

Yes,it is also a good idea.
I Love Simple Machines Forum .

Joker™

How about something like this (see pic attached)

Don't look that much at column size of empty boards as on live site no one leave boards that much empty :P. Also the board having a lot of boards is having the board description of 80 characters which I think is more than enough size.

Also in this look need to work on to align the image in center, add some paddings here and there and have to arrange some stuff to make it to look more clean.

Hope someone likes this styling 8).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

#44
Good job!! Hoping for your new codes :laugh:
And do you decide to put the post station(xpost xtopic) in the center,how about on the left?

I Love Simple Machines Forum .

Joker™

So you have to make a lot of edits, remove all previous edits make a backup of the file before editing it


Code (Find:) Select
<div class="tborder" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">



Code (Replace it with:) Select
<div class="tborder boardsep" style="margin-top: ' , $first ? '0;' : '1ex;' , '' , $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'width: 100%;' : '', '">



Code (Find:) Select
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor" style="margin-top: 1px;">';

/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{

echo '



Code (Replace it with:) Select
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '<table class="boardborder" cellspacing="0" cellpadding="0">



Code (Find:) Select
<td ' , !empty($board['children']) ? 'rowspan="2"' : '' , ' class="windowbg" width="6%" align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';


Code (replace it with:) Select
<td ' , !empty($board['children']) ? 'rowspan="4"' : 'rowspan="3"' , ' class="windowbg" width="3%" align="center" valign="middle" style="border-right: 1px solid #476C8E;"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';



Code (Find:) Select
// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
// No new posts at all! The agony!!
else
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';



Code (Replace it with:) Select
// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img style="valign:middle;" src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img style="valign:middle;" src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
// No new posts at all! The agony!!
else
echo '<img style="valign:middle;" src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';




Code (Find:) Select
<td class="windowbg2">



Code (Replace it with:) Select
<td class="windowbg2" style="padding: 0 5px;">



Code (Find:) Select
<div style="padding-top: 1px;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>';



Code (Replace it with:) Select
<br /><div style="padding-top: 1px; float:right;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>';




Code (Find:) Select
<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">';



Code (Replace it with:) Select
</tr>
<tr>
<td class="windowbg" valign="middle" style="width: 12ex;padding: 0 5px;"><span class="smalltext">
', '(', $board['posts'], ' ', $txt[21], ' ,
', $board['topics'],' ', $txt[330], ')','
</span></td>
</tr>
<td class="windowbg2" valign="middle" width="22%" style="padding: 0 5px;">
<span class="smalltext">';



Code (Find:) Select
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">



Code (Replace it with:) Select
<td style="padding: 0 5px;" colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">



Code (Find:) Select
</tr>';
}
}
echo '
</table>';
}



Code (Replace it with:) Select
</tr>';
}

echo '
</table>';
}
}
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Thank you, i think you have success this time,i will try it at once ;D
I Love Simple Machines Forum .

SFF Forum

It is working now,thanks for your hard work these days.You make a best theme ever.It will make my big forum tidy and short. :D

Hope that anyone else can enjoy your work,too.

Big thanks
I Love Simple Machines Forum .

Joker™

Quote from: SFF Forum on May 15, 2011, 11:26:30 AM
It is working now,thanks for your hard work these days.You make a best theme ever.It will make my big forum tidy and short. :D

Hope that anyone else can enjoy your work,too.

Big thanks
If I get some time out of schedule I'll make a 2-3 column board theme for SMF 2 (right now it seems to be impossible for me :P).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SFF Forum

Quote from: Joker™ on May 16, 2011, 01:20:33 AM
Quote from: SFF Forum on May 15, 2011, 11:26:30 AM
It is working now,thanks for your hard work these days.You make a best theme ever.It will make my big forum tidy and short. :D

Hope that anyone else can enjoy your work,too.

Big thanks
If I get some time out of schedule I'll make a 2-3 column board theme for SMF 2 (right now it seems to be impossible for me :P).

IF it has a setting pandel i think it is more better,people can set use column or not
I Love Simple Machines Forum .

Joker™

Quote from: SFF Forum on May 16, 2011, 01:50:51 AM
IF it has a setting pandel i think it is more better,people can set use column or not
Yeah I was also thinking of it. Let's see how fast can I start working over it as by next weak my exams are also starting (I hate them).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: