ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Joshua Dickerson on December 26, 2015, 01:48:23 pm

Title: // Compatibility
Post by: Joshua Dickerson on December 26, 2015, 01:48:23 pm
I assume this is old code but can it be removed? I say yes and make theme authors fix their themes.

Code: [Select]
	// Compatibility.
if (!isset($settings['theme_version']))
$modSettings['memberCount'] = $modSettings['totalMembers'];
Title: Re: // Compatibility
Post by: emanuele on December 26, 2015, 02:15:26 pm
This goes back to SMF 1.0 to SMF 1.1 era.
So: yes please, drop it.
Title: Re: // Compatibility
Post by: Joshua Dickerson on December 26, 2015, 03:03:47 pm
Cool. I'll have a PR soon for some refactoring in Load.php which I'll further change to make loadTheme pretty much a separate file.
Title: Re: // Compatibility
Post by: Joshua Dickerson on December 26, 2015, 03:28:35 pm
Umm... who did this?

Code: [Select]
	// Are we showing debugging for templates?  Just make sure not to do it before the doctype...
if (allowedTo('admin_forum') && isset($_REQUEST['debug']) && !in_array($sub_template_name, array('init')) && ob_get_length() > 0 && !isset($_REQUEST['xml']))
{
echo '
<div class="warningbox">---- ', $sub_template_name, ' ends ----</div>';
}

Bad [insert name here]. Bad developer.
Title: Re: // Compatibility
Post by: emanuele on December 26, 2015, 04:00:55 pm
The brackets are an hint. :P
Title: Re: // Compatibility
Post by: Spuds on December 26, 2015, 04:08:55 pm
Its also down level from whats in development now, I know I changed that to use $req as well as use infobox ... you have to rebase  from time to time or you will have a merge conflict on yer hands  ;)
Title: Re: // Compatibility
Post by: Joshua Dickerson on December 26, 2015, 06:58:14 pm
Yeah, I realized that after I sent the PR. I'll rebase in a minute. Making crazy changes that are going to wind up being crazy conflicts anyway.
Title: Re: // Compatibility
Post by: Joshua Dickerson on December 26, 2015, 06:59:35 pm
Can I ask that we always namespace class instantiations? Template_Layers::getInstance() is the big one. It would make copy and paste easier to just add \ before Template_Layers
Title: Re: // Compatibility
Post by: Spuds on December 26, 2015, 07:31:40 pm
I'm rather namespace illiterate so have no strong opinion on that.  I do think that if you do that "globally", you will have to fully qualify everything which is ugly to me.