Created
November 19, 2013 18:33
-
-
Save MissAllSunday/7550139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($enable_only) | |
$query = ' | |
SELECT th.value, th.variable, th2.id_theme, th2.variable, th2.value | |
FROM {db_prefix}themes AS th | |
INNER JOIN {db_prefix}themes AS th2 ON (th2.id_theme = th.id_theme | |
AND th2.variable IN ({string:theme_dir}, {string:theme_url}, {string:images_url}, {string:name}, {string:theme_layers}, {string:theme_templates}, {string:version}, {string:install_for}, {string:based_on}, {string:enable})) | |
WHERE th.variable = {string:enable} | |
AND th.value = 1 | |
OR th.id_theme = 1'; | |
else | |
$query = ' | |
SELECT id_theme, variable, value | |
FROM {db_prefix}themes | |
WHERE variable IN ({string:theme_dir}, {string:theme_url}, {string:images_url}, {string:name}, {string:theme_layers}, {string:theme_templates}, {string:version}, {string:install_for}, {string:based_on}, {string:enable}) | |
AND id_member = {int:no_member}'; | |
// Perform the query as requested. | |
$request = $smcFunc['db_query']('', $query, | |
array( | |
'no_member' => 0, | |
'theme_dir' => 'theme_dir', | |
'images_url' => 'images_url', | |
'theme_url' => 'theme_url', | |
'name' => 'name', | |
'theme_layers' => 'theme_layers', | |
'theme_templates' => 'theme_templates', | |
'version' => 'version', | |
'install_for' => 'install_for', | |
'based_on' => 'based_on', | |
'enable' => 'enable', | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment