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

direction for creating a forum wrapper

Hello all,
I'm inexperienced at developing drupal modules, and I was hoping someone could set me in the right direction for a module idea I have.

Basically, I want to wrap around the forum module. I want to extend the update, create, display, and edit functions.

I'm thinking that I would need to use hook_nodeapi. There is also the hook_form_alter. I have been looking here: http://api.drupal.org/api/HEAD/file/developer/examples/nodeapi_example.m...

destroy the user object

I want to stop a user from creating a new account unless the user provides the correct validation code. I wan tto know what to use to destroy the user object. I am using hook_user, see my code below:

Weather module completely wrecked my site - twice

I installed the weather module in 4.7.5 site, with no problems at all.

I installed the approprite weather module in a 5.0 site, and when I clicked "configure" by the block, the site just took a long, long, time loading, then loaded a blank page, and my site was effectively gone. I tride to rescue it. For example, I tried doing a check/repair on the database - nothing worked. I backed up the settings.php file, reinstalled drupal 5.0, then put the settings.php file back - that didn't work.

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.

Pages

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