
HOT New Web Service, SquareLeaf
I'm going to make it a regular thing here of me writing about a new web site or service which I find useful or interesting from the web. For the first of such articles I'm going to write about a new web service which I find very useful called SquareLeaf.

In the most simplest sense, Square Leaf is Post-It Notes in a web interface. You're basically given a white-board in which you can place different colored notes on it with whatever you like. Laundry list, errands, shopping list, etc etc. Whatever you'd like.
I'm a big fan of efficiency and project management and by utilizing SquareLeaf the right way makes handling those two very much easier.
It's missing a lot of features I wish it had (like, text colors, sizes, fonts, etc etc), and I hope they're at least working on these, but it's very useful already, indeed.
Bottom line:
SquareLeaf is the Post-It Notes I always wished I had.
Have A Copy of New User Welcome Message Sent to You (ASPDotNetStoreFront)
ASPDNSF Version: 9 (C# + MS SQL)
If you would like to have a copy of the new user welcome email message sent to you whenever a new user signsup to your shop, well you'd assume they would have this feature in the system already...but that's not the case. This feature is currently lacking in AspDotNetStorefront as of version 9 (ML).
No fear, Ben is here!
To enable this feature it will take a bit of C# work and some tinkering.
First, open up createaccount.aspx.cs using your favorite text editor. Then find the lines of code where the welcome message is sent to the new user...
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(...
Now, add the following code after the try and catch...
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"youremail@yourdomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
...being sure to change "youremail@yourdomain.com" to the email address where you want to receive the notifications.
Example:
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
EMailField,
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}
catch { }
// below added by Benjamin Eskew (Aug 25, 2010)
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"myemail@mydomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
// the above added by Benjamin Eskew (Aug 25, 2010)
}
Now save the file and upload it to your server and that's that! Do realize that this is just a simple copy of the message, not a custom message sent to the administrator. In order to make something like that you'll have to create a custom XmlPackage to handle it and use that one in place of the current one in use (XmlPackage.WelcomeEmail).
As you can see from my current and previous posts, I've been working a lot with AspDotNetStorefront lately and have plans to continue posting information articles like this one here, so stay tuned!
The MS SQL and NTEXT Problem (SOLVED)
So, the other day I ran into the problem of trying to pull data from a field which was of type ntext in a MS SQL database using PHP. I'm fairly new with MS SQL and Windows IIS server environments for that matter so please bare with me. Well, I found the solution!
When you're using PHP's mssql_ functions and you need to pull data from a table field which is of type ntext you can't simply pull it using typical select methods, you need to cast the variable as another because the ntext type is not supported in PHP's mssql_ functions.
Code Which Wasn't Working:
$r = mssql_query("select ProductID, Description from myTable where id = '1'");
Solution:
$r = mssql_query("select ProductID, CAST(Description AS TEXT) AS Description from myTable where id = '1'");
Use Facebook “Like” Widget in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
It's very easy to embed the Facebook "Like" widget into an XMLPackage (like the product pages for example) within AspDotNetStorefront. Simply add the following code to your XMLPackage:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.yoursite.com%2F(!PAGEURL!)&layout=button_count& show_faces=false&width=50&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>
Of course, you should adjust the iframe variables to your liking.
Use Images as Add To Cart/Add To Wish List Buttons with AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default AspDotNetStorefront uses basic form buttons for the Add To Cart and Add To Wish List features in the design. If you'd like to use images as those buttons instead you will need to make some modifications.
First, make sure you have some good images to use and then upload/FTP them to the theme images directory "App_Themes/Your_Skin_Folder/images/". Now go to the AspDotNetStorefront back-end administration and go to "Configuration > Advanced > AppConfig Parameters" and find the config "AddToCart.AddToCartButton" and update it with the image you are going to use for the Add To Cart button. Then, find the config "AddToCart.AddToWishButton" and update it with the image you are going to use for the Add To Wish List button. Finally, find the config "AddToCart.UseImageButton" and change it to true. Your Add To Cart forms should now use your images as buttons.
Display MSRP in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default in AspDotNetStorefront the MSRP for products is not displayed or used within the product.SimpleProduct.xml XMLPackage, so if you would like to use or display it you will need to make some fine-tuned adjustments.
The Quick and Dirty Way (not as efficient):
In your product.SimpleProduct.xml XMLPackage find the lines where database queries are being made, like:
...
<query name="Products" rowElementName="Product" runif="edit">
<sql>
<![CDATA[
exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
]]>
</sql>
<queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
<queryparam paramname="@CustomerLevelID" paramtype="system" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
</query>
...
and add a new database query by adding the following after the last query:
<query name="Variant" rowElementName="Price" runif="showproduct">
<sql>
<![CDATA[
select MSRP from dbo.ProductVariant with(NOLOCK) where ProductID=@ProductID and IsDefault=1
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
</query>
ex.
...
<query name="Products" rowElementName="Product" runif="edit">
<sql>
<![CDATA[
exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
]]>
</sql>
<queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
<queryparam paramname="@CustomerLevelID" paramtype="system" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
</query>
<query name="Variant" rowElementName="Price" runif="showproduct">
<sql>
<![CDATA[
select MSRP from dbo.ProductVariant with(NOLOCK) where ProductID=@ProductID and IsDefault=1
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
</query>
...
Now, in your XMLPackage wherever you'd like to display the MSRP, simply add the following:
<xsl:value-of select="aspdnsf:FormatCurrency(/root/Variant/Price/MSRP)" disable-output-escaping="yes" />
The Efficient Way (MS SQL):
Using SQL Management Studio, open up the stored procedure and locate near the bottom where it reads:
...
SELECT
p.*,
pv.VariantID, pv.name VariantName, pv.Price, pv.Description VariantDescription, isnull(pv.SalePrice, 0) SalePrice, isnull(SkuSuffix, '') SkuSuffix, pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points, pv.Inventory, pv.ImageFilenameOverride VariantImageFilenameOverride, pv.isdefault, pv.CustomerEntersPrice, isnull(pv.colors, '') Colors, isnull(pv.sizes, '') Sizes,
...
simply add the MSRP table call to the select statement, like:
...
SELECT
p.*,
pv.VariantID, pv.name VariantName, pv.Price, pv.MSRP, pv.Description VariantDescription, isnull(pv.SalePrice, 0) SalePrice, isnull(SkuSuffix, '') SkuSuffix, pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points, pv.Inventory, pv.ImageFilenameOverride VariantImageFilenameOverride, pv.isdefault, pv.CustomerEntersPrice, isnull(pv.colors, '') Colors, isnull(pv.sizes, '') Sizes,
...
Now, execute the statement.
Finally, in your XMLPackage where you'd like to display the MSRP simply add the following:
<xsl:value-of select="aspdnsf:FormatCurrency(MSRP)" disable-output-escaping="yes" />
Or, if you're calling it from outside of the Product template, use the full xpath, like:
<xsl:value-of select="aspdnsf:FormatCurrency(/root/Products/Product/MSRP)" disable-output-escaping="yes" />
Display SKU in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default in AspDotNetStorefront the SKU for products is not displayed or used within the product.SimpleProduct.xml XMLPackage, so if you would like to use or display it you will need to make some fine-tuned adjustments.
First:
In your product.SimpleProduct.xml XMLPackage find the lines where the Product is being handled, namely the lines starting with:
...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
...
...
and add a new parameter call to the parameters by adding:
<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>
ex.
...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
<xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
<xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>
...
...
Now, in your XMLPackage wherever you'd like to display the SKU, simply add the following:
<xsl:value-of select="$pSKU" disable-output-escaping="yes"/>
Using this method you can call any field from the Product table including Variants, like if you simply wanted to get the ProductID so you can display it in the XMLPackage...
...set parameter for it:
<xsl:param name="pID" select="aspdnsf:GetMLValue(ProductID)"></xsl:param>
...use it:
...href="http://www.yoursite.com/EMailproduct.aspx?productid={$pID}"><img src="http://www.yoursite.com/App_Themes/Skin_1/images/Icon-Email.gif"...
Make Breadcrumbs in AspDotNetStorefront template.master
ASPDNSF Version: 9 (C# + MS SQL)
If you've not gone through every nook and cranny of the AspDotNetStorefront manual chances are that you haven't figured out how to properly create "breadcrumbs" with your navigation.
No fear, Ben is here.
In your template.master skin file, located at "App_Templates/Your_Skin_Folder/template.master", simply add the following immediately after the opening id="content" DIV:
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
ex.
...
<div id="content">
<!-- CONTENTS START -->
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
<asp:ContentPlaceHolder ID="PageContent" runat="server">
</asp:ContentPlaceHolder>
<!-- CONTENTS END -->
</div>
...
Although, you don't absolutely NEED to add it within the content DIV, I just placed it there because it's the top-most element within the content column in the layout. Technically, you can add it anywhere you'd like within the template.master file.
hitMan Visual Basic Source Code (AOL PWC)
(DISCLAIMER: The software attached is NOT legal to use but is legal to view and has educational value to those who would like to learn how to connect to remote servers using the HTTP protocol (and Winsock) through their Visual Basic applications for PC. During development stages of this application it was completely legal to make such software, but is not now. You have been warned.)

hitMan was an AOL/AIM password cracker which I had developed when I was learning how to program for Windows PC's and communicating with the AOL software. It was originally developed with the intent to display to other programmers how evolved I was getting and to convey how they should also be; follow your own path and don't be a follower. It was completely programmed using Visual Basic 6.
Within the source code you will discover how to connect to a remote server and send/retrieve data (communicate through proxies also). You will also learn how to manipulate other software (specifically the AOL software) using basic Windows manipulations. I'm sure you'll also learn way to much about using Visual Basic as a whole (my primary reason for releasing this source code), like window manipulations, Windows memory usage, shell calls, etc.
Remember, if you are to compile the source files and try to use this software you could be held accountable for whatever is to happen.
To Be Releasing All My Old VB Projects Soon
I've recently decided to let the world gasp in horror and amazement at all of my old source projects which I made using Visual Basic way back in the day when I was learning how to program on PC's.
This all includes my old AOL & AIM related projects (yep, including a famous "cracker" which I made for fun back then) because I believe they all hold educational value even today. I'm currently preparing a lot of the projects for you to easily download and whatnot so give me a bit of time. I will be releasing the main source code for hitMan later on today/tonight though. Stay tuned!