News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

If - topics of one board

Started by Helgi, December 25, 2021, 05:26:12 PM

Previous topic - Next topic

Helgi

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!

Helgi

Thank you, but I already understood:
$context['current_board'] == 222

Sir Osis of Liver

Are you really using 1.1?  Went eol 2018 and is unsupported.  You should upgrade to current version before doing anything else.

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Kindred

If you explain more specifically what you are trying to do we might be able to offer a better suggestion
Сл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."

Helgi

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';
}

Doug Heffernan

#5
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.

Helgi

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.

Kindred

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
Сл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."

Doug Heffernan

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.

Helgi

Yes, you are right about security.
We will wait 2.1 Final and then think.

Illori

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.

Helgi

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:

Advertisement: