Posted by: guest - Saturday, 2 December 2006 17:30:16
I was the happiest camper on earth. So I found this great forum YAF (woo hoo)........but didnt have a way to make it work with my existing ASP.NET member based photo / friends site that I had compeletely built from scratch. I searched and I searched and i figured I would just try to make my own. Now bear with me this is a work in progress. The details are below:
[size=7][b]YAFblend 1.3.8[/b] (Updated 12.27.2006)[/size]
Download Here: [url=http://www.ORCradio.com/YAFblend/YAFblend.dll]YAFblend 1.3.8[/url]
Example Here: [url=http://forum.yetanotherforum.net/Default.aspx?g=posts&m=11445#11445]YAFblend.YAFuser Sample[/url]
[size=6][b]Fixes[/b][/size]
-----------------------------------------------------------------------
If some users were getting this error when using yafblend.
[quote][b]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.[/b][/quote]
Here is the solution. The error was occuring due to the way I was checking for Private Messages. Any user who had more than one PM would get this error on any page that contained a YAFuser instance. Rookie mistake. This problem has been addressed in the above version.
[size=6][b]What is it?[/b][/size]
-----------------------------------------------------------------------
YAFblend is an ASP.NET DLL that retrieves the settings/authentication status of the user currently signed into YetAnotherForum allowing for seamless integration of YAF into an existing ASP.NET site. Now bear with me, YAFblend is still in the very early stages but is powerful enough to be used safely on a live site. I will be working on it alot so be sure to check back for updates.
[size=6][b]How do i use it?[/b][/size]
-----------------------------------------------------------------------
1. Drop [b]YAFblend.dll[/b] into your ASP.NET Website's ~/Bin directory
2. Import the YAFblend Namespace on any page you wish to retrieve user information
3. To access the current YAF user use the YAFuser class:
[size=6][b]Usage:[/b][/size]
-----------------------------------------------------------------------
Dim _yu as New YAFuser(WebConfigAppSettingKey)
WebConfigAppSettingKey = Your db connection string [b]OR[/b] AppSetting Key in the web.config file that contains the DB connection string to your YAF database.
[b]web.config (Optional)[/b]
----------
[b]page.aspx.vb OR page.aspx.cs[/b]
----------------------------
Dim _yu as New YAFuser( "YAFConnectionStringAppSettingsWebConfigKey" )
[size=6][b]YAFblend.YAFuser Structure[/b][/size]
---------------------------------
New(strYAFConnectionStringKey as string, Optional blnGetAvaterImage as boolean = False)
[b]Booleans[/b]
YAFblend.YAFuser.Authenticated 'Is a user logged in
YAFblend.YAFuser.NewMail 'Does the user have any new Private messages
YAFblend.YAFuser.PMNotification 'Does the user want to be notified of PM's thru email
YAFblend.YAFuser.GotExtras 'Whether the Current YAF user extra information Datatable has been filled
[b]Strings[/b]
YAFblend.YAFuser.AIM
YAFblend.YAFuser.Avatar
YAFblend.YAFuser.Email
YAFblend.YAFuser.HomePage
YAFblend.YAFuser.ICQ
YAFblend.YAFuser.Interests
YAFblend.YAFuser.IP
YAFblend.YAFuser.LanguageFile
YAFblend.YAFuser.Location
YAFblend.YAFuser.MSN
YAFblend.YAFuser.Name 'YAF Username (very helpful)
YAFblend.YAFuser.Occupation
YAFblend.YAFuser.RealName
YAFblend.YAFuser.Signature
YAFblend.YAFuser.ThemeFile
YAFblend.YAFuser.Weblog
YAFblend.YAFuser.YIM
[b]Integers[/b]
YAFblend.YAFuser.BoardID
YAFblend.YAFuser.Gender
YAFblend.YAFuser.Flags
YAFblend.YAFuser.NumPosts
YAFblend.YAFuser.Points
YAFblend.YAFuser.RankID
YAFblend.YAFuser.TimeZone
YAFblend.YAFuser.UserID
[b]Dates[/b]
YAFblend.YAFuser.Joined
YAFblend.YAFuser.LastVisit
YAFblend.YAFuser.Suspended
[b]Byte()[/b]
YAFblend.YAFuser.AvatarImage
[b]Datatables[/b]
YAFblend.YAFuser.Extras
[b]Methods[/b]
[b]Sub Touch()[/b] - Updates users active status outside the forum. Automatically executed when an instance is created. No custom update stored procedure needed anymore.
[b]Sub GetExtras(strSQL)[/b] - Fills the YAFblend.YAFuser.Extras DataTable with the records returned from the strSQL line that gets executed.
[i]*NOTE* Use @UserID in the strSQL string where you want the YAFuser Instance UserID substituted. ie: strSQL = "Select * from ExtraUserInfo where UserID=@UserID"[/i]
[size=6][b]Coming Soon[/b][/size]
-----------------------------------------------------------------------
Profile Updating right from the YAFuser instance
Ability to log in from a blank instance [Credits: Blackwater]
Posted by: test2005 - Sunday, 3 December 2006 00:00:47
You have been a bussy bee ;)
I'll have a look and let ya know how I get on.
Posted by: Mek - Sunday, 3 December 2006 03:05:58
Said in PM, and I'll say it here. Exceptionally well done.
Posted by: guest - Tuesday, 5 December 2006 08:20:41
Needs some coke to work apparently. It requires an assembly Cizzle when I tried to test it that it couldnt load.
Posted by: guest - Tuesday, 5 December 2006 10:15:34
[quote=MindPhaze]Needs some coke to work apparently. It requires an assembly Cizzle when I tried to test it that it couldnt load.[/quote]
Whoops. I am a true amateur. I forgot about my other DLL. Will fix immediately.
Posted by: Mek - Tuesday, 5 December 2006 10:25:22
Happens to us all ;-)
Posted by: zyenite - Friday, 8 December 2006 23:14:40
Great work! Thanks a lot :d
Posted by: test2005 - Saturday, 9 December 2006 13:28:58
This is a great peice of work dude!!!
If your an amateur, then I must be uber-amateur-zilla!! Your solution "blends" better than mine does!!
Great work!
:)
Posted by: uticket - Saturday, 9 December 2006 19:43:00
Hi, YAFaddict:
Can you give me a little more hints on how to use your dll? I can comply after adding your dll, but still can not get the user informaiton from YAF. I put both my own web site project and YAF under same directory same solution.
Thanks!
Posted by: guest - Monday, 11 December 2006 12:10:48
[quote=uticket]Hi, YAFaddict:
Can you give me a little more hints on how to use your dll? I can comply after adding your dll, but still can not get the user informaiton from YAF. I put both my own web site project and YAF under same directory same solution.
Thanks![/quote]
Hey uticket,
Sure..here is a sample page. Make sure you change the "YAFConnectionString" parameter to whatever app settings key that you have defined in your web.config file.
[code]
<%@ Page Language="VB" %>
<%@ Import Namespace="YAFblend" %>
Untitled Page
[/code]
Posted by: guest - Monday, 11 December 2006 19:50:10
Hi YAFaddict,
Nice work! Am I right in thinking that your DLL allows you to get the currently logged in user to the YAF forum and then use that to authenticate the user with the rest of your ASP.NET app?
What if you've already authenticated your user with the ASP.NET membership provider (I think that's what it is) and want to then automatically sign them into the forum? I guess this is the reverse of what your DLL does.
What I'd really like to do is have the user log into my site and then automatically log them into the forum. Do you know if this is possible?
Many thanks,
Blackwater
Posted by: guest - Tuesday, 12 December 2006 07:45:40
[quote=Blackwater]Hi YAFaddict,
Nice work! Am I right in thinking that your DLL allows you to get the currently logged in user to the YAF forum and then use that to authenticate the user with the rest of your ASP.NET app?
What if you've already authenticated your user with the ASP.NET membership provider (I think that's what it is) and want to then automatically sign them into the forum? I guess this is the reverse of what your DLL does.
What I'd really like to do is have the user log into my site and then automatically log them into the forum. Do you know if this is possible?
Many thanks,
Blackwater[/quote]
Hi Blackwater:
Thx! Yes you are right. It just reads the current ASP.NET membership profile of the authenticated/unauthenticated user and queries the YAF database to pull the user information and extra information from any cooresponding records that you might have in your database. As of now there is nothing that does any automatic login however I can look into this. Once this thing is really solid I will release the source code. Some more updates are coming this week.
-YAFaddict
Posted by: guest - Wednesday, 13 December 2006 01:35:51
[quote=YAFaddict]
Hi Blackwater:
Thx! Yes you are right. It just reads the current ASP.NET membership profile of the authenticated/unauthenticated user and queries the YAF database to pull the user information and extra information from any cooresponding records that you might have in your database. As of now there is nothing that does any automatic login however I can look into this. Once this thing is really solid I will release the source code. Some more updates are coming this week.
-YAFaddict[/quote]
Thanks for the info YAFaddict. I'm really looking forward to the updates, source and if you feel like looking into a single sign-on to the forums from the "main" application (with it's own .NET 2.0 membership stuff) that would be awesome.
Cheers,
Blackwater
Posted by: guest - Wednesday, 13 December 2006 14:05:57
I'll put something together by the end of the week that allows you to login from a blank instance. Be sure to check it out Friday for updates.
Posted by: Mek - Wednesday, 13 December 2006 23:40:17
Slow down your putting us to shame :-) haha
Posted by: uticket - Thursday, 14 December 2006 18:35:41
Hi, YAFAddict, thanks a lot for your source code. It is very helpful.
May I ask how you identify the current user in your source code.
I guess you are connecting to Activer_User table, and then use the session key to query the table? Am I right, or there is other way to handle?
I am looking forward to your new release!
have a great holiday!
[quote=YAFaddict][quote=uticket]Hi, YAFaddict:
Can you give me a little more hints on how to use your dll? I can comply after adding your dll, but still can not get the user informaiton from YAF. I put both my own web site project and YAF under same directory same solution.
Thanks![/quote]
Hey uticket,
Sure..here is a sample page. Make sure you change the "YAFConnectionString" parameter to whatever app settings key that you have defined in your web.config file.
[code]
<%@ Page Language="VB" %>
<%@ Import Namespace="YAFblend" %>
Untitled Page
[/code]
[/quote]
Posted by: guest - Monday, 18 December 2006 00:35:55
Hey YAFAddict,
Just wondering how you're going with YAFBlend? I've been checking back here daily! :wink:
No pressure though.. I know it's a busy time of year.
Cheers,
Blackwater
Posted by: uticket - Tuesday, 19 December 2006 10:55:44
I also check back daily.....
[quote=Blackwater]Hey YAFAddict,
Just wondering how you're going with YAFBlend? I've been checking back here daily! :wink:
No pressure though.. I know it's a busy time of year.
Cheers,
Blackwater[/quote]:cry: :cry: :cry:
Posted by: guest - Tuesday, 19 December 2006 21:12:35
Addict, this module is almost stupid useful. Thank you for all the time you've put into it. If you are able, as has been suggested, to make YAFBlend auto-log your forum account based on another ASP.net login status, this would be pretty much the greatest thing of all time. Next to panda bears, of course. Awesome job; I'll be using this once I get my head out of PHP mode.
Posted by: guest - Wednesday, 20 December 2006 10:58:52
Thx for all the patience/compliments gents. It really is my pleasure. I have the next 5 days off so I will be really digging into it hardcore. I haven't had much time to work on anything in the last week b/c we are so busy at work here this time of year. I shall be in touch
Posted by: guest - Wednesday, 20 December 2006 13:05:21
[quote=richmix]Addict, this module is almost stupid useful. Thank you for all the time you've put into it. If you are able, as has been suggested, to make YAFBlend auto-log your forum account based on another ASP.net login status, this would be pretty much the greatest thing of all time. Next to panda bears, of course. Awesome job; I'll be using this once I get my head out of PHP mode.[/quote]
And yes I second that. Panda's do f'n rule.
Posted by: guest - Wednesday, 20 December 2006 16:24:32
Hey YAFaddict, happy holidays!
Any updates for YAFblend?
I don't mean to seem too impatient, but I'd love to fool around with YAFblend a bit while I'm off work.
Cheers,
Blackwater
Posted by: guest - Saturday, 30 December 2006 06:19:29
Hey YAFaddict,
thank you for your work at this very helpful program.
Unfortunately it is not working correctly for me:
I am using your sample and when I am not logged in the sample page it is working correctly for the user Guest. But when I am logged in in YAF the page generates following error:
Procedure 'dbo.UF_BasicMaintenance' was not found
Source Error:
Line 6:
Line 7: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Line 8: Dim CurrentYAFuser As New YAFuser("YAFConnectionString" )
Line 9:
Line 10: lblYAFname.Text = CurrentYAFuser.Name
It is possible to reproduce this error.
For info: I am not using YAF in the web root but I am using it in a subfolder of my webpage.
I hope you can help me with this issue.
Thanks and cheers
Checker
Posted by: guest - Tuesday, 2 January 2007 13:34:47
Heey checker. I fixed this. Go ahead and redownload the dll.
Sorry for the mixup!
Posted by: guest - Wednesday, 3 January 2007 02:14:37
Hey YAFaddict,
thanks a lot. Now it is working.
Is it planned for the next release to implement a fuction where the group name of the logged-in-user could be displayed also?
Thanks again
checker
[quote=YAFaddict]Heey checker. I fixed this. Go ahead and redownload the dll.
Sorry for the mixup!
[/quote]
Posted by: guest - Thursday, 4 January 2007 14:12:15
Great. Hey I'm open to any suggestions and thats a really good idea. I'll have the instance populate a string array with the different group names. Currenntly I'm working on a login feature that allows you to log in right from the instance. Its proving to be harder than I anticipated but I i know I'll get thru it. If you or anyone else has any other suggestions then dont hesitate to ask me to include them. Once this project is a little more matured I will open it up completely.
Posted by: guest - Friday, 5 January 2007 04:57:29
Yeah, perfect. It would be very nice to use the user administration from YAF and logingin from somewhere in the own page (where YAF is part of). For instance you have in the masterpage.master Username/Password boxes and if you login it refers to the YAF usertable and uses the authorisation functions. I hope you are talking about this feature on which you are working. That would be a very helpful option because then you don't need to go via the Forum to login or to have two parallel "user authentications" to handle.
I am really looking forward to this.
BTW: do you know how make the YAF menu bar (Login, Register, etc) unvisible for all users (also guests) beside the admin?
[quote=YAFaddict]Great. Hey I'm open to any suggestions and thats a really good idea. I'll have the instance populate a string array with the different group names. Currenntly I'm working on a login feature that allows you to log in right from the instance. Its proving to be harder than I anticipated but I i know I'll get thru it. If you or anyone else has any other suggestions then dont hesitate to ask me to include them. Once this project is a little more matured I will open it up completely.[/quote]
Posted by: guest - Monday, 8 January 2007 01:51:22
hi
on the root of solution i got a default page and under my solution i got the YAF website project. now i am using YAFBLEND on my default page to get the logged in user information but it shows Guest and that user is not authenticated. i have logged into the YAF forum on other page and on other window i am checking the YAFBLEND. but its shows nothing but guest and notauthenticated.
plz help
cheers
Posted by: guest - Tuesday, 9 January 2007 11:42:29
[quote=zeee]hi
on the root of solution i got a default page and under my solution i got the YAF website project. now i am using YAFBLEND on my default page to get the logged in user information but it shows Guest and that user is not authenticated. i have logged into the YAF forum on other page and on other window i am checking the YAFBLEND. but its shows nothing but guest and notauthenticated.
plz help
cheers[/quote]
Send you code. If you followed the Sample above it should work fine.
Posted by: guest - Thursday, 1 February 2007 08:40:10
Hi YAFaddict,
it's me again and I am still trying to use the user authentication out of my website with the forum login infos plus YAFblend.
I am calling the functions from yaf in my login page (nearly like zeee describes it on his page) and it works sometimes and sometimes I get an error from yafBlend when I am logging in:
Violence of the PRIMARY KEY 'PK_yaf_Active'. A double key could not inserted in the 'dbo.yaf_Active'-object.
And the error occures here: Dim CurrentYAFuser As New YAFblend.YAFuser("YAFConnectionString" )
Please could you give me an advice what your function is doing? I think your funktion doesn't insert a recordset in the yaf_Active table, right? But the error look like this for me
I am working on this issue some weeks, but I cannot find the problem.
Thanks and cheers
checker
Posted by: guest - Friday, 23 March 2007 06:52:21
Hi Everybody,
First, great forum, it's the only open source forum for asp.net that I found and which I can take serious and it's really very well done.
For sure I'm writing here because I'm also very interested regarding the YAFBlend. I want my users to login on my site and automatically get logged in on the YAF-Forum too. Are there already posiblities available to do that?
Best regards,
Markus
Posted by: wsosfr - Thursday, 12 April 2007 14:35:53
Hi guys
First of all, thanks yafaddict for your tool, although i cant get it to run :(
I get a "connectionstring property not initialized" error when calling new YAFUser($$)
I tried to put in $$:
1. The connectionstring (String) itself, which definitely works
2. AppSetting Key
3. ConnectionString from the web.config (System.Configuration.ConfigurationManager.ConnectionStrings.Item("YAFConnectionString").ConnectionString)
Any clues for the cause?
Thanks
Posted by: guest - Monday, 16 April 2007 12:14:33
I've been checking out the YAF software for a majority of the day. I'm very impressed so far. My plan at this point is to build my new site around the YAF Membership provider with the help of YAFBlend.
With regards to YAFBlend...I get the following database error if I set the constructor's touch variable to true:
Violation of PRIMARY KEY constraint 'PK_yaf_Active'. Cannot insert duplicate key in object 'dbo.yaf_Active'.
The statement has been terminated.
Example:
[code]
YAFblend.YAFuser user = new YAFblend.YAFuser("Fishing", true, false);
if (user == null || !user.Authenticated)
{
Response.Redirect(string.Format("~/forums/default.aspx?g=login&ReturnUrl={0}", Server.UrlEncode(Request.Url.PathAndQuery)));
}
[/code]
I think there is a bug in the constructor (or the underlying function call) because when I look at the yaf_Active table, it made an entry for UserId=1 even through I was logging in with a user who's user id should have been 4...
Posted by: guest - Tuesday, 8 May 2007 20:06:16
Hi,
fantastic library! this is exactly what our site is needing - however i am getting this error:
[quote]
The ConnectionString property has not been initialized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.
[/quote]
i have tried my connection string in quotes "myconnstring" and
System.Configuration.ConfigurationManager.ConnectionStrings["mystring"].ConnectionString
this is happening when i:
YAFuser userCurrent = new YAFuser("myconnstring", false, false);
it is definately there in my web.config as i slapped on an ASP gridview and it filled up nicely using this connection string.
thanks in advance!
- wicked
Posted by: guest - Wednesday, 9 May 2007 16:09:15
[quote=wicked]Hi,
fantastic library! this is exactly what our site is needing - however i am getting this error:
[quote]
The ConnectionString property has not been initialized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.
[/quote]
i have tried my connection string in quotes "myconnstring" and
System.Configuration.ConfigurationManager.ConnectionStrings["mystring"].ConnectionString
this is happening when i:
YAFuser userCurrent = new YAFuser("myconnstring", false, false);
it is definately there in my web.config as i slapped on an ASP gridview and it filled up nicely using this connection string.
thanks in advance!
- wicked[/quote]
I seem to have found why it was not working for me.
with my project my 'connection string' (in web.config) for my database was defined as follows:
HOWEVER - after using this fantastic tool [url=http://www.aisto.com/roeder/dotnet/]Reflector[/url] to peek inside the yafblend dll i found it is not using the 'connectionStrings' method of getting the connection string - it is using the 'appSettings' method.
For yafblend to get a successfull connection to the database you need to add this to your web.config (outside the system.web):
Posted by: guest - Tuesday, 31 July 2007 06:42:47
Hi there,
First off, this is a great forum and YAFBlend looks like a great addition.
Runing my website as one app and the YAF forum as virtual directory under that app in it's own folder but accessible under myapp/forum and works great. (Couldn't get it into a folder directly under my app, since it complained about going to a diff app which was not allowed.)
Thing is, I'm getting "guest" as the YAFuser.Name returned to myapp.
What are the rules around implementing this or is there another way to incorporate the forum into the site.
Also looking forward to having the user group returned as I want the diff logged in user groups to be able to download diff stuff on my site.
Could anyone please point me in the right direction?
Posted by: guest - Wednesday, 1 August 2007 06:15:33
Oh, sorted out my issue.
Added forum as an actual folder using the /MyappName/YAFforum/ since I was running on my localhost. Working great now, I can see on the main site the User that's logged in.
Still looking to find a way to tell my main site which usergroup the user is. Are there any new updates? Is anyone still out there? Or can someone point me in the new direction everyone is taking?
Posted by: mattd00d - Tuesday, 22 July 2008 21:56:46
When I use YAFBlend I have a issue with IIS6. When I check for authentication on my main website it always returns nothing so it assumes guest. When I am logged into the forum this happens all the time. Is there any trick to get the httpcontext or cookie info across to the main web page application? It seems like they are using the same session keys. I was thinking of just queuing off the session keys and the time on and off? Any suggestions?