Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Helgi on December 25, 2021, 05:26:12 PM

Title: If - topics of one board
Post by: Helgi on December 25, 2021, 05:26:12 PM
Greetings to all!

The community has a board. Say, with ID 222.

I want to write a condition in the Display.template.php file.

if (only topics of board=222){
    //code
}

Can you tell me - what should I write to the condition? Thanks a lot!
Title: Re: If - topics of one board
Post by: Helgi on December 25, 2021, 05:34:51 PM
Thank you, but I already understood:
$context['current_board'] == 222
Title: Re: If - topics of one board
Post by: Sir Osis of Liver on December 25, 2021, 05:37:13 PM
Are you really using 1.1?  Went eol 2018 and is unsupported.  You should upgrade to current version before doing anything else.

Title: Re: If - topics of one board
Post by: Kindred on December 25, 2021, 05:51:05 PM
If you explain more specifically what you are trying to do we might be able to offer a better suggestion
Title: Re: If - topics of one board
Post by: Helgi on December 25, 2021, 06:15:27 PM
SMF 1.1.21 is the best version of Simple Machines.
I very much cried that no longer updates SMF 1xx.
There are almost 60 thousand topics in the community and almost 3.5 million messages.
Our main anxiety is that it works only on PHP 5.6.
I'm afraid for security. :(

Quote from: Kindred on December 25, 2021, 05:51:05 PMIf you explain more specifically what you are trying to do we might be able to offer a better suggestion
Thank you, but it seems to me that this is a good solution:
if ($context['current_board'] == 222){
    echo 'This text is seen only in the topics of board 222';
}
Title: Re: If - topics of one board
Post by: Doug Heffernan on December 25, 2021, 06:22:50 PM
Quote from: Helgi on December 25, 2021, 06:15:27 PMSMF 1.1.21 is the best version of Simple Machines.
I very much cried that no longer updates SMF 1xx.
There are almost 60 thousand topics in the community and almost 3.5 million messages.
Our main anxiety is that it works only on PHP 5.6.
I'm afraid for security. :(

I beg to differ. Smf 1.1x is definitely not the best version of Smf imo.

Anyways, if you are afraid about the security, you should upgrade a.s.a.p. to 2.0.19. As mentioned above, the 1.1.x series is not supported anymore and therefore the security issues and bugs are not patched up.

Upgrading Smf is easy. You should not be afraid to do it. And you will not loose anything. That is what db backups are for. Anyways, the choice is yours, but I would seriously think aabout it if I were you. You are really missing out on a lot of great new stuff that are added in 2.0.x, and especially in the 2.1. series.

And happy holidays.
Title: Re: If - topics of one board
Post by: Helgi on December 25, 2021, 06:26:50 PM
Quote from: Doug Heffernan on December 25, 2021, 06:22:50 PMUpgrading Smf is easy. You should not be afraid to do it. And you will not loose anything.
We perfectly updated the forum to 2.1 RC4 on the test server. But we have big problems. Strong change of the forum code. Individual unique large modifications that are very important for our community.

We are forced to stay at 1.1.21.
And we like everything there. Except security rumors.
Title: Re: If - topics of one board
Post by: Kindred on December 25, 2021, 06:33:35 PM
They are not rumors.
There are know security issues in 1.1.21 which are not patched, since 1.1.x was EOL years ago. Additionally,  since php 5.x was also EoL years ago, that means there may be holes in that as well

Seriously,  either refactor your custom mods or pay someone to rewrite them for 2.1
Title: Re: If - topics of one board
Post by: Doug Heffernan on December 25, 2021, 06:35:25 PM
Quote from: Helgi on December 25, 2021, 06:26:50 PM
Quote from: Doug Heffernan on December 25, 2021, 06:22:50 PMUpgrading Smf is easy. You should not be afraid to do it. And you will not loose anything.
We perfectly updated the forum to 2.1 RC4 on the test server. But we have big problems. Strong change of the forum code. Individual unique large modifications that are very important for our community.

We are forced to stay at 1.1.21.
And we like everything there. Except security rumors.

You will get up to speed with the new code in no time. I hear you about the large modifications. Anyways, as long as you are happy with it, that is what matters at the end of the day.
Title: Re: If - topics of one board
Post by: Helgi on December 25, 2021, 06:36:48 PM
Yes, you are right about security.
We will wait 2.1 Final and then think.
Title: Re: If - topics of one board
Post by: Illori on December 25, 2021, 07:03:27 PM
you should start to plan before 2.1 goes final, that way when it does go final you are ready to test your changes and do the upgrade.
Title: Re: If - topics of one board
Post by: Helgi on December 26, 2021, 08:15:16 AM
Quote from: Illori on December 25, 2021, 07:03:27 PMplan before 2.1 goes final
In any case, we have a couple of years before that time. ;) :laugh: