Advertisement:

Author Topic: who.template.php <br> element at credit mods why  (Read 2209 times)

Online Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
who.template.php <br> element at credit mods why
« on: August 24, 2017, 04:07:13 PM »
As the title says why is there the <br> element if you add your mod credit with array:
Code: [Select]
$context['copyrights']['mods'][] ='blabala';
I think it should be removed, as its not necessary in my eyes.


Code: [Select]
// 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']);

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,047
    • Arantor on GitHub
Re: who.template.php <br> element at credit mods why
« Reply #1 on: August 24, 2017, 04:42:45 PM »
So that every mod gets its own line.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Online Pipke

  • Jr. Member
  • **
  • Posts: 377
    • NRNS-GAMES
Re: who.template.php <br> element at credit mods why
« Reply #2 on: August 24, 2017, 04:57:46 PM »
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.

Offline Suki

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 15,087
  • Kaizoku Jotei
    • MissAllSunday on GitHub
    • SMF mods
Re: who.template.php <br> element at credit mods why
« Reply #3 on: August 24, 2017, 06:08:21 PM »
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.
Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Gwenwyfar

  • Customizer
  • Full Member
  • *
  • Posts: 690
  • Gender: Female
    • Gwenwyfar on GitHub
Re: who.template.php <br> element at credit mods why
« Reply #4 on: August 25, 2017, 08:36:13 AM »
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.

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: who.template.php <br> element at credit mods why
« Reply #5 on: August 28, 2017, 12:00:21 PM »
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

Offline Suki

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 15,087
  • Kaizoku Jotei
    • MissAllSunday on GitHub
    • SMF mods
Re: who.template.php <br> element at credit mods why
« Reply #6 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.

To 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...  ::) ::)
Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Gwenwyfar

  • Customizer
  • Full Member
  • *
  • Posts: 690
  • Gender: Female
    • Gwenwyfar on GitHub
Re: who.template.php <br> element at credit mods why
« Reply #7 on: September 03, 2017, 06:41:46 AM »
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 :)