// Determine if this is should be using WAP, WAP2, or imode.
// Seed the random generator for PHP < 4.2.0.
if (@version_compare(PHP_VERSION, '4.2.0') == -1)
{
if (empty($modSettings['rand_seed']))
{
$modSettings['rand_seed'] = microtime() * 1000000;
updateSettings(array('rand_seed' => $modSettings['rand_seed']));
}
$seed = ($modSettings['rand_seed'] + ((double) microtime() * 1000003)) & 0x7fffffff;
srand($seed);
// Change the seed?
if (rand(1, 250) == 69)
updateSettings(array('rand_seed' => rand()));
}
// Determine if this is should be using WAP, WAP2, or imode.
db_query("
INSERT IGNORE INTO {$db_prefix}board_permissions
(ID_BOARD, ID_GROUP, permission, addDeny)
VALUES
(" . implode('), (', $boardPerms) . ")", __FILE__, __LINE__);
if (!empty($boardPerms))
db_query("
INSERT IGNORE INTO {$db_prefix}board_permissions
(ID_BOARD, ID_GROUP, permission, addDeny)
VALUES
(" . implode('), (', $boardPerms) . ")", __FILE__, __LINE__);
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['display_name'] . '</a>'
'link' => empty($row['ID_MEMBER']) ? $row['display_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['display_name'] . '</a>'
if (get_magic_quotes_gpc() != 0)
$_GET = stripslashes__recursive($_GET);
if (@get_magic_quotes_gpc() != 0)
$_GET = stripslashes__recursive($_GET);
// Load the Login template and language file.
loadTemplate('Login');
loadLanguage('Login');
// Load the Login template and language file.
loadLanguage('Login');
// Are we in wireless mode?
if (WIRELESS)
$context['sub_template'] = WIRELESS_PROTOCOL . '_login';
else
{
loadTemplate('Login');
$context['sub_template'] = 'kick_guest';
}
if ($crc['crc32'] != crc32($data))
if ($crc['crc32'] != smf_crc32($data))
fclose($this->connection);
return true;
}
}
fclose($this->connection);
return true;
}
}
// crc32 doesn't work as expected on 64-bit functions - make our own.
// http://www.php.net/crc32#79567
if (!function_exists('smf_crc32'))
{
function smf_crc32($number)
{
$crc = crc32($number);
if($crc & 0x80000000){
$crc ^= 0xffffffff;
$crc += 1;
$crc = -$crc;
}
return $crc;
}
}
'id' => $row['ID_ATTACH'],
'size' => round($row['filesize'] / 1024, 2),
'name' => htmlspecialchars($row['filename']),
'downloads' => $row['downloads'],
'href' => $row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH']),
'link' => '<a href="' . ($row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'])) . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \';image\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . htmlspecialchars($row['filename']) . '</a>'
'id' => $row['ID_ATTACH'],
'size' => round($row['filesize'] / 1024, 2),
'name' => htmlspecialchars($row['filename']),
'downloads' => $row['downloads'],
'href' => $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'],
'link' => '<a href="' . $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'] . '">' . htmlspecialchars($row['filename']) . '</a>'
'id' => $row['ID_ATTACH'],
'size' => round($row['filesize'] / 1024, 2),
'name' => $row['filename'],
'downloads' => $row['downloads'],
'href' => $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'],
'link' => '<a href="' . $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'] . '">' . $row['filename'] . '</a>'
'id' => $row['ID_ATTACH'],
'size' => round($row['filesize'] / 1024, 2),
'name' => htmlspecialchars($row['filename']),
'downloads' => $row['downloads'],
'href' => $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'],
'link' => '<a href="' . $scripturl . '?action=dlattach;' . ($context['browse_avatars'] ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'] . '">' . htmlspecialchars($row['filename']) . '</a>'