Hello!
What I would like to know is how to get the logged in user´s name to show up on the Send Comment page instead of the text box where he/she fills in their names. This is because I only want logged in users to send their comments.
Other suggestions are also welcome. Thank You in advance.
UserId and Comments module
Re: UserId and Comments module
Ok...
So now the user name is displayed where I wanted it to show up on the send comment page...
heh... Now, if I only could figure out how to have it shown on the page where you read the comments too, everything would be just fine
Added this
changed this
to this
Right - that´s so far.. 
So now the user name is displayed where I wanted it to show up on the send comment page...
heh... Now, if I only could figure out how to have it shown on the page where you read the comments too, everything would be just fine

Added this
Code: Select all
function DoAction($name, $id, $params, $return_id='')
{
$db = $this->cms->db;
$useridmodule=$this->GetModuleInstance("UserID");
switch ($name)
Code: Select all
<td>Your name:</td><td><?php echo $this->CreateInputText($id, 'author', $author)?></td>
Code: Select all
<td>Your name:</td><td><?php echo $useridmodule->LoggedInName()?></td>

-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: UserId and Comments module
it may be handy if you posted a patch to the forge for inclusion back into the main svn or for others to apply easily.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: UserId and Comments module
Hi Patricia. Yes, you´re right, it wont be saved in the database the way I´ve done it... I appologize if someone thought that it would. I was hoping that some code gury could give me a hint about this, because I certainly don´t know what I´m doing.
Guess I´ll have to try with some more "hacking" when I get the time for it...
Guess I´ll have to try with some more "hacking" when I get the time for it...

-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: UserId and Comments module
no, that won't get saved to the database, as an excercise left for the user,
putting the username from the userid module into the input field, and then marking the input field as read only should do the trick.
putting the username from the userid module into the input field, and then marking the input field as read only should do the trick.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: UserId and Comments module
Yes, I was heading somewhere that way too before... didn´t get it to work though... But I´ll give it another try later. Thanks.