The module calls directly a function that is specific for a database. Doing so, the module works only if the server which runs the web site has the PHP MySQL extension installed, and working.

The call to mysql_num_rows() can be avoided, as there is another way to get the number of rows, in Drupal 6.
I.e., the code:

  $query = "SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.uid = " . $account->uid . $limit . " ORDER By n.created DESC ";
  $postpermonth =  mysql_num_rows(db_query($query));

can be changed in

  $query = "SELECT COUNT(*) FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.uid = " . $account->uid . $limit;
  $postpermonth =  db_result(db_query($query));

Comments

Chajecki’s picture

Assigned: Unassigned » Chajecki

Thanks. Very good suggestions. Will be implemented in a new release.

avpaderno’s picture

It should also be the case to avoid to pass arguments directly in the query string, but to use something like:

  $query = "SELECT COUNT(*) FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.uid = %d";
  $postpermonth =  db_result(db_query($query, $account->uid));
avpaderno’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue since it's for a Drupal version that isn't supported.