Zen Cart Logo
Forums / All Other Contributions/Addons / WordPress: Including application_top fails in init_db_config_read.

WordPress: Including application_top fails in init_db_config_read.

Views: 1,325

Results 1 to 8 of 8
23 Mar 2012, 11:18 PM
#1
zerogravity avatar

zerogravity

New Zenner

Join Date:
Jun 2011
Location:
Colorado, USA
Posts:
46
Plugin Contributions:
0

WordPress: Including application_top fails in init_db_config_read.

I eventually tracked this down when I was trying to use Sidebox Anywhere with WordPress (v3.3.1 - Genesis 1.8). Execution stalls at:

$configuration = $db->Execute('select configuration_key as cfgkey, configuration_value as cfgvalue
                                 from ' . TABLE_CONFIGURATION, '', $use_cache, 150);

The select runs in phpMyAdmin. Has anyone come across this or can you help me with how to debug this.

Many Thanks

23 Mar 2012, 11:34 PM
#2
zerogravity avatar

zerogravity

New Zenner

Join Date:
Jun 2011
Location:
Colorado, USA
Posts:
46
Plugin Contributions:
0

Re: WordPress: Including application_top fails in init_db_config_read.

I just found this in one of the debug files.

PHP Fatal error: Call to a member function sql_cache_exists() on a non-object in /home/xyz/public_html/store/includes/classes/db/mysql/query_factory.php on line 125

24 Mar 2012, 2:58 AM
#3
zerogravity avatar

zerogravity

New Zenner

Join Date:
Jun 2011
Location:
Colorado, USA
Posts:
46
Plugin Contributions:
0

Re: WordPress: Including application_top fails in init_db_config_read.

Since this has been moved to the add-ons forum I wanted to mention that this happens whenever I include a file from zen cart that requires application_top.php into WordPress, not just with Sidebar Anywhere.

24 Mar 2012, 8:30 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: WordPress: Including application_top fails in init_db_config_read.

Zen Cart was never written to run from within WordPress.
Evidently WordPress uses variables that are of the same name as those that Zen Cart uses, and is using them for different purposes.

Thus, whatever you're trying to do ... can't.

24 Mar 2012, 4:15 PM
#5
zerogravity avatar

zerogravity

New Zenner

Join Date:
Jun 2011
Location:
Colorado, USA
Posts:
46
Plugin Contributions:
0

Re: WordPress: Including application_top fails in init_db_config_read.

I am trying to add the bestsellers sidebox to the sidebar of a WordPress blog. Zen Cart is in a sub-folder 'store'. I had a basic implementation working in a previous version of WordPress and I know others currently have it working.

I tracked it down to this line in query_factory.php

if ( $zf_cache AND $zc_cache->sql_cache_exists($zf_sql, $zf_cachetime) )

values

zf_cache = 1
zf_sql = select configuration_key as cfgkey, configuration_value as cfgvalue from configuration
zf_cachetime = 150

If there is nothing wrong with these values I will try and track down what may be causing the conflict.

24 Mar 2012, 11:53 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: WordPress: Including application_top fails in init_db_config_read.

No, there's nothing wrong with those values.

25 Mar 2012, 12:19 AM
#7
zerogravity avatar

zerogravity

New Zenner

Join Date:
Jun 2011
Location:
Colorado, USA
Posts:
46
Plugin Contributions:
0

Re: WordPress: Including application_top fails in init_db_config_read.

Thanks Doc. I will report back any findings, successful or otherwise, just in case anyone else is having the same issue.

31 Mar 2012, 2:23 PM
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: WordPress: Including application_top fails in init_db_config_read.

I just wanted to drop in to add this to this thread.

I've ONLY ever been able to get Zen Cart sideboxes to appear in WordPress widgets when my widget code includes a call to an external file using a require or include statement. Dropping the code from the external file directly inside a WordPress widget always lead to the sidebar disappearing from the point the Zen Cart sidebox code starts.. What causes this is WELL over my paygrade to understand fully...:laugh:

I'm sure there is a way to do this without using an include or require, but it is definitely over my meager little skills to execute..