Needs work
Project:
Guestbook
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2005 at 17:35 UTC
Updated:
2 May 2022 at 23:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
neablo commentedThat's exactly what I need!
Is it possible to help me with a phptemplate file that integrates a guestbook directly in the user profile page?
That would be so great, I just don't know how to do it myself!
Is there anyone who is able to make such (as I think) difficult stuff?!?
Comment #2
Anonymous (not verified) commentedYes, I am looking to do this too!
I would imagine it can be done through the userprofile.tpl.php file, but how is the question. I am not much of a coder so perhaps we can get someone to help us out with this request.
Thanks in advance.
Comment #3
hba commentedWould this demand changes outside the guestbook module?
Comment #4
bluecobalt commentedSee http://drupal.org/node/46976
It works for me.
peace,
blue
Comment #5
hba commentedBumping version to 4.7. Someone might have a hack for 4.7 as well?
Comment #6
scroogie commentedYes, I did it already. Its really simple. You need a template override for your user_profile. An explenation for general profile customization can be found here: http://drupal.org/node/35728
To show the user guestbook just type
print module_invoke('guestbook', 'page', $user->uid)in the profile template.
There is one problem though, and thats the reason i was just searching the issues. The problem is that you get forwarded to the dedicated guestbook page after submitting an entry. It would be nice if you could change the module, so that it uses an hidden form field to determine from which page it gets called, and redirects to this page after submission. The regarding code is in guestbook_form_entry_submit() line 407.
Comment #7
kylehase commentedSo far looks good but the submission form is missing on my profile pages. Any ideas? Also, the theming for the guestbook module seems strange. I sometimes get white sections in the guestbook entry borders as if there's something wrong with the floating pictures. I'm ok with PHP but very new to CSS.
Comment #8
kylehase commentedOops, disregard that issue about missing the form. I was looking at my own profile. Still have a theming issue though.
Comment #9
kylehase commentedAlso found that if the user disables their guestbook, you get a "page not found" page where the guestbook should be. Any suggestions on an "if" statement to check thta the user has guestbook enabled?
Comment #10
kylehase commentedThis seems to work but if anyone could suggest a better alternative please let me know.
Comment #11
scroogie commentedComment #12
moshe weitzman commentedyes, seems like inline presentation of comments is the usual. i agree that guestbook should behave like this by default.
Comment #13
hba commentedadded this info to INSTALL.txt in cvs
Comment #14
netentropy commentedcannot get the snippet to work in 5.1 added
as a cut and paste to a functional user profile overide and recieved the following error.
Parse error: syntax error, unexpected T_STRING, expecting '
on the second line of the code.
Comment #15
hba commentedTry this instead (added missing ";" and used module_exists() instead):
Comment #16
hba commentedComment #17
rayvan commentedso i put
in my template.php file????? please clarify.
Comment #18
jeforma commentedI have tried all the ways, and your modification to add the guestbook to the profile page does not work.
please help :)
Regards,
Charles
Comment #19
moonray commentedAfter trying the option suggested in the INSTALL.txt I found several issues.
All the links still point to the guestbook/* url, instead of the user/* url.
So, I wrote up a patch that adds a configuration option to show the guestbook on the user profile page. It then fixes the links so the user profile page is the main page it always returns to, rather than guestbook/*.
Please review.
Comment #20
artycul commentedhey moonray...
absolutely great idea. i tried your patch and had only one problem... i couldn't get the comments to work properly. the diff around line 638 looks good for me, but when i click on 'add comment' the profile shows up as before (without guestbook_form_comment_form), while the url says something like: "www.domain.tld/user/2/comment/22#comment-entry". i had to change the file by hand, because the patch didn't work for me. i'm using the dev-version...
thanks
...sebi
Comment #21
moonray commentedSounds like it could be a cache issue. Have you tried clearing your cache after applying the patch?
Also sounds like the patch needs to be re-rolled... will get to that soon.
Comment #22
artycul commentedsorry, clearing the cache did not solve the prob... i'll try to re-change the file from the original one and keep you informed to rule out mistakes by me ;) thanks again for the good work!
...sebi
Comment #23
hade commentedon my drupal 5.1 site all above snippets gave errors or "page not found" when a user disables his guestbook, now this works for me:
with moonray´s patch it´s nearly perfect, but now looking for some ajax functionality for guestbook pager on profiles. ;)
Comment #24
gurukripa commentedhi
i am using the Core profile module without any template override..
how can i ensure that the guestbook shows at the bottom of each profile...can this be done without a template override...
if i do have to do an override..then its going to be tough to get all the info back on the page...
can someone help me out..thanks..
Comment #25
gurukripa commentedi am using Version 5.x-1.0 not the dev verssion..pls help..thanks.
Comment #26
gurukripa commentedmoonray..i want to use your patch..but u say u r going to re roll it..and also there was a point ..that there was some issue with comments....cld u clarify...
shld i use the patch ???
Comment #27
moonray commentedI just checked, and there were no changes in 5.x-1.x-dev. So no need to re-roll.
Try applying it, and if it doesn't work we'll try and figure it out.
Comment #28
G Gavitt commentedI had the same problem as #20 (submitted by sebi_tl)
I did a quick fix by changing this line in moonray's patch
To
That brings you back to the regular guestbook page when you add a comment back to a guestbook entry..I am not sure if the patch was supposed to add the comment form right on the profile page? That would be cool but, either way works for me ..YMMV.
Comment #29
scarer commentedHi,
I tried to run the patch using the patch command in ssh and it returns an error that all 9 hunks failed.
Is there something I am doing wrong? Please help.
Sarah
Comment #30
panis commentedI just finished extended guestbook module to insert the guestbook in a block on any page
Features:
- show a clipped entry in the block - so if the entry is too long it will show the first "N" a teaser if you like.
- enter a new short entry into the guestbook - can be as long as you need but because it is a block I kept the entry to one line.
- Update the block using ajax as soon as the entry is updated - if ajax not available then the entire page will reload
- refresh block periodically and automatically only if ajax is available.
Configurations:
- adjust the height of the block and have scrollbar if needed
- change the background image of the block
- Limit the number of entries shown in the block
I will have a demo on my website later this week. Please let me know if something like this would be acceptable as part of the guestbook module or I should be developing an independent module. Any ideas and suggestions for features are welcome.
thanks
Comment #31
Muslim guy commentedPlease could somebody summarize here `How to integrate Guestbook with custom userprofile.tpl.php'
and add to `Fun with user_profile.tpl.php - stuff for MySpace or Friendster like customizable profile'
http://drupal.org/node/165114
*You'd be an instant Drupal hero to all Drupal users/non-programmers thank you :)
Comment #32
Muslim guy commentedWow that worked! So simple, and no addition to template.php
So for 4.7.x, you must not use module_exists bcos its not understood by Drupal
Comment #33
Muslim guy commentedThe above for Drupal 4.7.x worked, only that when SUBMIT, you are brought to the actual guestbook, and you have to hit Back Button on your web browser to return to the custom user profile
Nice though, thanks a lot
*I also tried the lengthy PHP code from http://drupal.org/node/46976 but got wacky result
Comment #34
artycul commentedThx Suede Pudding, with your help it now works for me, too ;)
Comment #35
johnnocThe problem with the code for 5.x stated above is that whenever the owner of the profile visits his own profile, Drupal seems to think that the profile has been edited and updated. This will show on userlists with last updated info or if you have snippets to show when the profileuser updated his profile.
dunno if it has the same problem in the 4.7.x snippet above. Haven't tested it.
Comment #36
72dpi commentedDoes anyone know if you can add an entry to your own Gusetbook?
I am using it as 'comment blocks" on user pages, and it is handy to respond top someones comments.
Also, I would lofve to modify this, so U could have a 'whisper", whereby only you and the person you wrote on can read it.
Anyone thought of this? would be really handy...
Comment #37
sdsheridanI could definitely use something like this. Is it ready for general consumption?
Comment #38
gurukripa commentedwhere can we see this..hope it works for Drupal 5.1
Comment #39
panis commentedComment removed...
Comment #40
sun@panis: If you want to share your code, please open a separate issue and attach a patch against the latest development snapshot of guestbook.
Setting a more appropriate title.
Comment #41
millions commentedI'm sorry, where do you paste this code? I'm using the Denver theme and don't have a userprofile.tpl.php file or anything like that. can i paste it in my template.php like rayvan asked?
Comment #42
millions commentedI got it, I just need to resize the guestbook image and get it to use the imagecache pic. can't find how to do that.
Comment #43
the2ndday commentedI had same problem and I just changed guestbook module file(guestbook.module)
It's not pretty but, check it out.
What I did to use imagecache on guestbook page
Replace this code (from guestbook.module)
___________________
$picture = theme('image', $picture, $alt, $alt, '', false);___________________
with this
___________________
$picture = theme('imagecache', 'Put name of imagecache profile you made', $account->picture, $alt, $alt, '', false);___________________
Comment #44
sunPlease do not hijack issues.
Comment #45
fe commentedclicking the submit button brings me on the guestbook page, rather than the profile page. is there a fix? i really would appreciate this feature!!
Comment #46
icecreamyou commentedIs there any chance of this patch getting into a release of the module anytime soon? If not, what needs to be done to get it in?
Comment #47
icecreamyou commentedAlso, how can I get the guestbook to display at the bottom of the user's profile instead of the top without reconstructing my profile page? I know it's possible (somehow) if I create a user_profile.tpl.php but I really don't want to have to go find all the different variables I need to put in it.
Comment #48
millions commentedI use advanced profile with panels. Then you can customize your profile layout easily.
Comment #49
icecreamyou commentedI'll probably do that at some point, but working out all the theming procedures that Advanced Profile requires to make it look good is a little more than I have time for right now.
Comment #50
Muslim guy commentedThe guestbook is sort of PUBLIC
So to achieve like u called `Whisper',
Akin to:
Private message :)
Modified privatemsg.module maybe?
Comment #51
coupet commentedsubscribe
Comment #52
ChristieLuv commentedHi! I tried all of the above with drupal version 5.7 but they seem to not be working. I'd like to try moonrays's patch but I don't have the capabilities to make patches. Can someone be so kind to attach the already patched file or is it even compatible with 5.7? I think an official release for 5.x would help so many people out. This is a feature a lot of people would want, a myspace style comment area. Thank you!
Comment #53
ChristieLuv commentedYay! I got it to work with the code hade posted! I just needed to adjust some of my configurations. Thank you so much! My visitor profiles will be so much more fun now!
Comment #54
carl ditzler commentedDoes someone have a fix to display guestbook within (not replace) user profiles for Drupal 6.x?
Comment #55
atuyo60 commentedquam, isn't the guestbook already presented as a tab in the user page?
Comment #56
alexmoreno commentedis it possible to define the redirect url as #6 asked?
im using a user profile very optimized and i dont want to show the original template for the module
thanks in advance.
Comment #57
bflora commentedThat looks like an easy hack. On line 519 of Guestbook 5.x.1.1 change
return 'guestbook/'. $uid;
to
return 'user/'. $uid;
seems to be working for me.
Comment #58
icecreamyou commentedDo that also on line 581 and 620 for commenting and deletion to redirect to the profile page.
Comment #59
drupaloSa commentedFor Drupal 6 use this code in user-profile.tpl.php file:
Comment #60
metazoid commentedIn your code reloading the entire $account variable causes some pretty serious conflicts with other modules such as activity which thinks you've updated your profile every time you reload the page. Conversely if you use $account->uid to indicate a persons individual profile it gives a page no found error embedded into your user profile.
Comment #61
childfreecommunity_com commentedFor Drupal 6.9 none of this worked...but here's what did...
I do a direct call to the function in guestbook.module that creates the guestbook page. Paste this code into your user-profile.tpl.php:
It works beautifully and returns the user back to the profile page after posting. Anyone see any security or other issues with this?
Comment #62
samwich commentedI'm using Drupal 6.10 and guestbook 6.x-1.1 and couldn't get the above snippets to work,
I tried pasting the snippets into user-profile.tpl.php and my local site rendered a blank page. Ideally I would like to be able to paste this into my page-users.tpl.php page.
is there any chance someone could look into this?
Comment #63
jjesus commentedThis code works in user-profile.tpl.php for Drupal 6.8 guestbook-6.x-1.1 :
Comment #64
andrenoronha commentedhow can I create a link to the user's guestbook in a custom block?
Comment #65
andrenoronha commentedi arranged that.
now, how can I add the number of new guestbook entries beside this link?
Comment #66
sumitk commentedto add guestbook block in profiles add this custom code
Copy paste this code in "Add custom content" with type php as filter
Comment #67
Thoor commentedThis code in #66 works fine for me. But only when the guestbook is activated in the user profile.
If not activated by the user in its profile, the profile-page is not shown correctly, with using the code.
Because of my PHP Lack, i am not able to inclue another "IF" for checking the activated Guestbook in Profile ...
Comment #68
andrenoronha commented@ THOOR
you can:
note:
0 => guestbook activated
1 => guestbook not activated
i dont know why it's not the opposite...
Comment #69
icecreamyou commentedTo clarify,
However, the Facebook-style Statuses module may be a better solution if you want to allow users to post messages on others' profiles, since it's designed to do that by default.
Comment #70
Thoor commentedThx al lot for your help!
works like charme!
Thomas
Comment #71
Sinan Erdem commentedIt works nicely... So I dont need a tab for the guestbook on users profile. Is there a way to remove it? (Other tnah using CSS)
Thanks,
Sinan
Comment #72
halloffame commentedGuys, all codes above lead you to the actual guestbook page after hitting the send button. What I want is that the user stays on the user profile page after submitting the guestbook entry. Any advice? Thanks.
Comment #73
andrenoronha commentedyou can put a "?destination=user/[uid]" in the url of the link to the guestbook
Comment #74
Drupalskie commented@ a.luiz.n
Where do i do that?
Greetings from Germany
Comment #75
andrenoronha commented@Drupalskie
look for the function guestbook_entry in the guestbook module and implement it in your template.php file as yourtheme_guestbook_entry
Comment #76
dmf7 commentedI'm really confused now after reading all of this. I don't know much about php but can't figure things out.
I installed the Guestbook module and I need it to display on my user profile pages. After a user posts a comment, i want it to stay on the profile page.
What code is the final working code for this and where does it need to be placed? Please help. if we alter one of the original files, will it get screwed up during an update?
Thanks,
Comment #77
frenk commentedYes I'm confused to.
The code of IceCreamYou is working good, but it would be better to stay on the profile page after posting a guestbook entry.
How can I accomplish that?
Comment #78
frenk commentedGot it!
To get the guestbook on profile pages use this code of IceCreamYou in panels:
Then, to let posters stay on the profile page when posting a guestbook entry change the following code in guestbook.module:
Line 900
Change:
return 'user/'. $uid .'/guestbook';
In to:
return 'user/'. $uid .'';
Comment #79
quiptime commentedAn new possibility exists to add the guestbook to the user profile (Content profile). You can use the Guestbook Views module to create an guestbook view and insert the view with Panels to the user profile.
Comment #80
dmf7 commentedI downloaded guestbook views and am getting this error message after I add it to my user profile pane (when viewing user profiles).
user warning: Unknown column 'users.uid' in 'field list' query: SELECT guestbook.recipient AS recipient, users.uid AS users_uid, guestbook.author AS guestbook_author, guestbook.anonname AS guestbook_anonname, guestbook.message AS guestbook_message, guestbook.comment AS guestbook_comment, guestbook.commentauthor AS guestbook_commentauthor, (SELECT u.name AS commentauthor_name FROM users u WHERE u.uid = guestbook.commentauthor) AS guestbook_commentauthor_name, (SELECT u.name AS author_name FROM users u WHERE u.uid = guestbook.author) AS guestbook_entry_author_name, guestbook.created AS guestbook_created, ((SELECT LOCATE('guestbook_status";s:1:"1', u.data) FROM users u WHERE u.uid = users.uid) > 0) AS guestbook_status FROM guestbook guestbook WHERE (SELECT LOCATE('guestbook_status";s:1:"1', u.data) FROM users u WHERE u.uid = users.uid) > 0 LIMIT 0, 10 in /home/***/public_html/***/modules/views/includes/view.inc on line 771.
Does anyone know why I'm getting this message and how to fix it. Right now, the guestbook isnt displaying in the profile due to this error.
Comment #81
parasolx commented#69 solve my problem. so it list out all the guestbook belongs to user.
nice code.