YAFLogo

alex.kucherenko
13 years ago
Hi,

I'm working on YAF embedding into ASP.NET portal. Dirung embedding I found several issues and fixes for them.

Embedding Instructions:
1) download latest YAF ZIP
2) install it as standalone web site (virtual folder) first and configure
3) I place my YAF into ~/yaf (UNZIP yaf into that folder)
4) copy ~/yaf/App_Code into ~/App_Code
5) Merge ~/yaf/web.config with ~/web.config (I recommend to use WinMerge utility)
6) Configure Application settings, by applying keys:


 <add key="YAF.Root" value="~/yaf/" />
 <add key="YAF.BaseUrl" value="~/Support/" />

(Second option requered in case when ASP.NET page that embedding YAF located in other folder)

7) Copy ~/yaf/error.aspx and ~/yaf/error.aspx.cs into root ~/
8) Embed forum into page


<YAF:Forum runat="server" ID="forum"></YAF:Forum>

and don't forget to place code


  public void Page_Error( object sender, EventArgs e )
  {
    Exception x = Server.GetLastError();
    YAF.Classes.Data.DB.eventlog_create( YafContext.Current.PageUserID, this, x );
    YAF.Classes.Utils.CreateMail.CreateLogEmail( x );
  }   

After that forum should start to work...



Fixes required for several issues fixing:
1) CAPTCHA does not work on registration screen...

apply fix on file ~/yaf/pages/register.ascx.cs line 110


// FIX: 2009-07-10 - YafForumInfo.ForumRoot changed on YafForumInfo.ForumFileRoot
imgCaptcha.ImageUrl = String.Format("{0}resource.ashx?c=1", YafForumInfo.ForumFileRoot);

2) Text editor in text signature has problems with toolbar images showing...

apply fix ~/yaf/controls/EditUsersSignature.ascx.cs line 58


// FIX: 2009-07-10 - YafForumInfo.ForumRoot replaced by YafForumInfo.ForumFileRoot
_sig.BaseDir = YafForumInfo.ForumFileRoot + "editors"; 

So far it's all that I found during integration/embedding.


Sponsor

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
13 years ago
Thanks for your info!
eastern40
13 years ago
The above instructions do not work as simply as they are stated. I fear there has been a ton left out.

Quote:

1) download latest YAF ZIP
2) install it as standalone web site (virtual folder) first and configure



DONE! -- Ran as stand alone and worked fine.

Here is what I did: Vista OS, IIS7, SQL SERVER 2008 DEV, Visual Studio 2008 Pro

If you create a basic website with an App_Code directory and bin directory you cannot just follow the directions above.

1. Lets say you create a site called Site (creative i know). Also create two sub-folders yaf and Support.
2. Unzip yaf download into the yaf directory. Open Visual Studio 2008 and open website.
3. Set ~/yaf/install/default.aspx as your start page.
4. Open Sql Manager and create a database named yafnet.
5. Create a user at the database instance level named yafuser(this can be any user you like), set its default database to yafnet you can make it dbowner.
6. Open security under database named yafnet (the user should be there). *If not you did not do the above step correctly.
7. Now you must edit db.config to point to this database with the username and password you just created.
8. Now start the application: it now promts you on the startpage (install/default.aspx) to enter a password twice. *If you are like me it will EXPLODE here and tell you that ASPNET user needs to be able to modify app.config. But wait!!!! Vista does not use ASPNET user what should I do, reinstall my OS you say.....oh no. Just put that pass word in app.config under
<add key="YAF.ConfigPassword" value="yourpassword" />[/code]  This will now run the scripts in the database.
8.  Now follow the wizard to set up some config stuff and now you have a stand alone forums, wooohoooo.  [i]Note: (Not a 3 min setup by any means like someone in these forums suggested but certainly not 8 hours)  BTW I am running Vista as my dev machine i would think there is some tinkering that needs to be done for other OS's.[/i]

[quote]3) I place my YAF into ~/yaf (UNZIP yaf into that folder)
4) copy ~/yaf/App_Code into ~/App_Code
5) Merge ~/yaf/web.config with ~/web.config (I recommend to use WinMerge utility)
6) Configure Application settings, by applying keys:[/quote]

Followed verbatim -- does not work.  READ THIS ---- This leaves out many details and this could not work in any way, even if you imagined it to.


