I am using guestbook 5.x-2.x-dev.
Tried to display it on user profile ( I am using Advanced profile kit 5.x-1.0-beta1) panel page. Successfully working when guestbook is enable. When a user disables his guestbook, " page not found" error message displayed along with distorted profile page.
I went through the node http://drupal.org/node/34484 .

<?php
if (module_exists('guestbook')) {
  if(!$user->guestbook_status){  // guestbook_status seems to store 0 for enabled and 1 for disabled
     print module_invoke('guestbook', 'page', $user->uid);
  }
}
?>

Where to use this code ? I don have a user-profile.tpl.php as I am having APK . Poor i am, please help.

CommentFileSizeAuthor
#7 guestbook-DRUPAL-5--2.404.patch1.43 KBsun

Comments

sun’s picture

Project: Guestbook » Advanced Profile Kit
Version: 5.x-2.x-dev » 5.x-1.0-unstable1
Component: User interface » Code
Priority: Critical » Normal

I'm not sure how APK works, or worked in 5.x. Basically, Guestbook 5.x-2.x already provides a Panels content-type, which can be used in panels that have a user argument/context (without any custom code).

Above code looks like it could go into a template file in your theme, but I really have no idea.

michelle’s picture

Status: Active » Fixed

As Sun said, use the panels content type that guestbook is providing.

Michelle

godfather1’s picture

Status: Fixed » Active

Hi sun,
embedding code with template.php is not helping..
still trying to figure out...but no result.

sun’s picture

Status: Active » Fixed

You should listen to Michelle.

godfather1’s picture

Status: Fixed » Active

Hello Michelle,
I am able to add the panels content type that guestbook is providing to "user profile" and working fine when guestbook is enabled. My problem is when user disables his guestbook, "page not found" message is displayed along with the distorted profile layout. How to encounter this ?

sorry for the inconvenience

michelle’s picture

Project: Advanced Profile Kit » Guestbook
Version: 5.x-1.0-unstable1 » 5.x-2.x-dev

Ok, that I can't help with. The guestbook / panels integration needs to return either empty or a message that the guestbook is disabled, not a page not found, since it's not a page.

Michelle

sun’s picture

Title: Page not found(guestbook on APK profile panel page) » Panels: Page not found page displayed if user has no guestbook
Category: support » bug
Status: Active » Needs review
StatusFileSize
new1.43 KB

Please test attached patch and report back if it works for you.

sun’s picture

Status: Needs review » Closed (duplicate)
godfather1’s picture

Status: Closed (duplicate) » Closed (fixed)

Sorry for replying late. Was busy with some other works.
The above attached patch worked well and disabling gusestbook doesn't harm the site anymore.
Thank you very much.