Advertisement:

Author Topic: Moving the Topics/Posts/Replies/Views to under the Board/Post Name  (Read 1121 times)

Offline shadav

  • Full Member
  • ***
  • Posts: 682
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
nothing really special here....
just me playing around, moving stuff around



in BoardIndex.template.php
find
Code: [Select]
echo '

<p>', $board['description'] , '</p>';
replace
Code: [Select]
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
Code: [Select]
// 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
Code: [Select]
echo '
</td>
SAVE


in MessageIndex.template.php
find
Code: [Select]
</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
Code: [Select]
- <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
Code: [Select]
</td>
<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>
<td class="lastpost ', $alternate_class, '">
replace
Code: [Select]
</td>
<td class="lastpost ', $alternate_class, '">

find
Code: [Select]
echo '
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</p>
replace
Code: [Select]
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

Offline shadav

  • Full Member
  • ***
  • Posts: 682
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #1 on: July 01, 2020, 04:28:54 PM »
I forgot about the recent posts


Recent.template.php

find
Code: [Select]
<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
Code: [Select]
<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
Code: [Select]
<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>

find
Code: [Select]
<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
Code: [Select]
<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>

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,127
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #2 on: July 01, 2020, 04:34:52 PM »
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.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,516
  • Gender: Male
    • trekkiesforyes on Facebook
    • pouvik on GitHub
    • @@deakinbryan on Twitter
    • YES
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #3 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

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,276
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #4 on: July 01, 2020, 05:37:25 PM »
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.

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,491
  • Master of BBC Abuse
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #5 on: July 01, 2020, 05:39:59 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. :)

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,491
  • Master of BBC Abuse
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #6 on: July 01, 2020, 05:40:48 PM »
Your first replace for MessageIndex.template.php is borked. :)

Code: [Select]
- <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.)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,515
  • Gender: Male
    • Kindred-999 on GitHub
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #7 on: July 01, 2020, 06:18:07 PM »
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)
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."

Offline shadav

  • Full Member
  • ***
  • Posts: 682
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #8 on: July 01, 2020, 06:27:36 PM »
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
Code: [Select]
table.table_list p
{
padding: 0;
margin: 0;
}

replace
Code: [Select]
table.table_list p
{
padding: 0;
margin: 5px 0px 5px 0px;
}
find
Code: [Select]
.topic_table td.subject p, .topic_table td.stats
{
font-size: 0.85em;
padding: 0;
margin: 0;
}
replace
Code: [Select]
.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
Code: [Select]
table.table_list tbody.content td.lastpost
{
line-height: 1.3em;
font-size: 85%;
width: 24%;
}

replace
Code: [Select]
table.table_list tbody.content td.lastpost
{
line-height: 1.3em;
font-size: 85%;
width: 35%;
}
find
Code: [Select]
.topic_table td.lastpost
{
font-size: 0.85em;
line-height: 1.3em;
padding: 4px;
}
replace
Code: [Select]
.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....

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,491
  • Master of BBC Abuse
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #9 on: July 01, 2020, 06:34:30 PM »
the edit time limit can not be set "per board"
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.

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,276
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #10 on: July 01, 2020, 06:42:02 PM »
Im not a fan of them board icons either. Rid! lol

Offline Deaks

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,516
  • Gender: Male
    • trekkiesforyes on Facebook
    • pouvik on GitHub
    • @@deakinbryan on Twitter
    • YES
Re: Moving the Topics/Posts/Replies/Views to under the Board/Post Name
« Reply #11 on: July 01, 2020, 06:50:29 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.