Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Ministry Tools > Discussion Forum Extension > Do not show 'User name who posted' - automatically use FE user instead
Total Posts: 4 - Pages (1): [1]
Author: koala beer
Posted: Aug 24 2008 - 09:44 AM
Subject: Do not show 'User name who posted' - automatically use FE user instead
Hi,

After being helped getting rid of a very annoying bug, i'm currently configuring the forum. Everything is very easy to change. But i still have a question. I only want FE users to be able to post. No problem so far...

But here comes my question. I do not want to show the 'User Name Who Posted' field in the post form, as this is still editable by the user. The user can still fill in another name in the form and post under many different names. Can this be changed? I.e. i want to not show the user name field, and display the FE user in the posts automatically instead of Anonymous when this field is not shown.

Kind regards,
Koala
Author: Dave Slayback
Posted: Aug 25 2008 - 10:21 AM
Subject: re: Do not show 'User name who posted' - automatically use FE user instead
Hi Koala,

I can see your point. This might be able to be done by modifying the template (pi1/wecdiscussion.tmpl), so that you take the field in the ###TEMPLATE_POSTFORM### template under ###SHOW_NAME### --- begin. And above that you will see ###HIDDEN_VARS###. Copy this line after ###HIDDEN_VARS###:
<input name="tx_wecdiscussion[name]" type="hidden" size="40" value="###VALUE_NAME###"/>

This should put the username in there, and make it non-editable. You can try it. You will have to save the template (or should save it) in fileadmin/templates (or at a location you want). Then you need to go to the Constant Editor and set the plugin.tx_wecdiscussion_pi1.templateFile = fileadmin/templates/newdiscussion.tmpl or whatever you call the new template.

Then you will have to remove the display field and/or required field in the Flexform "Fields" tab.

I would hope this would work, but if it does not please let me know. I can also look into making this an easier-to-configure option.

-Dave

Author: koala beer
Posted: Aug 26 2008 - 10:31 AM
Subject: re: Do not show 'User name who posted' - automatically use FE user instead
Hi Dave,

I already changed my template, as this was perfectly explained in the documentaion, thanks for explaining again.

I've moved the input field name to the hidden vars and changed the type=text to type=hidden as you proposed, and it works perfectly! No users can post when logged in as FE user and their name is shown in their post, without the username field in the form

Thanks again!

Kind regards,
Koala
Author: Dave Slayback
Posted: Aug 26 2008 - 10:51 AM
Subject: re: Do not show 'User name who posted' - automatically use FE user instead
Hi Koala,

Glad it worked. I plan on allowing this to be an option, and if you have the fields set in display, they will not be editable. So that way you can see the username / name info that will be displayed. Plus, with the configuration option, you will not have to edit any template file.

Thanks for testing this and verifying it works. Let us know if there are any improvements we can make to the extension.

-Dave
Total Posts: 4 - Pages (1): [1]
You must login to post a message to this conference.