dir . '/Sources'))
$sourcedir = $boarddir . '/Sources';
$db_character_set = 'utf8';
?> without cgi.fix_pathinfo.
if (!empty($modSettings['queryless_urls']) && (!$context['server']['is_cgi'] || @ini_get('cgi.fix_pathinfo') == 1) && $context['server']['is_apache'])
{
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);
}
// Return the changed buffer.
return $buffer;
}
?>an't access nslookup/host, PHP 4.1.x might just crash.
if (@version_compare(PHP_VERSION, '4.2.0') == -1)
$host = false;
// Try the Linux host command, perhaps?
if (!isset($host) && (strpos(strtolower(PHP_OS), 'win') === false || strpos(strtolower(PHP_OS), 'darwin') !== false) && rand(0, 1) == 1)
{
if (!isset($modSettings['host_to_dis']))
$test = @shell_exec('host -W 1 ' . @escapeshellarg($ip));
else
$test = @shell_exec('host ' . @escapeshellarg($ip));
// Did host say it didn't find anything?
if (strpos($test, 'not found') !== false)
$host = '';
// Invalid server option?
elseif (strpos($test, 'invalid option') && !isset($modSettings['host_to_dis']))
updateSettings(array('host_to_dis' => 1));
// Maybe it found something, after all?
elseif (preg_match('~\s([^\s]+?)\.\s~', $test, $match) == 1)
$host = $match[1];
}
// This is nslookup; usually only Windows, but possibly some Unix?
if (!isset($host) && strpos(strtolower(PHP_OS), 'win') !== false && strpos(strtolower(PHP_OS), 'darwin') === false && rand(0, 1) == 1)
{
$test = @shell_exec('nslookup -timeout=1 ' . @escapeshellarg($ip));
if (strpos($test, 'Non-existent domain') !== false)
$host = '';
elseif (preg_match('~Name:\s+([^\s]+)~', $test, $match) == 1)
$host = $match[1];
}
// This is the last try :/.
if (!isset($host) || $host === false)
$host = @gethostbyaddr($ip);
// It took a long time, so let's cache it!
if (array_sum(explode(' ', microtime())) - array_sum(explode(' ', $t)) > 0.5)
cache_put_data('hostlookup-' . $ip, $host, 600);
return $host;
}
// Chops a string into words and prepares them to be inserted into (or searched from) the database.
function text2words($text, $max_chars = 20, $encrypt = false)
{
global $func, $context;
// Step 1: Remove entities/things we don't consider words:
$words = preg_replace('~([\x0B\0' . ($context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}' : pack('C*', 0xC2, 0xA0)) : '\xA0') . '\t\r\s\n(){}\\[\\]<>!@$%^*.,:+=`\~\?/\\\\]|&(amp|lt|gt|quot);)+~' . ($context['utf8'] ? 'u' : ''), ' ', strtr($text, array('
' => ' ')));
// Step 2: Entities we left to letters, where applicable, lowercase.
$words = un_htmlspecialchars($func['strtolower']($words));
// Step 3: Ready to split apart and index!
$words = explode(' ', $words);
if ($encrypt)
{
$possible_chars = array_flip(array_merge(range(46, 57), range(65, 90), range(97, 122)));
$returned_ints = array();
foreach ($words as $word)
{
if (($word = trim($word, '-_\'')) !== '')
{
$encrypted = substr(crypt($word, 'uk'), 2, $max_chars);
$total = 0;
for ($i = 0; $i < $max_chars; $i++)
$total += $possible_chars[ord($encrypted{$i})] * pow(63, $i);
$returned_ints[] = $max_chars == 4 ? min($total, 16777215) : $total;
}
}
return array_unique($returned_ints);
}
else
{
// Trim characters before and after and add slashes for database insertion.
$returned_words = array();
foreach ($words as $word)
if (($word = trim($word, '-_\'')) !== '')
$returned_words[] = addslashes($max_chars === null ? $word : substr($word, 0, $max_chars));
// Filter out all words that occur more than once.
return array_unique($returned_words);
}
}
// Creates an image/text button
function create_button($name, $alt, $label = '', $custom = '')
{
global $settings, $txt, $context;
if (!$settings['use_image_buttons'])
return $txt[$alt];
elseif (!empty($settings['use_buttons']))
return '
' . ($label != '' ? '' . $txt[$label] . '' : '');
else
return '
';
}
?>ver();
if (!$memcached)
{
// '0' means ignore me for the rest of this page view.
$memcached = '0';
return null;
}
if (!fwrite($memcached, 'get ' . $key . "\r\n"))
{
$memcached = fclose($memcached);
return null;
}
$response = fgets($memcached);
if (substr($response, 0, 3) != 'END' && substr($response, 0, 5) != 'VALUE')
{
// Bad response, junk time.
$memcached = fclose($memcached);
return null;
}
if (substr($response, 0, 5) == 'VALUE' && preg_match('~(\d+)$~', trim($response), $match) != 0)
$value = substr(fread($memcached, $match[1] + 2), 0, -2);
fread($memcached, 5);
}
// Again, eAccelerator.
elseif (function_exists('eaccelerator_get'))
$value = eaccelerator_get($key);
// The older, but ever-stable, Turck MMCache...
elseif (function_exists('mmcache_get'))
$value = mmcache_get($key);
// This is the free APC from PECL.
elseif (function_exists('apc_fetch'))
$value = apc_fetch($key . 'smf');
// Zend's pricey stuff.
elseif (function_exists('output_cache_get'))
$value = output_cache_get($key, $ttl);
if (isset($db_show_debug) && $db_show_debug === true)
{
$cache_hits[$cache_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
$cache_hits[$cache_count]['s'] = isset($value) ? strlen($value) : 0;
}
if (empty($value))
return null;
// If it's broke, it's broke... so give up on it.
else
return @unserialize($value);
}
function get_memcached_server($level = 3)
{
global $modSettings, $memcached, $db_persist;
$servers = explode(',', $modSettings['cache_memcached']);
$server = explode(':', trim($servers[array_rand($servers)]));
// Don't try more times than we have servers!
$level = min(count($servers), $level);
// Don't wait too long: yes, we want the server, but we might be able to run the query faster!
if (empty($db_persist))
$memcached = @fsockopen($server[0], empty($server[1]) ? 11211 : $server[1], $err, $err, 0.15);
else
$memcached = @pfsockopen($server[0], empty($server[1]) ? 11211 : $server[1], $err, $err, 0.15);
if (!$memcached && $level > 0)
get_memcached_server($level - 1);
elseif ($memcached)
{
@socket_set_timeout($memcached, 1);
@set_file_buffer($memcached, 0);
}
}
?>
R. A. Wood Associates Software Support Forum - Index
|
R. A. Wood Associates Software Support
|
 |
Software Support for all Programs
This is a forum to discuss general topics about R. A. Wood Associates Software, covering all programs.
|
6 Posts in
4 Topics
|
Last post on September 20, 2005, 02:50:18 PM
in Re: downloadable version... by adminter
|
 |
SpurFinder Support
This is a forum to discuss the SpurFinder software.
|
4 Posts in
2 Topics
|
Last post on August 06, 2005, 04:29:50 PM
in Re: Requests for Upcomin... by adminter
|
 |
TunerHelper Support
This is a forum to discuss the TunerHelper software.
|
3 Posts in
2 Topics
|
Last post on December 23, 2004, 10:34:50 PM
in Requests for Upcoming ve... by adminter
|
 |
PathLossSolver Support
This is a forum to discuss the PathLossSolver software.
|
3 Posts in
2 Topics
|
Last post on December 23, 2004, 10:35:14 PM
in Requests for Upcoming ve... by adminter
|
 |
PainlessExtraction Support
This is a forum to discuss the PainlessExtraction software.
|
8 Posts in
3 Topics
|
Last post on January 31, 2006, 02:30:58 AM
in Re: Connection with 8235... by Francis MILLON
|
 |
RFSpecTest Support
This is a forum to discuss the RFSpecTest software.
|
1 Posts in
1 Topics
|
Last post on December 23, 2004, 10:36:27 PM
in Requests for Upcoming ve... by adminter
|
 |
RF Path Analysis Toolkit Support
Support for RF Path Analysis Toolkit. This program has been released as a beta version on 10/15/2004.
|
4 Posts in
3 Topics
|
Last post on January 29, 2005, 04:56:57 PM
in RF Path Analysis Toolkit... by Bob Wood
|
|
Loading...