Is there any magic to place a Registration link in "Chatblock" block?
I've seen the module code (chatblockchatform()), but Drupal Form API has no option to insert a static link.

TIA

PS: I'm very newbie in CSS design.

Comments

attb2’s picture

Status: Active » Fixed

Solved. :-)
I've found a special 'markup' type in Form API. This element outputs its value without any modification.
So I inserted this piece of code to chatblockchatform() function:

$form['chatblocklink'] = array(
    '#type' => 'markup',
    '#value' => l('Register', 'user/register'),
);

Next step: place this link only when no user logged in.

dwees’s picture

To place the link when the user is not logged in, use the following:


global $user;

if (!$user->uid) {
  $form['chatblocklink'] = array(
    '#type' => 'markup',
    '#value' => l('Register', 'user/register'),
  );
}

this works because the anonymous user has uid = 0, and !0 resolves as true (since Php converts 0 to null/false when needed).

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.