UserId and Comments module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
mehepp

UserId and Comments module

Post by mehepp »

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.  
mehepp

Re: UserId and Comments module

Post by mehepp »

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

Code: Select all

	function DoAction($name, $id, $params, $return_id='')
	{
		$db = $this->cms->db;
                $useridmodule=$this->GetModuleInstance("UserID");
		switch ($name)
changed this

Code: Select all

<td>Your name:</td><td><?php echo $this->CreateInputText($id, 'author', $author)?></td>
to this

Code: Select all

<td>Your name:</td><td><?php echo $useridmodule->LoggedInName()?></td>
Right - that´s so far..  ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: UserId and Comments module

Post by calguy1000 »

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.
mehepp

Re: UserId and Comments module

Post by mehepp »

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...  :)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: UserId and Comments module

Post by calguy1000 »

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.
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.
mehepp

Re: UserId and Comments module

Post by mehepp »

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.
Locked

Return to “Modules/Add-Ons”