<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkMHRXo7eCp7ImA9Wx5TE0w.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889</id><updated>2010-07-28T12:47:14.400+03:00</updated><title>DotNetNuke them!</title><subtitle type="html">My blog on DNN development and customization</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dnnuke.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DotnetnukeThem" /><feedburner:info uri="dotnetnukethem" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DU8MSH08fyp7ImA9WxFbEUQ.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-9174549577713034066</id><published>2010-07-04T01:33:00.008+03:00</published><updated>2010-07-04T01:58:09.377+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-04T01:58:09.377+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Extending" /><title>(Not a) tutorial: Creating my first DNN scheduled task</title><content type="html">&lt;p&gt;In this post, I’ll describe my (successful) attempt to create a basic email queue functionality using a custom DNN scheduled task.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Why not a tutorial? Because my intention is to show you what I have done, without telling you that this is the right (or the only) way to do it, or demonstrating this as a techically complete and correct solution. This work is far from finished – it just covers basic functionality and is not usable out of the box. But if you’re struggling with DNN scheduled tasks, reading below may provide you with a way to get started.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I found great help in &lt;a href="http://kemmis.info/blog/archive/2008/03/08/how-to-write-a-custom-dotnetnuke-schedulerclient-i.e.-a-scheduled.aspx" target="_blank"&gt;this excellent post here&lt;/a&gt;, which you should read for more information on creating your own scheduled tasks in DNN. Actually, this article here is a simple application of the tutorial I found in that post. Read it, it’ll be extremely helpful.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Let’s get to the point. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I had the need to notify custom groups of DNN registered users upon submission of some forms created either with the XMOD Pro or the Datasprings Dynamic Forms module. Although both modules support sending emails upon submission, they are restricted to sending emails to specific people, lists, or roles. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I needed something more complex, such as a database query based on several tables, in order to determine who would get the notification. Both modules allow issuing queries to the database upon submission, so it seemed right to create my own email queue, consisting of a database table (the queue) and a scheduled task to send the mails.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;What’s more, a queue can help where there is a bunch of emails to be sent – let’s say you need to send 1k emails upon the next form submission – you don’t have to send them all at once. You just send a dozen each time the scheduled task is ran, until the queue is empty.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Database objects&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So – what did I need first? Of course, a table to hold my queue.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: auto; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [dbo].[DotSee_MailQueue]( &lt;br /&gt;    [MailID] [&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;] &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt;(1,1) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;, &lt;br /&gt;    [FromUser] [nvarchar](500) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;, &lt;br /&gt;    [ToUser] [nvarchar](500) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;, &lt;br /&gt;    [Subject] [nvarchar](500) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;, &lt;br /&gt;    [BodyHtml] [nvarchar](&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;, &lt;br /&gt;&lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [PK_DotSee_MailQueue] &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CLUSTERED&lt;/span&gt; &lt;br /&gt;( &lt;br /&gt;    [MailID] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt; &lt;br /&gt;)&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; (PAD_INDEX  = &lt;span style="color: #0000ff"&gt;OFF&lt;/span&gt;, STATISTICS_NORECOMPUTE  = &lt;span style="color: #0000ff"&gt;OFF&lt;/span&gt;, IGNORE_DUP_KEY = &lt;span style="color: #0000ff"&gt;OFF&lt;/span&gt;, ALLOW_ROW_LOCKS  = &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;, ALLOW_PAGE_LOCKS  = &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;FILLFACTOR&lt;/span&gt; = 80) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt;] &lt;br /&gt;) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt;] &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Yes, it’s a silly table but enough for my basic functionality: From, To, Subject, Body and an id. All the necessary information to send an email.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Then I needed a stored procedure to retrieve information from that table:&lt;/p&gt;&lt;br /&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;br /&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: auto; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [dbo].[DotSee_GetMailQueueItems] &lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;br /&gt;&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt; &lt;br /&gt;&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; NOCOUNT &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Select&lt;/span&gt; &lt;span style="color: #0000ff"&gt;top&lt;/span&gt; 10 [MailID],[FromUser],[ToUser],[Subject],[BodyHtml] &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [dbo].[DotSee_MailQueue] &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Note: I prefix my tables with “DotSee_” since this is the name I have selected for my custom work (namespaces included, as you’ll see below). Don’t give it serious attention, it’s just my convention.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Setting up a project for my scheduled task&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are more than one ways to begin creating a scheduled job for DotNetNuke using Visual Studio, but there is a common denominator: Your job MUST be a DLL file in DotNetNuke’s bin directory. So you can go either with a Web Application Project or with a Class Library. I chose Class Library. Here’s what I did:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Created a new Class Library project. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Added a reference to DotNetNuke.dll from an existing DNN installation (and set Copy Local to false) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Added a reference to Microsoft.ApplicationBlocks.Data from the same DNN installation (in order to be able to use DNN’s own DAL for interacting with the database) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Set the build path INSIDE DNN’s bin folder to save me time copying and recopying the dll. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Went to the project’s properties and deleted the contents of the root namespace field. Yes, it should be empty for your dll to work. Don’t miss that. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_GEekUYeFuZ0/TC-6u3R7LZI/AAAAAAAAAyo/PNFEiBwDFxQ/s1600-h/sche1%5B6%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="sche1" border="0" alt="sche1" src="http://lh5.ggpht.com/_GEekUYeFuZ0/TC-6vyM-a5I/AAAAAAAAAys/ljOc3XFFkKo/sche1_thumb%5B4%5D.jpg?imgmax=800" width="420" height="118" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Regarding (4), I did this work on a virtual machine, where I had a DNN installation and my class library project on the same computer. I suggest you follow some similar approach, since it is very easy to test and debug (you can debug only by attaching to the w3wp.exe process, but it’s better than nothing). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Writing the code&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Two more things you must know: Your custom class must inherit DotNetNuke.Services.Scheduling.SchedulerClient and the only method that is called by DNN’s scheduler is DoWork(). &lt;/p&gt;&lt;br /&gt;&lt;p&gt;So here’s my custom scheduler class:&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; DotNetNuke.Services.Scheduling &lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; DotNetNuke.Services.Exceptions &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System &lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System.Web &lt;br /&gt;&lt;span style="color: #0000ff"&gt;Imports&lt;/span&gt; System.IO &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt; DotSee.DnnScheduledMailNotifier &lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; Mailer &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Inherits&lt;/span&gt; SchedulerClient &lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;' requires a special constructor which &lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;' accepts a ScheduleHistoryItem &lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;( _ &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; objScheduleHistoryItem _ &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; ScheduleHistoryItem) &lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;MyBase&lt;/span&gt;.&lt;span style="color: #0000ff"&gt;New&lt;/span&gt;() &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Me&lt;/span&gt;.ScheduleHistoryItem = objScheduleHistoryItem &lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Overrides&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; DoWork() &lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt; &lt;br /&gt;                &lt;span style="color: #008000"&gt;' perform some tasks &lt;/span&gt;&lt;br /&gt;                MailWorker.DoWork() &lt;br /&gt;&lt;br /&gt;                &lt;span style="color: #008000"&gt;' report success to the scheduler framework &lt;/span&gt;&lt;br /&gt;                ScheduleHistoryItem.Succeeded = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Catch&lt;/span&gt; ex &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Exception &lt;br /&gt;&lt;br /&gt;                ScheduleHistoryItem.Succeeded = &lt;span style="color: #0000ff"&gt;False&lt;/span&gt; &lt;br /&gt;                ScheduleHistoryItem.AddLogNote _ &lt;br /&gt;                    (&lt;span style="color: #006080"&gt;&amp;quot;EXCEPTION&amp;quot;&lt;/span&gt; + ex.ToString()) &lt;br /&gt;                Errored(ex) &lt;br /&gt;                Exceptions.LogException(ex) &lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt; &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Namespace&lt;/span&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Apart from the MailWorker.DoWork() line (code coming right below), the class can be used as a template for writing your own scheduled tasks. (You will use your own namespace, of course). I put my specific code in a different class so that it would be easy to make the distinction between code needed for my specific need and the “template” code that every DNN scheduled task needs.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here’s my MailWorker class (DotNetNuke.dll referenced was version 5.2.1, GetHostSettingsDictionary may not work with 4.x):&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Imports DotNetNuke.Services.Mail&lt;br /&gt;Imports DotNetNuke&lt;br /&gt;Imports DotNetNuke.&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;&lt;br /&gt;Imports DotNetNuke.Entities.&lt;span style="color: #0000ff"&gt;Host&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Namespace DotSee.DnnScheduledMailNotifier&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; MailWorker&lt;br /&gt;&lt;br /&gt;        Private Sub &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; Shared Sub DoWork()&lt;br /&gt;&lt;br /&gt;            Dim d &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Dictionary&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;Of&lt;/span&gt; String, String)&lt;br /&gt;            d = &lt;span style="color: #0000ff"&gt;Host&lt;/span&gt;.GetHostSettingsDictionary()&lt;br /&gt;&lt;br /&gt;            Dim dnp &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; DataProvider&lt;br /&gt;            dnp = DataProvider.Instance&lt;br /&gt;            Dim dr &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; IDataReader&lt;br /&gt;&lt;br /&gt;            Dim ids &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(&lt;span style="color: #0000ff"&gt;Of&lt;/span&gt; Int32)&lt;br /&gt;&lt;br /&gt;            dr = dnp.ExecuteReader( _&lt;br /&gt;                &amp;quot;DotSee_GetMailQueueItems&amp;quot;, Nothing)&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;If&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Not&lt;/span&gt; dr.&lt;span style="color: #0000ff"&gt;Read&lt;/span&gt;() &lt;span style="color: #0000ff"&gt;Then&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;While&lt;/span&gt; dr.&lt;span style="color: #0000ff"&gt;Read&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                Mail.SendMail( _&lt;br /&gt;                    dr(&amp;quot;fromuser&amp;quot;).ToString _&lt;br /&gt;                    , dr(&amp;quot;touser&amp;quot;).ToString _&lt;br /&gt;                    , &amp;quot;&amp;quot; _&lt;br /&gt;                    , dr(&amp;quot;subject&amp;quot;).ToString _&lt;br /&gt;                    , dr(&amp;quot;bodyhtml&amp;quot;).ToString _&lt;br /&gt;                    , &amp;quot;&amp;quot; _&lt;br /&gt;                    , &amp;quot;&amp;quot; _&lt;br /&gt;                    , d(&amp;quot;SMTPServer&amp;quot;) _&lt;br /&gt;                    , d(&amp;quot;SMTPAuthentication&amp;quot;) _&lt;br /&gt;                    , d(&amp;quot;SMTPUsername&amp;quot;) _&lt;br /&gt;                    , d(&amp;quot;SMTPPassword&amp;quot;) _&lt;br /&gt;                    )&lt;br /&gt;&lt;br /&gt;                ids.&lt;span style="color: #0000ff"&gt;Add&lt;/span&gt;(CType(dr(&amp;quot;mailid&amp;quot;), Int32))&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;While&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; id &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; ids&lt;br /&gt;                dnp.ExecuteSQL( _&lt;br /&gt;                    String.Format( _&lt;br /&gt;                        &amp;quot;&lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; DotSee_MailQueue &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; mailid={0}&amp;quot; _&lt;br /&gt;                        , id.ToString))&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Namespace&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;What it actually does (in a brutal way, I should add) is check the table, get 10 items at a time (via the DotSEe_GetMailQueueItems stored procedure defined earlier), send an email for each of the items and then delete the corresponding records from the table. (Ok, I know the way it does it sucks a bit, but It’s only quick and dirty functionality, remember).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So when I compile this beauty, my DotSee.DNNScheduledMailNotifier.dll goes inside DNN’s bin folder, and now what I have to do is tell DNN that this is a scheduled task and that the scheduler should include it. Here’s how:&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Host-Schedule and click “Add Item to Schedule”.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Set friendly name to whatever you want&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Full class name and assembly should be your assembly name and your class name (the class containing the DoWork method) combined, as in AssemblyName.Classname. My Assembly’s name is DotSee.DnnScheduledMailNotifier and my class name is Mailer, so the full name is DotSee.DnnScheduledMailNotifier.Mailer.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the “schedule enabled” checkbox&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Time lapse MUST have some value or else the task will not run at all.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_GEekUYeFuZ0/TC-6w1zPXQI/AAAAAAAAAyw/f6ARhfwKnHY/s1600-h/sche2%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="sche2" border="0" alt="sche2" src="http://lh6.ggpht.com/_GEekUYeFuZ0/TC-6x6uH0zI/AAAAAAAAAy0/pYS-r2N6QLA/sche2_thumb%5B2%5D.jpg?imgmax=800" width="420" height="261" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;That’s it! The task is ready to run. I tested it by manually inserting records into the DotSee_MailQueue table and it worked well, even with hundreds of records, sending 10 emails every 5 seconds. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;So now I have my basic system ready. When I need to send emails to groups of people not defined by roles or other DNN constructs, I just have to write a good SQL query that fills the table with recipients that correspond to the criteria I need every time and presto!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Of course, there’s plenty of room for configuration / parameterization (for example, the number of emails sent each time or the type of email – html or plain text, or even a check for whether delivery was successful). But I guess you got the idea. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Thank you for your time.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-9174549577713034066?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vSwkxSw1phoZnoew-8QHyndBcmo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vSwkxSw1phoZnoew-8QHyndBcmo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vSwkxSw1phoZnoew-8QHyndBcmo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vSwkxSw1phoZnoew-8QHyndBcmo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/Xmef1GSi8KA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/9174549577713034066/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=9174549577713034066" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/9174549577713034066?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/9174549577713034066?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/Xmef1GSi8KA/not-tutorial-creating-my-first-dnn.html" title="(Not a) tutorial: Creating my first DNN scheduled task" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/07/not-tutorial-creating-my-first-dnn.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0INRnYzfCp7ImA9WxFREU4.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-3069686188434631856</id><published>2010-04-24T18:12:00.001+03:00</published><updated>2010-04-24T23:06:37.884+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-24T23:06:37.884+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>ModuleMaster, an admin module that was really missing from DNN</title><content type="html">&lt;p&gt;&lt;a href="http://www.snowcovered.com/Snowcovered2/Default.aspx?tabid=242&amp;amp;PackageID=15592"&gt;ModuleMaster&lt;/a&gt; is what I was looking for (and often considered developing myself). It can link modules – along with their settings – on the pages of your choice. Simple as that, but DNN doesn’t give you this option – you can either mark a module as “displayed in all pages”, in which case you only have linked modules to your original one – meaning that if you change something in one, it’ll change in every linked module, or copy the module by hand and then apply settings by hand (IPortable is not always well-implemented).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This module is a time-saver, especially for sites that have a number of pages already developed (and more especially if you’re using templates to create new pages). &lt;strike&gt;Imagine the scenario where the client asks you to apply a new text/html module, for example, in about 500 pages that you have already created, demanding to be able to edit each one of them independently of the others and needing to use a specific container. Count the DAYS it’ll take you to do it by hand&lt;/strike&gt;. EDIT: Unfortunately, as I realised later, the module just creates “shadow” copies – i.e., links and not new instances, but remains useful whatsoever.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If anybody tries it, please post a comment here. I haven’t tried it yet, but looks very promising and it already has a couple of good reviews on SnowCovered.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-3069686188434631856?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K6u5LjLjT_bUd9UCJkGD_DsBCn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K6u5LjLjT_bUd9UCJkGD_DsBCn4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K6u5LjLjT_bUd9UCJkGD_DsBCn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K6u5LjLjT_bUd9UCJkGD_DsBCn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/3LCrqDn1AJI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/3069686188434631856/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=3069686188434631856" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3069686188434631856?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3069686188434631856?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/3LCrqDn1AJI/modulemaster-admin-module-that-was.html" title="ModuleMaster, an admin module that was really missing from DNN" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/04/modulemaster-admin-module-that-was.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIBSH8yeip7ImA9WxBaFk0.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-6370741039593437400</id><published>2010-03-26T13:39:00.001+02:00</published><updated>2010-03-26T13:39:19.192+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-26T13:39:19.192+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Using page titles instead of names on the DNN breadcrumb skinobject</title><content type="html">&lt;p&gt;Simple, but useful. A fellow developer needed to use the page title (and not the page name which is the default) on the breadcrumb skinobject of his skin. The reason was that his menu had limited real estate so he had to keep names short, but he needed to give more information on the navigation breadcrumb.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The solution is just so simple! In your skin’s .ascx file, you’ll see a definition like the following:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;&amp;lt;dnn:BREADCRUMB runat=&amp;quot;server&amp;quot; id=&amp;quot;dnnBREADCRUMB&amp;quot;&amp;#160; CssClass=&amp;quot;Breadcrumb&amp;quot; RootLevel=&amp;quot;0&amp;quot; Separator=&amp;quot;&amp;amp;nbsp;&amp;gt;&amp;amp;nbsp;&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;If you add the following attribute:&lt;/p&gt;  &lt;p align="left"&gt;UseTitle=&amp;quot;True&amp;quot;&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;You’ll have something like this:&lt;/p&gt;  &lt;p align="left"&gt;&amp;lt;dnn:BREADCRUMB runat=&amp;quot;server&amp;quot; id=&amp;quot;dnnBREADCRUMB&amp;quot;&amp;#160; CssClass=&amp;quot;Breadcrumb&amp;quot; RootLevel=&amp;quot;0&amp;quot; Separator=&amp;quot;&amp;amp;nbsp;&amp;gt;&amp;amp;nbsp;&amp;quot; UseTitle=&amp;quot;True&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;And then your breadcrumb will be using page titles instead of names. &lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Enjoy.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-6370741039593437400?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c9xG0Km1s5CJSgFcKuwCIDi4yIc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c9xG0Km1s5CJSgFcKuwCIDi4yIc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c9xG0Km1s5CJSgFcKuwCIDi4yIc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c9xG0Km1s5CJSgFcKuwCIDi4yIc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/2QsXIgSyGnU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/6370741039593437400/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=6370741039593437400" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/6370741039593437400?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/6370741039593437400?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/2QsXIgSyGnU/using-page-titles-instead-of-names-on.html" title="Using page titles instead of names on the DNN breadcrumb skinobject" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/03/using-page-titles-instead-of-names-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcGQn45fCp7ImA9WxBaFk0.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-1649589656990627943</id><published>2010-03-26T13:13:00.001+02:00</published><updated>2010-03-26T13:13:43.024+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-26T13:13:43.024+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>Quick snippet: Show first n characters of a string without cutting words in half with OWS</title><content type="html">&lt;p&gt;Just a quickie for those of you who use the free &lt;a href="http://www.openwebstudio.com/" target="_blank"&gt;Open Web Studio&lt;/a&gt; DNN RAD environment: I needed to show only the first n characters of a string that I got via a query in OWS, but wanted to “stop” display at the end of a word, (that is, not being very strict on the n character limit). &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If our field is, for example, called “description” and the character limit is, let’s say, 100, and we need to insert three dots (…) after the end of the string if it’s only part of the original, here’s the function (be sure to write it on a single line):&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;{IIF, &amp;quot;[FORMAT,&amp;quot;[description]&amp;quot;, {LENGTH}]&amp;gt;100&amp;quot;, &amp;quot;[FORMAT,&amp;quot;[description]&amp;quot;, {LEFT:[FORMAT,&amp;quot;[FORMAT, &amp;quot;[description]&amp;quot;, {LEFT:100}]&amp;quot;,{LASTINDEXOF: }]}]...&amp;quot;,&amp;quot;[description]&amp;quot;}&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Change the field name, the number of characters and the three dots at the end to whatever suits you.&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Of course there are several ways to achieve that via your SQL query itself, but that’s a quick way to do it in OWS if you can’t modify the query (when you’re using a view that is used somewhere else, for example).&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;Enjoy.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-1649589656990627943?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PxeK6dwcGEzxMrtgMOrZ19_IVAc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PxeK6dwcGEzxMrtgMOrZ19_IVAc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PxeK6dwcGEzxMrtgMOrZ19_IVAc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PxeK6dwcGEzxMrtgMOrZ19_IVAc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/ISTAaqvxa7Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/1649589656990627943/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=1649589656990627943" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1649589656990627943?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1649589656990627943?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/ISTAaqvxa7Y/quick-snippet-show-first-n-characters.html" title="Quick snippet: Show first n characters of a string without cutting words in half with OWS" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/03/quick-snippet-show-first-n-characters.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4ESXs6eSp7ImA9WxBbFkk.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-2816960943703354288</id><published>2010-03-15T10:15:00.001+02:00</published><updated>2010-03-15T10:15:08.511+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-15T10:15:08.511+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>Free search/replace admin module from Engage Software</title><content type="html">&lt;p align="left"&gt;&lt;a href="http://www.engagesoftware.com/Products/Modules/Engage_F3.aspx" target="_blank"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="f3" border="0" alt="f3" align="left" src="http://lh4.ggpht.com/_GEekUYeFuZ0/S53siyM3U2I/AAAAAAAAAx4/zjmZwKKITVM/f3%5B6%5D.jpg?imgmax=800" width="150" height="200" /&gt;&lt;/a&gt; This one is cute. It,s called &lt;a href="http://www.engagesoftware.com/Products/Modules/Engage_F3.aspx" target="_blank"&gt;Engage F3&lt;/a&gt; and it lets you search and replace text in Text/Html and Engage Publish modules, site-wide. It’s intended for admin use only.&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;You can &lt;a href="http://www.snowcovered.com/snowcovered2/default.aspx?tabid=242&amp;amp;PackageID=17037" target="_blank"&gt;download it for free&lt;/a&gt; from Snowcovered. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-2816960943703354288?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3PUv9n7C55jIdySlI-0Q8Rds-_U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3PUv9n7C55jIdySlI-0Q8Rds-_U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3PUv9n7C55jIdySlI-0Q8Rds-_U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3PUv9n7C55jIdySlI-0Q8Rds-_U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/3zXrLf-L4lw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/2816960943703354288/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=2816960943703354288" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/2816960943703354288?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/2816960943703354288?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/3zXrLf-L4lw/free-searchreplace-admin-module-from.html" title="Free search/replace admin module from Engage Software" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/03/free-searchreplace-admin-module-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQAQ3o-eyp7ImA9WxBUEEU.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-829544827423734565</id><published>2010-02-25T10:25:00.001+02:00</published><updated>2010-02-25T10:25:42.453+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-25T10:25:42.453+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><title>Free HTML Template Repeater module – TEXT/HTML replacement</title><content type="html">&lt;p&gt;A simple idea, but someone had to conceive it and develop it. We often need to repeat a template made for a text/html module, without necessarily having the data stored in the database. Moreover, we need to give editors an easy way to enter data without having to know HTML to edit the markup. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There already are solutions, like &lt;a href="http://www.openwebstudio.com/" target="_blank"&gt;Open Web Studio&lt;/a&gt; (formerly Listx) and the core &lt;a href="http://www.formandlist.com/" target="_blank"&gt;Form and List&lt;/a&gt; module (formerly User Defined Table) module which can achieve similar results, but in a more complex and time-consuming way for the developer when it comes to simple, non-database-bound implementations like the one described above. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enter &lt;strong&gt;HTML Template Repeater&lt;/strong&gt;, created by &lt;a href="http://www.softwaresedge.com" target="_blank"&gt;Software’s Edge&lt;/a&gt;. You can define a template just as you would normally do in a Text/HTML module, defining placeholders for “variables” that you need to be replaced when the module output is rendered. The module provides you with a form to create “records” based on those variables and then you can repeat your template for as many records as you have entered. It even has paging functionality!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can &lt;a href="http://htrm.codeplex.com/Release/ProjectReleases.aspx" target="_blank"&gt;download the module from Codeplex&lt;/a&gt;, or &lt;a href="http://www.softwaresedge.com/Products/HTMLTemplateRepeater/tabid/73/Default.aspx" target="_blank"&gt;see a video tutorial here&lt;/a&gt;. Another blog post / tutorial on the module is &lt;a href="http://www.softwaresedge.com/Blog/ARedirection/tabid/64/EntryId/2/HTML-Template-Repeater-released.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-829544827423734565?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q-BXIRSLjvkfcFMDYi8lPaPOkJQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-BXIRSLjvkfcFMDYi8lPaPOkJQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q-BXIRSLjvkfcFMDYi8lPaPOkJQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-BXIRSLjvkfcFMDYi8lPaPOkJQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/JVwpsCB6m_g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/829544827423734565/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=829544827423734565" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/829544827423734565?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/829544827423734565?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/JVwpsCB6m_g/free-html-template-repeater-module.html" title="Free HTML Template Repeater module – TEXT/HTML replacement" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/02/free-html-template-repeater-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AHQ306cSp7ImA9WxBUEEU.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-4162282759675163309</id><published>2010-02-25T10:15:00.001+02:00</published><updated>2010-02-25T10:15:32.319+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-25T10:15:32.319+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><title>ERD Data Model and Meta Data Dictionary for DNN CE 5.2.2</title><content type="html">&lt;p&gt;Mr. Chodnicki from &lt;a href="http://www.r2integrated.com" target="_blank"&gt;R2integrated&lt;/a&gt; has created a very useful data model and meta data dictionary for DotNetNuke Community Edition 5.2.2, which you can download &lt;a href="http://www.r2integrated.com/Blog/Entry/ERD_Data_Model_and_Meta_Data_Dictionary_for_DNN_CE_5_2_2.aspx" target="_blank"&gt;by clicking here&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-4162282759675163309?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M0IYzge-p59gtpxHPau_9DtGVV0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M0IYzge-p59gtpxHPau_9DtGVV0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M0IYzge-p59gtpxHPau_9DtGVV0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M0IYzge-p59gtpxHPau_9DtGVV0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/PEO_iQGvcm8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/4162282759675163309/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=4162282759675163309" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/4162282759675163309?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/4162282759675163309?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/PEO_iQGvcm8/erd-data-model-and-meta-data-dictionary.html" title="ERD Data Model and Meta Data Dictionary for DNN CE 5.2.2" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2010/02/erd-data-model-and-meta-data-dictionary.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EESXw9eCp7ImA9WxNSFks.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-352769156395075215</id><published>2009-08-30T20:30:00.001+03:00</published><updated>2009-08-30T23:53:28.260+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-30T23:53:28.260+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Displaying a “no search results” message when no search results are found</title><content type="html">&lt;p&gt;In earlier (4.x) DNN versions, when you make a search and it yields no results you are presented with an empty search results page – without any message. It’s silly, but nobody ever included this as a feature. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks to &lt;a href="http://www.allaboutduncan.com/2008/dotnetnuke-no-search-results-message/" target="_blank"&gt;this post&lt;/a&gt;, I found a way to include a “no search results” message. Or course, there are plenty of ways to do that, but I think this is the fastest. You’ll have to edit the &lt;strong&gt;admin/search/searchresults.ascx&lt;/strong&gt; file as follows:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;First, find this line and add what’s written in big, bold letters:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;&amp;lt;asp:HyperLink&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;id&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”lnkTitle”&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;runat&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”server”&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;strong&gt;&lt;font size="4"&gt;&lt;font color="#000000"&gt;Name&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”result”&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;CssClass&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”SubHead”&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;NavigateUrl&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;’&amp;lt;%&lt;/font&gt;&lt;font color="#0000ff"&gt;#&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;FormatURL(DataBinder.Eval(Container.DataItem,”TabId”),&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataBinder.Eval(Container.DataItem,”Guid”))&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;%&amp;gt;’&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Text&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;’&amp;lt;%&lt;/font&gt;&lt;font color="#0000ff"&gt;#&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;DataBinder.Eval(Container.DataItem,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;“Title”)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;%&amp;gt;’&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;/asp:HyperLink&amp;gt;&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then add the following code directly under the last line of the file:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;&amp;lt;div&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;id&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”NoResults”&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;h3&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;class=&lt;/font&gt;&lt;font color="#000000"&gt;”red”&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;style&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”text-align:center”&amp;gt;No&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Search&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Results&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Found&amp;lt;/h3&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;/div&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;script&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;language&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;”Javascript”&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;search&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;search&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;document&lt;/font&gt;&lt;font color="#000000"&gt;.getElementsByName(”result”)&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;(search.length&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;==&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;document&lt;/font&gt;&lt;font color="#000000"&gt;.getElementById(”NoResults”).style.display&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;’block’&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;document&lt;/font&gt;&lt;font color="#000000"&gt;.getElementById(”NoResults”).style.display&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;’none’&lt;/font&gt;&lt;font color="#0000ff"&gt;;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;font color="#808080"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;/script&amp;gt;&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Change the “No Search Results Found” string to whatever you like and you’ll have your “no results” message when your search yields nothing. Of course, you can also change the h3 tag with whatever you like, even include an image. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I don’t know what’s going on with 5.x versions since I haven’t tried it yet in one, but I think it’s still an interesting tweak for 4.x versions.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;EDIT: This may not work if you leave the single and double quotes as they are in the code above. Better paste the code to Notepad first. Sorry about that, but I didn’t have the time to replace. (Live Writer can be very unfriendly sometimes :) )&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-352769156395075215?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Y6GtvCcM11mA--jTlS9J8BDQ3mY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Y6GtvCcM11mA--jTlS9J8BDQ3mY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Y6GtvCcM11mA--jTlS9J8BDQ3mY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Y6GtvCcM11mA--jTlS9J8BDQ3mY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/PMT783sR4Mg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/352769156395075215/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=352769156395075215" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/352769156395075215?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/352769156395075215?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/PMT783sR4Mg/displaying-no-search-results-message.html" title="Displaying a “no search results” message when no search results are found" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2009/08/displaying-no-search-results-message.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AHQns5fCp7ImA9WxJTGE8.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-7772674696161458843</id><published>2009-04-27T13:55:00.001+03:00</published><updated>2009-04-27T13:55:33.524+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-27T13:55:33.524+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><title>DnnGallery.net – a place to showcase your DNN sites</title><content type="html">&lt;p&gt;One of the questions I have always found hard to answer is “ok, but show me some ‘wow’ sites made with DotNetNuke”. I always had a hard time finding some sites till I read a post about &lt;a href="http://www.dnngallery.net"&gt;www.dnngallery.net&lt;/a&gt; at the DotNetNuke forums.I think it’s pretty interesting, provided that the “Showcase” section at the official DotNetNuke site is dead and that there is no other place (none that I know of, at least) where one can see and rate some worthy DNN sites. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;DnnGallery allows you to submit your DNN site and lets other users rate it. You will find some interesting implementations there, let’s hope that more DNN publishers participate in the future.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-7772674696161458843?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1HchMEIpB7uC8N0GPOxBNCT_4nE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1HchMEIpB7uC8N0GPOxBNCT_4nE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1HchMEIpB7uC8N0GPOxBNCT_4nE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1HchMEIpB7uC8N0GPOxBNCT_4nE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/cs-K1Db-B7k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/7772674696161458843/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=7772674696161458843" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/7772674696161458843?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/7772674696161458843?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/cs-K1Db-B7k/dnngallerynet-place-to-showcase-your.html" title="DnnGallery.net – a place to showcase your DNN sites" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2009/04/dnngallerynet-place-to-showcase-your.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMGQ387cCp7ImA9WxJTE04.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-8181248592699738139</id><published>2009-04-21T19:47:00.001+03:00</published><updated>2009-04-21T19:47:02.108+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-21T19:47:02.108+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Extending" /><title>UDT 03.05.01 and incorrect filtering of script in text/html fields</title><content type="html">&lt;p&gt;Those of you using the latest version of the old User Defined Table module (which is to be replaced by the Form and List module in DNN 5.x) may have noticed an annoying bug that makes the UDT module insist on filtering out script, object and embed tags even when you have specifically specified that you don’t want it to.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What does this mean? It means that you can’t embed YouTube videos, for example, because UDT will filter out the embed code’s tags.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When does it happen? Well, fortunately it doesn’t happen when you’re admin or host. But it does happen if you’ve given other users edit rights on UDT data. Any user that is not Admin or Host cannot write these tags in the HTML view of a Text/HTML field inside a User Defined Table. They are just filtered out, even when the relevant setting is unchecked.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To fix that, you’ll need to download the code for UDT 03.05.01. The problem lies in file EditControls.vb, line 52:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;ParentModule.Settings.ContainsKey(SettingName.ForceInputFiltering) &lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;inputFilterScript&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Not&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;isAdmin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;inputFilterTags&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;isAnonymous&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The “if” clause in line 52 just checks whether the setting exists, not its value. To fix that you need to make the code in line 52 as follows:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;ParentModule.Settings.ContainsKey(SettingName.ForceInputFiltering)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;AndAlso&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;ParentModule.Settings(SettingName.ForceInputFiltering).Equals(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;True&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;inputFilterScript&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Not&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;isAdmin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;inputFilterTags&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;isAnonymous&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;(I apologise for the line breaks, please consider that the IF clause should be in a single line)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What I’ve done is that I have added a second condition that actually checks the VALUE of the setting and applies the rule only if it’s true.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can compile the code with that change and just replace the old dll file with the newly-compiled one in dotnetnuke’s Bin folder.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please let me know if you’ve been having trouble with this, I’ve already got a compiled dll so I could send it to anyone who’s not into code much – although, as always, I must insist that you always try those things at your own risk!&lt;/p&gt;  &lt;p&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-8181248592699738139?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5hRlzLjCha2hZD2WLgvR-vyde0g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5hRlzLjCha2hZD2WLgvR-vyde0g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5hRlzLjCha2hZD2WLgvR-vyde0g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5hRlzLjCha2hZD2WLgvR-vyde0g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/g1NPoq72B2M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/8181248592699738139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=8181248592699738139" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8181248592699738139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8181248592699738139?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/g1NPoq72B2M/udt-030501-and-incorrect-filtering-of.html" title="UDT 03.05.01 and incorrect filtering of script in text/html fields" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2009/04/udt-030501-and-incorrect-filtering-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4MRH46cCp7ImA9WxVbF0o.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-8590675421628033171</id><published>2009-04-03T19:43:00.001+03:00</published><updated>2009-04-03T19:43:05.018+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-03T19:43:05.018+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Replacing default module titles in search results with the corresponding tab’s title</title><content type="html">&lt;p&gt;How many times has it happened to you? You put some Text/HTML module here, a Links module there, maybe a third-party module and you forget to change its title, mostly because you’re using a container that doesn’t utilize it, or for any other reason.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This can lead to ugly search results, since DNN’s indexer stores the module’s &lt;strong&gt;title&lt;/strong&gt; in the &lt;strong&gt;SearchItem&lt;/strong&gt; table and uses it as the title for each one of your search results. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;On the other hand, you’ve got some module titles you’ve explicitly set and you need to preserve for your search results. So, you’ve only got to replace the DEFAULT titles with something – in my script, I chose to replace them with the corresponding tab’s title, but you could alter it and make it display anything – or even delete the record if you like.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So here’s a trigger that checks whether the row being written in the SearchItem table is for a module having the default title, and if so, changes the title to the corresponding tab’s title. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;CREATE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;TRIGGER&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tr_FixSearchItemTitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;ON&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;dbo.SearchItem&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;AFTER&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;INSERT&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#0000ff"&gt;UPDATE&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;-- SET NOCOUNT ON added to prevent extra result sets from     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;-- interfering with SELECT statements.     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;SET&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;NOCOUNT&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ON;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--These three variables will come from the     &lt;br /&gt;--searchitem table.      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@searchitemid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduleid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@title&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;200&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--These two will come from the&amp;#160; &lt;br /&gt;--modules table.      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduletitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;200&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduledefid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--This will come from the&amp;#160; &lt;br /&gt;--moduledefinitions table      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@friendlyname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;200&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--This will come from the     &lt;br /&gt;--tabs table      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabtitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;200&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--Get inserted values     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@searchitemid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;searchitemid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@title&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;title&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduleid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;inserted&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--Find moduletitle and definition id of the&amp;#160; &lt;br /&gt;--module being inserted in searchitems table.      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@moduletitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;moduletitle&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduledefid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;moduledefid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;modules&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduleid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--Find the friendly name from the     &lt;br /&gt;--moduledefinitions table      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@friendlyname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;friendlyname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;moduledefinitions&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;moduledefid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduledefid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--If the title of the module in the searchitem table     &lt;br /&gt;--is equal to the module definition's friendly name      &lt;br /&gt;--then we can safely suppose that the module has&amp;#160; &lt;br /&gt;--the default title.      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@friendlyname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@title&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--Get the tab's title     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@tabtitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;title&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;tabs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;in&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--If we have multiple instances     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--of modules in several pages,     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--just get the first page. I know,     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--this might be ugly but I've not found     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;--any other way.     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;top&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;(tabid)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;tabmodules&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduleid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;--Replace the default title with the page's title.     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;update&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;searchitem&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;title&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabtitle&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;searchitemid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@searchitemid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;GO&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This trigger checks each entry in the &lt;strong&gt;SearchItem&lt;/strong&gt; table at the time it’s inserted or updated and determines whether the module title being inserted is a default title. It achieves that by comparing the module’s title with the &lt;strong&gt;FriendlyName&lt;/strong&gt; field of the &lt;strong&gt;ModuleDefinitions&lt;/strong&gt; table – all core modules and all third-party modules I know use this value as the default title. This means the trigger will probably work with any combination of modules you’ve installed in your site.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There’s a catch, though: If you have the same module instance (not the same module, the exact same instance – that means you’ve used the &lt;strong&gt;“add existing module”&lt;/strong&gt; option) in more than one page, it’ll get only one title for it – that is, if you’ve “added an existing module” to several pages, each search result that corresponds to such a module may have the wrong title – no problem if you’re not using multiple instances of modules.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Another catch is that you &lt;strong&gt;have to have recursive triggers disabled for your database&lt;/strong&gt;, or this will execute forever – it will run itself again and again since it alters a newly inserted or updated record.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In order to see how this trigger handle things, you should delete everything from your SearchItem table and then do a reindex via the Host-&amp;gt;Search Admin page, or else the trigger will run only for new or updated entries.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As always, use at your own risk!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-8590675421628033171?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9Aac3enuyXFHw6FkQpfVvP7ifMQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9Aac3enuyXFHw6FkQpfVvP7ifMQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9Aac3enuyXFHw6FkQpfVvP7ifMQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9Aac3enuyXFHw6FkQpfVvP7ifMQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/4-4jyi9l_HQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/8590675421628033171/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=8590675421628033171" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8590675421628033171?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8590675421628033171?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/4-4jyi9l_HQ/replacing-default-module-titles-in.html" title="Replacing default module titles in search results with the corresponding tab’s title" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2009/04/replacing-default-module-titles-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YGQ3k_fCp7ImA9WxVREU0.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-1124102536278184121</id><published>2009-01-16T14:32:00.001+02:00</published><updated>2009-01-16T14:32:02.744+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-16T14:32:02.744+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Extending" /><title>Using the PortalSettings class in containers</title><content type="html">&lt;p&gt;It’s simple, but useful: If you try to use the PortalSettings class in code you have added to a container’s&amp;#160; .ascx file, you’ll find out that you can’t. The PortalSettings shared class is only directly accessible from skins. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s dissapointing, especially when you need to grab things like, for example, the current tab id (PortalSettings.ActiveTab.TabId) inside a container for some reeson.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The solution to this is to grab your PortalSettings contents from the HttpContext and use it like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;&amp;lt;script&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;runat&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_portalSettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;PortalSettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;_portalSettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;CType&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#2b91af"&gt;HttpContext&lt;/font&gt;&lt;font color="#000000"&gt;.Current.Items(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;PortalSettings&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;PortalSettings)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;/script&amp;gt;&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In order to get, for example, the current tab id from your container, you can now use _portalSettings.ActiveTab.Tabid. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-1124102536278184121?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1J4GzJvjHi3j6O8btMrLKhqOXCo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1J4GzJvjHi3j6O8btMrLKhqOXCo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1J4GzJvjHi3j6O8btMrLKhqOXCo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1J4GzJvjHi3j6O8btMrLKhqOXCo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/tu_Vvw4ycfQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/1124102536278184121/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=1124102536278184121" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1124102536278184121?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1124102536278184121?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/tu_Vvw4ycfQ/using-portalsettings-class-in.html" title="Using the PortalSettings class in containers" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2009/01/using-portalsettings-class-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8MRn8ycSp7ImA9WxRbFEs.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-313970088172944842</id><published>2008-12-05T09:58:00.001+02:00</published><updated>2008-12-05T09:58:07.199+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-05T09:58:07.199+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Extending" /><title>How to enable - disable caching programmatically and on-demand</title><content type="html">&lt;p&gt;Sometimes, when you're doing something programmatically, like moving tabs around, you really don't want caching in your way in any form, since there's a great danger it'll affect the outcome. For some reason, programmatically clearing the cache may not be enough - you just don't need any caching around when you do certain stuff, and you don't want to oblige any host user to manually clear the cache. Here's a really simple way to disable caching programmatically.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#006400"&gt;'Get the initial caching level     &lt;br /&gt;'from the HostSettings arraylist&amp;#160; &lt;br /&gt;'(this is the easiest way)      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;initialCachingLevel&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;initialCachingLevel&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;HostSettings.Item(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;PerformanceSetting&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;).ToString&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;'Disable caching     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;hc&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;New&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Entities.Host.HostSettingsController&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;hc.UpdateHostSetting(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;PerformanceSetting&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;0&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;'Do your stuff here     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;'Enable caching with     &lt;br /&gt;'the initial caching level      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;hc.UpdateHostSetting(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;PerformanceSetting&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;initialCachingLevel)&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What I'm doing in the bit of code above is disable caching temporarily to do what I have to do, then return it to its previous state. That's equivalent to going to Host Settings-Performance, from the Host menu, change the caching level, click &amp;quot;update&amp;quot;, do any job I have to do and then get back to the Host menu and return caching to its previous value.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The caching level is defined by the &amp;quot;PerformanceSetting&amp;quot; Host property which can take string values ranged from &amp;quot;0&amp;quot; to &amp;quot;3&amp;quot; representing different levels of caching:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;0 - No caching&lt;/p&gt;  &lt;p&gt;1 - Light caching&lt;/p&gt;  &lt;p&gt;2 - Moderate caching&lt;/p&gt;  &lt;p&gt;3 - Heavy caching&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Some notes: &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can get the current caching level from the HostSettingsController too, but it's a bit more fussy since the GetHostSetting method returns an IDataReader. Since the Host's settings get copied to the publicly-available HostSettings hashtable, I thought it's easier to obtain the current setting from there.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Changing the value in the HostSettings hashtable will NOT affect your caching. You've got to use HostSettingsController.UpdateHostSetting.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You may also want to clear any cache left before you start doing your stuff, it helps in some cases. In this case, the DataCache class may prove very useful. Here's what you can do (you can choose not to execute some of these lines, depending on your needs):&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;DataCache.ClearTabsCache(&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataCache.ClearPortalCache(&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataCache.ClearHostCache(&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataCache.ClearModuleCache()&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataCache.ClearTabPermissionsCache(&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;DataCache.ClearUserCache(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;UserController.GetCurrentUserInfo().Username)&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Some of the above statements may overlap, in the sense that they're actually subsets of other statements. For example, ClearHostCache() is considered equivalent to the Clear Cache option that exists in the Host Settings page. I personally prefer to issue ALL those statements, even if they overlap. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The DataCache class has some more methods but I think those mentioned here are enough to give you a good start. You'll probably find out the rest yourself, in an as-needed basis.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The above code applies only to portal 0. Whenever you see a boolean parameter there, it's indicating &amp;quot;cascade&amp;quot; cache clearing, which I always want set to true. Also, the ClearUserCache() method needs the currently logged on user's name, which I get by using UserController.GetCurrentUserInfo() which returns a UserInfo object containing, among others, the user's name.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-313970088172944842?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fLlJUCIP00Swz51CRCcwPnYwpQE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fLlJUCIP00Swz51CRCcwPnYwpQE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fLlJUCIP00Swz51CRCcwPnYwpQE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fLlJUCIP00Swz51CRCcwPnYwpQE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/-UVpa6XSpBI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/313970088172944842/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=313970088172944842" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/313970088172944842?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/313970088172944842?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/-UVpa6XSpBI/how-to-enable-disable-caching.html" title="How to enable - disable caching programmatically and on-demand" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/12/how-to-enable-disable-caching.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUDRHkyfCp7ImA9WxRUGEo.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-1655043982595480621</id><published>2008-11-28T14:44:00.001+02:00</published><updated>2008-11-28T14:44:35.794+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-28T14:44:35.794+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Resolving "fileid=xxx" field values to actual file paths</title><content type="html">&lt;p&gt;Following a previous article of mine, &lt;a href="http://dnnuke.blogspot.com/2008/05/dbotabsiconfile-field-issue.html" target="_blank"&gt;The dbo.tabs.IconFile field issue&lt;/a&gt;, I would like to share an easy way to resolve any field that holds values of the type &amp;quot;FileID=xxx&amp;quot; (where xxx is the primary key of a record in the Files table) into the actual file path. This is especially useful when you deal with the IconFile field in the Tabs table, as well as with fields of type Image in a User Defined Table, and probably in a lot more places too.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I have created a UDF (User Defined Function) which accepts a string value and looks whether it's of type &amp;quot;FileID=xxx&amp;quot;. If it is, it constructs the full path (including the portal number) and returns that, otherwise it just returns the initial string with no modification at all. You can use this scalar-valued function inline, in your own SELECT statements, like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;tabid,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;tabname,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;dbo.ResolveFileField(iconfile)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;CODE&lt;/strong&gt;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;CREATE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;FUNCTION&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;dbo.ResolveFileField&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@file&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;RETURNS&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@retval&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@portalid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;patindex&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;'FileID=%'&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@file)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@fileid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@fileid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;replace&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@file&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; 'fileid='     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt; ''     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;@retval&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 'Portals/'&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;convert&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;10&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;files.portalid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; '/'&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;folders.folderpath&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;files.filename&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;files&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;left&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;outer&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;join&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;folders&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;on&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;files.folderid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;folders.folderid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;files.fileid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@fileid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@retval&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@file&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@retval&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;GO&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-1655043982595480621?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OHXU9tCt9Ch9mblolXEwYfAoU4s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OHXU9tCt9Ch9mblolXEwYfAoU4s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OHXU9tCt9Ch9mblolXEwYfAoU4s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OHXU9tCt9Ch9mblolXEwYfAoU4s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/HcitcPKuoII" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/1655043982595480621/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=1655043982595480621" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1655043982595480621?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/1655043982595480621?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/HcitcPKuoII/resolving-field-values-to-actual-file.html" title="Resolving &amp;quot;fileid=xxx&amp;quot; field values to actual file paths" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>3</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/11/resolving-field-values-to-actual-file.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEBSH8_fyp7ImA9WxRUF0U.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-7849986588887597269</id><published>2008-11-27T13:00:00.001+02:00</published><updated>2008-11-27T13:00:59.147+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-27T13:00:59.147+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>How to promote a regular DotNetNuke user to a superuser</title><content type="html">&lt;p&gt;I found this in &lt;a href="http://www.kevinsouthworth.com/Blog/tabid/59/articleType/ArticleView/articleId/50/Default.aspx" target="_blank"&gt;Kevin Southworth's blog&lt;/a&gt; and I think it's worth mentioning since it may save your life in case you have forgotten your superuser's password. Using SQL, you can promote a regular DNN user to a superuser like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#006400"&gt;-- Promote regular user to SuperUser     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;DECLARE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@username&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;50&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;SET&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@username&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; 'theUsernameToPromote'     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;UPDATE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;Users&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;SET&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;IsSuperUser&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;username&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@username&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;DELETE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;UserPortals&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;UserId&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;UserID&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Users&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;username&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@username)&lt;/font&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Simply replace 'theUsernameToPromote' with the user name you need.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks Kevin!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-7849986588887597269?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1ueJsAPjk8tPknmARhWOUUDC-0I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1ueJsAPjk8tPknmARhWOUUDC-0I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1ueJsAPjk8tPknmARhWOUUDC-0I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1ueJsAPjk8tPknmARhWOUUDC-0I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/rTj7_I1vjMY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/7849986588887597269/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=7849986588887597269" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/7849986588887597269?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/7849986588887597269?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/rTj7_I1vjMY/how-to-promote-regular-dotnetnuke-user.html" title="How to promote a regular DotNetNuke user to a superuser" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/11/how-to-promote-regular-dotnetnuke-user.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMCSXs7eSp7ImA9WxRUFEg.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-3204664342173328076</id><published>2008-11-23T01:59:00.001+02:00</published><updated>2008-11-23T16:27:48.501+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-23T16:27:48.501+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Extending" /><title>Persisting large values in Module Settings when creating a custom module</title><content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;So you want to create a simple custom module. At first, it seems easy. Just two or three settings to take care of, no need for complicated, custom tables and unistall/uninstall scripts. DNN's built-in module settings API seems to be enough. But suddenly, needs grow a lot. There are some large values you need to store and the ModuleSettings table won't allow large chunks of information per row. It seems that you have to switch to a custom table which will be holding your settings...&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;br /&gt;...or use my class :)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;I came upon the need of storing just one large value (a serialized object, to be more specific) in a custom module I was creating. I didn't have any way to know how large the serialized (XML) sting would be, since the object was a collection, and I HAD to store it in module settings. I thought it wouldn't be worth to create a custom table and the accompanying code to store settings in a case like this, so I decided to extend DNN's ModuleController class instead. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;What I did was to write a new &lt;strong&gt;ModuleControllerExtended &lt;/strong&gt;class which inherits from ModuleController (so I could use it in its place) and add two methods to it: &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. UpdateLargeTabModuleSetting:&lt;/strong&gt; This method is essentially an extension of the UpdateTabModuleSetting method of the ModuleController class which allows storing large string values in the ModuleSettings table by breaking them into smaller chunks and storing multiple name/value pairs. If a value is small enough to fit into a single row of the ModuleSettings table, then it's stored normally, as it would with the UpdateTabModuleSetting method. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;When the value is large, it's stored in 2KB chunks in several rows using a numeric prefix (in the form of _x) for each row, based on the initial name given for the setting. For example, a setting named &amp;quot;SerializedObject&amp;quot; with a value sized at 5KB would be stored in 3 rows with names &amp;quot;SerializedObject_0&amp;quot;, &amp;quot;SerializedObject_1&amp;quot; and &amp;quot;SerializedObject_2&amp;quot; accordingly. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The method also takes care to delete rows from the ModuleSettings table every time an update takes place to ensure that there are no leftovers should you specify a value of a smaller size (and probably fewer chunks) than the one that may be already stored. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. ReadLargeTabModuleSetting:&lt;/strong&gt; This one reads a large setting doing all the work needed to give you back its string value, but it can also read single-row settings. This is a shared method, and it was added to the class only for consistency. It does not extend any of the known methods of the ModuleController class, meaning you can always remove it from the definition of the class and use it as stand-alone code. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To use the method, you will need the hashtable containing the module's settings, which you can easily get by using the base class GetModuleSettings() method. You feed the method with the hashtable, the module's id and the name of the setting you want and you get a string value containing the &amp;quot;large&amp;quot; value for the setting you specified, or just a setting value should the setting be a &amp;quot;normal&amp;quot; one.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It's not really complicated and it should save you a lot of time when dealing with situations like the one I described above. I would love to hear your comments, though.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here's the code:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div class="code"&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Imports&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Microsoft.VisualBasic&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Imports&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;System.Collections.Generic&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Public&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Class&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;ModuleControllerExtended&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Inherits&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;DotNetNuke.Entities.Modules.ModuleController&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Public&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;New&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;MyBase&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Public&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;UpdateLargeTabModuleSetting(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleSettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Hashtable&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleID&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Int32&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingValue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cntDel&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Int32&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Object&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;continueDeleting&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Boolean&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;continueDeleting&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Delete all multiple-value module settings, if they exist.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;continueDeleting&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleSettings(settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;_&amp;quot; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cntDel.ToString)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Not&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Is&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Nothing&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;DeleteTabModuleSetting(tabModuleID,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;_&amp;quot; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cntDel.ToString)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;cntDel&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Else&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;continueDeleting&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;False&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Guard - if setting value is less than 2KB, update normally and exit&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingValue.Length&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;2000&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Normal value&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;UpdateTabModuleSetting(tabModuleID,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingValue)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Exit&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'If we get to this point, then setting value is more than 2KB.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Delete the original setting (if it exists) so as not to get confused.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;DeleteTabModuleSetting(tabModuleID,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Split the value in 2KB chunks&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;stringList&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;New&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;font color="#000000"&gt;(Of&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sb&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;New&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;StringBuilder&lt;/font&gt;&lt;font color="#000000"&gt;(settingValue)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sb.Length&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;2000&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;stringList.Add(sb.ToString.Substring(&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1999&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;sb.Remove(&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1999&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Add the last chunk&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sb.Length&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;stringList.Add(sb.ToString)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Now do the update changing the setting name with the suffix _x (x=0,1,2,etc.) for&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'each update&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cnt&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Int32&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;For&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Each&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;s&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;In&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;stringList&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;UpdateTabModuleSetting(tabModuleID,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;_&amp;quot; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cnt.ToString,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;s)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;cnt&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Next&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;Public&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Shared&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Function&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;ReadLargeTabModuleSetting(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleSettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Hashtable&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleID&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Int32&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;_&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Guard - if there is a single setting, just return that and exit&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;objTester&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Object&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;objTester&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleSettings(settingName)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Not&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;objTester&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Is&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Nothing&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Return&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#0000ff"&gt;CType&lt;/font&gt;&lt;font color="#000000"&gt;(objTester,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'If we got to this point, there's a large value stored.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#006400"&gt;'Loop through the records and reconstruct the value.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sb&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;New&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;StringBuilder&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cnt&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#2b91af"&gt;Int32&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Object&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;continueAdding&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Boolean&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;continueAdding&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;continueAdding&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;True&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabModuleSettings(settingName&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;_&amp;quot; &lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cnt.ToString)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Not&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;o&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Is&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Nothing&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;sb.Append(&lt;/font&gt;&lt;font color="#0000ff"&gt;CType&lt;/font&gt;&lt;font color="#000000"&gt;(o,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;String&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;cnt&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;+&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Else&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;continueAdding&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;False&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;While&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Return&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sb.ToString&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Function&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Class&lt;/font&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-3204664342173328076?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5sApS4s_kMYFZKFOA1DOtNDfYRI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5sApS4s_kMYFZKFOA1DOtNDfYRI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5sApS4s_kMYFZKFOA1DOtNDfYRI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5sApS4s_kMYFZKFOA1DOtNDfYRI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/8mihI2-WBbY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/3204664342173328076/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=3204664342173328076" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3204664342173328076?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3204664342173328076?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/8mihI2-WBbY/persisting-large-values-in-module.html" title="Persisting large values in Module Settings when creating a custom module" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>1</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/11/persisting-large-values-in-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04BR3o6fSp7ImA9WxRUEUU.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-5447979863119317569</id><published>2008-11-07T17:14:00.003+02:00</published><updated>2008-11-20T14:59:16.415+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-20T14:59:16.415+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Creating pages based on templates - eventually!</title><content type="html">All my attempts to use custom templates when creating new DNN pages for my portals were frustrating. Even though I exported the template from a page using the Export feature, the new template would not show up at all in the combo box when creating a new page, although it existed in the file system. Even the default template wouldn't show up!&lt;br /&gt;&lt;br /&gt; Here's a simple solution to make those template files appear when you create a new page:&lt;br /&gt;&lt;br /&gt; 1. Go to Host Settings - Other Settings and locate the &amp;quot;File Upload Extensions&amp;quot; section. Add &amp;quot;template&amp;quot; (without the quotes) there and save your changes. &lt;br /&gt;&lt;br /&gt; 2. Click &amp;quot;Restart Application&amp;quot; in Host Settings.&lt;br /&gt;&lt;br /&gt; 3. Go to the File Manager and synchronize files with the &amp;quot;recursive&amp;quot; option set.&lt;br /&gt;&lt;br /&gt; 4. Optionally, clear the portal's cache in Host Settings (only if it doesn't seem to work differently).&lt;br /&gt;&lt;br /&gt; Now you'll have access to your custom templates when creating new pages. Hope that helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-5447979863119317569?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NCYAf0rCKegDGSZX61jegSwr4is/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NCYAf0rCKegDGSZX61jegSwr4is/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NCYAf0rCKegDGSZX61jegSwr4is/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NCYAf0rCKegDGSZX61jegSwr4is/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/yzM2aO_NB8U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/5447979863119317569/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=5447979863119317569" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/5447979863119317569?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/5447979863119317569?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/yzM2aO_NB8U/creating-pages-based-on-templates.html" title="Creating pages based on templates - eventually!" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>3</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/11/creating-pages-based-on-templates.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMQHgyfSp7ImA9WxRUFUw.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-6056211308332234901</id><published>2008-10-24T17:31:00.002+03:00</published><updated>2008-11-24T10:03:01.695+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-24T10:03:01.695+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Adding Javascript to the BODY tag in DNN</title><content type="html">When working with .ascx skin files, you will sometimes need to add some Javascript to the BODY tag, such as something that runs when the OnLoad event triggers.   &lt;br /&gt;  &lt;br /&gt;Well, you can always add a BODY tag inside your .ascx file along with the Javascript you like and hope that the browser will understand that. Essentially, you'll end up having two BODY tags in your source code-one that is generated by DNN and one that is typed by you. Some browsers (like Chrome) understand what's happening and try to transfer the Javascript to the actual BODY tag when rendering the page, but others don't.  &lt;br /&gt;  &lt;br /&gt;What you can do, though, is create a Page_Init event handler inside your .ascx file and put this code there:  &lt;br /&gt;  &lt;br /&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;Dim&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;body&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;System.Web.UI.HtmlControls.HtmlGenericControl&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;CType&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2b91af"&gt;Page&lt;/font&gt;&lt;font color="#000000"&gt;.FindControl(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;body&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;),&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;System.Web.UI.HtmlControls.HtmlGenericControl)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;body.Attributes(&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;onload&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt; &amp;quot;blablablaJavascript&amp;quot;&lt;/font&gt; &lt;/div&gt;  &lt;br /&gt;  &lt;br /&gt;Where blablablaJavascript is your Javascript. Of course, you can do that for other events (even for other tags) as well.  &lt;br /&gt;  &lt;br /&gt;If you're using a single .ascx file with no code-behind (like most do), you'll want to define a Page_Init event there. You can do that like this:  &lt;br /&gt;  &lt;br /&gt;  &lt;div class="code"&gt;&lt;font color="#000000"&gt;&amp;lt;script&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;runat&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;quot;server&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;Private&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;Page_Init(&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;sender&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;System.&lt;/font&gt;&lt;font color="#0000ff"&gt;Object&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;ByVal&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;e&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;As&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;System.&lt;/font&gt;&lt;font color="#2b91af"&gt;EventArgs&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Handles&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;MyBase&lt;/font&gt;&lt;font color="#000000"&gt;.Init&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;'Add your code here     &lt;br /&gt;&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;End&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;Sub&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;lt;/script&amp;gt;&lt;/font&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-6056211308332234901?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KveBkqtNBYlmC9UJ1W3CxqJY47w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KveBkqtNBYlmC9UJ1W3CxqJY47w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KveBkqtNBYlmC9UJ1W3CxqJY47w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KveBkqtNBYlmC9UJ1W3CxqJY47w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/zPT4hRB31JI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/6056211308332234901/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=6056211308332234901" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/6056211308332234901?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/6056211308332234901?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/zPT4hRB31JI/adding-javascript-to-body-tag-in-dnn.html" title="Adding Javascript to the BODY tag in DNN" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>4</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/10/adding-javascript-to-body-tag-in-dnn.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08GSHs_eip7ImA9WxRUEUU.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-8851805103535222057</id><published>2008-10-24T17:23:00.006+03:00</published><updated>2008-11-20T14:57:09.542+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-20T14:57:09.542+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Thickbox and Google Maps API - avoiding random thickbox initialization problems</title><content type="html">&lt;a href="http://jquery.com/demo/thickbox/" target="_blank"&gt;Thickbox&lt;/a&gt; is a very nice JQuery-based Javascript plugin that allows you to present images and other stuff (even whole pages!) in your page in a popup manner but without leaving the current page or opening a new one. Essentially, it's considered an evolution of the &lt;a href="http://www.huddletogether.com/projects/lightbox/" target="_blank"&gt;Lightbox&lt;/a&gt; script which only works with images.&lt;br /&gt;&lt;br /&gt;Many developers use Thickbox with Google maps, in order to provide clickable links on Google Map bubbles that lead to enlarged photos or other info. Some of them (including me) noticed, to their surprise, that suddenly Thickbox wouldn't work correctly inside Google Maps. Specifically, it would work once in a while, and the only way to ensure it worked would be to click on a bubble, close it an then click on another. Then all Thickbox links inside bubbles would work.&lt;br /&gt;&lt;br /&gt;There seems to be a problem with the new version of the Google Maps API that kills the functionality of Thickbox. According to &lt;a href="http://groups.google.com/group/Google-Maps-API/browse_thread/thread/7007425022ea5ab5" target="_blank"&gt;this discussion on Google Groups&lt;/a&gt;, a way to ensure Thickbox is working correctly is to "lock" on version 2.122 of the Google Maps API inside the Javascript that creates the markers. That is, use: google.load("maps", "2.122"); instead of google.load("maps", "2.x");&lt;br /&gt;&lt;br /&gt;I've been using Thickbox and Google Maps in some DNN sites and I was panicked to see this happening in the first place. Although this post is not exactly DNN-related, I think it'll be useful to all of you working with DNN out there. I was very happy to know that there wasn't anything wrong with my DNN development, it was only Google's API.&lt;br /&gt;&lt;br /&gt;Hope it helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-8851805103535222057?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7--9-lygNjEJ3q7EOrymoDLQtic/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7--9-lygNjEJ3q7EOrymoDLQtic/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7--9-lygNjEJ3q7EOrymoDLQtic/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7--9-lygNjEJ3q7EOrymoDLQtic/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/rBD22w_r1aw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/8851805103535222057/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=8851805103535222057" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8851805103535222057?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8851805103535222057?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/rBD22w_r1aw/thickbox-and-google-maps-api-avoiding.html" title="Thickbox and Google Maps API - avoiding random thickbox initialization problems" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/10/thickbox-and-google-maps-api-avoiding.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEHQH46cSp7ImA9WxRUFUw.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-455036148735814845</id><published>2008-09-26T19:07:00.001+03:00</published><updated>2008-11-24T10:00:31.019+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-24T10:00:31.019+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Finding a tab's parent by level</title><content type="html">This is a simple but useful user defined function I have implemented in order to recursively find a tab's parent on a specific level. Syntax is as follows:  &lt;br /&gt;  &lt;br /&gt;select dbo.udfGetParentByLevel (level, tabid)   &lt;br /&gt;  &lt;br /&gt;where level is the level you need (0,1,2 etc.) and tabid is the id of the tab for which you need to find the parent.  &lt;br /&gt;  &lt;br /&gt;Nothing much, but can save you in certain scenarios.  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  &lt;div class="code"&gt;&lt;font color="#0000ff"&gt;CREATE&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;FUNCTION&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;udfGetParentTabByLevel&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- Add the parameters for the function here     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;@parentlevel&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@initialtabid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#000000"&gt;RETURNS&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;BEGIN&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@level&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@parentid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@level&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;level,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;tabid,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@parentid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;parentid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@initialtabid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;while&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@level&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@parentlevel&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@level&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;level,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;tabid,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@parentid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;parentid&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabs&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;tabid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@parentid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- Return the result of the function     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;RETURN&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@tabid&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;END&lt;/font&gt;&lt;font color="#808080"&gt;     &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;GO&lt;/font&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-455036148735814845?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xRCsA1Pz6U4spgYPiBKxrMItAJ8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xRCsA1Pz6U4spgYPiBKxrMItAJ8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xRCsA1Pz6U4spgYPiBKxrMItAJ8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xRCsA1Pz6U4spgYPiBKxrMItAJ8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/4sT7Gi7f6Mo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/455036148735814845/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=455036148735814845" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/455036148735814845?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/455036148735814845?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/4sT7Gi7f6Mo/finding-tabs-parent-by-level.html" title="Finding a tab&amp;#39;s parent by level" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>3</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/09/finding-tabs-parent-by-level.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAEQHY8fCp7ImA9WxRUFUw.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-3400925312703012078</id><published>2008-09-19T15:07:00.001+03:00</published><updated>2008-11-24T10:01:41.874+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-24T10:01:41.874+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Modules" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Copying settings between DNNArticle modules</title><content type="html">&lt;a href="http://www.zldnn.com" target="_blank"&gt;ZLDNN's&lt;/a&gt; &lt;a href="http://www.zldnn.com/Modules/ModuleView/tabid/496/selectmoduleid/1613/ArticleID/30/reftab/1/title/DNNArticle/Default.aspx" target="_blank"&gt;DNNArticle&lt;/a&gt; is a really cool article module, loaded with a ton of features. Unfortunately, sometimes you'll have to add more than one modules on your site, and a ton of features typically comes with a ton of settings. In order not to have a hard time setting all the options from scratch, here is a script you can use to copy all those nifty settings you'll find in the &amp;quot;DNNArticle Settings&amp;quot; area from an already existing module.   &lt;br /&gt;  &lt;br /&gt;You need to know three things: The source and destination module ids (NOT the tab ids, the actual module ids) and the tab id which will be used for the presentation of an article.   &lt;br /&gt;  &lt;br /&gt;In the script given, I'm copying settings from module id 430 to module id 1232, with a view tab id of 986. Be sure to put your own numbers there.   &lt;br /&gt;  &lt;br /&gt;Also, before running the script, make sure you have visited the settings area of the (newly added) DNNArticle module to be updated and have pressed &amp;quot;update&amp;quot; there (even if you haven't changed anything) so that the corresponding records are created in the ModuleSettings table.   &lt;br /&gt;  &lt;br /&gt;The script is fairly straightforward, use at your own risk as always. Enjoy.   &lt;br /&gt;  &lt;br /&gt;  &lt;div class="code"&gt;&lt;font color="#006400"&gt;/*&amp;#160; &lt;br /&gt;------------------------------------------------------&amp;#160; &lt;br /&gt;Start of values to be changed each run&amp;#160; &lt;br /&gt;------------------------------------------------------&amp;#160; &lt;br /&gt;*/&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- This is the module id we are copying settings FROM&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@originalmodule&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@originalmodule&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#800000"&gt;430&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- This is the module id we are copying settings TO&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduletobeupdated&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@moduletobeupdated&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#800000"&gt;1232&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- This is the view tab id for the module we are updating, in case it is&amp;#160; &lt;br /&gt;-- different than the one of the source module.&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@viewtab&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@viewtab&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#800000"&gt;986&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;/*&amp;#160; &lt;br /&gt;------------------------------------------------------&amp;#160; &lt;br /&gt;End of values to be changed each run&amp;#160; &lt;br /&gt;------------------------------------------------------&amp;#160; &lt;br /&gt;*/&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- Some variables to hold table data&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;50&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingvalue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;nvarchar&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#800000"&gt;2000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#006400"&gt;-- Get a cursor and start updating&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;declare&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;cursor&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;fast_forward&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;settingname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;,settingvalue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;modulesettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@originalmodule&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;open&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;fetch&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;next&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;into&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingname,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingvalue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;while&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@@fetch_status&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#800000"&gt;0&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingname&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#808080"&gt;'ViewTab'&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;update&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;modulesettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;settingvalue&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@viewtab&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;settingname&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@settingname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;and&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@moduletobeupdated&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;begin&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;update&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;modulesettings&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;set&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;settingvalue&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@settingvalue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#0000ff"&gt;where&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#000000"&gt;settingname&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@settingname&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;and&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;moduleid&lt;/font&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;font color="#000000"&gt;@moduletobeupdated&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;fetch&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;next&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#0000ff"&gt;into&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingname,&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;@settingvalue&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;end&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;close&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;deallocate&lt;/font&gt;&lt;font color="#808080"&gt;&amp;#160;&lt;/font&gt;&lt;font color="#000000"&gt;cur&lt;/font&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-3400925312703012078?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/b2RlpngkkTJr59sZJI7gfhl0pdU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b2RlpngkkTJr59sZJI7gfhl0pdU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/b2RlpngkkTJr59sZJI7gfhl0pdU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b2RlpngkkTJr59sZJI7gfhl0pdU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/QdNiIMt1oPw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/3400925312703012078/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=3400925312703012078" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3400925312703012078?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3400925312703012078?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/QdNiIMt1oPw/copying-settings-between-dnnarticle.html" title="Copying settings between DNNArticle modules" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/09/copying-settings-between-dnnarticle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMERnozfip7ImA9WxdUGUQ.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-3026517340464887656</id><published>2008-08-06T06:41:00.003+03:00</published><updated>2008-08-06T06:46:47.486+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-06T06:46:47.486+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Utilities" /><title>MSDN-style core DNN documentation</title><content type="html">Mr. Ernst Peter Tamminga has created a help (.CHM) DNN Core reference file, based on the inline code documentation comments found on the DNN source code. Pretty useful, if you want to have a quick browse at all the DNN classes. The latest download is based on DNN 4.8.4.&lt;br /&gt;&lt;br /&gt;You'll find it here: &lt;a href="http://www.codeplex.com/DNNHelpSystem"&gt;http://www.codeplex.com/DNNHelpSystem&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-3026517340464887656?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HTn81DVREZnxDf6A8IaVzWG9TY8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HTn81DVREZnxDf6A8IaVzWG9TY8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HTn81DVREZnxDf6A8IaVzWG9TY8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HTn81DVREZnxDf6A8IaVzWG9TY8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/-dZmheRF-V8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/3026517340464887656/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=3026517340464887656" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3026517340464887656?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/3026517340464887656?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/-dZmheRF-V8/msdn-style-core-dnn-documentation.html" title="MSDN-style core DNN documentation" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/08/msdn-style-core-dnn-documentation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcDRHY8eCp7ImA9WxdUGUQ.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-814305429745184260</id><published>2008-07-04T18:07:00.003+03:00</published><updated>2008-08-06T06:41:15.870+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-06T06:41:15.870+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tweaking" /><title>Changing what appears on the title bar</title><content type="html">DotNetNuke has two ways of setting the title bar, depending on whether you set the "Page Title" field in Page Properties. It either displays your page title as you have set it, or the full path to your page (similar to the breadcrumb) when you leave it blank.&lt;br /&gt;&lt;br /&gt;Some third-party modules, though, do use the page title for their purposes so you may want to have a page title exactly the same as the page name (reminder: the page name is what you see in the navigation component, while the page title is what you see at the browser title bar). &lt;br /&gt;&lt;br /&gt;But you don't want the page title to appear "naked" in the title bar. You may still want to display the full path, or even just the portal name along with the current page's title.&lt;br /&gt;&lt;br /&gt;To do either:&lt;br /&gt;&lt;br /&gt;- Open default.aspx.vb (you'll find it in the root folder) with your favourite editor, even with notepad.&lt;br /&gt;&lt;br /&gt;- Locate the InitializePage() function.&lt;br /&gt;&lt;br /&gt;- Find the following chunk of code:&lt;br /&gt;&lt;br /&gt;            ' set page title&lt;br /&gt;            Dim strTitle As String = PortalSettings.PortalName&lt;br /&gt;            For Each objTab In PortalSettings.ActiveTab.BreadCrumbs&lt;br /&gt;                strTitle += " &gt; " &amp; objTab.TabName&lt;br /&gt;            Next&lt;br /&gt;            ' tab title override&lt;br /&gt;            If PortalSettings.ActiveTab.Title &lt;&gt; "" Then&lt;br /&gt;                strTitle = PortalSettings.ActiveTab.Title&lt;br /&gt;            End If&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first part of the code (set page title) says: "Put the full path in the title"&lt;br /&gt;The second part of the code (tab title override) says: "If the title is not empty, just show the title the user has entered and nothing else".&lt;br /&gt;&lt;br /&gt;In order to show the portal name along with the title the user has entered, change the line:&lt;br /&gt;&lt;br /&gt;strTitle = PortalSettings.ActiveTab.Title&lt;br /&gt;to&lt;br /&gt;strTitle = PortalSettings.PortalName + " &gt; " + PortalSettings.ActiveTab.Title&lt;br /&gt;&lt;br /&gt;In order to show the full path in any case (regardless whether the title is empty or not), DELETE the second part of the code all together (the last if...end if part). That way, the title will always be the full path to your page, comprised of the corresponding page titles of all the parent pages till the root page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-814305429745184260?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OmdRlM425aFH6CaVpMoJgnmWqc0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OmdRlM425aFH6CaVpMoJgnmWqc0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OmdRlM425aFH6CaVpMoJgnmWqc0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OmdRlM425aFH6CaVpMoJgnmWqc0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/A_UIrhvl970" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/814305429745184260/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=814305429745184260" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/814305429745184260?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/814305429745184260?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/A_UIrhvl970/changing-what-appears-on-title-bar.html" title="Changing what appears on the title bar" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>2</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/07/changing-what-appears-on-title-bar.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMBSXczfSp7ImA9WxdXFE0.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-8198273777332118124</id><published>2008-06-25T18:36:00.001+03:00</published><updated>2008-06-25T18:40:58.985+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-25T18:40:58.985+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Retrieving tabs using SQL, security-aware</title><content type="html">&lt;p&gt;There are times when you like to go deeper with DNN and retrieve certain information by means of an SQL Query or a stored procedure. That's what happened to me when I needed to create a custom combo box which would redirect the user to specific pages. &lt;/p&gt;  &lt;p&gt;In order to achieve that functionality, I had to use a module which would permit me to issue SQL queries to DotNetNuke and then format the results as I wanted. As I've stated many times before, I find the &lt;a href="http://www.bi4ce.com/?tabid=122&amp;amp;pid=2"&gt;ListX&lt;/a&gt; module pretty useful in these situations. &lt;/p&gt;  &lt;p&gt;One thing I discovered, though, is that you need to have a deeper understanding on what's going on with security in order to issue an SQL query that selects ONLY the tabs that a registered user has the right to see. You see, DNN tabs are not always visible to all user roles, so when using SQL you must be careful not to retrieve tab records that lead nowhere for the current user.&lt;/p&gt;  &lt;p&gt;I'm not going to go into details on what I've done with the ListX module, unless someone asks specifically for it. Instead, on this post, I'm going to focus on how to issue a SQL query that retrieves records from the Tabs table that are visible for the current user.&lt;/p&gt;  &lt;p&gt;For this post, it is assumed that you already know the ID of the current user in some way. &lt;/p&gt;  &lt;p&gt;If you issue something like:&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;SELECT tabid, tabtitle FROM Tabs&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Then you'll have all tabs, even those that are deleted. So we first need to have a WHERE clause to exclude deleted tabs, like this:&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;SELECT tabid,tabtitle FROM Tabs WHERE isDeleted=0&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;That leaves as with all active tabs, even those that are accessible by the administrator. In order to make our query security-aware, we have to see what tables the Tabs table is related to, in the context of security permissions. &lt;/p&gt;  &lt;p&gt;The related tables are the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;TabPermission&lt;/strong&gt;: A table which holds role permissions for every tab. Remember, DNN security works with roles. (We assume that we're not using the special &amp;quot;specific userid&amp;quot; feature that was introduced in later version of DNN).&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;UserRoles&lt;/strong&gt;: A table which holds the participations of DNN users to DNN security roles&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Users&lt;/strong&gt;: A table which holds the actual DNN users.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The table that interests us more is the &lt;strong&gt;TabPermission&lt;/strong&gt; table. Let's see the fields that interest us the most from this table:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;TabId&lt;/strong&gt;: &lt;/p&gt;  &lt;p&gt;The tab id the record is referring to. There may be more than one records per tab id in the TabPermissions table, if the tab is available to multiple roles or even to one role with multiple permissions (DNN grants VIEW and EDIT permissions to tabs).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;PermissionID&lt;/strong&gt;: &lt;/p&gt;  &lt;p&gt;The number you see here is the type of permission specified, and is related to the Permission.PermissionId field. If you do a SELECT * FROM Permissions you'll get, among other records, the following two records:&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;3&amp;#160;&amp;#160;&amp;#160; SYSTEM_TAB&amp;#160;&amp;#160;&amp;#160; -1&amp;#160;&amp;#160;&amp;#160; VIEW&amp;#160;&amp;#160;&amp;#160; View Tab     &lt;br /&gt;4&amp;#160;&amp;#160;&amp;#160; SYSTEM_TAB&amp;#160;&amp;#160;&amp;#160; -1&amp;#160;&amp;#160;&amp;#160; EDIT&amp;#160;&amp;#160;&amp;#160; Edit Tab&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;For our purposes, we will need permission id 3, i.e. VIEW permissions. Remember, we need the tabs that our user is allowed to see.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;RoleID&lt;/strong&gt;: &lt;/p&gt;  &lt;p&gt;This is where things get a bit complicated. The RoleID field is related to the &lt;strong&gt;Roles.RoleId&lt;/strong&gt; field (try a SELECT * FROM Roles to see what you'll get). But here, we don't need all the roles but just the roles our user is participating in. So we need to relate this field to the &lt;strong&gt;UserRoles&lt;/strong&gt; table, which holds that information. If you do a SELECT * FROM UserRoles WHERE UserId=xxx (put your user id in the place of xxx), you'll get all role participations for the specified user. &lt;/p&gt;  &lt;p&gt;(You'll notice that the &lt;strong&gt;UserRoles&lt;/strong&gt; table also has the fields &lt;strong&gt;ExpiryDate, IsTrialUsed and EffectiveDate&lt;/strong&gt;. For the sake of simplicity, we'll suppose that we don't have any roles with dates set, although it would be very easy to extend our final query to include only roles that are effective in the current time period.)&lt;/p&gt;  &lt;p&gt;In the &lt;strong&gt;TabPermissions&lt;/strong&gt; table, you'll notice two additional role ids that DO NOT exist on the Roles table: -1 and -2. -2 stands for &amp;quot;&lt;strong&gt;Host&lt;/strong&gt;&amp;quot;, and concerns pages accessible by the host user. -1 stands for &amp;quot;&lt;strong&gt;All Users&lt;/strong&gt;&amp;quot; and concerns all non-administrative pages that are accessible from the &amp;quot;All Users&amp;quot; virtual role (this role actually does not exist anywhere). &lt;/p&gt;  &lt;p&gt;Try doing the following:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;--Fetch only admin pages accessed by the Administrators role     &lt;br /&gt;select * from tabpermission      &lt;br /&gt;inner join tabs      &lt;br /&gt;on tabs.tabid = tabpermission.tabid      &lt;br /&gt;where roleid=0&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;--Fetch only non-admin pages accessed by all users     &lt;br /&gt;select * from tabpermission      &lt;br /&gt;inner join tabs      &lt;br /&gt;on tabs.tabid = tabpermission.tabid      &lt;br /&gt;where roleid=-1&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;--Fetch only host pages     &lt;br /&gt;select * from tabpermission      &lt;br /&gt;inner join tabs      &lt;br /&gt;on tabs.tabid = tabpermission.tabid      &lt;br /&gt;where roleid=-2&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And observe the different results.&lt;/p&gt;  &lt;p&gt;So what do we need in order to get the tabs that are accessible from a single, specific user? We'll take our initial query:&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;SELECT      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; tabid,tabtitle       &lt;br /&gt;FROM       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Tabs       &lt;br /&gt;WHERE       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; isDeleted=0&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And we'll amend it as follows:&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;declare @userid int      &lt;br /&gt;select @userid = 2 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;&amp;#160;&amp;#160;&amp;#160; select      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tabs.tabid, tabs.title      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; from       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tabs &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;inner join (     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; select       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; distinct tabpermission.tabid      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; from       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tabpermission       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; left outer join       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; userroles on tabpermission.roleid = userroles.roleid      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; left outer join       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; users on users.userid = userroles.userid      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; where       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tabpermission.permissionid=3      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; and (users.userid = @userid      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; or tabpermission.roleid=-1 or @userid=1)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ) as perm      &lt;br /&gt;on perm.tabid=tabs.tabid &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="courier new"&gt;where      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; tabs.isdeleted=0      &lt;br /&gt;order by tabs.tabid ASC&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;What we did was to initially declare a &lt;strong&gt;@userid&lt;/strong&gt; variable and give it a value (4 for our example, whatever suits you for your DNN installation - if you're making an SP out of this you can just provide the user's ID value as a parameter to the SP).&lt;/p&gt;  &lt;p&gt;We're using the @userid variable inside our &lt;strong&gt;JOIN&lt;/strong&gt; statement, which actually joins the &lt;strong&gt;Tabs&lt;/strong&gt; table with the &lt;strong&gt;TabPermission&lt;/strong&gt; table, but restricts the TabPermission table results to where the permission type is VIEW (id 3) and our user id is equal to @userid (users.userid = @userid) OR there are view rights for all users (tabpermission.roleid=-1)&amp;#160; OR our user is the administrator. (@userid=1), which overrides everything else. The DISTINCT clause is used to ommit propable multiple results for the same tab.&lt;/p&gt;  &lt;p&gt;This will essentially get us the tab records that are accessible with VIEW permissions for the given user. &lt;/p&gt;  &lt;p&gt;As I've mentioned before, some things are not covered in this query:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Permissions to a specific user id&lt;/li&gt;    &lt;li&gt;Roles with start and expiry dates&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;But in my opinion it's a good starting point for anyone who needs to create a security-aware tab retrieval query in DNN. &lt;/p&gt;  &lt;p&gt;Please let me know what you think.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-8198273777332118124?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KATCB9o_Lz2gelOE0_6-ae16Nio/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KATCB9o_Lz2gelOE0_6-ae16Nio/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KATCB9o_Lz2gelOE0_6-ae16Nio/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KATCB9o_Lz2gelOE0_6-ae16Nio/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/VSeu7OsJpvo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/8198273777332118124/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=8198273777332118124" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8198273777332118124?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/8198273777332118124?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/VSeu7OsJpvo/retrieving-tabs-using-sql-security.html" title="Retrieving tabs using SQL, security-aware" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/06/retrieving-tabs-using-sql-security.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUACQnc6eip7ImA9WxdTGUk.&quot;"><id>tag:blogger.com,1999:blog-660094329033919889.post-9174405164613583460</id><published>2008-05-16T17:04:00.003+03:00</published><updated>2008-05-16T17:22:43.912+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-16T17:22:43.912+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>The dbo.tabs.IconFile field issue</title><content type="html">The case is fairly simple: In a DNN installation, we needed the user to use the IconFile field (i.e. the "Icon" field in the Advanced Settings section of the Page Properties page to add a custom icon to each page they made. We would then use a query created in Bi4Ce's &lt;a href="http://www.bi4ce.com/"&gt;ListX &lt;/a&gt;module to present a list of pages in the form of an in-page navigation menu for a specific portion of the portal.&lt;br /&gt;&lt;br /&gt;To our horror, we discovered (using DNN version 4.8.2), that the IconFile field in the Tabs table takes two types of values: Either a value like "FileID=xxx", where xxx is the id of a record in the Files table, or the full path of the image file (Portals/0 is implied, so the file path is starting with the next sub folder).&lt;br /&gt;&lt;br /&gt;That is, if you've set the icon to be in portals/0/myimages/myimage.jpg, you either get an entry in the Tabs table like "FileId=2312", or an entry like "myimages/myimage.jpg". At this point we are not sure why this is happening, but the truth is we don't care. We just want the path to the actual file either way.&lt;br /&gt;&lt;br /&gt;In the case of the fileid thing, you can get the path by joining the tabs table with the files table and then the files table with the folders table (the folder path itself is in the folders table) and voila. In the case where the full path exists in the IconFile field, you obviously don't need to do anything else.&lt;br /&gt;&lt;br /&gt;We created a query which decides on what to do and produces a result set with two fields: tabid and img where img ALWAYS contains the full path to the image file (provided that one is set for the page), regardless of whether it's in the form "FileID=xxx" or in the full path form, and I'd like to share it with you.&lt;br /&gt;&lt;br /&gt;You can easily make a view out of it and use it where appropriate. It hasn't been tested on multi-portal installations, maybe things will differ a bit there. Comments are always welcome. Here goes:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;select &lt;br /&gt; tabid&lt;br /&gt; , case &lt;br /&gt;  when ltrim(rtrim(iconfilepath))='' &lt;br /&gt;  then folderpath+filename&lt;br /&gt;  else iconfilepath&lt;br /&gt;  end &lt;br /&gt; as img&lt;br /&gt;&lt;br /&gt;from &lt;br /&gt;(&lt;br /&gt;select &lt;br /&gt;&lt;br /&gt;   tabid&lt;br /&gt; , taborder&lt;br /&gt; , case&lt;br /&gt;  when patindex ('FileID=%', iconfile) &gt;0&lt;br /&gt;  then convert(int, replace(iconfile, 'fileid=', '')) &lt;br /&gt;  else 0&lt;br /&gt;  end &lt;br /&gt; as iconfileid&lt;br /&gt; , case&lt;br /&gt;  when patindex ('FileID=%', iconfile) =0&lt;br /&gt;  then iconfile&lt;br /&gt;  else ''&lt;br /&gt;  end &lt;br /&gt; as iconfilepath&lt;br /&gt; &lt;br /&gt;from &lt;br /&gt; tabs &lt;br /&gt;where &lt;br /&gt; isdeleted=0 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;) mytabs&lt;br /&gt;&lt;br /&gt;left outer join files&lt;br /&gt;on files.fileid = iconfileid&lt;br /&gt;left outer join folders&lt;br /&gt;on files.folderid = folders.folderid&lt;br /&gt;&lt;br /&gt;order by &lt;br /&gt; taborder asc&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/660094329033919889-9174405164613583460?l=dnnuke.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G1nTyJWv7VS_I6wVTYoRkGAV_wM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G1nTyJWv7VS_I6wVTYoRkGAV_wM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G1nTyJWv7VS_I6wVTYoRkGAV_wM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G1nTyJWv7VS_I6wVTYoRkGAV_wM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/DotnetnukeThem/~4/JEV2ksYWoE4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dnnuke.blogspot.com/feeds/9174405164613583460/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=660094329033919889&amp;postID=9174405164613583460" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/9174405164613583460?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/660094329033919889/posts/default/9174405164613583460?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DotnetnukeThem/~3/JEV2ksYWoE4/dbotabsiconfile-field-issue.html" title="The dbo.tabs.IconFile field issue" /><author><name>Gyromyristis</name><uri>http://www.blogger.com/profile/07078677584884156019</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="07147315759930180556" /></author><thr:total>0</thr:total><feedburner:origLink>http://dnnuke.blogspot.com/2008/05/dbotabsiconfile-field-issue.html</feedburner:origLink></entry></feed>
