WORDPRESS DB: Cannot get data to be displayed in grid

Hey community,

I cannot get the grid data to show with a WP folder structure…

The grid box gets shown properly, but it won’t load the data. I’m connecting it like this:

    mygrid.load('connector.php');

And for the connector file, I have tried:

require_once(TEMPLATEPATH . '/buyer_sales/dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php');//includes related connector file

And:

require_once('http://jtc.ae/pre/wp/wp-content/themes/Amazing_japan_HP/buyer_sales/dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php');//includes related connector file

I’m not sure which files don’t get included correctly…
Any ideas?
Cheers!

This one looks correct

require_once(TEMPLATEPATH . '/buyer_sales/dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php');//includes related connector file

Just check that above address is resolved to correct location.

Dear Stanislav,

Thank you for your help. But I think maybe the bug lies in the connector.php connection.
When just using:

mygrid.load('connector.php');

It gave me a console error:

When I tried this:

mygrid.load('<?php echo bloginfo('template_url'); ?>/buyer_sales/connector.php');

the console log doesn’t show me anything anymore, but I’m not sure if the connector.php file is properly connected or not…

I get this console log error:

GET http://jtc.ae/pre/wp/wp-content/themes/Amazing_japan_HP/buyer_sales/connector.php?dhxr1445317633682=1 500 (Internal Server Error) window.dhx4.ajax._call @ dhtmlxgrid.js:9 window.dhx4.ajax.get @ dhtmlxgrid.js:9 dhtmlXGridObject.load @ dhtmlxgrid.js:9 dhtmlXGridObject.load @ dhtmlxgrid.js:9 (anonymous function) @ (index):56
URL:

http://jtc.ae/pre/buyer-sales/

I guess that the connector get’s loaded properly, but the whole framework just doesn’t work on wordpress websites…

GET jtc.ae/pre/buyer-sales/connector … 16983488=1 404 (Not Found)

It does mean that PHP file was not found at the define location

GET jtc.ae/pre/wp/wp-content/themes/ … 17633682=1 500 (Internal Server Error)

This one is an error in PHP code, check the PHP error log for more details.

Dear Stanislav!
I think I found the PHP log, it said:

[Wed Oct 21 09:54:21 2015] [error] [client 118.238.203.52] PHP Notice: Use of undefined constant TEMPLATEPATH - assumed 'TEMPLATEPATH' in /var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/buyer_sales/connector.php on line 3, referer: http://jtc.ae/pre/buyer-sales/ [Wed Oct 21 09:54:21 2015] [error] [client 118.238.203.52] PHP Warning: require_once(TEMPLATEPATH/buyer_sales/dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php): failed to open stream: No such file or directory in /var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/buyer_sales/connector.php on line 3, referer: http://jtc.ae/pre/buyer-sales/ [Wed Oct 21 09:54:21 2015] [error] [client 118.238.203.52] PHP Fatal error: require_once(): Failed opening required 'TEMPLATEPATH/buyer_sales/dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php' (include_path='.:') in /var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/buyer_sales/connector.php on line 3, referer: http://jtc.ae/pre/buyer-sales/

So I think the connector.php file doesn’t get referred to correctly. However because of the wordpress framework it’s really confusing why it won’t work, as ‘TEMPLATEPATH’ does work on other php pages…
Any ideas?

Thank you so much for all the help until now! Each time I get one step closer to getting dhtmlx to work!
-Luca Ban

In the connector.php file I tried changing TEMPLATEPATH with the wordpress way to add the path.
for ’ get_template_directory() ’ I get:

for ’ bloginfo() ’ I get:

So as well TEMPLATEPATH as wordpress functions fail in the connector.php file…

Dear admins,

It worked when I just changed the path to the grid connector in the connector.php file to the full path like this:
/var/www/vhosts/jtc.ae/httpdocs/pre/wp/wp-content/themes/Amazing_japan_HP/