| Hello, Thank you for a fantastic bridge component! I'm using: Joomla version is: 1.0.11 SMF version is: 1.1 RC3 Joomla-SMF version: 2.0 beta 3 CB 1.0.1 Windows XP Apache/1.3.34 PHP/5.1.2 /// ok, Subs.php There have been other posts about this error. http://www.joomlahacks.com/component/option,com_smf/Itemid,94/topic,2301.msg11014#msg11014 The error is something along these lines: PHP Fatal error: Cannot redeclare db_query() then a path to smf forum / Subs.php. Code was suggeste in the other thread, but it was flawed. I revisited the code and came up with an answer. The following code: Code: // @!start subs patch $included_files = get_included_files(); $testStr = $jsmfConfig->smf_path .'/Sources/Subs.php'; $winStr = str_replace('/','\\', $testStr); $found = false; foreach ($included_files as $filename) { if (strcasecmp($filename, $winStr) == 0) { $found = true; } } if (!$found) { include_once($winStr); } // end subs patch Much of the above code was written by Wolverine. The flaw lay in windows pathing delimiter. When the oringinal code checked the loaded files string array for the Path/Subs.php, it couldn't find it because the slashes in the path were in the wrong direction. The str_replace remedys this problem. I already posted on the other thread my findings, but I've since come upon another subs.php error, this time during user registration. I've patched this one the same way. I only write this so perhaps when the time is right for the development team, they might permenantly fix this issue for us windows users. Thanks, A. |
Forum 





Author



Logged









