Hello all. I'm now evaluating Joomlahacks 2.0 in my Wampserver lab (meaning I'm using a Windows machine to emulate the Apache environment).
Everything installs fine. The problem is that I'm getting the dreaded "PHP Fatal error: Cannot redeclare db_query()" error involving Subs.php. This happens during login/logout, and I also notice that my SMF themes are not displaying as they should when wrapped in Joomla.
I researched previous messages about this error for clues as to what is happening, but since 2.0 is so different, I couldn't readily find anything that helped.
I did not have any of these problems with previous versions of Joomlahacks in this same environment.
Also, because in the lab I am using the latest versions of both Joomla and SMF, I cannot "downgrade" to older versions of the bridge.
Any ideas? Has anyone else with the same setup encountered this problem and solved it? Thanks!
wampserver? I use xampp without problems. There are known issues with the behavior of include_once on windows. Generally this is why a include_once for a file like subs.php fails when it is the second time included.
Themes, had you modified them to work inside joomla? Since we add these to the joomla header the are included *before* the joomla css(in most cases). Whereas previous verisons of the bridge allowed these definitions to occur in the body *after* the joomla css. The difference is browsers generally use the last declaration of an element, so this could by why things are appearing different. Check if you need to merge some css definitions to achieve the best look wrapped.
That's the funny thing. Wampserver (or WAMP) should function just like XAMPP. I used to use XAMPP a while ago, but switched to Wampserver because XAMPP had permissions issues I couldn't resolve.
So, that's why I cannot figure out why I am having this particular problem.
$included_files = get_included_files(); $found = false; foreach ($included_files as $filename) { if (strcasecmp($filename, $jsmfConfig->smf_path.'/Sources/Subs.php') == 0) { $found = true; } } if (!$found) { include_once($jsmfConfig->smf_path.'/Sources/Subs.php'); }
But this is all a workaround for Windows. By definition, this is the logic that php uses when include_once is called. You may need to verify that the full paths actually match(I don't know how it is stored in php). A stripos may be better, i.e.
I switched to XAMPP and the problem is gone. I still don't know why WAMP is behaving that way (I find WAMP much more user-friendly and easier to work with), but I simply have too much to do to debug someone else's software.
Continuing development with XAMPP, hopefully problem free.
good news... I can show you how to retrieve params etc. for JSMF 2.0 to make them work with your CB plugins. Just gimme shout... save us both some time.
$found = false; foreach ($included_files as $filename) { if (strcasecmp($filename, $winStr) == 0) { $found = true; } } if (!$found) { include_once($jsmfConfig->smf_path.'/Sources/Subs.php'); }
it seems that since this was a string compare, all slashes needed to be pointed in the right direction. 'nix systems of course don't have this problem because Windows is the only one looking to make our lives a bit more difficult. Thanks for the orignial code!
Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use