* @version 2.1.1
* @version 2.1.2
* @version 2.1.0
* @version 2.1.2
$attachmentOptions['errors'][] = vsprintf($txt['attach_warning'], $attachment['name']);
$attachmentOptions['errors'][] = sprintf($txt['attach_warning'], $attachment['name']);
* @version 2.1.0
* @version 2.1.2
$start_parsed = date_parse(convertDateToEnglish($_REQUEST['start_date']));
$start_parsed = date_parse(str_replace(',', '', convertDateToEnglish($_REQUEST['start_date'])));
$start_object = checkdate($month, $day, $year) === true ? date_create(implode('-', array($year, $month, $day))) : date_create(implode('-', array($today['year'], $today['month'], $today['day'])));
$start_object = checkdate($month, $day, $year) === true ? date_create(implode('-', array($year, $month, $day)) . ' ' . getUserTimezone()) : date_create(implode('-', array($today['year'], $today['month'], $today['day'])) . ' ' . getUserTimezone());
$end_parsed = date_parse(convertDateToEnglish($_REQUEST['end_date']));
$end_parsed = date_parse(str_replace(',', '', convertDateToEnglish($_REQUEST['end_date'])));
* @version 2.1.0
* @version 2.1.2
<select name="req_action" onchange="if (this.value != 0 && (this.value == \'reason\' || confirm(\'' . $txt['mc_groupr_warning'] . '\'))) this.form.submit();">
<select id="req_action" name="req_action" onchange="if (this.value != 0 && (this.value == \'reason\' || confirm(\'' . $txt['mc_groupr_warning'] . '\'))) this.form.submit();">
* @version 2.1.1
* @version 2.1.2
if (!empty($db_character_set))
$smcFunc['db_query']('', '
SET NAMES {string:db_character_set}',
array(
'db_character_set' => $db_character_set,
)
);
if (empty($db_character_set))
$db_character_set = 'utf8';
$smcFunc['db_query']('', '
SET NAMES {string:db_character_set}',
array(
'db_character_set' => $db_character_set,
)
);
// Enclosing the user input within some other text?
$simple_value = $value;
'value' => un_htmlspecialchars(tokenTxtReplace($value)),
'simple' => tokenTxtReplace($simple_value),
if ((!empty($options['show_no_censored']) && !empty($modSettings['allow_no_censored']) && !$force) || empty($modSettings['censor_vulgar']) || trim($text) === '')
if ((!empty($options['show_no_censored']) && !empty($modSettings['allow_no_censored']) && !$force) || empty($modSettings['censor_vulgar']) || !is_string($text) || trim($text) === '')
* @version 2.1.0
* @version 2.1.2
if (empty($date_choices))
$date_select .= '
<option></option>';
else
foreach ($date_choices as $id => $text)
foreach ($date_choices as $id => $text)
* @version 2.1.0
* @version 2.1.2
if ($settings_not_writable)
$context['settings_message'] = array(
'label' => $txt['settings_not_writable'],
'tag' => 'div',
'class' => 'centertext strong'
);
elseif ($settings_backup_fail)
if ($settings_backup_fail)
// If no cert, force_ssl must remain 0
require_once($sourcedir . '/Subs.php');
if (!ssl_cert_found($boardurl) && empty($modSettings['force_ssl']))
$disable_force_ssl = true;
else
$disable_force_ssl = false;
/* If you're writing a mod, it's a bad idea to add things here....
For each option:
/* If you're writing a mod, it's a bad idea to add things here....
For each option:
array('force_ssl', $txt['force_ssl'], 'db', 'select', array($txt['force_ssl_off'], $txt['force_ssl_complete']), 'force_ssl', 'disabled' => $disable_force_ssl),
'force_ssl' => array('force_ssl', $txt['force_ssl'], 'db', 'select', array($txt['force_ssl_off'], $txt['force_ssl_complete']), 'force_ssl'),
// Setup the template stuff.
$context['post_url'] = $scripturl . '?action=admin;area=serversettings;sa=general;save';
// If no cert, force_ssl must remain 0 (The admin search doesn't require this)
$config_vars['force_ssl']['disabled'] = empty($modSettings['force_ssl']) && !ssl_cert_found($boardurl);
$context['settings_title'] = $txt['general_settings'];
$context['save_disabled'] = $context['settings_not_writable'];
// Some javascript for SSL
addInlineJavaScript('
// Some javascript for SSL
if (empty($context['settings_not_writable']))
addInlineJavaScript('
$context['settings_title'] = $txt['cookies_sessions_settings'];
$context['settings_title'] = $txt['cookies_sessions_settings'];
$context['save_disabled'] = $context['settings_not_writable'];
* @version 2.1.0
* @version 2.1.2
'down' => 'mem.website_url = \'\', mem.website_url is null, mem.website_url DESC',
'up' => 'mem.website_url != \'\', mem.website_url is not null, mem.website_url ASC'
'down' => $context['user']['is_guest'] ? '1=1' : 'mem.website_url = \'\', mem.website_url is null, mem.website_url DESC',
'up' => $context['user']['is_guest'] ? ' 1=1' : 'mem.website_url != \'\', mem.website_url is not null, mem.website_url ASC'
* @version 2.1.0
* @version 2.1.2
$moveCache[0][] = $topic;
// Never move topics to redirect boards
$redirect_boards = array();
$request = $smcFunc['db_query']('', '
SELECT id_board
FROM {db_prefix}boards
WHERE redirect != {string:blank_redirect}',
array(
'blank_redirect' => '',
)
);
while ($row = $smcFunc['db_fetch_row']($request))
$redirect_boards[] = $row[0];
$smcFunc['db_free_result']($request);
if (in_array($moveCache[1][$topic], $redirect_boards))
continue;
* @version 2.1.0
* @version 2.1.2
$txt['error_attach_initial_error'] = $txt['attach_no_upload'] . '<div style="padding: 0 1em;">' . (is_array($attachment) ? vsprintf($txt[$attachment[0]], $attachment[1]) : $txt[$attachment]) . '</div>';
$txt['error_attach_initial_error'] = $txt['attach_no_upload'] . '<div style="padding: 0 1em;">' . (is_array($attachment) ? vsprintf($txt[$attachment[0]], (array) $attachment[1]) : $txt[$attachment]) . '</div>';
$txt['error_attach_errors'] .= vsprintf($txt['attach_warning'], $attachment['name']) . '<div style="padding: 0 1em;">';
$txt['error_attach_errors'] .= sprintf($txt['attach_warning'], $attachment['name']) . '<div style="padding: 0 1em;">';
$txt['error_attach_errors'] .= (is_array($error) ? vsprintf($txt[$error[0]], $error[1]) : $txt[$error]) . '<br >';
$txt['error_attach_errors'] .= (is_array($error) ? vsprintf($txt[$error[0]], (array) $error[1]) : $txt[$error]) . '<br >';
$context['post_error'][$post_error_id] = vsprintf($txt['error_' . $post_error_id], $post_error[1]);
$context['post_error'][$post_error_id] = vsprintf($txt['error_' . $post_error_id], (array) $post_error[1]);
// Show the max number of attachments if not 0.
if ($type == 'attachmentNumPerPostLimit')
$context['attachment_restrictions'][] = sprintf($txt['attach_remaining'], max($modSettings['attachmentNumPerPostLimit'] - $context['attachments']['quantity'], 0));
$context['attachment_restrictions'][$type] = sprintf($txt['attach_restrict_' . $type . ($modSettings[$type] >= 1024 ? '_MB' : '')], comma_format($modSettings[$type] >= 1024 ? $modSettings[$type] / 1024 : $modSettings[$type], 2));
// Show the max number of attachments if not 0.
if ($type == 'attachmentNumPerPostLimit')
{
$context['attachment_restrictions'][$type] .= ' (' . sprintf($txt['attach_remaining'], max($modSettings['attachmentNumPerPostLimit'] - $context['attachments']['quantity'], 0)) . ')';
}
elseif ($type == 'attachmentPostLimit' && $context['attachments']['total_size'] > 0)
{
$context['attachment_restrictions'][$type] .= '<span class="attach_available"> (' . sprintf($txt['attach_available'], max($modSettings['attachmentPostLimit'] - ($context['attachments']['total_size'] / 1024), 0)) . ')</span>';
}
$attach_errors[] = '<dd>' . (is_array($attachment) ? vsprintf($txt[$attachment[0]], $attachment[1]) : $txt[$attachment]) . '</dd>';
$attach_errors[] = '<dd>' . (is_array($attachment) ? vsprintf($txt[$attachment[0]], (array) $attachment[1]) : $txt[$attachment]) . '</dd>';
$attach_errors[] = '<dt>' . vsprintf($txt['attach_warning'], $attachment['name']) . '</dt>';
$attach_errors[] = '<dt>' . sprintf($txt['attach_warning'], $attachment['name']) . '</dt>';
* @version 2.1.0
* @version 2.1.2
// We should now have what we need to serve the file.
// Allow access to their attachments even if they can't see the board.
// This is just like what we do with posts during export.
$context['attachment_allow_hidden_boards'] = true;
if (strtotime($modified_since) >= $mtime)
{
ob_end_clean();
if (strtotime($modified_since) >= $mtime)
{
ob_end_clean();
header_remove('content-encoding');
if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false)
{
ob_end_clean();
if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false)
{
ob_end_clean();
header_remove('content-encoding');
// 40 kilobytes is a good-ish amount
header_remove('content-encoding');
// 40 kilobytes is a good-ish amount
* @version 2.1.0
* @version 2.1.2
if (isset($_POST['sa']) && $_POST['sa'] == 'ignoreboards' && empty($_POST['ignore_brd']))
$_POST['ignore_brd'] = array();
if (isset($_POST['sa']) && $_POST['sa'] == 'ignoreboards' && empty($_POST['brd']))
$_POST['brd'] = array();
if (!is_array($_POST['ignore_brd']))
$_POST['ignore_brd'] = array($_POST['ignore_brd']);
if (!is_array($_POST['brd']))
$_POST['brd'] = array($_POST['brd']);
foreach ($_POST['ignore_brd'] as $k => $d)
foreach ($_POST['brd'] as $k => $d)
$_POST['ignore_boards'] = implode(',', $_POST['ignore_brd']);
unset($_POST['ignore_brd']);
$_POST['ignore_boards'] = implode(',', $_POST['brd']);
unset($_POST['brd']);
if ($row['mask'] == 'nohtml' && ($valueReference != strip_tags($valueReference) || $value != filter_var($value, FILTER_SANITIZE_STRING) || preg_match('/<(.+?)[\s]*\/?[\s]*>/si', $valueReference)))
if ($row['mask'] == 'nohtml' && ($valueReference != strip_tags($valueReference) || $value != filter_var($value, FILTER_SANITIZE_FULL_SPECIAL_CHARS) || preg_match('/<(.+?)[\s]*\/?[\s]*>/si', $valueReference)))
SELECT col_name, field_name, field_desc, field_type, bbc, enclose
SELECT col_name, field_name, field_desc, field_type, field_options, show_mlist, bbc, enclose
if (!isset($disabled_fields[$row['col_name']]))
if (!isset($disabled_fields[$row['col_name']]) && !empty($row['show_mlist']))
'label' => $row['field_name'],
'label' => tokenTxtReplace($row['field_name']),
'type' => $row['field_type'],
'options' => !empty($row['field_options']) ? explode(',', $row['field_options']) : array(),
// Gotta disable the gender option.
if (isset($context['custom_pf']['cust_gender']) && $context['custom_pf']['cust_gender'] == 'None')
unset($context['custom_pf']['cust_gender']);
$smcFunc['db_free_result']($request);
if (!empty($buddiesArray))
$smcFunc['db_free_result']($request);
if (!empty($buddiesArray))
if ($column['bbc'] && !empty($context['buddies'][$buddy]['options'][$key]))
$currentKey = 0;
if (!empty($column['options']))
{
foreach ($column['options'] as $k => $v)
{
if (empty($currentKey))
$currentKey = $v == $context['buddies'][$buddy]['options'][$key] ? $k : 0;
}
}
'{INPUT}' => $context['buddies'][$buddy]['options'][$key],
'{KEY}' => $currentKey,
'{INPUT}' => tokenTxtReplace($context['buddies'][$buddy]['options'][$key]),
$context['member']['signature'] = empty($cur_profile['signature']) ? '' : str_replace(array('<br>', '<', '>', '"', '\''), array("\n", '<', '>', '"', '''), $cur_profile['signature']);
$context['member']['signature'] = empty($cur_profile['signature']) ? '' : str_replace(array('<br>', '<br/>', '<br />', '<', '>', '"', '\''), array("\n", "\n", "\n", '<', '>', '"', '''), $cur_profile['signature']);
* @version 2.1.0
* @version 2.1.2
* @version 2.1.0
* @version 2.1.2
// This is done to clear any output that was made before now.
ob_end_clean();
// This is done to clear any output that was made before now.
ob_end_clean();
header_remove('content-encoding');
// A thumbnail has been requested? madness! madness I say!
$preview = isset($_REQUEST['preview']) ? $_REQUEST['preview'] : (isset($_REQUEST['type']) && $_REQUEST['type'] == 'preview' ? $_REQUEST['type'] : 0);
$showThumb = isset($_REQUEST['thumb']);
$attachTopic = isset($_REQUEST['topic']) ? (int) $_REQUEST['topic'] : 0;
// A thumbnail has been requested? madness! madness I say!
$showThumb = isset($_REQUEST['thumb']);
// No access in strict maintenance mode or you don't have permission to see attachments.
if ((!empty($maintenance) && $maintenance == 2) || (!allowedTo('view_attachments') && !isset($_SESSION['attachments_can_preview'][$attachId])))
// No access in strict maintenance mode.
if (!empty($maintenance) && $maintenance == 2)
id_folder, filename, file_hash, fileext, id_attach,
id_thumb, attachment_type, mime_type, approved, id_msg
FROM {db_prefix}attachments
WHERE id_attach = {int:attach}' . (!empty($context['preview_message']) ? '
AND a.id_msg != 0' : '') . '
{string:source} AS source,
a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach,
a.id_thumb, a.attachment_type, a.mime_type, a.approved, a.id_msg,
m.id_board
FROM {db_prefix}attachments AS a
LEFT JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)
WHERE a.id_attach = {int:attach}
// If theres a message ID stored, we NEED a topic ID.
if (!empty($file['id_msg']) && empty($attachTopic) && empty($preview))
{
send_http_status(404, 'File Not Found');
die('404 File Not Found');
}
// Previews doesn't have this info.
if (empty($preview) && is_resource($attachRequest))
{
$request2 = $smcFunc['db_query']('', '
SELECT a.id_msg
FROM {db_prefix}attachments AS a
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg AND m.id_topic = {int:current_topic})
WHERE {query_see_message_board}
AND a.id_attach = {int:attach}
LIMIT 1',
array(
'attach' => $attachId,
'current_topic' => $attachTopic,
)
);
// The provided topic must match the one stored in the DB for this particular attachment, also.
if ($smcFunc['db_num_rows']($request2) == 0)
{
send_http_status(404, 'File Not Found');
die('404 File Not Found');
}
$smcFunc['db_free_result']($request2);
}
// If attachment is unapproved, see if user is allowed to approve
if (!$file['approved'] && $modSettings['postmod_active'] && !allowedTo('approve_posts'))
{
$request3 = $smcFunc['db_query']('', '
SELECT id_member
FROM {db_prefix}messages
WHERE id_msg = {int:id_msg}
LIMIT 1',
array(
'id_msg' => $file['id_msg'],
)
);
$id_member = $smcFunc['db_fetch_assoc']($request3)['id_member'];
$smcFunc['db_free_result']($request3);
// Let users see own unapproved attachments
if ($id_member != $user_info['id'])
{
send_http_status(403, 'Forbidden');
die('403 Forbidden');
}
}
// set filePath and ETag time
$file['filePath'] = getAttachmentFilename($file['filename'], $attachId, $file['id_folder'], false, $file['file_hash']);
// set filePath and ETag time
$file['filePath'] = getAttachmentFilename($file['filename'], $attachId, $file['id_folder'], false, $file['file_hash']);
$file['filePath'] = !file_exists($file['filePath']) && isset($filePath['extension']) ? substr($file['filePath'], 0, -(strlen($filePath['extension']) + 1)) : $file['filePath'];
$file['etag'] = '"' . md5_file($file['filePath']) . '"';
$file['exists'] = file_exists($file['filePath']);
$file['filePath'] = !$file['exists'] && isset($filePath['extension']) ? substr($file['filePath'], 0, -(strlen($filePath['extension']) + 1)) : $file['filePath'];
$file['mtime'] = $file['exists'] ? filemtime($file['filePath']) : 0;
$file['size'] = $file['exists'] ? filesize($file['filePath']) : 0;
$file['etag'] = '"' . sha1_file($file['filePath']) . '"';
// set filePath and ETag time
$thumbFile['filePath'] = getAttachmentFilename($thumbFile['filename'], $thumbFile['id_attach'], $thumbFile['id_folder'], false, $thumbFile['file_hash']);
$thumbFile['etag'] = '"' . md5_file($thumbFile['filePath']) . '"';
$thumbFile['filePath'] = getAttachmentFilename($thumbFile['filename'], $thumbFile['id_attach'], $thumbFile['id_folder'], false, $thumbFile['file_hash']);
$thumbPath = pathinfo($thumbFile['filePath']);
// set filePath and ETag time
$thumbFile['exists'] = file_exists($thumbFile['filePath']);
$thumbFile['filePath'] = !$thumbFile['exists'] && isset($thumbPath['extension']) ? substr($thumbFile['filePath'], 0, -(strlen($thumbPath['extension']) + 1)) : $thumbFile['filePath'];
$thumbFile['mtime'] = $thumbFile['exists'] ? filemtime($thumbFile['filePath']) : 0;
$thumbFile['size'] = $thumbFile['exists'] ? filesize($thumbFile['filePath']) : 0;
$thumbFile['etag'] = '"' . sha1_file($thumbFile['filePath']) . '"';
// Replace the normal file with its thumbnail if it has one!
// Can they see attachments on this board?
if (!empty($file['id_msg']))
{
// Special case for profile exports.
if (!empty($context['attachment_allow_hidden_boards']))
{
$boards_allowed = array(0);
}
// Check permissions and board access.
elseif (($boards_allowed = cache_get_data('view_attachment_boards_id-' . $user_info['id'])) == null)
{
$boards_allowed = boardsAllowedTo('view_attachments');
cache_put_data('view_attachment_boards_id-' . $user_info['id'], $boards_allowed, mt_rand(850, 900));
}
}
// No access if you don't have permission to see this attachment.
if
(
// This was from SMF or a hook didn't claim it.
(
empty($file['source'])
|| $file['source'] == 'SMF'
)
&& (
// No id_msg and no id_member, so we don't know where its from.
// Avatars will have id_msg = 0 and id_member > 0.
(
empty($file['id_msg'])
&& empty($file['id_member'])
)
// When we have a message, we need a board and that board needs to
// let us view the attachment.
|| (
!empty($file['id_msg'])
&& (
empty($file['id_board'])
|| ($boards_allowed !== array(0) && !in_array($file['id_board'], $boards_allowed))
)
)
)
// We are not previewing an attachment.
&& !isset($_SESSION['attachments_can_preview'][$attachId])
)
{
send_http_status(404, 'File Not Found');
die('404 File Not Found');
}
// If attachment is unapproved, see if user is allowed to approve
if (!$file['approved'] && $modSettings['postmod_active'] && !allowedTo('approve_posts'))
{
$request = $smcFunc['db_query']('', '
SELECT id_member
FROM {db_prefix}messages
WHERE id_msg = {int:id_msg}
LIMIT 1',
array(
'id_msg' => $file['id_msg'],
)
);
$id_member = $smcFunc['db_fetch_assoc']($request)['id_member'];
$smcFunc['db_free_result']($request);
// Let users see own unapproved attachments
if ($id_member != $user_info['id'])
{
send_http_status(403, 'Forbidden');
die('403 Forbidden');
}
}
if (strtotime($modified_since) >= filemtime($file['filePath']))
{
ob_end_clean();
if (!empty($file['mtime']) && strtotime($modified_since) >= $file['mtime'])
{
ob_end_clean();
header_remove('content-encoding');
$eTag = '"' . substr($_REQUEST['attach'] . $file['filePath'] . filemtime($file['filePath']), 0, 64) . '"';
if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $eTag) !== false)
{
ob_end_clean();
if (!empty($file['etag']) && !empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $file['etag']) !== false)
{
ob_end_clean();
header_remove('content-encoding');
$range_end = !$range_end ? $size - 1 : intval($range_end);
$range_end = !$range_end ? $file['size'] - 1 : intval($range_end);
header('last-modified: ' . gmdate('D, d M Y H:i:s', filemtime($file['filePath'])) . ' GMT');
header('last-modified: ' . gmdate('D, d M Y H:i:s', $file['mtime']) . ' GMT');
header("content-range: bytes $range-$range_end/$size");
header("content-range: bytes $range-$range_end/$file[size]");
header("content-length: " . $size);
header("content-length: " . $file['size']);
// Allow customizations to hook in here before we send anything to modify any headers needed. Or to change the process of how we output.
call_integration_hook('integrate_download_headers');
* @version 2.1.0
* @version 2.1.2
if (empty($attachInfo) || empty($attachInfo['msg']) && empty($context['preview_message']))
if (empty($attachInfo))
return 'attachments_no_data_loaded';
if (empty($attachInfo['msg']) && empty($context['preview_message']))
// Previewing much? No msg ID has been set yet.
if (!empty($context['preview_message']))
{
$attachContext['href'] = $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview';
$attachContext['link'] = '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachID . ';type=preview' . (empty($attachContext['is_image']) ? ';file' : '') . '" class="bbc_link">' . $smcFunc['htmlspecialchars']($attachContext['name']) . '</a>';
// Fix the thumbnail too, if the image has one.
if (!empty($attachContext['thumbnail']) && !empty($attachContext['thumbnail']['has_thumb']))
$attachContext['thumbnail']['href'] = $scripturl . '?action=dlattach;attach=' . $attachContext['thumbnail']['id'] . ';image;type=preview';
}
// You may or may not want to show this under the post.
// You may or may not want to show this under the post.
'href' => $scripturl . '?action=dlattach;topic=' . $attachment['topic'] . '.0;attach=' . $attachment['id_attach'],
'href' => $scripturl . '?action=dlattach;attach=' . $attachment['id_attach'],
'link' => '<a href="' . $scripturl . '?action=dlattach;topic=' . $attachment['topic'] . '.0;attach=' . $attachment['id_attach'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars']($attachment['filename']) . '</a>',
'link' => '<a href="' . $scripturl . '?action=dlattach;attach=' . $attachment['id_attach'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars']($attachment['filename']) . '</a>',
* @version 2.1.0
* @version 2.1.2
$timezone_array['default'] = timezone_open(date_default_timezone_get());
$timezone_array['default'] = timezone_open(getUserTimezone());
$low_object = date_create($low_date);
$low_object = date_create($low_date, $timezone_array['default']);
$high_object = date_create($high_date);
$high_object = date_create($high_date, $timezone_array['default']);
'day' => (int) smf_strftime('%d', time()),
'day' => (int) smf_strftime('%d', time(), getUserTimezone()),
'month' => (int) smf_strftime('%m', time()),
'month' => (int) smf_strftime('%m', time(), getUserTimezone()),
'year' => (int) smf_strftime('%Y', time()),
'year' => (int) smf_strftime('%Y', time(), getUserTimezone()),
'date' => smf_strftime('%Y-%m-%d', time()),
'date' => smf_strftime('%Y-%m-%d', time(), getUserTimezone()),
global $scripturl, $modSettings;
$selected_object = date_create($selected_date);
global $scripturl, $modSettings;
$selected_object = date_create($selected_date . ' ' . getUserTimezone());
$next_object = date_create($selected_date);
$next_object->modify('first day of next month');
$next_object = date_create($selected_date . ' ' . getUserTimezone());
$next_object->modify('first day of next month');
$prev_object = date_create($selected_date);
$prev_object->modify('first day of previous month');
$prev_object = date_create($selected_date . ' ' . getUserTimezone());
$prev_object->modify('first day of previous month');
$first_day_object = date_create(date_format($selected_object, 'Y-m-01'));
$last_day_object = date_create(date_format($selected_object, 'Y-m-t'));
$first_day_object = date_create(date_format($selected_object, 'Y-m-01') . ' ' . getUserTimezone());
$last_day_object = date_create(date_format($selected_object, 'Y-m-t') . ' ' . getUserTimezone());
'first_day_of_year' => date_format(date_create(date_format($selected_object, 'Y-01-01')), 'w'),
'first_day_of_next_year' => date_format(date_create((date_format($selected_object, 'Y') + 1) . '-01-01'), 'w'),
'first_day_of_year' => date_format(date_create(date_format($selected_object, 'Y-01-01') . ' ' . getUserTimezone()), 'w'),
'first_day_of_next_year' => date_format(date_create((date_format($selected_object, 'Y') + 1) . '-01-01' . ' ' . getUserTimezone()), 'w'),
$selected_object = date_create($selected_date);
// Get today's date.
$selected_object = date_create($selected_date . ' ' . getUserTimezone());
// Get today's date.
$first_day_object = date_create($selected_date);
$first_day_object = date_create($selected_date . ' ' . getUserTimezone());
$last_day_object = date_create(date_format($first_day_object, 'Y-m-d'));
$last_day_object = date_create(date_format($first_day_object, 'Y-m-d') . ' ' . getUserTimezone());
$next_object = date_create($selected_date);
date_add($next_object, date_interval_create_from_date_string('1 week'));
$next_object = date_create($selected_date . ' ' . getUserTimezone());
date_add($next_object, date_interval_create_from_date_string('1 week'));
$prev_object = date_create($selected_date);
date_sub($prev_object, date_interval_create_from_date_string('1 week'));
$prev_object = date_create($selected_date . ' ' . getUserTimezone());
date_sub($prev_object, date_interval_create_from_date_string('1 week'));
$current_day_object = date_create(date_format($first_day_object, 'Y-m-d'));
$current_day_object = date_create(date_format($first_day_object, 'Y-m-d') . ' ' . getUserTimezone());
$start_object = date_create($start_date);
$end_object = date_create($end_date);
$start_object = date_create($start_date . ' ' . getUserTimezone());
$end_object = date_create($end_date . ' ' . getUserTimezone());
$d = date_parse(convertDateToEnglish($_POST['start_date']));
$d = date_parse(str_replace(',', '', convertDateToEnglish($_POST['start_date'])));
$d = date_parse(convertDateToEnglish($_POST['start_datetime']));
$d = date_parse(str_replace(',', '', convertDateToEnglish($_POST['start_datetime'])));
$start_string_parsed = date_parse(convertDateToEnglish($start_string));
$start_string_parsed = date_parse(str_replace(',', '', convertDateToEnglish($start_string)));
if ($start_string_parsed['year'] != false)
if ($start_string_parsed['year'] !== false)
if ($start_string_parsed['hour'] != false)
if ($start_string_parsed['hour'] !== false)
$end_string_parsed = date_parse(convertDateToEnglish($end_string));
$end_string_parsed = date_parse(str_replace(',', '', convertDateToEnglish($end_string)));
* @version 2.1.0
* @version 2.1.2
?>
/**
* Prevent fatal errors under PHP 8 when a disabled internal function is called.
*
* Before PHP 8, calling a disabled internal function merely generated a
* warning that could be easily suppressed by the @ operator. But as of PHP 8
* a disabled internal function is treated like it is undefined, which means
* a fatal error will be thrown and execution will halt. SMF expects the old
* behaviour, so these no-op polyfills make sure that is what happens.
*/
if (version_compare(PHP_VERSION, '8.0.0', '>='))
{
/*
* This array contains function names that meet the following conditions:
*
* 1. SMF assumes they are defined, even if disabled. Note that prior to
* PHP 8, this was always true for internal functions.
*
* 2. Some hosts are known to disable them.
*
* 3. SMF can get by without them (as opposed to missing functions that
* really SHOULD cause execution to halt).
*/
foreach (array('set_time_limit') as $func)
{
if (!function_exists($func))
eval('function ' . $func . '() { trigger_error("' . $func . '() has been disabled for security reasons", E_USER_WARNING); }');
}
unset($func);
}
* @version 2.1.0
* @version 2.1.2
// Allow mods to modify BBC buttons.
// Define this here so mods can add to it via the hook.
$context['disabled_tags'] = array();
foreach ($editor_tag_map as $thisTag => $tagNameBBC)
if ($tag === 'float')
{
$context['disabled_tags']['floatleft'] = true;
$context['disabled_tags']['floatright'] = true;
}
if ((!empty($tag['code'])) && empty($context['disabled_tags'][$tag['code']]))
if (empty($tag['code']))
{
$context['bbc_toolbar'][$row][] = implode(',', $tagsRow);
$tagsRow = array();
}
elseif (empty($context['disabled_tags'][$tag['code']]))
$context['bbcodes_handlers'] .= '
});';
}
else
{
$context['bbc_toolbar'][$row][] = implode(',', $tagsRow);
$tagsRow = array();
}
$context['bbcodes_handlers'] .= '
});';
}
$row['answers'] = $smcFunc['json_decode']($row['answers'], true);
$row['answers'] = (array) $smcFunc['json_decode']($row['answers'], true);
* @version 2.1.0
* @version 2.1.2
if (!rename($fileName . '.tmp', $fileName))
return false;
return true;
elseif (function_exists('imagejpeg'))
elseif (!empty($preferred_format) && ($preferred_format == 6) && function_exists('imagebmp'))
$success = imagebmp($dst_img, $destName);
elseif (!empty($preferred_format) && ($preferred_format == 15) && function_exists('imagewbmp'))
$success = imagewbmp($dst_img, $destName);
* @version 2.1.0
* @version 2.1.2
* @version 2.1.0
* @version 2.1.2
$cdir = unpack('vdisk/@4/vdisk_entries/ventries/@12/Voffset', $data, $data_ecr + 4);
$cdir = unpack('vdisk/@4/vdisk_entries/ventries/@12/Voffset', substr($data, $data_ecr + 4, 16));
$header = unpack('Vcompressed_size/@8/vlen1/vlen2/vlen3/vdisk/@22/Voffset', $data, $pos_entry + 20);
$header = unpack('Vcompressed_size/@8/vlen1/vlen2/vlen3/vdisk/@22/Voffset', substr($data, $pos_entry + 20, 26));
* @version 2.1.0
* @version 2.1.2
* @version 2.1.0
* @version 2.1.2
$context['current_page'] = $start / $num_per_page;
if (!isset($context['current_page']))
$context['current_page'] = $start / $num_per_page;
// A series of punctuation marks (except %), possibly separated by whitespace.
'~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u',
// Repeated punctuation marks (except %), possibly separated by whitespace.
'~(?'.'>([^%\P{P}])\s*(?=\1))*~u',
'~([^%\P{P}])(?'.'>\1(?!$))*~u',
'~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u',
// Runs of horizontal whitespace.
'~\s+~',
call_integration_hook('integrate_pre_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
if ($message !== false)
call_integration_hook('integrate_pre_parsebbc', array(&$message, &$smileys, &$cache_id, &$parse_tags));
return $data = !empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment;
return $data = '<span style="display:inline-block" class="errorbox">' . (!empty($txt[$currentAttachment]) ? $txt[$currentAttachment] : $currentAttachment) . '</span>';
* @version 2.1.0
* @version 2.1.2
$error_message = str_replace('"', '"', empty($actions['error_params']) ? $txt[$actions['error']] : vsprintf($txt[$actions['error']], $actions['error_params']));
$error_message = str_replace('"', '"', empty($actions['error_params']) ? $txt[$actions['error']] : vsprintf($txt[$actions['error']], (array) $actions['error_params']));
* @version 2.1.0
* @version 2.1.2
<a href="', $scripturl, '?action=pm" class="button">', $txt['inbox'], '</a>
<a href="', $scripturl, '?action=pm;f=sent" class="button">', $txt['sent_items'], '</a>
<strong> ', $txt['on'], ':</strong> ', $message['time'], '
<strong> ', $txt['on'], ':</strong> ', $message['time'], '
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['to']), $context['sort_by'] == 'name' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['pm_to']), $context['sort_by'] == 'name' ? ' <span class="main_icons sort_' . $context['sort_direction'] . '"></span>' : '', '</a>
* @version 2.1.0
* @version 2.1.2
* @version 2.1.0
* @version 2.1.2
<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>';
<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '" is_redirect="', (int) !empty($board['redirect']), '"><![CDATA[', cleanXml($board['name']), ']]></item>';
.buttonlist .button {
margin-top: 2px;
margin-bottom: 2px;
}
.pagesection .button {
.pagesection .button {
// Version: 2.1.0;
// Version: 2.1.2;
$txt['attach_restrict_attachmentPostLimit'] = 'maximum total size %1$d KB';
$txt['attach_restrict_attachmentPostLimit'] = 'maximum total size %1$s KB';
$txt['attach_restrict_attachmentPostLimit_MB'] = 'maximum total size %1$d MB';
$txt['attach_restrict_attachmentPostLimit_MB'] = 'maximum total size %1$s MB';
$txt['attach_restrict_attachmentSizeLimit'] = 'maximum individual size %1$d KB';
$txt['attach_restrict_attachmentSizeLimit'] = 'maximum individual size %1$s KB';
childLevel: parseInt($(this).attr('childlevel'))
isRedirect: parseInt($(this).attr('is_redirect')),
auto_1.php |
This file should not be able to execute standalone.You may have to run the following queries manually.
Query: Select <?php
|