Tim Maxey .NET Technology Blog & Resources
So in DotNetNuke you want the SEO friendly URL like my-web-page-is-cool.aspx correct? Well unless you want to purchase the $120 deal and learn it, go ahead, but for me I just needed the dashes, that's all, didn't want to pay $120 for a thrid party module, ya know?
So I came across this post: http://rubicite.com/Tutorials/DotNetNukeFriendlyURLSeparators.aspx which I had to modify my DNN source with C# so get the code, open it up and go to the library/commons and globals and change this function:
public static string GenerateTabPath(int ParentId, string TabName)
To this:
public static string GenerateTabPath(int ParentId, string TabName)
{
string strTabPath = "";
var objTabs = new TabController();
if (!Null.IsNull(ParentId))
{
string strTabName;
var objTab = objTabs.GetTab(ParentId, Null.NullInteger, false);
while (objTab != null)
{
//strTabName = HtmlUtils.StripNonWord(objTab.TabName, false);
string S = System.Text.RegularExpressions.Regex.Replace(objTab.TabName, "[\\s]+", "-");
S = System.Text.RegularExpressions.Regex.Replace(S, "[^\\w-]*", "");
strTabName = S;
strTabPath = "//" + strTabName + strTabPath;
if (Null.IsNull(objTab.ParentId))
{
objTab = null;
}
else
{
objTab = objTabs.GetTab(objTab.ParentId, objTab.PortalID, false);
}
}
}
//strTabPath = strTabPath + "//" + HtmlUtils.StripNonWord(TabName, false);
string S2 = System.Text.RegularExpressions.Regex.Replace(TabName, "[\\s]+", "-");
S2 = System.Text.RegularExpressions.Regex.Replace(S2, "[^\\w-]*", "");
strTabPath = strTabPath + "//" + S2;
return strTabPath;
}
Rebuild the "Library" upload new DotNetNuke dll and you are set, work like a champ, it's getting ready to be used on http://DTGDNN.noptm.com, then on their live site: Direct to Garment Printer
Hope this help someone else! Let me know if you want the dll, mine id 6.1.3.108, but for if you like shoot me an email and for $40 I will take current version of DNN amd update the dll for ya if you have a different version.!
I haven't had to use a direct call to a stored procedure in a long time, but came across the could not find stored procedure error. (And yes I had all security set fine). If I uncommented out the "commandType" it worked!
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("myconnection").ConnectionString)
Dim cmd As New SqlCommand
Dim execStr As String = "EXEC dbo.InsertActivity " & userid
cmd.CommandText = execStr
'cmd.CommandType = CommandType.StoredProcedure DOES NOT WORK WITH THIS UNCOMMENTED, WEIRD
cmd.Connection = conn
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
cmd.Dispose()
Click on the link below to start tethering with no problems on Verizon with Gingerbread! Thank you to the guys over at:
Geek Sailor
In fact, I am posting this blog post from the tethering software, installed quick and worked fast!
So you forgot and can no longer get into the nopCommerce administration? Easiest way to do it is this:
-
1. Register a new user from the main website
- 2. Open SQL server and update that user to "IsAdmin=1"
- 3. logout and login with that same user
- 4. Goto the administrator and customers and change whatever account your need etc..
Hope this helps!
I came across the problem of when I wanted to update my Android SDK, or add Google Maps api, or add the Google Checkout, Licensing packages, I'd get "nothing installed" and some crap about can't update the packages, check the path etc, etc..
Well come to find out, you got to go to the start menu, Android SDK Tools right click on the SDK Manager and run as Administrator...
I just happen to try that and it worked! Hope it helps someone else out there!
Microsoft SQL Server Management Studio: An error with a message like “Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.VisualStudio.OLE.Interop.IServiceProvider’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{6D5140C1-7436-11CE-8034-00AA006009FA}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0×80004002 (E_NOINTERFACE)). (Microsoft.VisualStudio.OLE.Interop)
My error, the first solution, download the cmd file this dude made and run as admin, reboot, geesh! It worked for me, hope it works for you and gets on Goolge, save someone some time!
http://www.davidmoore.info/2009/08/19/solution-explorer-open-each-folder-in-same-window-error-and-sql-management-studio-ie-and-team-explorer-errors/
So on my TimMaxey.com blog I am using BlogEngine.Net, a great opened source Blog software! I am not sure which one I like better, this one (SubText) or BlogEngine. (I am leaning towards BlogEngine for the XML provider...
So anyway I was using MySQL as the provider for my blog over there and I wanted to change it to the XML provider. I found a great article and zip file for the migration. It also works for going from XML to a Database, but I hadn't tried that yet.
Worked like a champ, but remember to change ALL DEFAULT providers in the web.config to the the xml provider. I orginally only set the first one in the web.config and kept getting garbage characters when I tried to login, finally realized I didn't change the security, roles etc provider deep in the web config to the xml provider. All good now!
Here the post:
http://www.nyveldt.com/blog/page/BlogEngineNET-Provider-Migration.aspx
Ok, gonna try to explain this, for me and for you:
I needed to strip apart a strap number like U-22-29-5J5-0000.20 and pass it to the property appraiser's site like: 29225J5000020U
Now how do you do that? You have to use Regular Expression Replace, so pattern the above like this:
([0-9a-zA-Z]{1})([\w-]{1})([0-9a-zA-Z]{2})([\w-]{1})([0-9a-zA-Z]{2})([\w-]{1})([0-9a-zA-Z]{3})([\w-]{1})([0-9a-zA-Z]{4})([\w.]{1})([0-9a-zA-Z]{2})
Say what? huh? Let's break it apart. The above regex is the "pattern" to look for, so we are matching in the first () i.e. ([0-9a-zA-Z]{1}) all numbers and letters. Note: each character in the orginal strap is represented by "something" in parentheses ()
This first set ([0-9a-zA-Z]{1}) is the "U" notice the [ ] then the { } we have a {1} to represent only one character and what's inside the [ ] is normal regex matching for numbers and letters. Then the next character ( a dash - ) is represented like ([\w-]{1}) (The \w is match word characters like dashes or periods, in our case toward the end I use ([\w.]{1}) to represent the period toward the end of the strap string.
So if you follow the above "pattern" it will match the orginal strap. Now we do this so we can replace, move stuff around, each section or what is in the parentheses is a unit, or in our instance, there are 11 section patterns, does this make sense? ([0-9a-zA-Z]{1}) is 1 and ([\w-]{1}) is another (2), ([0-9a-zA-Z]{2}) is 3 etc, etc,
So our "replace" filter is represented by a $ then the "section" number, so in our case since we need U-22-29-5J5-0000.20 to look like 29225J5000020U, we need the 5th section first: $5, then we need the "22" which is the 3rd $3 and so forth until we get this: $5$3$7$9$11$1
Broken down:
U = 1
- = 2
22 = 3
- = 4
29 = 5
- = 6
5J5 = 7
- = 8
0000 = 9
. = 10
20 = 11
Now we can use this is a RegEx.Replace
This example is VB.NET but you could do it for whatever supports RegEx.Replace...
Dim strP as String = "([0-9a-zA-Z]{1})([\w-]{1})([0-9a-zA-Z]{2})([\w-]{1})([0-9a-zA-Z]{2})([\w-]{1})([0-9a-zA-Z]{3})([\w-]{1})([0-9a-zA-Z]{4})([\w.]{1})([0-9a-zA-Z]{2})"
Dim strR as string = "$5$3$7$9$11$1"
Dim mynewstrap = RegEx.Replace("U-22-29-5J5-0000.20",strP,strR)
The variable mynewstrap now = 29225J5000020U
Alternatively if you needed the "new" strap to be 29/225J50000/20U (notice the forward slashes) how would you do that?
Dim strR as string = "$5/$3$7$9/$11$1". Hope this helps, you can really do a lot with this stuff, mix and match etc, like the 5J5 for instance, that "section" ([0-9a-zA-Z]{3}) could be "broken" up if you needed the J in the front, so that section would then become ([0-9a-zA-Z]{1})([0-9a-zA-Z]{1})([0-9a-zA-Z]{1}) and the $numbers would be:
5 = $7
J = $8
5 = $9
and the rest of the sections would now have different numbers
- = $10
0000 = $11
. = $12
20 = $13
Then if you needed this U-22-29-5J5-0000.20 to look like this J292255000020U, then the strR would look like this:
$8$5$3$7$9$11$13$1
Hopefully this all makes sense to me the next time I need it!!!