Drupal is up and running but how do I ...?

Conditional block issue on login page?

I combined the ideas suggested here and here and implemented a "Blogs in queue" block that displays only to those roles ("editor", in my case) that have moderation permissions set. (See code below.)

It works great (although I'm not sure that it is the best solution -- it seems to rely on Drupal's tendency to not display blocks if they are empty, so the block itself is still universal, it's just that it fails to display as a function of the user role condition).

My only active problem with this method involves the "unrecognized username or password" page: something happens with that specific error result on that node (user/login), and the php in the block skips around the "$user->roles" conditional somehow. Of course, the db queries fail without an appropriate uid to return from the node and the mySQL error that is returned provides the content that then forces display of the (now especially ugly) block.

Is this due to Drupal treating the "failed login" page as an authenticated user node somehow? What can I do to either prevent this node from giving a false-positive result or else code the php to discount results from that particular node?

My php is in baby steps, so verbose replies are helpful.

Thanks! (Block code follows.)

global $user;
if (in_array('editor',$user->roles)) {
if ($user->uid) {
  // get the links
  $queryResult =  db_query_range("SELECT n.* FROM {node} n WHERE n.moderate = 1", 0, 10); 
  while ($node = db_fetch_object($queryResult)) {
    if ($user->uid == $node->uid || field_get($node->users, $user->uid)) {
      // it's our own node or we've already voted
      $rows[] = l($node->title, "queue/$node->nid") . " (" . queue_score($node->nid) . ")";
    }
    else {
      // it's someone else's node
      $rows[] = l($node->title, "queue/$node->nid");
    }
  }
  return theme("item_list", $rows)
    . "<div class=\"more-link\">"
    . l(t("more"), "queue", array("title" => t("List all queue entries.")))
    . "</div>";
}
}

help need with my filter module

Hi everyone,

Anybody know why I can't get my simple filter module to run? I'm going crazy because I can't even get the example found at www.drupaldocs.org to work.

Any ideas? I think I'm just missing something simple but I don't know what it is. I can activate it through the Admin Section but does nothing.

The code below is for a filter module designed to fix the page anchor/link problem

Thanks for your help!
Anthony

A couple of questions

Hello all:

Installed Drupal 4.5, with MySQL. Enabled the forum module and created a few forums, added a few postings. Everything's going swimmingly.

Now, I'd like to make one or two of the forums private: only accessible by users with a certain role. Is this possible?

While we're at it, I'd also like to be able to setup a couple of FAQ's lists. Someone suggested the Books module was the right tool for this job. I tried adding a book page and that didn't really show up where I expected it. Does osmeone have suggestions for this?

rss feed parsing error

Greetings.

I'm using Drupal 4.4 and having a rss feed problem. The feed Im trying to import is being served by my own little embedded server, the same xml file is parsed without problems if served from elsewhere.

The xml feeds both pass the valildification tests at the sites llinked to below:

Damn Forum Module..... (postgres)

I'm using drupal 4.5 and postgres.....

For some bizarre reason the forums don't work properly on my site....

When I go to the forums page it will show me the forums ok and the number of topics.... but then when you click on the forum it will just display a blank forum page, like there are no topics.

It does spit out this error:
warning: pg_query(): Query failed: ERROR: invalid input syntax for type boolean: "7" CONTEXT: PL/pgSQL function "if" line 2 at if in /home/.sites/66/site39/web/includes/database.pgsql.inc on line 104.

Giving the user a choice of roles....

Is it possible to have the user be able to pick a role/s to join?

So that I could have 4 roles:

  • Authenticated user (not shown to user, automatic)
  • Project Weird Clan Member ( one of the choices)
  • Gatherer Clan Member
  • Site Admin (not shown to user)

    So that a user could chose to become part of a clan if he choses that role?

    Thanks

    Mr Maggoo

    P.S I'm using the 4.5 version of drupal and Postgres (but I can convert the SQL code myself)

  • Pages

    Subscribe with RSS Subscribe to RSS - Post installation