I'm trying to add an else statement with this code but I'm getting a persistent parse error. I must have done something wrong. I would really appreciate any help.

<?php
  if (module_exists('guestbook')) {
    $account_user = user_load(arg(1));
    if (!$account_user->guestbook_status) {
      $view_args = array($account_user);
      $func_args = array_merge(array('guestbook', 'page'), $view_args);
      $guestbook = call_user_func_array('module_invoke', $func_args);
      print $guestbook;
    }
  }
?>

Basically what it does is to display the guestbook module inside a profile. Got that going. But I want to display an alternate message such as "Username Guestbook is disabled" when that user's guestbook is set to disabled.

Thanks!

Comments

jerdiggity’s picture

You might (might) try changing user_load(arg(1)); (on the third line down) to user_load(array('uid' => $uid, 'status' => 1));

I could be way off but it can't hurt to try... Good luck!

:)

---
Yo that's shizzle.

halloffame’s picture

It got me a page not found error and it kinda messed up the profile page. ;)