Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepository"Author" field = free field ???"Author" field = free field ???
Previous
 
Next
New Post
2/4/2007 5:04 PM
 

Hello,

I would like to customize my 'default template' repository. I have already suppressed in the template the 'email'.
Now, I would like to be able to enter my own text in the 'author' field (and not the author name = the user name of the person who upload the file). Is it possible, customisable easily or not ??
Sometimes, it happens that you upload a file for someone else, and you want to put the name of the author manually (I know that I can change it in the database, but for multiple files, this is very heavy). Any advice is welcomed.

DV

 
New Post
2/5/2007 9:41 AM
 

no, sorry, the only way to fix that would require a code change

you would have to make 2 changes and both would be in the form.ascx.vb file...

first, in the CreateInputForm function, find the case statement where the AUTHORNAME and AUTHOREMAIL tags are processed. You'll see code that checks to see if the user is logged in, and if so, it will set the author field to the user's fullname, then make the field disabled so you can't change it. Just comment out the line that set's the textbox's enabled property to false. You should make the same change for the AUTHOREMAIL tag.

If HttpContext.Current.User.Identity.IsAuthenticated Then
  objTextbox.Text = UserInfo.Profile.FullName
  ' objtextbox.Enabled = False
End If

The second change would be in the btnUpload_Click function that saves the data when you click Submit. In the current version, the author name and email are only saved when an item is intially uploaded, not on an edit. So find the code that looks at the AuthorName and AuthorEMail textboxes and change the code to save any new values.

OLD CODE:

' the author field and should only be populated on new uploads, not edits.
' Persist the UserId during edits even if edited by an admin or super user account
Dim AuthorField As TextBox = PlaceHolder.FindControl("__AuthorName")
If Not AuthorField Is Nothing Then
  If objRepository.ItemId = -1 Then
    objRepository.Author = AuthorField.Text.Trim()
  End If
End If

NEW CODE:

' Persist the AuthorName during edits
Dim AuthorField As TextBox = PlaceHolder.FindControl("__AuthorName")
If Not AuthorField Is Nothing Then
    objRepository.Author = AuthorField.Text.Trim()
End If

And again, make the same change for the AuthorEMail field.

Those 2 changes will allow you to edit the AuthorName and EMail address and have those changes saved when you Submit the form.

 
New Post
2/5/2007 9:58 AM
 

GREAT !!! I will test this in the next few days and keep you informed. THANK YOU VERY MUCH for the time taken for the answer and all the details !!

DV FX

 
New Post
2/6/2007 3:59 PM
 

You will find me certainly stupid but... I have not been able to find the file called: form.ascx.vb

WHERE is it ????.... Do I have to do some compilation or something like that ????

DV FX

 
New Post
2/6/2007 4:17 PM
 

IMPORTANT!: The source code is ONLY compatible with .NET 1.1, so you can only make code changes and recompile the source code using Visual Studio 2003. You can install the resulting package on a DotNetNuke 4.X site, but you must make any code changes on a 3.X site and rebuild the package.

PRE-REQS:
- DotNetNuke 3.X working web site
- Visual Studio 2003
- NANT Utility (http://nant.sourceforge.net/)

To make code changes:
1. Download and Install the Repository_3.01.10_Install.zip package
2. Test your local DotNetNuke 3.X web site, and test the Repository module
3. Download and Unzip the Repository_3.01.10_Source.zip package into your /DesktopModules/Repository folder
4. Load the /DesktopModules/Repository/DotNetNuke.Repository.sln solution file in Visual Studio 2003
5. Make your source code changes, compile and test
6. Make a final compile in Release mode
7. Exit Visual Studio 2003
8. run the /DesktopModules/Repository/DotNetNuke.Repository.build file

You will see 2 new packages in the /DesktopModules/Repository/packages folder, one named Repository_3.01.10_Install.zip and Repository_3.01.10_Source.zip

You can now take your recompiled install package, Repository_3.01.10_Install.zip and install it on your DotNetNuke 4.X web site.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepository"Author" field = free field ???"Author" field = free field ???


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out