You are here:  » Using SearchExternal and PricesExternal on Drupal sites

Support Forum



Using SearchExternal and PricesExternal on Drupal sites

Submitted by npaitken on Thu, 2009-06-11 16:20 in

Hi David,

Following on from this thread

http://www.pricetapestry.com/node/2289

which is great and helped me get SearchExternal and PriceExternal on my Wordpress site.

I now want to move to Drupal and am testing a Drupal install in a subdomain of my live site. As I'm sure you know, in Drupal articles you can select PHP code as an 'Input Format'. However, when I post code snippets like this:

<?php
  $common_baseHREF = "http://www.mysite.co.uk/shopping/";
  $common_path = "/kunden/homepages/2/d99999999/htdocs/shopping/";
  $_GET["q"] = "Footjoy Greenjoy Ladies";
  require($common_path."searchExternal.php");
?>

it kind of works (embeds the search result) but seems to affect my Drupal theme - top nav disappears, frontpage is broken, etc.

Have you had any similar problems before or do you have any ideas on how to approach debugging this.

Thanks for any help,

Best,
NEil

Submitted by support on Fri, 2009-06-12 09:28

Hi Neil,

I just tested this on one my Drupal installations, and, as is the case sometimes with WordPress, there is a conflict between the database connections. This generates error messages, which in turn break the template as output is generated before Drupal is ready, so when it comes to send the headers it can't - which generates another error message...!

The solution is simply to make sure that Price Tapestry creates its own database connection. To do this, in includes/database.php look for the following code on line 13:

$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);

...and REPLACE with:

$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword,TRUE);

That should sort it!

Cheers,
David.