Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Module ExpirationModule Expiration
Previous
 
Next
New Post
1/8/2010 7:35 PM
 

Hi,

im a massive fan of DotNetNuke and web design in general which has led to me picking up programming languages and really start getting into coding. I like to code in C# as i found this strangely easier to pick up rather than VB.

I have developed a simple module that when a user clicks the button, it inserts the current date into the EndDate cell of the modules table for that particular module. This module will be used to display instructions for a certain tab and once the user is familiar with that tab they can remove the instructions by clicking the button.

The problem is that when a user clicks the button, it does insert the data but the module wont "expire" until either i restart the application, add a new module, or or when the server clock changes to the next date. As you can tell none of these are ideal for my problem.

Is there a event trigger or method i could use to add to my button_click call that can refresh / expire the module instantly? other wise i have to add a label to the program informing my members that there module will be removed "within 24 hours" which is not ideal.

thanks

 
New Post
1/9/2010 9:47 AM
 

After setting the end date to a date one day prior to the current date I would try calling:

Entities.Modules.ModuleController.SynchronizeModule(ModuleId)

then redirect to the same tab.

I see a serious logic problem in your solution. Setting the EndDate of the module will cause it to be hidden from ALL users, not just the one who clicks the button. Instead of applying this approach, I would either save the hide module flag (for unauthenticated users) in a persistant cookie in the user's browser or (for authenticated users) as a user personalization setting. Michael Washington has a tutorial on this latter approach here: http://www.adefwebserver.com/DotNetNukeHELP/Personalization/


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/10/2010 12:22 PM
 

Hi Bill,

I tried the Entities.Modules.ModuleController.SynchroniseModule() method but had no luck. Is there any other call that i could make?

 

THanks

 
New Post
1/10/2010 8:08 PM
 

Although I do not recommend your approach of hiding the module by setting the module's expiration date, the following code should work in your "Hide Module" button:

Protected Sub btnHideModule_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHideModule.Click
   ModuleConfiguration.EndDate = DateTime.Now
   Dim mc As New ModuleController
   mc.UpdateModule(ModuleConfiguration)
   ModuleController.SynchronizeModule(ModuleId)
   Response.Redirect(NavigateURL(TabId), True)
End Sub

Note also that the module will still be visible (with red outline) to administrators and superusers.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Module ExpirationModule Expiration


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