News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Moving the Topics/Posts/Replies/Views to under the Board/Post Name

Started by shadav, June 30, 2020, 03:57:08 AM

Previous topic - Next topic

shadav

nothing really special here....
just me playing around, moving stuff around



in BoardIndex.template.php
find
echo '

<p>', $board['description'] , '</p>';

replace
echo '

<p>', $board['description'] , '</p>
<p>', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], ' / ', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], '</p>';


find
// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>
</td>

replace
echo '
</td>

SAVE


in MessageIndex.template.php
find
</th>
<th scope="col" width="14%"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>


replace
- <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>

find
</td>
<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>
<td class="lastpost ', $alternate_class, '">

replace
</td>
<td class="lastpost ', $alternate_class, '">


find
echo '
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</p>

replace
echo '
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
<br />', $topic['replies'], ' ', $txt['replies'], ' / ', $topic['views'], ' ', $txt['views'], '
</p>

SAVE

shadav

I forgot about the recent posts


Recent.template.php

find
<th scope="col">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th scope="col" width="14%" align="center" class="hidden">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';


replace
<th scope="col" align="left">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> - <a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';


find and remove
<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>


find
<p>
', $txt['started_by'], ' <strong>', $topic['first_post']['member']['link'], '</strong>
', $txt['in'], ' <em>', $topic['board']['link'], '</em>
<small id="pages', $topic['first_post']['id'], '">', $topic['pages'], '</small>
</p>

replace
<p>
', $txt['started_by'], ' <strong>', $topic['first_post']['member']['link'], '</strong>
', $txt['in'], ' <em>', $topic['board']['link'], '</em>
<small id="pages', $topic['first_post']['id'], '">', $topic['pages'], '</small>
<br />', $topic['replies'], ' ', $txt['replies'], ' / ', $topic['views'], ' ', $txt['views'], '
</p>

Arantor

Not a fan of this, sorry, it makes it very cluttered on the left, not to mention making it harder for accessibility tools (i.e. non-sighted people) to use.

Might be better with a bit more spacing added in the CSS.

Deaks

I've done this before for some themes years ago did try it recently but got validation errors so never released it.  I am a fan of this style,  however only think I have qualms with is the space it leaves
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Mick.

On a custom theme, say, at 900px wide, might do. I too can't stand the open space. It's a waste.

You should dabble on custom themes. I think you have the potential.

ps....i chopped and diced my boardindex a few months ago. https://www.idesignsmf.com/index.php?action=forum Tho, I don't have a direct link to the forum in my website since I want to preserve the 'blog' look.

Antechinus

Quote from: Deaks on July 01, 2020, 05:31:30 PM
I've done this before for some themes years ago did try it recently but got validation errors so never released it.  I am a fan of this style,  however only think I have qualms with is the space it leaves

If you got validation errors that just means you didn't check the markup. You can do this sort of thing without validation problems as long as you check all your bits and pieces. :)

Antechinus

Your first replace for MessageIndex.template.php is borked. :)

- <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></th>

You forgot the opening th tag. It has to be there somewhere.

Ranty also has a point about accessibility. The whole idea of scope="col" is that it allows screen readers to assign column headings to column content. Although arguably this is a moot point to some extent, since the default column content (particularly for the subject cells) isn't strictly tabular anyway.




Note to team: Really, it would make a lot of sense to not limit edit times in certain boards. This is a perfect example. The team has approved the topic, without checking for errors in the coding, and now Shadav is stuck with the OP as originally posted.

If you're not going to allow people to edit code they have posted (in any board, for that matter) then you should check it thoroughly for all possible errors before approving the topic. If you are not going to do that, then you should allow people to edit their posts. The current arrangement is the worst of both worlds.

(This is intended as constructive criticism, BTW.)

Kindred

the edit time limit can not be set "per board"


I agree with Arantor. Not a fan of this one at all...   it takes a tabular data with clear columns (and meaning for the columns) and jams it up under other text...

I think a better/cleaner look would be to get rid of the first and last column... (the last (aka lastpost) column can even be hidden purely with CSS)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shadav

I merged the two th's together ;) since I got rid of that column

I thought about just getting rid of it entirely, but then you lose the sort by replies and views function
so instead I just tacked it onto the subject / started by


and yes I really wish that I could at least edit the first post without a time limit because well lol I make mistakes often and typos :D

I hadn't thought about screen readers.....

and yeah there's a lot of wide open space now  :laugh:

maybe in index.css
add some spacing to the text
find
table.table_list p
{
padding: 0;
margin: 0;
}


replace
table.table_list p
{
padding: 0;
margin: 5px 0px 5px 0px;
}

find
.topic_table td.subject p, .topic_table td.stats
{
font-size: 0.85em;
padding: 0;
margin: 0;
}

replace
.topic_table td.subject p, .topic_table td.stats
{
font-size: 0.85em;
padding: 0;
margin: 5px 0px 5px 0px;
}



and then
add more room to the latest post column
find
table.table_list tbody.content td.lastpost
{
line-height: 1.3em;
font-size: 85%;
width: 24%;
}


replace
table.table_list tbody.content td.lastpost
{
line-height: 1.3em;
font-size: 85%;
width: 35%;
}

find
.topic_table td.lastpost
{
font-size: 0.85em;
line-height: 1.3em;
padding: 4px;
}

replace
.topic_table td.lastpost
{
font-size: 0.85em;
line-height: 1.3em;
padding: 4px;
width: 35%;
}


hm....gonna play some more....
don't like the wide space there but don't really like the replies/view column either....

Antechinus

Quote from: Kindred on July 01, 2020, 06:18:07 PM
the edit time limit can not be set "per board"
Quote from: Antechinus on July 01, 2020, 05:40:48 PMIf you're not going to allow people to edit code they have posted (in any board, for that matter) then you should check it thoroughly for all possible errors before approving the topic.

Mick.


Deaks

Quote from: Antechinus on July 01, 2020, 05:39:59 PM

If you got validation errors that just means you didn't check the markup. You can do this sort of thing without validation problems as long as you check all your bits and pieces. :)

I did also had someone else look at it, I released the theme without the changes did plan on updating with the changes when I fixed it but never got back to it, the n eventually just got rid of my themes.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: