YAFLogo

Pinguino
  • Pinguino
  • 56.6% (Neutral)
  • YAF Camper Topic Starter
13 years ago
Is there a walkthrough that shows how YAF 1.9.5.5 can be installed in such a way that a the yaf:forum control can be added to one of my website's master pages to have the forum appear in the existing web site structure.

I've been attempting to make it work using an old instructions I found on the wiki and that is producing more headaches than results.

Has anyone successfully installed the newer version of YAF (1.9.5.5 or the 1.9.6 beta) into an existing web application?

My ideal scenario:

1. YAF runs in an entirely different database (perhaps a pipe dream given that I would like to have my existing asp.net membership logins function in YAF -- but I have no custom profile provider).

2. The majority of application files sit in a subdirectory like ~/yaf/ (with the exception of assemblies in ~/bin/ and a few .config files in root).

3. Forum integration is as simple as placing a into one of my master paged webforms.

Links:

Here are some sample instructions (the ones that didn't work nicely for me). I might try just integrating YAF into an otherwise blank application using these instructions and see what happens. Maybe it will give me a clue as to where things went wrong. I though the web.config merging went smoothly but... ??? Sigh.

http://wiki.yetanotherforum.net/1_9.ashx 

http://wiki.yetanotherforum.net/embeddedYaf.ashx 

http://wiki.yetanotherforum.net/Merge web_config 1.ashx 

http://wiki.yetanotherforum.net/Integration with existing Application (Revisited).ashx 

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
13 years ago
I created a Sample Project of a Default Asp.Net Application including YAF 1.96.1 as Control. I Hope that helps in addition to your posts.

Hopefully the Wiki gets updated, currently i dont have edit access there to do it myself.

http://www.watchersnet.de/yaf/YAF.SampleWebApplication-v1.96.1-RTW.zip 

ashkann
  • ashkann
  • 51.2% (Neutral)
  • YAF Forumling
13 years ago
Hi,

I'm doing YAF-1.9.5 integration with a simple website project (not a web app),

does your sample work on this version of YAF and with a website ?

Actually this is a test proj, but we have a portal which contains asp.net website projects and we want to integrate YAF and use our master pages (which are in a website and don't have *.designer file).

I tried to convert YAF to a website but it had so much errors.

now I'm sticking with using it as a control in our site.

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
13 years ago

Hi,

I'm doing YAF 1.9.5 integration with a simple website project (not a web app),

does your sample work on this version of YAF and with a website ?

Actually this is a test proj, but we have a portal which contains asp.net website projects and we want to integrate YAF and use our master pages (which are in a website and don't have *.designer file).

I tried to convert YAF to a website but it had so much errors.

now I'm sticking with using it as a control in our site.

Originally Posted by: ashkann 

The Main YAF Site 1.9.5.5 is a WSP and not web application, but it not the important part, if you want to use YAF in your site you need to place the YAF Control on to your master Page like described in the first post of that topic.

ashkann
  • ashkann
  • 51.2% (Neutral)
  • YAF Forumling
13 years ago
thanks for your reply.

Are you sure it's a WSP? I downloaded the YAF-v1.9.5.5-RTW-SRC.zip, there is a YAF.csproj project file in YetAnotherForum.Net directory and all user controls have *.designer.cs file! maybe source code is WAP. or I am making a mistake.

Any way I don't want my pages to be like YAF template, I want to use my site's master page.

I also want to use my site's membership and authentication (it worked well with a standalone YAF installation).

I change the YAF.Classes/Config.cs file like:

   
    public static bool IsAnyPortal
    {
      get
      {
          return true;
          //return IsDotNetNuke || IsMojoPortal || IsRainbow || IsPortal || IsPortalomatic;
      }
    }

because there is no other way to disable register from YAF(I also tried AllowLoginAndLogoff="false" in app.config).

One more thing is that your Sample web application works fine when I run it on VS2010 but when I host it on IIS 7, it gives an error:

could not load type or assembly "app_Global.asax" ....

any Idea where does it come from?

thnx

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
13 years ago

Are you sure it's a WSP? I downloaded the YAF-v1.9.5.5-RTW-SRC.zip, there is a YAF.csproj project file in YetAnotherForum.Net directory and all user controls have *.designer.cs file! maybe source code is WAP. or I am making a mistake.

Yes sorry you are right its wap

One more thing is that your Sample web application works fine when I run it on VS2010 but when I host it on IIS 7, it gives an error:

could not load type or assembly "app_Global.asax" ....

Its works on my IIS 7.5 test machine. You need to compile The Project you will get that Error when there is now YAF.SampleWebApplication.dll in the Bin Folder.

JP
  • JP
  • 100% (Exalted)
  • YAF Leader
12 years ago
I have tried the sample application project and it works ok...

The only thing that I don't find fully ok, is that I get logged in to the forum no matter what page I am on (Home/Forum/About).

How can I do a login page that returns to the current page that the "Log In" link is presented?

Ie, if I am on the "About" page - I should return to the "About" page also after the login.

SInce I have decided to completely rework my site, I need some kind of advice on how to get the login (using the YAF provider) to work seamlessly also on the rest of the site... IE some content should only be available to members, some to only moderators, site editors and such...


He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago

I have tried the sample application project and it works ok...

The only thing that I don't find fully ok, is that I get logged in to the forum no matter what page I am on (Home/Forum/About).

How can I do a login page that returns to the current page that the "Log In" link is presented?

Ie, if I am on the "About" page - I should return to the "About" page also after the login.

SInce I have decided to completely rework my site, I need some kind of advice on how to get the login (using the YAF provider) to work seamlessly also on the rest of the site... IE some content should only be available to members, some to only moderators, site editors and such...

Originally Posted by: JP 

I updated the download login now contains a return url, to go back to the correct site.

JP
  • JP
  • 100% (Exalted)
  • YAF Leader
12 years ago
Have now tried the updated version, and it works great too...

Next step is to try to implement it myself in my new site project....

However, is there a simple way to hide the forum top menu on the login page?

Edit - Forget this post, have solved "login" (see later post) and normal forum registration will be the base for logins...


He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
JP
  • JP
  • 100% (Exalted)
  • YAF Leader
12 years ago
Hmm... Have tried to use the YAF providers in my MVC3 project with the help of tha_watcha's sample...

Since I am doing an MVC3 site project, I have a kind of challenge using YAF seamlessly...

MVC and Web Forms do not mix very well...

What I have done is to add a reference to the existing /forum/bin/YAF.dll to my MVC project, replace the default forms auth/membership/role/profile tags with the ones used in YAF in the MVC project web.config - and moved my project connectionstrings to the YAF db.config file (and replaced the strings in the MVC3 web.config with a configSource pointing at forum\db.config).

This worked great, I could log on using the MVC3 Account Controller, as well as YAF using the YAF membership...

Unfortunately I could only be logged in on either the MVC3 pages (via AccountController) or YAF (via YAF login), mutually exlcusive... If I logged in with MVC3, I got logged out from YAF and vice versa....

Took a little walk outside, and remembered that someone had mentioned machine key settings in some context regarding this exclusive login problem somewhere in this forum...

So I reconfigured the machine key settings in IIS for the site, and suddenly both login methods worked in harmony...

I can login now via the MVC3 AccountController which gives me a logged in status also in YAF, and a YAF login also logs me in on the MVC3 site...

That's "good enough" for me right now, since I can now check "logged in as a forum member" also on the MVC site to enable "member-only features"

A real breakthrough for me.. A small step for pro web devs but a giant leap to me...

Will have to make a separate "available site member features" xref table for logged in forum members, but that has nothing to do with YAF.


He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
aysha
  • aysha
  • 51.8% (Neutral)
  • YAF Forumling
12 years ago
Hi Jp

I have a MVC3 webforms website and an umbraco portal. These two are integrated and work fine. Now we want to integrate YAF with a common user authentication. So at the moment our app registers an user in to app and it works fine. Now We would like to integrate YAF into our web applciation such that we allow user to register from App and once user is registered, they are logged into YAF as well.

Can you please tell me how did u achieved the same with ur website?

We were thinking of creating a YAF user once we register a user in our app as YAF uses its own DB. So we will have YAF users created in YAF DB and app user created in App DB during app user registration.

When user logs into app, we set the cookie for YAF as well ... What are the APIs which I can use to do this?

Are we on right track ?

JP
  • JP
  • 100% (Exalted)
  • YAF Leader
12 years ago
Well, my little project is based on the YAF user membership and user registration is still made in YAF.

I cannot register users correctly outside YAF, just login & check if logged in.

So I am not the right one to give any advice about how to do it the other way around. I believe there was a web service example here in the forum as a possible way of doing it.

I was myself only looking for a way to have some "member only" pages on my MVC3 (w Razor views) site, and not total site integration (yet)....


He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
Stegothedump
12 years ago
Could this method be applied to creating a webpart for SharePoint?

S