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: 6 - 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
Author: Christina Gustavsson
Posted: Jul 19 2009 - 08:21 AM
Subject: re: Do not show 'User name who posted' - automatically use FE user instead
I have the WEC discussion set up as a Blog, so that every fe_user could have their own blog. I thought of having the user name = category so that each individuals posts would be linked together. But this does not happen automatically & the individual must remember to set their category at the time of posting. It becomes troublesome with tens of thousands of fe_users

Isn't there an easier way to accomplish this? I thought that I could store the new fields "blog_name" and "blog_id" in the table "fe_users" and retrieve them each time a new post is created. That way they would be free to change their "Blog Name" and when they create the new posts the correct information would be entered into the post form as hidden variables. I am new to typo3, and a bit unsure how to accomplish this task. Would appreciate some advice...

Thank you!

-Christina
Author: Dave Slayback
Posted: Jul 20 2009 - 01:35 PM
Subject: re: Do not show 'User name who posted' - automatically use FE user instead
Hi Christina,

This would be a nice feature. You can do it as you have, but probably the better way to do it is have a blog_list db table and then store the fe_users, name of blog, and the blog id. You could add some configuration settings here too. Then you would have to write some code to access them so that on their "My Blog" page, it retrieves the blog for their user id. And then write a simple update form to change their blog name and possibly make some configuration for it. You would also have to take into account security issues so that only the given fe_user could edit their blog.

Sounds like a great idea. If you need help, let me know. If you do write the code, I would consider adding it to the WEC Discussion Forum.

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