How to fill in Comments "user" with customcontent_loginname? [solved]
-
nakuttaja
How to fill in Comments "user" with customcontent_loginname? [solved]
Hi!
How can I fill in the Comments "user"-field with customcontent_loginname? So the user wouldn't have an option to insert it's name but it being filled automatically. I have already made that "Add comment" is only available for logged in users.
Thanks, Nakuttaja
How can I fill in the Comments "user"-field with customcontent_loginname? So the user wouldn't have an option to insert it's name but it being filled automatically. I have already made that "Add comment" is only available for logged in users.
Thanks, Nakuttaja
Last edited by nakuttaja on Wed Jan 03, 2007 12:16 am, edited 1 time in total.
-
nakuttaja
Re: How to fill in Comments "user" with customcontent_loginname?
Sorry to bring this up, but I still haven't find the answer.
Re: How to fill in Comments "user" with customcontent_loginname?
hmm, havent checked the source one bit but I bet you could do it by inserting customcontent_loginname into the comments user field field value parameter and changing it to be type="hidden"
hope this helps
hope this helps
-
nakuttaja
Re: How to fill in Comments "user" with customcontent_loginname?
In Comments Display Template there is just this:tsw wrote: hmm, havent checked the source one bit but I bet you could do it by inserting customcontent_loginname into the comments user field field value parameter and changing it to be type="hidden"
hope this helps
{$yournametxt}
I looked those php-files but I don't really know anything about programming so it just confusing me
-
nakuttaja
Re: How to fill in Comments "user" with customcontent_loginname?
up.
There must be someone who has already made this kind of integration.
There must be someone who has already made this kind of integration.
-
cyberman
Re: How to fill in Comments "user" with customcontent_loginname?
That's only the text field, not the input fieldnakuttaja wrote: In Comments Display Template there is just this:
{$yournametxt}
I'm not a coder for real but have you tried something like this?
Open action.default.php with your favourite editor, go to line 235
Code: Select all
$this->smarty->assign_by_ref('inputyourname', $this->CreateInputText($id, 'author', $author, 50, 255));Code: Select all
$this->smarty->assign_by_ref('inputyourname', $loginname);- Elijah Lofgren
- Power Poster

- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: How to fill in Comments "user" with customcontent_loginname?
I figured out how:nakuttaja wrote: Hi!
How can I fill in the Comments "user"-field with customcontent_loginname? So the user wouldn't have an option to insert it's name but it being filled automatically. I have already made that "Add comment" is only available for logged in users.
Thanks, Nakuttaja
1. Open modules/Comments/action.default.php
2. Find this code:
Code: Select all
$this->smarty->assign_by_ref('inputyourname', $this->CreateInputText($id, 'author', $author, 50, 255));Code: Select all
$module = $this->GetModuleInstance('FrontEndUsers');
$this->smarty->assign_by_ref('inputyourname', $this->CreateInputHidden($id, 'author', $module->LoggedInName(), 50, 255));
5. Replace this:
Code: Select all
<tr>
<td>{$yournametxt}(*):</td>
<td>{$inputyourname}</td>
</tr>
Code: Select all
{$inputyourname}Hope this helps,
Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 
-
nakuttaja
Re: How to fill in Comments "user" with customcontent_loginname?
Thank you so much! I've been fighting with this so long. Now it works just the way I needed.Elijah Lofgren wrote: ...
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: How to fill in Comments "user" with customcontent_loginname? [solved]
I'm pretty sure, though I haven't tried it.... that one could use smarty's {eval var=$whatever assign=inputyourname}..... somehow with this
http://smarty.php.net
http://smarty.php.net
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.
