I have done something like what I think you are describing several times. Back then I used the Razor Host module. Doing it now, I would use 2sxc (sexycontent.docdplex.com).
Basically you want to get a list of users, choose the user you want to spotlight and then get that user's profile. Your module would then use whatever profile properties you plan to use for the display.
Take a look at the home page of www.investedinc.org. You will see a rotating display of people under the "Featured Board Member" heading. This actually creates a list of people and uses a jquery based rotator to change the display. You'll have to figure out how to get the "user of the day", save their userid and use it to generate the display.
One way to do that would be to store the userid in a module setting, and also store the date that user's spotlight will expire. When the module loads, you'd update an expired id, or keep it if it hasn't expired.
Here is the code that generates the display I mentioned:
@using DotNetNuke.Security.Roles
@using DotNetNuke.Entities.Users
@using DotNetNuke.Common.Utilities
@using DotNetNuke.Common
@using DotNetNuke.Entities.Profile
@using DotNetNuke.Entities.Portals
@using System.Web
@{
var users = (new RoleController()).GetUsersByRoleName(Dnn.Portal.PortalId, "Board");
}
<div class="team-rotate">
@foreach (UserInfo user in users)
{
<div class="teammember">
<div class="teamheader ">
<div class="profilephoto">
<img src="@GetProfileUrl(user.Profile)" alt="@GetFormattedProfileProperty(user.Profile, "AltTag", @"{0}")" />
</div>
<div class="organization">
<div class="membername">@user.FirstName @user.LastName</div>
@GetFormattedCityState(user.Profile, "<div class=\"citystate\"> ( {0} )</div>")
<hr>
@Server.HtmlDecode(@GetFormattedProfileProperty(user.Profile, "JobTitle", @"<div class=""jobtitle"">{0}</div>"))
</div>
</div>
@Server.HtmlDecode(@GetFormattedProfileProperty(user.Profile, "BoardBiography", "<div class=\"bio\">{0}</div>"))
<div style="clear:both; height:0px;"></div>
</div>
}
</div>
@functions {
public static string GetProfileUrl(UserProfile profile)
{
string strPhotoURL = Globals.ApplicationPath + "/images/no_avatar.gif";
ProfilePropertyDefinition objProperty = profile.GetProperty("Photo");
if (objProperty != null &&
string.IsNullOrEmpty(objProperty.PropertyValue) == false )
{
DotNetNuke.Services.FileSystem.FileController objFiles = new DotNetNuke.Services.FileSystem.FileController();
DotNetNuke.Services.FileSystem.FileInfo objFile = objFiles.GetFileById(int.Parse(objProperty.PropertyValue), objProperty.PortalId);
// There is a bug in the Photo profile property that stores the host photo
// in the Current Portal and not in the host portal (-1). To overcome this
// bug we just look in the current Portal if we can't find a photo in the Profile Portal
if (objFile == null)
{
objFile = objFiles.GetFileById(int.Parse(objProperty.PropertyValue), objProperty.PortalId);
}
if (objFile != null)
{
PortalInfo objPortal = (new PortalController()).GetPortal(objFile.PortalId);
if (objPortal != null)
{
strPhotoURL = string.Format("{0}/{1}/{2}", Globals.ApplicationPath, objPortal.HomeDirectory, objFile.RelativePath);
}
}
}
return strPhotoURL;
}
public static string GetProfileProperty(UserProfile profile, string propertyName)
{
ProfilePropertyDefinition objProperty = profile.GetProperty(propertyName);
if (objProperty == null || string.IsNullOrEmpty(objProperty.PropertyValue)) return string.Empty;
return objProperty.PropertyValue;
}
public static string GetFormattedProfileProperty(UserProfile profile, string propertyName, string tagformat)
{
string propertyval = GetProfileProperty(profile, propertyName);
if (propertyval != string.Empty)
{
return string.Format(tagformat, @propertyval);
}
return string.Empty;
}
public static string GetFormattedCityState(UserProfile profile, string tagformat)
{
string theCity = GetProfileProperty(profile, "City");
string theState = GetProfileProperty(profile, "Region");
string theString = string.Empty;
if( theCity != string.Empty )
{
theString = theCity;
if( theState != string.Empty )
{
theString += ", " + theState;
}
else theString = theState;
}
if (theString != string.Empty)
{
return string.Format(tagformat, @theString);
}
return string.Empty;
}
}
I stole a lot of this from a blog post written by Joe Brinkman. If you look around on the DNNSoftware.com site, you may be able to find it.
For the DNN API, one of the WROX books (the new DNN 7 version was published last week) might be a good place to start. There is also the "Compiled Help File" that you can download from codeplex.com where you also download DNN.
And ... do look at 2sxc to host the Razor script rather than the plain Razor Host module. It's a much better/more flexible solution.