Show Username without having it required

Phoca Guestbook - creating guestbooks in Joomla! CMS
chaintrooper
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Nov 2009, 22:51

Show Username without having it required

Post by chaintrooper »

Hello,

I did some searching in the forum but couldnt find the answer yet. I'm saying this, because I'm quite surprised that nooned had a similar problem. Well, whatever, I need help in this issue:

To get to my guestbook, users must be logged in. I want them to give a title and the content (so both are required), but when the massage is shown, I want the username to be visible. What I desire sounds pretty normal to me, but could not get it to work after I tried all kinds of config combinations.

Thanks in advice! :twisted:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48706
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Show Username without having it required

Post by Jan »

Hi, sorry I don't understand where you want to display the username. It is displayed in the messages:

see:
https://www.phoca.cz/demo/phoca-guestbook-demo

(there only guests can leave message so the guest is displaying, instead of guest the username is displayed there.
Jan
If you find Phoca extensions useful, please support the project
chaintrooper
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Nov 2009, 22:51

Re: Show Username without having it required

Post by chaintrooper »

Hi Jan,

and thanx for the quick answer. Let my try to explain once more. First of all, the area, where my guestbook is, can only be viewes by registered users. Which means, I have no guests, and they have nothing to do with my problem.

Let me make an example: A registered user logs in, clicks to the area, where he can leave massage. He enters a title and a content (but no name). So far so good. What I want now is, when the massage is displayed, I want it to include, this users username, eventhough he has never entered it.

I could solve this problem, by enabling the option "name required", but then it's field he can manipulate and write the name of some other user. I want the massage to show the authors username, without giving him the chance to delete or manipulate this.
chaintrooper
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 Nov 2009, 22:51

Re: Show Username without having it required

Post by chaintrooper »

Come on guys! It can't be that difficult: I just want the guestbook take the name of the registered user automatically, so he can't manipulate it?!?! :x
codejunkie
Phoca Professional
Phoca Professional
Posts: 167
Joined: 11 Apr 2009, 01:30
Contact:

Re: Show Username without having it required

Post by codejunkie »

Edit: A better and similar solution is here. You still need to use the code snippet below.

For clarification only as I do not use this component.

You would like the component to fill in the current user's name for their comments they post. You do not want this field to be editable by the users.

You might try this edit on the /front/views/phocaguestbook/tmpl/default.php file. Find this bit of code at about line 235, assuming you are using the 1.3.2 version of Phoca Guestbook

Code: Select all

<input type="text" name="pgusername" 
Add this afterward. (Make sure to have a space around it.)

Code: Select all

disabled
You probably also need to require user names for this to work. This is not tested.
Download Phoca Download Menu Module for listing Sections or Categories.
Post Reply