SunBlogNuke Team Blog

Share you with any news or development process about our dnn modules, such as status or release notes.

First time here? You may want to check out the blog archives, subscribe to the RSS feed, sign up for free email updates, or follow me on Twitter. Thanks for visiting!

Fighting DNN Bugs Ⅲ: Why Non-Administration Users Logged Out

Why Non-Administration Users Logged Out

Currently we are fixing a really weird issue that only happens with non-administration users.

When the user logs in and accesses one page, they are logged out of the system. The page finishes loading as if they were logged in, but once they try any other actions, such as clicking any module section menu (including refreshing the browser page) they are considered not logged in and presented with a login prompt.

After looking it into for a while, we found that this always seems to happen when this module requests my custom ashx web call, which was killing dnn authentication cookies and logging out non-administrator users. Later we made some search about reasonable solution – fortunately we found the helpful post exactly with the same issue -  Why is DNN killing my authentication cookies when I access an ashx from a child portal?

As the answer mentioned below:

This occurs because the user is only defined in the child portal, but the request to the ASHX occurs (from DNN's perspective) in the parent portal. When DNN receives the request, it sees that you've "switched portals," no longer have a valid identity, and removes your authentication information. This doesn't occur for super users because they do have a valid identity across both portals.

To fix this issue, you need to add a querystring parameter to your request with the portal ID. This let's DNN disambiguate the request and keep your authentication intact.

For example, the coding of our case will be modified as follow:

var path = PortalSettings.HomeDirectory + objFile.Folder + objFile.FileName;
var resizedUrl = string.Format("~/desktopmodules/my_module_name/imagehandler.ashx?portalid={0}&path={1}", 
                                PortalSettings.PortalId, path);

return ResolveUrl(resizedUrl);

Free & Customizable DNN Blog Widget – Photo Viewer Gallery

Today our team released a new optional widget (named 'Photo Viewer Widget') for Ultimate DNN Blog Module – #SunBlogNuke. If you are the client of our module and finding some similar stuffs, that is yours and feel free to get it from widget page (Required Login). It is free, customizable image gallery. It allows you to display the thumbnail of your blog posts on any dnn website in a professional and intuitive way.  Take a look at the screenshot below:

showcase gallery

The customizable image viewing widget is based on popular and awesome component – SimpleViewer. Initially the widget was inspired by our showcase gallery and we would like to provide the alternative way to present those excellent websites with their thumbnails.

Then we made some searches in Google and finally got that SimpleViewer is what we want. It is so lightweight and easy to use, it features smart preloading, a resizable interface, thumbnail menu and optional description text. The only thing is that we need to load gallery xml data from our showcase gallery. That should be so easy. Then I took 2 hours to program it with retrieving all the target posts with their thumbnails and provide some basic options for customizing the personation of flash component .

All look great. Please visit the case-studies page to see how it actions.

Note that its minimal required environment is DNN v5.x and SunBlogNuke v4.2.5 and  it is not core widget so we may not support all the possible issues. You can extend it as you want due to the available source code, such as category select support.

Also feel free to leave your thoughts and suggestions here if you indeed would like to let us make it more awesome and we may enhance it for you. In the latest version we will integrated it with Flickr Gallery. That will make it look more awesome.

5 Killer Features You Should Know on SunBlogNuke

As our popular blogging module #SunBlogNuke applied in more and more websites, it may fit most user sceneries for clients but actually some awesome features also hidden in the background. Today we would like to share you 5 killer features you should be interested in. Let us get started the investigation now.

Read the rest of entry »

How to Migrate DNN Module Settings

If you are a customized DNN developer, in common you way utilize the built-in module settings with inheriting the base class "ModuleSettingsBase".  You should be careful with your use of the two types of settings that can be associated with an instance of a custom module - there are Module settings and Tab-Module settings. As Chris Cant shared in his post [DNN module and tab-module settings]:

The Module settings are associated with all instances of a module on several pages, while the Tab-Modulesettings are only associated with one instance (on a single page).

 

When you copy a module instance to a new page with Add Existing Module, only the Module settings are available on the new page. So, if you want settings to be available after a module has been copied, then use Module settings, not Tab-Module settings.

 

When a module's content is exported using Export Content, the module controller is called with the ModuleId only (i.e. without the TabModuleId). This only provides easy access to the Module settings.

So when you are developing your DNN modules, the specific requirements will decide what you want to utilize. Now I would like to share some sample coding about how to migration DNN module settings based these discussed above. Yep, at first your module controller must implement IPortable interface of DNN framework and then you must implement two methods "public string ExportModule(int moduleID)" and "public void ImportModule(int moduleID, string content, string version, int userId)":

The coding to export your module settings:

var objModuleController = new ModuleController();
var objSettings = objModuleController.GetModuleSettings(moduleID);
var settingsElem = new XElement("settings");
foreach (var key in objSettings.Keys)
{
    var item = new XElement("setting");
    var keyElem = new XElement("key", key);
    var valueElem = new XElement("value", objSettings[key].ToString());
    item.Add(keyElem);
    item.Add(valueElem);

    settingsElem.Add(item);
}

XElement root = new XElement("Root");
root.Add(settingsElem);

return root.ToString();

The coding to import external module settings:

XElement xSettings = xRoot.Element("settings");
var objModuleController = new ModuleController();
foreach (var xField in xSettings.Elements())
{
    objModuleController.UpdateModuleSetting(moduleID, xField.Element("key").Value, xField.Element("value").Value);
}

If you have better solution or any question please feel free to share with us in the comments.

Fighting DNN Bugs Ⅱ: Why Can't Remove Google Analytics

Well, let us get started to fight DNN Bugs again. This is the second post we discussed about DNN bugs and share workarounds with you. The first post is Fighting DNN Bugs: All Handlers Not Work, which you also are interested in reading.

Why Can't Remove Google AnalyticsIt is so tired and uninteresting process but we we have to deal with them for our websites or clients if they requested. DotNetNuke is indeed the most excellent/great CMS at the first look but when going ahead, there are lots of issues/bugs to challenge your ability and patience. One of our client ever complained that there were lots of error filled in the event logs of their websites, and mainly indicated that "Object reference not set to an instance of an object". You look, so little information is not enough to investigate those issues and identify the problem that we can do nothing excerpt clearing the event logs to make us feel happy for a while. Yes, the community version is free however that is the big price when issues occurred. Some times we can look for helps in the silent forum but most times we have to fix them ourselves.

More frustrating things are that some bugs exists cross two major versions,  such as DNN6-DNN7 and still not fixed now even though they are created into issue tracker.  Well, if they are ignored with the official guys, let us check them out and address some workaround to fix them forever or temporarily.

Today we would like to share the bug is about Google Analytics Tracking. From DNN v6.0, the core package included the built-in module for Google Analytics Tracking. It looks indeed an awesome thing for us because we don’t have to trick these coding in the skin from the scratch. However, sarcastically one day we would like to disable the Google Analytics with some reasons, DNN only said NO WAY :(

How to reproduce this bug:

  1. Go to Admin/Google Analytics page.
  2. Fill in any value into the tracking ID field
  3. Click to update and make it active. Everything looks nice :)
  4. Again when I filled the empty value for tracking ID and hope that it should be inactive, the simple form just said that the field is required and can’t be empty. 
  5. Try to update, failure, update, failure… Nothing can’t be done any more and Google Analytics tracking coding always showed in every page.

How to fix it

Currently there seem to be some workarounds as follows:

1) Go to your site's root folder and find the siteanalytics.config file, COMMENT OUT or DELETE everything inside the CDATA tag.