1.  You can unzip this into a directory you name Site -> yaf  -- Done you did this above.
2.  You must then copy all files from App_Code to Site -> App_Code
3.  You also need to copy the bin files Site -> bin  --- After this step you will stop a bunch of errors.
4.  Then you must move web.conig, app.config, mail.config, db.config, and UrlRewriter.config up one level to ~/
5.  you can then change the folowing lines in app.config
[code]<add key="YAF.Root" value="~/yaf/" />
<add key="YAF.BaseUrl" value="~/Support/" />
6. You may now add a default page to Support folder.
Add Lines:
<YAF:Forum runat="server" ID="forum"></YAF:Forum>

and

public void Page_Error( object sender, EventArgs e )
  {
    Exception x = Server.GetLastError();
    YAF.Classes.Data.DB.eventlog_create( YafContext.Current.PageUserID, this, x );
    YAF.Classes.Utils.CreateMail.CreateLogEmail( x );
  }   

7. Now you will be able to start up this as a new forum.

To the creators of YAF, I know documentation is difficult. I am a Systems Architect, I know how tedious it is, I do documentation all the time. But hear me out, your system is not bad it just needs some proper documetation to make it work well. I will try and see if I can work something up but these instructions should help most people starting out. Also, I have noticed a tone in alot of the forums....the tone is condescending. Who is your audience? Do you want this program to benefit developers only (very small population) or the masses whou would like to install and use the product (many people)? I know you guys are putting your heart and soul into developing this (and not getting alot in return $$) but I do think you need to determine who your audience is or atleast who do you WANT to target. A small audience is fine if that's what you would like. I tend to think free is for the masses, imho.
Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
13 years ago
Cool. I documented this on my blog (which would've saved you some time), but I haven't covered parts of the integration. I'll go back and add this though. Thanks alot!

Also: we all know we need documentation (see I didn't even bother to say "more documentation" just "some" would be nice) and due to lack of it, we can get a bit fed up on support (I'm guilty of this). But at least I have started with a bit of documentation in order to cure this malady.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Ederon 🙂 )
alex.kucherenko
13 years ago
Thanks to estern40 for proper "opening of all steps".

http://www.artfulbits.com/Support 

After my last post I did complex testing of forum integration and found huge number of issues:
- Medals, Avatars, Smiles etc. - does not work correctly, due to use YafForumInfo.ForumRoot instead of YafForumInfo.ForumFileRoot;

I fix this issues by finding all places in code that use ForumRoot and replace them on ForumFileRoot.

- I run URL validator on web site and found that pages pointing on resources that are not accassable.

Fix in details:
1) ~/yaf/resources should be copied to ~/Support/resources (files in that folder: ProviderExceptions.xml forum.css DataPanel.js yaf.js). That solve part of issues.

2) Also I found all places in code that use resource.ashx and modify them. They all should use ForumFileRoot instead of ForumRoot.

3) Smiles require changes in YafUrlBuilder. If you use binaries without sources, then you have a problem. Fix of class require rebuild of assemblies.

P.S. due to high number of changes in YAF, and huge number of replaces of ForumRoot to ForumFileRoot I now have doubts about my fixes. Right now it works, but will be good to have confirmation from developers side.

Thanks.
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
13 years ago
Thanks for your information, Alex. Question: why is the forum in ~/yaf and the url is ~/Support?

Also, access to the CSS and resource.ashx is client-facing (external) url. ForumFileRoot is internal and use for YAF loading files. ForumRoot is external and is the actual url to the forum.

Can you give me examples of the incorrect forward-facing urls?

I hear you on documentation. I just want to point out that not everyone is trying to integrate YAF into a portal. Basic setup (not upgrade) could be easier (working on that), but there has not been many complaints. But, if you plan to have a more complex configuration with YAF, having knowledge in regards to IIS configurations and ASP.NET is usually needed.
alex.kucherenko
13 years ago
Jaben wrote:

Thanks for your information, Alex. Question: why is the forum in ~/yaf and the url is ~/Support?



Due to complex web site structure, SEO optimzation and huge number of reference on our web site from other locations, I have to be to be very polite to web site logical structure.

Jaben wrote:


Also, access to the CSS and resource.ashx is client-facing (external) url. ForumFileRoot is internal and use for YAF loading files. ForumRoot is external and is the actual url to the forum.

Can you give me examples of the incorrect forward-facing urls?



I plan to publish very soon patch on all sources...

Jaben wrote:


I hear you on documentation. I just want to point out that not everyone is trying to integrate YAF into a portal. Basic setup (not upgrade) could be easier (working on that), but there has not been many complaints. But, if you plan to have a more complex configuration with YAF, having knowledge in regards to IIS configurations and ASP.NET is usually needed.



Thats why I start publishing all details here.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button