This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How do I get RSS to auto-update?

I understand that cron is supposed to used, but how? I know how to use cron, but how do I use it for this?

Using db_rewrite_sql() on data from external database

I've written a simple module to query an external database to list and display properties for sale. All aspects of the code work okay except for the listing piece, which relies on db_rewrite_sql() to construct an argument for pager_query() and then display a list.

db_set_active('rmls');
$sql_cnt = "SELECT COUNT(DISTINCT(id)) from residential where ($coutput) AND ListPrice>=$low AND ListPrice<=$high";
$result = pager_query(db_rewrite_sql("SELECT ml,city,ListPrice,TotalSQFT,NumberofBedrooms,TotalBathrooms,NumberofPhotos from residential where ($coutput) AND ListPrice >=$low AND ListPrice <=$high ORDER BY ListPrice DESC"), 20,0,$sql_cnt);
db_set_active('default');

If I am logged in as the superuser, the list displays properly, though the function throws an error:

Table 'rmls.node_access' doesn't exist query: SELECT COUNT(*) FROM node_access WHERE nid = 0 AND ((gid = 0 AND realm = 'all')) AND grant_view >= 1 in /var/www/sjp/includes/database.mysql.inc on line 121.

If I am not logged in, or am logged in as a user other than the superuser, the code does not return a result and throws the following error:

load multiple nodes?

I need to load multiple nodes, but using subsequent node_load($nid) calls does not look like a reasonable idea :/ 5 calls to node_load would not be a problem, but what if i need to load 100 of them? it would be at least 100 single db queries for each node_load plus any other implemented with hook_load or hook_nodeapi.

Monket Calendar

I need help in developing a module for Monket Calendar integration in my Drupal site.

Conditional install for module

Hi,

Is it possible in drupal to enable a module conditionally, e.g. only if a postgresql database of a certain version is used? There seems no such thing in drupal as a 'failure' return value of the install hook and if you want to enable it in admin/build/modules, it will not fail. An error message can be given the 'The installation of the xx module was unsuccessful', but it still shows as enabled!
What's the best way to tackle this problem?

Regards,
John.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions