Topic Links 2.2 Archive Fix Jun 2026
// Topic Links 2.2 Archive Fix - Improved parsing $path = getenv('PATH_INFO'); if ($path && preg_match('#/t-([0-9]+)(\.html)?#i', $path, $matches)) $threadid = intval($matches[1]); else $threadid = intval(substr($QUERY_STRING, 2));
/archive/index.php/t-123.html → /new-forum/threads/123/ Topic Links 2.2 Archive Fix
The root of the problem lies in a mismatch between the legacy URL slugging system and the new routing engine introduced in version 2.2. Specifically, the archive controller fails to append the correct directory prefix to threads moved into the long-term storage tables. This results in the system searching for active thread IDs in the archive directory, leading to a total failure of the link-mapping process. // Topic Links 2
Find the function build_archive_link($topic_id) and replace the existing return statement with the patched code below: if ($path && preg_match('#/t-([0-9]+)(\.html)?#i'
We didn't have the source code for the original 2.2 parser. But we had 12,000 archived HTML files and a SQL dump of the original topic map. Here is the fix we built.
