CornerPixel Blog RSS 2.0

# Monday, November 02, 2009

Today I was doing a database backup for a DotNetNuke website.  When I did the backup, I was amazed at how big the database was.

I tried to shrink it, and it didn’t work.

The next thing I did was Googled it, and found a little help in pointing me to what the issue was.  A couple posts in the DotNetNuke forums had commented on big events logs, so I checked mine out.

581MB!!!

Okay now how to clear this?  I couldn’t even view them via the website when logged in as “host”.

I cleared them by doing the following steps.

  1. Log into your website as a "host user"
  2. Go to Host > SQL
  3. Run the script below

    Truncate table eventlog
  4. Logged into my SQL server and Shrunk the database
  5. All my issues were solved!!

This seems like an easy no brainer, but I hope it helps people out there with there DNN databases.

Oh and one other helpful hint:  Set your db’s “Recovery Model” to be simple in the options, if you backup your database on a regular basis.  This will keep your db from getting too big also.

Monday, November 02, 2009 2:43:45 AM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

CMS | DotNetNuke | SQL

# Monday, September 14, 2009

I ran into this while working on a customer’s new DNN site.  The install went well and I thought all was good.

Usually my first thing I do is delete the DotNetNuke stuff off the home page and then I go to the admin site settings and disable the inline editing.

When I chose to update settings on the admin settings page I got the following error.

DNN Cannot insert the value NULL into column 'DefaultLanguage'

The first thing I did was to check the admin settings page for a Language setting and sure enough under “Advanced Settings” and “Other Settings” there is a default language pull down menu.  I noticed that I couldn’t fill it in, because the pull down menu was blank.

So my next step was Google.  (Yah, I know I need to use Bing more often now)  I quickly found what I needed and this is what it boiled down to.

Within DNN

  1. Go to the Admin/Languages page
  2. Click on the Edit Languages link in the upper left corner of the module
  3. Select a language from the Dropdown list.
  4. Check the enabled checkbox
  5. Click the update button.

I got this information from the bottom of a bug fix page. And I got the bug fix page from my trusted DNNCreative websites forums.

I always like it when it is a quick and easy fix.  Go DotNetNuke!

Monday, September 14, 2009 2:29:21 AM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

CMS | DotNetNuke

# Wednesday, September 09, 2009

Today I was trying to change how the Table of Contents drop down menu worked in MindTouch Core.

The drop down menu is dynamically created as a list of headers on the page.  For example if your page has an h1 header of Hello and an h2 header of You, the drop down menu would be.
1. Hello
    1.1 You

mindtouch-toc

As you see above, “Hello” and “You” are both links to their respective header on the page.

This is great for wiki's, but for the intranet site I am working on, we are using the headers manly for design this could be a problem.  For example, it is not uncommon to have an h2 of “Hello” and an h5 of “You” because the odd numbered headers I have styled with a yellow background, but I still want it to appear under the h2 in the Table of Contents. 

So in the above example the TOC will display like this.
1. Hello               <--h2
    1.1.1 You        <--h5

This is confusing for my users so I wanted this.
Hello
    You

Notice that it is still a list, but there is no number structure.

I looked at the markup via Firebug (in Firefox) and found that this should be easy.  The numbers I wanted to remove where in a span.  (i.e. <span>1.1</span> and the span was in a <li> inside of div with a class of pageToc.

Figuring this would be easy, I just added this to CSS.

.pageToc li {
    display: none;
    }

After adding this to the CSS it worked GREAT in Firefox, but not so well in IE 7/8.  The numbers were gone, but there was still a big space where the span used to be.  At first I thought that the span just some how wasn't going away, so I tried all sorts of CSS with NO luck.

mindtouch-toc-firefox
Above is the TOC without the numbers viewed in Firefox

MindTouch TOC in IE 8 and IE 7
Above is the TOC without the numbers viewed in IE7/8

After a lot of frustration I actually looked at the source and noticed that the markup had a space before the anchor links (i.e. Hello and You) I am not sure why MindTouch did this and it might just be a bug or something they overlooked.

MindTouch TOC markup via viewing source

I had to look at the source because I could not tell viewing the markup via Firebug (in Firefox) that the spaces were there.

MindTouch TOC markup as viewed in Firebug of Firefox

However when I viewed the webpage with Internet Explorer’s Developer Toolbar and I could see them a little better.  As you can see below you can see the Text – Empty Text Node.  The problem with Developer Toolbar is that it doesn’t display closing tags, so I didn’t catch this right away.

mindtouch-toc-markup-ie

After all that troubleshooting I was happy to know at least what the issue was.  Now I just need to add some jQuery to remove those blank spaces.  Below is the jQuery I have come up on page load.

$(document).ready(function(){
            // Used to replace the spaces in the TOC menu before the anchor links
            $(".pageToc li").each (  function ( i , val  )
            {
                $(val).html($(val).html().replace(/\s<a/ig, "<a"));
            });
        });

I had to use Regular Expression to replace only in front of the anchor.  I created another post to go a little further into JavaScript's Regex Syntax.

After I added this jQuerry script all was good and now I had the following TOC display. 

mindtouch-toc-firefox

I know this isn’t a common thing to do, but it works well for my customer’s intranet site, and the way they use the headers in content more as display elements than hierarchy elements.

I hope this helps anyone in the same boat.

Wednesday, September 09, 2009 3:07:26 PM (Pacific Standard Time, UTC-08:00)

#       Comments [1] - Trackback

Deki Wiki | jQuery | MindTouch

# Friday, September 04, 2009

In JavaScript, a regular expression is written in the form of /pattern/modifiers where "pattern" is the regular expression itself, and "modifiers" are a series of characters indicating various options. The "modifiers" part is optional.

    * /g enables "global" matching. When using the replace() method, specify this modifier to replace all matches, rather than only the first one.
    * /i makes the regex match case insensitive.
    * /m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.

You can combine multiple modifiers by stringing them together as in /regex/gim.

Since forward slashes delimit the regular expression, any forward slashes that appear in the regex need to be escaped. For example, the regex 1/2 is written as /1\/2/ in JavaScript.

As with anything, you can find much more information about JavaScript on the web if you Google or Bing it. 

Friday, September 04, 2009 2:30:01 PM (Pacific Standard Time, UTC-08:00)

#       Comments [0] - Trackback

Code | JavaScript | jQuery

Archive

<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Email Subscription

Sign up to get the CornerPixel Blog delivered to your email.

About the Author

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In

Statistics

Total Posts: 52
This Year: 3
This Month: 0
This Week: 0
Comments: 28