2) Analytics settings are stored in file GoogleAnalytics.config, residing in portal root directory, such as portals/x/subdir(x is the portal id). Deleting the file will erase your settings.

3) Go to the folder $ROOT/DesktopModules/Admin/Analytics and find the GoogleAnalyticsSettings.ascx file. COMMENT OUT or DELETE the RequiredFieldValidator.

The 3) way is the one what I recommend and will fix all the issues – you don’t have to check out all the portals but the disadvantage is to be overwritten in the next upgrade. As the point of DNN module developer, it is meaningless to make this tracking id mandatory.

If you have any question or thoughts about this topic, please feel free share it in the comment. Thanks.

Resources links discussed the same issue above:

Can't Remove Google Analytics Tracking

Removing Google Analytics from your DNN site

Other issues addressed about DNN7 you may interested in:

After upgrading to DNN 7.1.2 Site Settings doesn't work

After upgrading to DNN 7.1 OpenSearch and DNN Preview Search doesn't work

Change the Space character in Advanced URLs with DNN 7.1

Customized DNN Forum Project Launched

After the acquisition of Active Modules by DNN (formerly DotNetNuke) Corp, the position of original Forum module had been replaced by the Active Forums Module and the status of development looks stopping currently. No any updates or activity – in my opinion, it will be dead in the end later. Unfortunately, some our websites are still building by DNN Forum Module and we don’t want to switch it to Active Forums Module because its features are enough for us and changing will be a potential risk with time or more works.

Actually it may be a great opportunity to get started a totally new/customized project for DNN Forum. We just want to make it live always and are able to add new features or enhance some pending issues. Well, let us get ahead. We will launch the customized forum project in GitHub(DNN Core Framework had been moved to GitHub, as share in this post DNN Nightly Builds) and it will be Open Source Project always there.

Highlights in the initially building:

  • Added new theme called "FlatBlue" and made it as default theme.
  • Removed multiple post view and only thread detail view without paging.
  • Supported quick reply with Markdown format,
  • Clean UI/coding optimization, such as removing unnecessary table/tr/td tags.
  • Supported relative time to make it look friendly.
  • Fixed avatar issue when current user without any specific profile avatar - never upload it.
  • Fixed issue where meta description with line or whitespace.

You can take a look at how it action here – Forum Community for SunBlogNuke.

All right, if you want to have any thoughts about this topics, such as advices about this behavior, sponsor us with buying coffee for us, please feel free to let us know. Thanks a lot.

What is DNN Forum Project?

DotNetNuke® Forum is a full featured module used for managing forums and email notification of posts on your DNN site.

