News:

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

Main Menu

Posts and Topics - flipped?

Started by JesusIsGodAlmighty.Life, September 28, 2020, 08:50:28 PM

Previous topic - Next topic

JesusIsGodAlmighty.Life

It seems Posts and Topics are flipped from the usual way of things?

Topics usual are first as far as I know and then posts which makes more sense like. Year, Month, day, hour, minutes and seconds. Catagories, Topics and Posts just makes more sense to me in that order?

I need to look more into - I don't recall seeing any other forum doing it this way, having Posts before Topics.

Is it possible to change it, with theming if it continues like that as standard?

Dearly Regards
- Darkijah
Dearly Regards - Darkijah - May Jayshua the Anointed, God Almighty who died for the Sins of the world bless you with wholesome health and eyes to see!
Websites: https://jesusisgodalmighty.life and https://paven666.dk

Antechinus

You can change anything. It's all basically HTML, with PHP strewn around for the dynamic stuff. I assume you are talking about the board index. That's handled by this beastie in BoardIndex.template.php:

/**
* Outputs the board stats for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_stats($board)
{
global $txt;

echo '
<p>
', $txt['posts'], ': ', comma_format($board['posts']), '<br>', $txt['board_topics'], ': ', comma_format($board['topics']), '
</p>';
}


If you want things the other way around, this should do it:

/**
* Outputs the board stats for a standard board.
*
* @param array $board Current board information.
*/
function template_bi_board_stats($board)
{
global $txt;

echo '
<p>
', $txt['board_topics'], ': ', comma_format($board['topics']), '<br>', $txt['posts'], ': ', comma_format($board['posts']), '
</p>';
}


Just be aware that although this stuff is generally fairly easy, the fact that the templates are written in PHP syntax means you have to get all the commas, apostrophes, and other little wotnots in the right places. If you get one or more of them wrong, the dreaded parse error will crash the template.

Short version: always have a backup copy ready to go, in case you need it. ;)

JesusIsGodAlmighty.Life

Ahhh, I did hear that SMF was strong in its customization - thanks for the great understandable walk through I guess I'll need to learn some PHP as well or at least get some understanding of it... Really the only PHP I've been using overall, is on my website - this gem of a code that HTML shamelessly can't do, <?php include"name.php";?>
So all my Website pages ends on php now.

Thanks for the Tip, I'm sure I'll mess something up ;) Usually happen all the time on my webpage. I just got my Music and Video player updated which takes hours and hours to sort it all out and you newer know what bugs you hit into. But I think I got both of them floating, although needing some more polishing here and there. But absolutly workable now.

This is great - so that's not an issue then. I looked into some of the Theme folders... There is a LOT of files :S Is there a guide on that somewhere just an overall lookout on it, or just learn as we go?

Anyway thanks again for the guide, very interesting getting a glimps into the theming.

Dearly Regards
- Darkijah
Dearly Regards - Darkijah - May Jayshua the Anointed, God Almighty who died for the Sins of the world bless you with wholesome health and eyes to see!
Websites: https://jesusisgodalmighty.life and https://paven666.dk

Advertisement: