Thursday, October 14, 2010

DotNetNuke Pro - A cheap SQL Query to display all pages with unapproved content

Here is a very cheap way to display all of the pages on your site with unapproved content on them. Be sure to check the WorkFlowState table in DNN to ensure that your are selecting the correct workflow state(s), you may have more than one StateID to add to this query if you have been creating custom workflows.

<asp:DataList ID="DataList_Portal0" runat="server"
            DataSourceID="SqlDataSource_Portal0" >
                <a href='<%#Eval("TabPath").ToString().Replace("//","/") %>.aspx'><%#Eval("TabPath").ToString().Replace("//","/") %>.aspx</a>
        <asp:SqlDataSource ID="SqlDataSource_Portal0" runat="server"
            ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
                SELECT [TabPath] FROM [Tabs] WHERE [TabID] IN
               SELECT [TabID] FROM TabModules WHERE [ModuleID] IN
                   SELECT [ModuleID] FROM [HtmlText]
                    WHERE StateID=5


No comments:

Post a Comment