I had a fun time getting YAF to work with ASP.NET, custom master pages and the like(
http://www.itcs4u.com/yaf.aspx ). It does work now with almost zero issue, the next thing I will be doing is customizing the YAF pages directly. So, let me tell you my setup:
Package: The basic stable 1.9.1.8 found at Here
Setup Time as long as prereq's(denoted by 😉 are done first and including setting up YAF online: 45 minutes unless you like to play 😎
Host: GoDaddy Basic Windows IIS 6.0 Web Hosting (the purchased one, not the free one with Domain Registration). No dedicated server, no dedicated IP. If you use IIS 7.0 from GoDaddy, please enable the compatibility option in the IIS settings. This helps tremendously as their may be some ASP.NET commands that behave slightly differently and we don't need the problem being your IIS provider version. !!!I DID NOT USE THE YAF ADD ON PROVIDED BY GODADDY. I DID NOT NEED TO UPGRADE MY PACKAGE TO GET YAF TO WORK AS GODADDY CLAIMS, AND DID THIS WITHOUT THIS SETUP BEING A HAK!!!
*DB: Many come with the above hosting package, but whatever you use, you must specify a Database that can have a connection string work over the internet. For GoDaddy, created the MS SQL 2005 DB and ran through that process. The DB must be set up first before this will work online. For development purposes, you can use a local DB, but you will need to be sure to update all the pointers, and re-run the 'install' when the site is published. My connection string is below (bold is the servername) and is in a format that 'yafnet' can use.
Data Source=dbname.db.372980.hostedresource.com;Initial Catalog=dbname;Persist Security Info=True;User ID=dbadmin;Password=***********
Existing Website: If you want to use your master pages, css, layouts, themes, etc. BACKUP YOUR WEB.CONFIG file.
Dev Tool: MS Visual Web Developer 2008 Express Editions with the MSDN package installed along with all ASP.NET additions. Is a C# and VB compiler to boot and can do dll mods too. Also has a nice DB explorer which auto generates connection strings and the like that you can use in C#. And it's free.
Step 1: Read the install.txt file below. This is pulled right from that file, but I have added some notes to it. This is not an upgrade How To, so I have removed the references:
1. Unzip to a folder available from your web server. ^Now, I did everything locally and freshly, using the YAF folder as my base, "/". I unzipped the files to a YAF directory and loaded the directory as a Web Site in VWD. If you are planning on publishing this, then I don't see a need to do this live. In fact, doing a live install on a production site I would not recommend. When extracted, go into the install folder, open up fulltext.sql with a text editor, delete everything, save and close.^
2. If you do not already have a "Web.Config" file, rename default.config
to web.config. If you do have a "web.config", merge default.config
changes with it.^Since we are using the YAF folder as a base, then we need to do this. Delete all references to UrlRewriter (3 lines) and I also removed the globalization command so YAF doesn't step on my master pages.^
3. Open up "yafnet.config" and modify connstr to a valid database connection
string for your SQL Server 2000/2005/Express database. The database that yaf
points too should already exist.^As it states. The connection format that is used above works with 'yafnet' and SQL 2005^
3. If YetAnotherForum.net isn't installed at the root of your web
server, make sure the files in the bin directory of the zip file
is copied to /bin on your web server. Also you'll need to add the
element to the yafnet.config to point to the correct URL. Example: If you have install the forum in the directory "/forum/yaf/"
you will need to add /forum/yaf/ to web.config.^OK, we can leave this alone for now. In my instance, I built YAF first, and then pulled everything into my current site and not into any sub-directory. When I played around and searched the web for various solutions, you need the full directory name, such as "MySite/forum/yaf/", so it includes the "/" descriptor. If you decide to use a different folder, then do this option. If you plan on keeping all the OOB logicals, ignore this step.^
4. Open the file install/default.aspx on your web site. If you are testing on your local computer, under a directory called
YetAnotherForum.Net, the address should be:
http://localhost/yetanotherforum.net/install/^Don't do this step until the site is published. Then we will run it from the internet. This step specifically configures the DB that you set in your connection string, so if you are using a local DB to develop, you'll just need to re-run the install in production, unless you copy your dev DB over and revise your connection string.^
5. Follow the directions and log in with the administration account
you created during the setup.^Skip, we'll pick this up again in a little bit^
NOTE: Url Rewriting is disable by default in this version to due to setup complexities for some users.
If you care about SEO for your forum, and are running YAF in a stand-alone configuration (non-DNN or Rainbow),
you can enable URL rewriting in yafnet.config by changing this line to true:
true
If you have any questions, please visit our forums at: forums.yetanotherforum.net
or e-mail to: support@yetanotherforum.net
Step 6: Compile the project and look for any errors. VWD generates 2 specific warnings and 2 specific info, both relating to not being able to define yafnet. You can ignore these if the are warnings or info only. If there is an error, trace it down. Don't execute any of the sites.
Step 7a: So, now you have a configured YAF site ready to integrate into your site. Now would be the time to change any references as stated in step 3 as it relates to your current website. If you are using a subdirectory, go ahead and move those YAF files over to that directory and goto step 8.
Step 7b: If you are going to use the same logical calls as the build and just bring everything over, then we need to wait for now and go to step 8.
Step 8: Now, we need to combine the web.config files. Use a regular text editor for this part as you should have a side by side comparison. Everything in the YAF web.config must be in the same area as the destination web.config file. GOTCHAS: So I fought with
And tried many different things. ASP.NET, depending on your current setup, may already have a string. If your current web.config file has anything else other than a single string for authentication, you may run into problems. If your site currently doesn't need any type of authentication, replace the string in your web.config with this one.Step 9a: Move yafnet.config to your "/" folder. Move the content of the YAF bin folder to your sites bin folder. If you are using a sub-folder, goto step 10.
Step 9b: Rename default.aspx in your YAF directory to default.aspx.yaf. Rename any other files as needed with the expectation of tweaking needed later on. Merge all the YAF the files/folders to your current website.
Step 10: VERIFY ALL REFERENCES
Step 11a: Create a new page or link that uses YAF. If you are doing either a subfolder install or base install, just put a link on your site referencing the ~/YAFfoldername/install/default.aspx. !!Be Carefull, this is the setup so it is not locked down yet!! Or:
Step 11b: Create a new webpage.aspx, using your favorite master page. Using the source view, add the following to the top of the page just under the page title declaration:
<%@ Register TagPrefix="yaf" Namespace="yaf" Assembly="yaf" %>
<%@ Register TagPrefix="yc" Namespace="yaf.controls" Assembly="yaf" %>
And to the content area, add the following which is the key for YAF:
Here is my yaf.aspx page:
<%@ Page Title="" Language="C#" MasterPageFile="~/ITCS.master" %><%@ Register TagPrefix="yaf" Namespace="yaf" Assembly="yaf" %>
<%@ Register TagPrefix="yc" Namespace="yaf.controls" Assembly="yaf" %>
11c: Publish that webpage and navigate to it !!Be Carefull, this is the setup so it is not locked down yet!!. It should automatically start at the setup page.
12: Run through the setup with the options you want. For the SMTP server, I had to use
relay-hosting.secureserver.net and no username or password, but that is for GoDaddy. I have read several forums where people were having difficulty with their SMTP provider. GOTCHAS: You do NOT need to define the in web.config for YAF to work. However, if you are having difficulty with SMTP, you may want to configure it with the appropriate settings. Doing this through web.config will allow you to set special settings such as the port# and any TLS security and the like and it's easier than going through the YAF files.13: !!!RENAME THE YAF INSTALL DIR AND THE DEFAULT.ASPX WITHIN FOR SECURITY PURPOSES!!! It will break the install link on your admin page, but you can rename the install and default.aspx when needed again.
You should be done, now you can fully configure YAF through the web and play with the page look, etc.
One annoying gotcha that I ran into, and yes, it is really, really stupid I know, but if you are logged in as admin, and you use the admin tools to change your username, it will immediatly kick out an error that "originalname" doesn't exist, and you are locked out of your site until you clear out the cookies or various other ways to get back in. So, don't do that 🙂 Just create another user that you want and then delete the old one. :cheesy:
Jimmy
Chief Technologist
ITCS
www.itcs4u.com
Please, someone correct me if I am wrong, because it happens a lot, that's how I learn! It is quite motivating to break something that causes a company to lose $12,000/minute, find out how you broke it, find out why what you did broke it, find out how to prevent that from happening again, then find out how to undo what you did.:cheesy:
Oh yeah, and what you broke is in California and you are in Connecticut and because you work with 100 other IT people that don't have a clue, you have to be the one to fix it.
Jimmy Andrews
Chief Technologist
ITCS
www.itcs4u.com