Zudane
|
Forum IndexI'm running phpbb3, and the template I started with has all of the forums in a single table, making it hard to distinguish each category in it. I moved the grey header so it is below the category name (see forum in sig).
What I want to know is this.. is there a way to make it so each category shows on a separate table so that there will be a space in between each category, not just one solid string down?
Here is the code for it...
I tried moving around the <table> commands to where I thought they should be, or adding in others.. but I just ended up with part of it in a table, and the rest sitting at the bottom of the page. My lack of php knowledge beat me.
|
admin (no pm's please)
|
It won't be php knowledge as the templates are html that get expanded according to a macro language.
Have you found the phpbb2 topics on how to do this. It is exactly the same.
|
Zudane
|
I'm afraid I'm not sure what to look for exactly, or where to find it.. a few searches have left me empty handed. Mind pointing me towards what I should be looking for?
|
Zudane
|
The problem I am running into, is if I get the table how I want it, it does a table for each row, which isn't what I want...
I don't know how to edit it so that it will do a table for each category. It checks for the category, and then if so does that section, if not a category checks for the link, then if neither it checks for the forum....
*is lost and confused*
|
Symon
|
This is the post admin is relating to
http://howtodoit.myfreeforum.org/...component=content&topicid=677
|
Zudane
|
Thanks symon.
I just looked, I don't have the catrow on mine at all.. I tried adding it in, and it made everything between the begin and end... disappear. anything I moved to the outside of that command loaded fine though.
does that catrow work the same in phpbb3? On mine inside the forumrow there is a | Code: | | IF forumrow.S_IS_CAT |
And I've found that that is what lists the category header, I had to move the header bar inside that to get it to help separate the categories.
Any ideas?
|
admin (no pm's please)
|
okay it seems there are some phpbb3 differences, albeit ones that might make it easier really.
Have you actually printed out the phpbb3 template? sometimes that makes it easier to understand, the same goes with the source code of the generated page.
By relating the two it should be possible to figure out how to get what you want. I see some work with colored highlighters involved!
|
Zudane
|
I've been using text pad and just mental notes and physical seperating of where each section affects.
I can tell that the only difference between categories is that it's listed all as forum rows, for the entire block....
and if it is a category it uses one section, links for another, then an else for the rest, starting with an if to see if it is not a category, then the code for the list of forums inside the categories.
As it's the entire forum_row block that's repeated I can't see a way to seperate them...
I looked at another page that has them seperated, and it's done with a list as compared to a table, but it has a command that is if last_row - but I couldn't figure out how to use it.. let me find it real fast...
| Code: | | <!-- IF forumrow.S_LAST_ROW --> |
as well as...
| Code: | | <!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT --> |
But I don't know how to use the S_FIRST_ROW or S_LAST_ROW
That's what i meant by my PHP knowledge lacking :X
|
Zudane
|
Any ideas on how to use the s_first_row and s_last_row? Should be able to get it with that, but I don't know how. I suppose there is a site somewhere for it too, but I just don't have the time right this second.
|
admin (no pm's please)
|
As I say it is not php, it is just a simple interpreted script,
In phpbb3 as I recall a category is just another type of forum. So the test:
| Code: |
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
|
Will be true for any forum that is not a category or for any category that is not the first category.
|
Zudane
|
Okay, I just did some playing around and I found this... Don't need the code you posted admin, the forumrow.S_NO_CAT worked fine, does the same as the code you have posted.
Here's what I did find out.. I started with (at the top)
| Code: | <table class="tablebg" cellspacing="1" width="100%">
<tr>
<td class="cat" colspan="5" align="{S_CONTENT_FLOW_END}"><!-- IF not S_IS_BOT --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF --> </td>
</tr>
<tr>
<th colspan="2"> {L_FORUM} </th>
<th width="50"> {L_TOPICS} </th>
<th width="50"> {L_POSTS} </th>
<th> {L_LAST_POST} </th>
</tr>
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<tr>
<td class="cat" colspan="5"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
</tr> |
I moved the begin forumrow and forumrow.S_IS_CAT tags to the top like this:
| Code: | <!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<table class="tablebg" cellspacing="1" width="100%">
|
That gave me the table for each catagory, but I didn't want the "mark forums read" repeated, so I moved the code for it to the top, and dropped the td and tr tags, leaving it centered:
| Code: | <!-- IF not S_IS_BOT --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF -->
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th colspan="2"> {L_FORUM} </th>
<th width="50"> {L_TOPICS} </th>
<th width="50"> {L_POSTS} </th>
<th> {L_LAST_POST} </th>
</tr>
<tr>
<td class="cat" colspan="5"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
</tr>
|
Then I moved the closing table code to inside the end forumrow so each forum has a separate table, so it looks like this:
| Code: |
</table>
<!-- END forumrow -->
|
This separated each forum into a table of it's own, but had them squished together.. so I added
in the middle of
| Code: |
<!-- IF forumrow.S_IS_CAT -->
<table class="tablebg" cellspacing="1" width="100%"> |
But I noticed this gave me a gap at the very top, so I tried forumrow.S_FIRST_ROW and found that it only affects the first row of the entire forum (and forumrow.S_LAST_ROW affects only the very last row). So instead of adding
I added | Code: |
<!-- IF not forumrow.S_FIRST_ROW -->
<br /><br />
<!-- ENDIF --> |
Then it adds spacing for all but the top row... so my code finally looked like (at the top only)
| Code: | <!-- IF not S_IS_BOT --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF -->
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<!-- IF not forumrow.S_FIRST_ROW -->
<br /><br />
<!-- ENDIF -->
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th colspan="2"> {L_FORUM} </th>
<th width="50"> {L_TOPICS} </th>
<th width="50"> {L_POSTS} </th>
<th> {L_LAST_POST} </th>
</tr>
<tr>
<td class="cat" colspan="5"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
</tr> |
Symon (I think it's you that does the HOWTODOIT) Mind adding all this in for a HOWTODOIT for this on PHPBB3?
----------
I still do have one problem with this, as well. The coding works great for the full forum, gives exactly what I want with one small problem. At the bottom is a section for the mods only, for some reason, it doesn't follow the same table/seperation rule that the rest does. It is correctly in the table, but with the </table> command before "END forumrow" then it puts "Delete all board cookies | The team" above that one forum. While if I put the </table> command after, it puts this forum snug against the one above it.
-- just tested - had to put <br /><br /> just before the </table> and it separated them, though the cell sizes are off for that one mod-only forum. But the problem is fixed.
(and don't worry, I remembered to turn off HTML in this post )
|
admin (no pm's please)
|
Very well done.
I guess it would make a good addition to the phpbb3 howtodoit, of course with the caveat that this sort of edit is going to vary with the template and it is only one for people able to grasp template structure and html. It is not easy.... well actually it is easy IF you do understand the template well.
I am sure Zudane is feeling that he made heavy weather of it in retrospect as he went up the learning curve?
|
Zudane
|
I rather slap myself for not bothering to succeed in what I am sure I tried before. This time though I am awake, so I blame tiredness
One question, I was trying to make the top of the forum flush with the border on the portal. I found I can do this without the double breaks I have in there. First thought was that the IF was wrong, but if I take out the IF statement then it takes the double break, and doubles, so it's a 4 line gap.
I've tweaked with all I can think of... It is skipping the breaks on the first row, but apparently there is a blank first row, so it does the breaks before the second row, which is where the forum actually starts...
Any ideas?
|
admin (no pm's please)
|
Can you post the template file, as looking at it whole is the only way I could even begin to answer.
|
Zudane
|
The entire forumlist_body.html - I am assuming?
| Code: | <!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<!-- IF forumrow.S_FIRST_ROW -->
<br /><br />
<!-- ENDIF -->
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th colspan="2"> {L_FORUM} </th>
<th width="50"> {L_TOPICS} </th>
<th width="50"> {L_POSTS} </th>
<th> {L_LAST_POST} </th>
</tr>
<tr>
<td class="cat" colspan="5"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
</tr>
<!-- ELSEIF forumrow.S_IS_LINK -->
<tr>
<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
<td class="row1">
<!-- IF forumrow.FORUM_IMAGE -->
<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
<!-- ENDIF -->
<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
<p class="forumdesc">{forumrow.FORUM_DESC}</p>
<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
</td>
<!-- IF forumrow.CLICKS -->
<td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td>
<!-- ELSE -->
<td class="row2" colspan="3" align="center"> </td>
<!-- ENDIF -->
</tr>
<!-- ELSE -->
<!-- IF forumrow.S_NO_CAT -->
<tr>
<td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
<td class="catdiv" colspan="3"> </td>
</tr>
<!-- ENDIF -->
<tr>
<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
<td class="row1" width="100%">
<!-- IF forumrow.FORUM_IMAGE -->
<div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
<!-- ENDIF -->
<a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
<p class="forumdesc">{forumrow.FORUM_DESC}</p>
<!-- IF forumrow.MODERATORS -->
<p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}</p>
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS -->
<p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p>
<!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
</td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
<td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td>
<td class="row2" align="center" nowrap="nowrap">
<!-- IF forumrow.LAST_POST_TIME -->
<p class="topicdetails">{forumrow.LAST_POST_TIME}</p>
<p class="topicdetails">{forumrow.LAST_POSTER_FULL}
<a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a>
</p>
<!-- ELSE -->
<p class="topicdetails">{L_NO_POSTS}</p>
<!-- ENDIF -->
</td>
</tr>
<!-- ENDIF -->
<!-- BEGINELSE -->
<tr>
<td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td>
</tr>
<!-- END forumrow -->
<br /><br />
</table>
<!-- IF not S_IS_BOT --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF --> |
-- Oh, and I moved the mark forums read to the bottom, lol.
|
admin (no pm's please)
|
| Code: |
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<!-- IF forumrow.S_FIRST_ROW -->
<!-- ENDIF -->
<!-- ELSEIF forumrow.S_IS_LINK -->
<!-- IF forumrow.FORUM_IMAGE -->
<!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
<!-- IF forumrow.CLICKS -->
<!-- ELSE -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- IF forumrow.S_NO_CAT -->
<!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE -->
<!-- ENDIF -->
<!-- IF forumrow.MODERATORS -->
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS -->
<!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
<!-- IF forumrow.LAST_POST_TIME -->
<!-- ELSE -->
<!-- ENDIF -->
<!-- ENDIF -->
<!-- BEGINELSE -->
<!-- END forumrow -->
<!-- IF not S_IS_BOT --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF -->
|
Just desconstructed your post, as I'm confused by the BEGINELSE which translates to in php "}} else {" e.g like two end blocks
|
Zudane
|
I don't know, I had just altered the style from darksunblue.
I was wondering if that had anything to do with it, but I wasn't sure what it was, exactly.
|
Zudane
|
That code I posted gives problems in sub-forums
see this post
http://forum.myfreeforum.org/about14885.html
|
|
|