diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index e61e409..9bcc201 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -2471,9 +2471,25 @@ function clear_history_by_group($group) $history_dbh = null; } +/* get_data_from_msgid uses overview database */ +/* get_db_data_from_msgid uses overview database */ function get_db_data_from_msgid($msgid, $group) { - global $spooldir; + global $spooldir, $config_dir, $logdir; + if (file_exists($config_dir . '/memcache.inc.php')) { + include $config_dir . '/memcache.inc.php'; + } + + if ($memcacheD) { + $row_cache = 'get_db_data_from_msgid-' . $msgid; + if ($row = $memcacheD->get($row_cache)) { + if ($enable_memcache_logging) { + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache hit) $row_cache", FILE_APPEND); + } + return $row; + } + } + $database = $spooldir . '/' . $group . '-articles.db3'; if (! is_file($database)) { return false; @@ -2490,6 +2506,12 @@ function get_db_data_from_msgid($msgid, $group) } $dbh = null; if ($found) { + if ($memcacheD) { + $nicole = $memcacheD->add($row_cache, $row, $memcache_ttl); + if ($enable_memcache_logging && $nicole) { + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND); + } + } return $row; } else { return false; @@ -2519,13 +2541,19 @@ function get_group_array_from_msgid($msgid) } } +/* get_data_from_msgid uses overview database */ +/* get_db_data_from_msgid uses overview database */ function get_data_from_msgid($msgid, $thisgroup = null) { - global $spooldir, $config_dir, $logdir; + global $spooldir, $config_dir, $logdir, $CONFIG; if (file_exists($config_dir . '/memcache.inc.php')) { include $config_dir . '/memcache.inc.php'; } + if ($CONFIG['article_database'] == '1' && isset($thisgroup)) { + return get_db_data_from_msgid($msgid, $thisgroup); + } + if ($memcacheD) { $row_cache = 'get_data_from_msgid-' . $msgid; if ($row = $memcacheD->get($row_cache)) { @@ -2558,7 +2586,10 @@ function get_data_from_msgid($msgid, $thisgroup = null) $dbh = null; if ($found) { if ($memcacheD) { - $memcacheD->add($row_cache, $row, $memcache_ttl); + $nicole = $memcacheD->add($row_cache, $row, $memcache_ttl); + if ($enable_memcache_logging && $nicole) { + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND); + } } return $row; } else { diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php index ad83956..48597e3 100644 --- a/Rocksolid_Light/rocksolid/overboard.php +++ b/Rocksolid_Light/rocksolid/overboard.php @@ -537,6 +537,9 @@ function display_flat($threads, $oldest) } } $results ++; + if($results > $maxdisplay) { + break; + } } $display .= ""; echo $display; diff --git a/Rocksolid_Light/rslight/memcached.inc.php b/Rocksolid_Light/rslight/memcached.inc.php index 065d124..c88e04a 100644 --- a/Rocksolid_Light/rslight/memcached.inc.php +++ b/Rocksolid_Light/rslight/memcached.inc.php @@ -16,8 +16,6 @@ $memcache_ttl = 14400; /* PLEASE DO NOT EDIT BELOW THIS LINE */ -/* PLEASE DO NOT EDIT BELOW THIS LINE */ - if ($enable_memcache) { $memcacheD = new Memcached('memcacheD'); $memcacheD->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); @@ -37,3 +35,4 @@ if ($enable_memcache) { } } } +