Home arrow Forum Joomlahacks 2.0 using Wampserver
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2008, 05:58:32 AM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 2.0.x (Moderators: -Wolverine, kai920)
| | | |-+  Joomlahacks 2.0 using Wampserver
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Joomlahacks 2.0 using Wampserver  (Read 2057 times)
Brat
Developer
Joomla Pro
*****

Karma: +11/-0
Offline Offline

Posts: 52


View Profile
Joomlahacks 2.0 using Wampserver
« on: September 09, 2006, 09:43:42 PM »

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!

Regards,
Brat.
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Joomlahacks 2.0 using Wampserver
« Reply #1 on: September 09, 2006, 10:54:43 PM »

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.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Brat
Developer
Joomla Pro
*****

Karma: +11/-0
Offline Offline

Posts: 52


View Profile
Re: Joomlahacks 2.0 using Wampserver
« Reply #2 on: September 10, 2006, 04:36:56 AM »

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.  Undecided
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Joomlahacks 2.0 using Wampserver
« Reply #3 on: September 10, 2006, 02:44:02 PM »

find this line(around 1580) in smf.class.php:
Code:
include_once($jsmfConfig->smf_path.'/Sources/Subs.php');
Do somethign like this:
Code:
$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.
Code:
if (stripos($filename, 'Subs.php') !== false) {
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Brat
Developer
Joomla Pro
*****

Karma: +11/-0
Offline Offline

Posts: 52


View Profile
Re: Joomlahacks 2.0 using Wampserver
« Reply #4 on: September 10, 2006, 04:32:32 PM »

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.  Grin

Continuing development with XAMPP, hopefully problem free.

Regards,
Brat.
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Joomlahacks 2.0 using Wampserver
« Reply #5 on: September 10, 2006, 04:47:05 PM »

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.  Grin
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
abstrakt
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 7


View Profile
Re: Joomlahacks 2.0 using Wampserver
« Reply #6 on: September 25, 2006, 02:41:30 AM »

I had this similar error. The code I used to fix this was:

Code:
   
    $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($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!

-A
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

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
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Joomla Comment
Search Contact About Advertise Blogs Topsites Submit News Register Login