who.template.php <br> element at credit mods why

Started by Pipke, August 24, 2017, 04:07:13 PM

Previous topic - Next topic

Pipke

As the title says why is there the <br> element if you add your mod credit with array:

$context['copyrights']['mods'][] ='blabala';

I think it should be removed, as its not necessary in my eyes.



// Display the credits.
if (!empty($context['credits_modifications']))
echo '
', implode('
<br>', $context['credits_modifications']);

// Legacy.
if (!empty($context['copyrights']['mods']))
echo (empty($context['credits_modifications']) ? '' : '<br>'),
implode('
<br>', $context['copyrights']['mods']);
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Arantor


Pipke

it ads how it is setup for now for every mod credit line a <br> element above the actuale outprinted lines, so 2 mods with credits 2 <br> elements wich ads an empty gap, see attachments, it only needs one if theres is more then 1 mod credit.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Suki

Its the price to pay for using a quick hack. I wouldn't bother that much about it, the credits page is as simple as it can get while still allow you to add more things like a license link.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Gwenwyfar

That is odd, the rest of the credits uses a dd for each line. Could change it to be the same, may also solve the double gap problem.
"It is impossible to communicate with one that does not wish to communicate"

[SiNaN]

Apparently, a developer thought working with definition lists wouldn't be simple enough at the time:

https://github.com/SimpleMachines/SMF2.1/commit/76beebeb2f5e914f4cc24380eba5669e59ee3e8d

To be frank, I don't think SMF developers have the luxury of relying on quick hacks.

The next developer who had a go with this piece of code did some interesting things as well but it doesn't appear to have turned out well either.

The line break would have needed to be added if there are mods in the first list - meaning the empty() check for the line break should actually be !empty().
Former SMF Core Developer | My Mods | SimplePortal

Suki

Ahh the joys of judging without context...

That dirty dev who removed your loved definition lists did so because at that time dls weren't loved at all, infact, they were removed from several places. There wasn't even any css for them anymore.

Quote from: [SiNaN] on August 28, 2017, 12:00:21 PMTo be frank, I don't think SMF developers have the luxury of relying on quick hacks.

Says the guy who literally flooded 2.0.x codebase with quick hacks...  ::) ::)
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Gwenwyfar

Quote from: Suki on August 28, 2017, 12:18:53 PM
Ahh the joys of judging without context...

That dirty dev who removed your loved definition lists did so because at that time dls weren't loved at all, infact, they were removed from several places. There wasn't even any css for them anymore.
Well, that partially explains it. dls make perfect sense in this case though, and uls would also be better than brs.

I'll take a look at this one when I'm back from travel,  if no one else has by then :)
"It is impossible to communicate with one that does not wish to communicate"

Advertisement: