By filiptc on
As it sounds. I'd like a section of my profile page to consist of user comments. Sort of for a field 'about [user]'... The comment form for it could be at the bottom of the profile just as normal comment forms would. I had thought of something like:
User Profile
-----------
[......]
About [user]
--comment1
--comment2
[...]
[......]
----------
comment formI am already using a PHPtemplate for a customized profile page, so something in that direction should be easy.
Phil
Comments
One step closer
I have found a way to aproach the issue with the guestbook module and a php snipplet I found on this page.
I added the snipplet right in the middle of the page profile template:
The problem I have now, is that I get the form right underneath the entries. I want it to be at the bottom of the page. I can't seem to find the way to dividing the snipplet... so I guess the guestbook.module just spits the whole thing out as one...
Am I right? Either way, how do I get the form part to display at the bottom?
Phil
Here's what I did
In case anyone wants to do anything similar on the profile node (or any other). I firstly installed the guestbook module and embedded the code above into the place of the phptemplate I wanted the user comments to appear. Then I opened up my guestbook.module in a text editor and removed or edited the parts I did not want to display or wanted to display differently. For instance, I wanted users to be forewarded to the profile node after submitting a comment, so I edited the
'guestbook/'. $uid,under the 'Insert new message' section, and changed it to'user/1',being the profile from user 1. Then, instead of displaying the comment form at the bottom of the page I edited the guestbook preferences to display the form on a different page.The final layout was something like this:
I like that idea!!! Could
I like that idea!!!
Could you tell me how/where i can format the guestbook entries? I would like to get rid of the user picture for example...
Would I have to do this in the guestbook.module or can this be done in the user_profile.tpl.php?
cheers,
kai
Webdesign Melbourne Australia
www.brizk.com
Depends
If you'd like to get rid of the user picture on the user's profile you'd have to edit the user_profile.tpl.php, customizing the fields and removing the
if($user->picture) {print theme('user_picture', $user);}snipplet.Phil
Reset number of unread guestbook entries
Hi filip!
thanks for your help. My member page looks really good now. One more thing I'd like to change though:
I have implemented a message that pops up at the top of the FRONT page and reads
"Welcome member name, there are 5 new entries in your guestbook! Go to your member page..."
I already found the code snippet that I need to display the number of unread messages:
Now usually this number is reset to 0, when this member visits his own guestbook-page.
However, since the guestbook is on the member page itself, this doesn't work in our case. Do you have an idea how I can reset this number when the person visits his member page (rather than the guestbook)?
Cheers,
Kai
Webdesign Melbourne Australia
www.brizk.com
has anyone else an
has anyone else an idea please?
Kai
Webdesign Melbourne Australia
www.brizk.com
Solution
I looked in the module and found this code that records when you visted your guestbook. If you add it to the other guestbook coding in your custom profile page (user_profile.tpl.php), it will mark your guestbook as read whenever you view your profile:
I've tested it, and it works as far as I can tell.
with further testing, it
with further testing, it seems to work too well.
The alert seems to show up only some of the time, and clicking on any page seems to clear it.
Not sure why this would happen...
Hope this helps anyways
hey, thanks for your help.
hey,
thanks for your help. I haven't had a chance to test it, but what do you mean but "the alerts only seem to show up sometimes"? Does it return errors?
Cheers,
Kai
Webdesign Melbourne Australia
www.brizk.com
no, there weren't any errors
no, there weren't any error messsages. I meant the alert that tells you you have new messages didn't show up.
I think it had something to do with the way the $user variable was declared in the custom profile page (if I declared it as global $user, none of the profile fields would show up.)
The best solution I could find was to place the code into a block, and make it conditional so it only runs when you look at your own profile. So far I've found it to work:
In a block? mmh.. I'm
In a block?
mmh.. I'm getting more and more confused.
Is there a final solution for this issue now? If so, what exactly are the steps to achieve it!?
Cheers,
Kai
Webdesign Melbourne Australia
www.brizk.com
As far as I can tell, that
As far as I can tell, that fix works now.
I mean a block, as in a the blocks used for the content of sidebars and the navigation menu. You access it by (yoursite)/admin/blocks. If you create your own a block (admin/blocks/add), and then past the code I gave before (make sure the input type is PHP), then the new comments should be marked as read whenever a user vists their profile page (make sure the new block is enabled).
Hope that helps
worx!
hey it seems to work! thanks a lot!! :-)
Webdesign Melbourne Australia - www.brizk.com
Work Travel Australien - www.ausmag.de
guestbook in a block
I found its hard to make a new template.php file..becoz so many modules link up to it..and its pretty difficult to add each item in a custom template file..
The second issue of putting Guestbook in the profile page is that if the person's guestbook is not enabled..then his/her profile page cannot be viewed...access denied or something like that..
so it would be nice to put the user Guestbook in a block on his/her page....
can someone give the code for this....such that it shows if enabled..else doesnt show.
thanks
My internet voluntary services include
1. Helping answer queries on www.krishna.com
2. Learning & Helping in the Vedic section of www.spiritualnectar.com
3. Helped in some aspects to make www.indiapoised.org
4. Learning & ( Helping newbies) on www.
how can I display a message
how can I display a message when the user guestbook is empty?
like: "you have no message"