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
protected function returnResponse() | |
{ | |
global $modSettings; | |
// kill anything else | |
ob_end_clean(); | |
if (!empty($modSettings['enableCompressedOutput'])) | |
@ob_start('ob_gzhandler'); |
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
filter: function(query, data, search_key) { | |
var _this = this; | |
return $.map(data, function(item, i) { | |
var name; | |
name = $.isPlainObject(item) ? item[search_key] : item; | |
if (name.toLowerCase().indexOf(query) >= 0) { | |
return item; | |
} | |
}); | |
}, |
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
// Doctrine | |
$sql = "SELECT * FROM articles WHERE id = ?"; | |
$stmt = $conn->prepare($sql); | |
$stmt->bindValue(1, $id); | |
$stmt->execute(); | |
// SMF | |
$result = $this->_smcFunc['db_query']('', ' | |
SELECT * | |
FROM articles |
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
protected function getAPIStatus() | |
{ | |
$apiUrl = 'https://status.github.com/api/status.json'; | |
$check = json_decode($this->fetch_web_data($apiUrl)); | |
if (empty($check)) | |
return false; | |
if (!empty($check) && is_object($check)) |
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
before: | |
throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode()); | |
now: | |
try | |
{ | |
throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode()); | |
} |
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
// This is the normal code | |
function RateStats_menu(&$menu_buttons) | |
{ | |
global $scripturl, $modSettings, $txt; | |
loadLanguage('RateStats'); | |
$menu_buttons['profile']['sub_buttons']['rateStats'] = array( | |
'title' => !empty($modSettings['RateStats_menu_name']) ? $modSettings['RateStats_menu_name'] : $txt['RateStats_title_main'], |
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
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE b.id_board IN (2) | |
AND bp.id_group IN (2, 4, 3) | |
AND bp.permission ' at line 6 | |
SELECT MIN(bp.add_deny) AS add_deny | |
FROM smf_boards AS b | |
INNER JOIN smf_board_permissions AS bp ON (bp.id_profile = b.id_profile) | |
LEFT JOIN smf_moderators AS mods ON (mods.id_board = b.id_board AND mods.id_member = 2) | |
LEFT JOIN smf_moderator_groups AS modgs ON (modgs.id_board = b.id_board AND b.id_group IN (2, 4) |
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 |
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 | |
function get_all_themes($enable_only = false) | |
{ | |
global $modSettings, $context, $smcFunc; | |
// Make our known themes a little easier to work with. | |
$knownThemes = !empty($modSettings['knownThemes']) ? explode(',',$modSettings['knownThemes']) : array(); | |
// All of them or just the enable ones? each will have a pretty different query. |
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 | |
foreach ($array as $var => $val) | |
$inserts[] = array($userID, $var, $val); | |
if (!empty($inserts)) | |
$this->_smcFunc['db_insert']('replace', | |
'{db_prefix}' . ($this->_tables['options']['table']), | |
array('member_id' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'), | |
$inserts, |
OlderNewer