News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Ternary in ternary in ternary (3)

Started by Jotade29, July 05, 2023, 07:34:30 PM

Previous topic - Next topic

Jotade29

Ok, the title may sound like a joke, but it's not, I'm trying to build 3 ternaries each inside the previous one, but there's something I'm not doing right... Let's see if anyone can tell me what I'm doing wrong.

'link' => ($row_board['poster_name'] != '' ? (!empty($row_board['id_member']) ($row_board['is_activated'] < 10 ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '">' . $row_board['real_name'] .'</a>' : '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '"><del>' . $row_board['real_name'] .'</del></a>') : $row_board['real_name']) : $txt['not_applicable']),
The file is subs.boarindex, and I intend that if the user is banned, his nick will appear crossed out. I have added the $row_board['is_activated'] to the query, and yes, it reads it correctly in complete ban (not parcial). Obviously I want to respect the first two ternaries that are in the original SMF file (subs.boarindex), and with the third ternary do the strikethrough if they are banned. The code does not give me an error, the result it gives me is that the nicks are shown without crossing out, whether the user is banned or not, when I say banned I mean complete ban.

And not!!! I dont want mods!!!!

Thankss!!

My version is 2.0.19
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Kindred

You don't want mods?

You realize that you are writing a mod? You might not package it up... but it's a modification  --- and mod is short for modification.

Why not use css? That would be more efficient and effective
Сл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."

Jotade29

Thanks for responding Kindred!!

xDEE, I know, but with a mod I have to see everything that touches me... Sometimes I don't even know the reason for some things in a mod... Doing it I have full control.

What you have told me about the css I do not understand how it can help me, that is, putting some class or id, I can have more control of the style to modify, for example, modify the underline, the textdecorationcolor... which is really how it is I will put, but the style for me is the last thing, and right now the <del> is the quick solution to test the strikethrough...

In any case, I have just fixed the 3rd ternary of the ban, which was the one that did not work well for me. Thank you very much for your support!!
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Advertisement: