Skip to main content
Topic: // Compatibility (Read 2189 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

// Compatibility

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

Re: // Compatibility

Reply #1

This goes back to SMF 1.0 to SMF 1.1 era.
So: yes please, drop it.
Bugs creator.
Features destroyer.
Template killer.

Re: // Compatibility

Reply #2

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.

Re: // Compatibility

Reply #3

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.

Re: // Compatibility

Reply #4

The brackets are an hint. :P
Bugs creator.
Features destroyer.
Template killer.

Re: // Compatibility

Reply #5

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  ;)

Re: // Compatibility

Reply #6

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.

Re: // Compatibility

Reply #7

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

Re: // Compatibility

Reply #8

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.