@set_time_limit(600);
@ini_set('memory_limit', '128M');
@set_time_limit(600);
if (@ini_get('memory_limit') < 256)
@ini_set('memory_limit', '256M');
// Tell the client to save this file, even though it's text.
header('Content-Type: application/octetstream');
// Tell the client to save this file, even though it's text.
header('Content-Type: ' . ($context['browser']['is_ie'] || $context['browser']['is_opera'] ? 'application/octetstream' : 'application/octet-stream'));
// Probably MyISAM.... and it might have a comment.
// MySQL users below 4.0 can not use Engine
if (version_compare('4', preg_replace('~\-.+?$~', '', min(mysql_get_server_info(), mysql_get_client_info()))) > 0)
$schema_type = 'TYPE=';
else
$schema_type = 'ENGINE=';
// Probably MyISAM.... and it might have a comment.
// Probably MyISAM.... and it might have a comment.
$schema_create .= $crlf . ') TYPE=' . (isset($row['Type']) ? $row['Type'] : $row['Engine']) . ($row['Comment'] != '' ? ' COMMENT="' . $row['Comment'] . '"' : '');
// Probably MyISAM.... and it might have a comment.
$schema_create .= $crlf . ') ' . $schema_type . (isset($row['Type']) ? $row['Type'] : $row['Engine']) . ($row['Comment'] != '' ? ' COMMENT="' . $row['Comment'] . '"' : '');
db_query("
CREATE TABLE {$db_prefix}log_search_words (
ID_WORD " . $index_properties[$context['index_settings']['bytes_per_word']]['column_definition'] . " unsigned NOT NULL default '0',
// MySQL users below 4.0 can not use Engine
if (version_compare('4', preg_replace('~\-.+?$~', '', min(mysql_get_server_info(), mysql_get_client_info()))) > 0)
$schema_type = 'TYPE=';
else
$schema_type = 'ENGINE=';
db_query("
CREATE TABLE {$db_prefix}log_search_words (
ID_WORD " . $index_properties[$context['index_settings']['bytes_per_word']]['column_definition'] . " unsigned NOT NULL default '0',
*/
function ManageSmileys()
void EditMessageIcons()
// !!!
void sortSmileyTable()
// !!!
*/
function ManageSmileys()
updateSettings(array(
'smiley_sets_default' => empty($context['smiley_sets'][$_POST['default_smiley_set']]) ? 'default' : $context['smiley_sets'][$_POST['default_smiley_set']],
'smiley_sets_enable' => isset($_POST['smiley_sets_enable']) ? '1' : '0',
// Make sure that the smileys are in the right order after enabling them.
if (isset($_POST['smiley_enable']))
sortSmileyTable();
updateSettings(array(
'smiley_sets_default' => empty($context['smiley_sets'][$_POST['default_smiley_set']]) ? 'default' : $context['smiley_sets'][$_POST['default_smiley_set']],
'smiley_sets_enable' => isset($_POST['smiley_sets_enable']) ? '1' : '0',
// Sort all smiley codes for more accurate parsing (longest code first).
db_query("
ALTER TABLE {$db_prefix}smileys
ORDER BY LENGTH(code) DESC", __FILE__, __LINE__);
// Sort all smiley codes for more accurate parsing (longest code first).
sortSmileyTable();
// Make sure the smiley codes are still in the right order.
db_query("
ALTER TABLE {$db_prefix}smileys
ORDER BY LENGTH(code) DESC", __FILE__, __LINE__);
// Make sure the smiley codes are still in the right order.
sortSmileyTable();
while ($row = mysql_fetch_assoc($request))
$context['boards'][$row['ID_BOARD']] = $row['name'];
mysql_free_result($request);
}
}
?>
while ($row = mysql_fetch_assoc($request))
$context['boards'][$row['ID_BOARD']] = $row['name'];
mysql_free_result($request);
}
}
// This function sorts the smiley table by code length, it is needed as MySQL withdrew support for functions in order by.
function sortSmileyTable()
{
global $db_prefix;
// Add a sorting column.
db_query("
ALTER TABLE {$db_prefix}smileys
ADD temp_order mediumint(8) not null", __FILE__, __LINE__);
// Set the contents of this column.
db_query("
UPDATE {$db_prefix}smileys
SET temp_order = LENGTH(code)", __FILE__, __LINE__);
// Order the table by this column.
db_query("
ALTER TABLE {$db_prefix}smileys
ORDER BY temp_order DESC", __FILE__, __LINE__);
// Remove the sorting column.
db_query("
ALTER TABLE {$db_prefix}smileys
DROP temp_order", __FILE__, __LINE__);
}
?>
'name' => htmlspecialchars($row['name']),
'url' => htmlspecialchars($row['url']),
'name' => $row['name'],
'url' => $row['url'],
$_POST['serverurl'] = substr($_POST['serverurl'], 0, -1);
$_POST['serverurl'] = substr($_POST['serverurl'], 0, -1);
$servername = htmlspecialchars($_POST['servername']);
$serverurl = htmlspecialchars($_POST['serverurl']);
// Make sure the URL has the correct prefix.
if (strpos($serverurl, 'http://') !== 0 && strpos($serverurl, 'https://') !== 0)
$serverurl = 'http://' . $serverurl;
if (trim($lower) <= $version && trim($upper) >= $version)
return true;
$lower = explode('.', $lower);
$upper = explode('.', $upper);
$version = explode('.', $version);
foreach ($upper as $key => $high)
{
// Let's check that this is at or below the upper... obviously.
if (isset($version[$key]) && trim($version[$key]) > trim($high))
return false;
// OK, let's check it's above the lower key... if it exists!
if (isset($lower[$key]))
{
// The version either needs to have something here (i.e. can't be 1.0 on a 1.0.11) AND needs to be greater or equal to.
// Note that if it's a range lower[key] might be blank, in that case version can not be set!
if (!empty($lower[$key]) && (!isset($version[$key]) || trim($version[$key]) < trim($lower[$key])))
return false;
}
}
return true;
if ($context['can_remove_poll'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';
if ($context['can_remove_poll'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';
if ($context['can_remove_poll'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';
if ($context['can_remove_poll'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';
function smfDetermineVersions()
{
var highYour = {"Sources": "??", "Default" : "??", "Languages": "??", "Templates": "??"};
function compareVersions(current, target)
{
// Are they equal, maybe?
if (current == target)
return false;
var currentVersion = current.split(".");
var targetVersion = target.split(".");
for (var i = 0, n = (currentVersion.length > targetVersion.length ? currentVersion.length : targetVersion.length); i < n; i++)
{
// Make sure both are set.
if (typeof(currentVersion[i]) == "undefined")
currentVersion[i] = "0";
else if (typeof(targetVersion[i]) == "undefined")
targetVersion[i] = "0";
// If they are same, move to the next set.
if (currentVersion[i] == targetVersion[i])
continue;
// Otherwise a simple comparison...
else
return (parseInt(currentVersion[i]) < parseInt(targetVersion[i]));
}
return false;
}
function smfDetermineVersions()
{
var highYour = {"Sources": "??", "Default" : "??", "Languages": "??", "Templates": "??"};
if (typeof(versionType) != "undefined")
{
if ((highYour[versionType] < yourVersion || highYour[versionType] == "??") && !lowVersion[versionType])
if (typeof(versionType) != "undefined")
{
if ((compareVersions(highYour[versionType], yourVersion) || highYour[versionType] == "??") && !lowVersion[versionType])
highYour[versionType] = yourVersion;
if (highCurrent[versionType] < smfVersions[filename] || highCurrent[versionType] == "??")
highYour[versionType] = yourVersion;
if (compareVersions(highCurrent[versionType], smfVersions[filename]) || highCurrent[versionType] == "??")
if (yourVersion < smfVersions[filename])
if (compareVersions(yourVersion, smfVersions[filename]))
}
}
else if (yourVersion < smfVersions[filename])
}
}
else if (compareVersions(yourVersion, smfVersions[filename]))
if ((highYour["Languages"] < yourVersion || highYour["Languages"] == "??") && !lowVersion["Languages"])
if ((compareVersions(highYour["Languages"], yourVersion) || highYour["Languages"] == "??") && !lowVersion["Languages"])
highYour["Languages"] = yourVersion;
if (highCurrent["Languages"] < smfLanguageVersions[filename] || highCurrent["Languages"] == "??")
highYour["Languages"] = yourVersion;
if (compareVersions(highCurrent["Languages"], smfLanguageVersions[filename]) || highCurrent["Languages"] == "??")
'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start']),
'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),