Chris Hammond

DotNetNuke Upgrade and Consulting specialist

News

Thanks for visiting my blog, you can find more about me at ChrisHammond.com. I specialize in all things DotNetNuke

Cool Sites

My domains

Projects

Archives

February 2007 - Posts

I'm going under the knife

Well, not me, but my Computer is going under the knife tonight.

I've had it with Vista and am getting my machine ready to reformat and I'll be installing XP Pro again.

I'll post again sometime tonight/tomorrow when I'm back up and running. CYA Vista, I'd say it's been fun, but I can't.

Posted: Feb 16 2007, 09:05 PM by Chris Hammond | with 6 comment(s)
Filed under:
Woot Off Tracker to use?
Let's say today were a Woot Off, which is isn't. What Wootoff tracker would you use for trying to keep up to date with the latest item?
Deleting unused blogs and photo galleries in CommunityServer.

I decided to remove some unused blogs and photo galleries from a few of my CommunityServer sites today. Here's some ROUGH SQL code to do it.

It worked for me, but I make no guarantees how it will work for you! Backup your database before performing any type of maintenance.

Be sure to sub in your UserId where I note below with the ##. I run the commented out code first at the top, this creates a quick table, after doing my testing I commit the changes then drop the table I had created.

I don't claim this code is great, but it got the job done :D

/*

create table temp_deletesections

(

SectionId int,

Processed int default 0

)

*/

begin tran

tran

--rollback

declare @rowsAdded int

insert into temp_deletesections

@rowsAdded int

insert into temp_deletesections

into temp_deletesections

select sectionid, 0 from cs_sections

sectionid, 0 from cs_sections

where totalposts <1

totalposts <1

set @rowsAdded = @@rowcount

@rowsAdded = @@rowcount

while @rowsAdded > 0

begin

declare @sectionDeleteId int

select top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0

@rowsAdded > 0

begin

declare @sectionDeleteId int

select top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0

begin

declare @sectionDeleteId int

select top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0

@sectionDeleteId int

select top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0

top 1 @sectionDeleteId = sectionId from temp_deletesections where processed=0

exec dbo.cs_Section_CreateUpdateDelete @SectionID=@sectionDeleteId,@DeleteForum=1,@SettingsID=1000,@UserID=##

dbo.cs_Section_CreateUpdateDelete @SectionID=@sectionDeleteId,@DeleteForum=1,@SettingsID=1000,@UserID=##

update temp_deletesections set Processed = 1 where Processed = 0 and sectionId = @sectionDeleteId

temp_deletesections set Processed = 1 where Processed = 0 and sectionId = @sectionDeleteId

set @rowsAdded = @rowsAdded-1

@rowsAdded = @rowsAdded-1

end

--commit

--drop table temp_deletesections

 

Why I won't be upgrading to CommunityServer 2007

I'm really starting to lose enthusiasm for Community Server the more and more it becomes restricted and pricey with it's licensing model. I guess it's time to look into writing some conversion scripts from CS to DotNetNuke for Forums and Blogs, as DotNetNuke still remains a good free solution for community websites.

CS seems to become more restrictive everytime the have a new release (once a year).

I use CS on a few sites (http://themadblogger.org, http://stlouisinside.com, http://sccaforums.com, http://solo2.org/, http://chrishammond.com) but will seriously consider making the move to DotNetNuke based sites for those currently running CS if the Licensing stays the way it is for 2007. I had actually looked forward to doing the upgrade to 2007 for some of the sites.

Open Source works -> www.dotnetnuke.com

Using DotNetNuke lists (c# included)

A quick update for using DotNetNuke's built in List functionality.

If you're logged in as a HOST you can create new lists from the HOSTS/LISTS menu.

If you want to access lists programatically? Here's some simple code for doing so, this uses the included United States region (States) list. In C# of course.

import DotNetNuke.Common.Lists;

using

then use the following in your code

ListController lc = new ListController();

ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Region","","Country.US");

ddlStates.DataTextField = "Text";

ddlStates.DataValueField = "Value";

ddlStates.DataSource = leic;

ddlStates.DataBind();

ddlStates.Items.Insert(0, new ListItem("Select State", "-1"));

 

Pretty simple! now get to it!

More Posts