YAFLogo

guest
  • guest
  • Guest Topic Starter
18 years ago
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:

YAFblend 1.3.8 (Updated 12.27.2006)

Download Here: YAFblend 1.3.8 

Example Here: YAFblend.YAFuser Sample 

Fixes

-----------------------------------------------------------------------

If some users were getting this error when using yafblend.

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

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.

What is it?

-----------------------------------------------------------------------

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.

How do i use it?

-----------------------------------------------------------------------

1. Drop YAFblend.dll 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:

Usage:

-----------------------------------------------------------------------

Dim _yu as New YAFuser(WebConfigAppSettingKey)

WebConfigAppSettingKey = Your db connection string OR AppSetting Key in the web.config file that contains the DB connection string to your YAF database.

web.config (Optional)

----------

page.aspx.vb OR page.aspx.cs

----------------------------

Dim _yu as New YAFuser( "YAFConnectionStringAppSettingsWebConfigKey" )

YAFblend.YAFuser Structure

---------------------------------

New(strYAFConnectionStringKey as string, Optional blnGetAvaterImage as boolean = False)

Booleans

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

Strings

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

Integers

YAFblend.YAFuser.BoardID

YAFblend.YAFuser.Gender

YAFblend.YAFuser.Flags

YAFblend.YAFuser.NumPosts

YAFblend.YAFuser.Points

YAFblend.YAFuser.RankID

YAFblend.YAFuser.TimeZone

YAFblend.YAFuser.UserID

Dates

YAFblend.YAFuser.Joined

YAFblend.YAFuser.LastVisit

YAFblend.YAFuser.Suspended

Byte()

YAFblend.YAFuser.AvatarImage

Datatables

YAFblend.YAFuser.Extras

Methods

Sub Touch() - Updates users active status outside the forum. Automatically executed when an instance is created. No custom update stored procedure needed anymore.

Sub GetExtras(strSQL) - Fills the YAFblend.YAFuser.Extras DataTable with the records returned from the strSQL line that gets executed.

*NOTE* Use @UserID in the strSQL string where you want the YAFuser Instance UserID substituted. ie: strSQL = "Select * from ExtraUserInfo where UserID=@UserID"

Coming Soon

-----------------------------------------------------------------------

Profile Updating right from the YAFuser instance

Ability to log in from a blank instance [Credits: Blackwater]

Sponsor
test2005
18 years ago
You have been a bussy bee ;)

I'll have a look and let ya know how I get on.


.....the man in black fled across the desert..........and the gunslinger followed.....

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
18 years ago
Said in PM, and I'll say it here. Exceptionally well done.


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 🙂 )

guest
  • guest
  • Guest Topic Starter
18 years ago
Needs some coke to work apparently. It requires an assembly Cizzle when I tried to test it that it couldnt load.
guest
  • guest
  • Guest Topic Starter
18 years ago

Needs some coke to work apparently. It requires an assembly Cizzle when I tried to test it that it couldnt load.

MindPhaze wrote:

Whoops. I am a true amateur. I forgot about my other DLL. Will fix immediately.

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
18 years ago
Happens to us all 😉
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 🙂 )

zyenite
  • zyenite
  • 53.6% (Neutral)
  • YAF Forumling
18 years ago
Great work! Thanks a lot :d
UserPostedImage 
test2005
18 years ago
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!

:)


.....the man in black fled across the desert..........and the gunslinger followed.....

uticket
  • uticket
  • 57.8% (Neutral)
  • YAF Forumling
18 years ago
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!

guest
  • guest
  • Guest Topic Starter
18 years ago

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!

uticket wrote:

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.


<%@ Page Language="VB" %>
<%@ Import Namespace="YAFblend" %>

<script runat="server">
    Private Const PRINT_FOR_HTML = True
    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim CurrentYAFuser As New YAFuser("YAFConnectionString")
        
        lblYAFname.Text = CurrentYAFuser.Name
        lblYAFdetails.Text = CurrentYAFuser.PrintMe(PRINT_FOR_HTML) 'True parameter uses <br /> instead of normal carriage returns
        
        If CurrentYAFuser.NewMail Then
            lblYAFmail.Text = "You've got mail!"
        Else
            lblYAFmail.Text = "You do not have mail!"
        End If
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        Username: <asp:Label ID="lblYAFname" runat="server"></asp:Label><br />
        <br />
        User Details:<br />
        <asp:Label ID="lblYAFdetails" runat="server"></asp:Label><br />
        <br />
        Mail Status:<br />
        <asp:Label ID="lblYAFmail" runat="server"></asp:Label>        
    </form>
</body>
</html>

guest
  • guest
  • Guest Topic Starter
18 years ago
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

guest
  • guest
  • Guest Topic Starter
18 years ago

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

Blackwater wrote:

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

guest
  • guest
  • Guest Topic Starter
18 years ago

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

YAFaddict wrote:

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

guest
  • guest
  • Guest Topic Starter
18 years ago
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.
Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
18 years ago
Slow down your putting us to shame 🙂 haha
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 🙂 )