DotNetNuke® Forum in CodePlex

Ever Official website of DotNetNuke Forum Project

Extended Entries Support for SunBlogNuke

After integration SunBlogNuke with Window Live Writer, you may wonder where to find or what to replace the excerpt field in the built-in edit post panel. There is one elegant workaround – using the <!--more--> tag to mark the end of the excerpt. Fortunately, there is a setting property called "supportsExtendedEntries" in the wlwmanifest.xml depending on the feature. Please note that setting this value to true will allow the <!--more--> tag in your Window Live Writer

What you need to accomplish is placing your cursor where you want the “Read More” tag and selecting “Split Post” from the “Format” menu. Then the collection page and simple entry partial will be modified to have a "Read More" link whenever there is extended content. Have  a look at the screenshot as follows:

extended-content

Also you can see the more features integrated with WLW, for example, keyword, category and slug etc. :)

Why Mega Menu Not Work in DNN6

Yesterday I encountered one strange behavior on DNN 6.2.9 -   DNN Mega menu dropdown is only visible to work when I login with admin/host account but the registered users doesn't see it. In the first looks, it should be caused by some jQuery plugin not registered correctly. After investigation a while, we found that the jQuery hoverIntent is the problem and we have to manually register it in our skin in default. Some code snippets below looks helpful:

 <script runat="server">
    protected override void OnInit(EventArgs e)
    {
      DotNetNuke.Framework.jQuery.RequestRegistration();
      
      if(!Request.IsAuthenticated)
      {
         var scriptPath = ResolveUrl("~/Resources/Shared/Scripts/jquery/jquery.hoverIntent.min.js");
         //for mega menu we need to register hoverIntent plugin, but avoid duplicate registrations 
         Page.ClientScript.RegisterClientScriptInclude("hoverintent", scriptPath); 
      }
      
      base.OnInit(e);
    }
 </script>

However, there is an elegant workaround to fix this issue – the core jQuery skin object is your better choice. 

<%@ Register TagPrefix="dnn" TagName="JQUERY" Src="~/Admin/Skins/jQuery.ascx" %>
<dnn:JQUERY ID="dnnjQuery" jQueryHoverIntent="true" runat="server" />

The following properties for the skin object can be set to True/False (False by default):

  • DnnjQueryPlugins - If true, the dnn plugins used for panels and tabs will be loaded in addition to jQuery and jQueryUI.
  • jQueryHoverIntent - If true, the HoverIntent script used for tooltips will be loaded in addition to jQuery.
  • jQueryUI - If true, jQueryUI will be loaded in addition to jQuery.

Resources links:

Reusable DotNetNuke jQuery Plugins

http://www.dnnsoftware.com/wiki/Page/jQuery

Fighting DNN Bugs: All Handlers Not Work

Fighting DNN Bugs: All Handlers Not Work

As you know, currently DNN is growing bigger than what you expected and the latest version is 7.2 building with lots of awesome features. However, in my opinion, we encountered more and more problems in the same time – tons of versions with tons of existing bugs to be fixed. More frustrating things are that some bugs exists cross DNN4-DNN7 and still not fixed now even though they are created into issue tracker.  Well, if they are ignored with the official guys, let us check them out and address some workaround to fix them forever or temporarily. Today we get started to build a series of posts and share how we fighting DNN bugs these years :(

Read the rest of entry »

Schedule DNN Posts Ahead of Time in SunBlogNuke

Have you ever seen a blogger mention how important it is to schedule posts ahead? You know that there is a certain time in a day when each site gets its most amount of users or maybe you are going for a one week vacation, but you don’t want to abandon your blog. How do you fix these problems? Now it is generally a good idea to have a few posts scheduled ahead in case those things come up. If you are a SunBlogNuke user, you might not know that you have the ability to schedule posts ahead. It is actually quite easy! In addition to scheduling posts ahead, you can use old dates if you want your post to be dated sometime in the past.

Here is how to schedule your posts to be published at a different time and/or date:

  1. Begin to write your post via edit post panel or WLW client tool. scheduling-post
  2. Go to where it says PublishDate on the bottom of the Options section and adjust the time/date to reflect when you would like your post to be published. You will want to verify that your blog’s time is set up correctly to ensure the post appears when you want it to.
  3. Click "Save & Publish" action button to publish the post.
  4. The post will now appear in the Manage posts panel, but will not show on your site until the designated date/time. Yes, if you configure it into the past, it will post right away and show the designated date/time.

This is a useful way to keep a few posts saved for a rainy day or to keep content showing up if an illness puts you out of commission for a while. You can also experiment with posting times to see what works best for you and your readers. It is more important for SEO if there exists scheduled posts in your website. Google love website and blog with continuous post and updates. If you are posting more then 8 post a day and then for the next few days no post, You are actually hurting your website authority and page rank. With scheduling you can keep your blog running and your blog will never run out of the post. Maybe you should know the fact that Schedule your Posts for the Best Success.

Good luck and happy writing.

The SunBlogNuke team

Copyright © 2009-2020 Ultimate DNN Blog Module - SunBlogNuke Powered by SunBlogNuke Corp