API for interfacing .net with phpBB

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

API for interfacing .net with phpBB

Post by smithy_dll »

This is my first public collection, no documentation on how to use it at this point, but you just initialise an instance of the dataclass.db and phpBBDotNet.phpBB

It has only been tested with MySQL 4 as localhost so far.

To initalise in a .aspx page you would do something like

First include the namespaces dataclass and phpBBDotNet

VB.net

Code: Select all

dim db as db
dim AspxphpBB as phpBB

sub page_load()
db = new db("root","", "localhost","", server.mappath("."),"phpBB_db", "mysql")
AspxphpBB = new phpBB(db, Response, Request, "phpbb_")
AspxphpBB.session_pagestart(Request.UserHostAddress(), -1)
end sub
c#

Code: Select all

no c# example yet, just translate the vb.net example it's essentially exactly the same
The above example will read the phpBB cookie if set, and will smoothly integrate with the cookie sessions of phpBB and should be able to read the session id from &sid=. (Though I haven't tested the cookieless method)

More methods are to come as this is just some basic stuff to begin with. There are also methods for getting a unix timestamp, converting date formats, and converting IPs to the phpBB Hex notation used to store an IP in the DB.

It also have access to the complete set of config values.

Theres also GeneratePagination which works the same as the phpBB method though it's only english atm.

Download the API here: http://www.smigit.com/phpBB/phpBBDotNet.zip

sorry if this post seems poorly constructed and hastily put together

Doe Ray Me
Registered User
Posts: 457
Joined: Mon Jun 16, 2003 5:25 am

Post by Doe Ray Me »

Not Found
The requested URL /phpBB/phpBBDotNet.zip was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Could not be found :twisted:

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll »

sorry, I uploaded a .rar instead of .zip by mistake

should be ok now

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll »

Updated,

A few more functions, a .chm documentation of the dataclass and phpBBDotNet.phpBB,

all source included

Improvements:
The cookie setting details are now pulled from the config data of the interfacing phpBB.

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

Here is the C# translation of your example code :wink:

Code: Select all

db mydb;
phpBB AspxphpBB;

private void Form_Load(object sender, System.EventArgs e)
{
    mydb = new db("root","", "localhost","", server.mappath("."),"phpBB_db", "mysql");
    AspxphpBB = new phpBB(mydb, Response, Request, "phpbb_"); 
    AspxphpBB.session_pagestart(Request.UserHostAddress(), -1);
}

Bye :)
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

uiswjd0
Registered User
Posts: 1
Joined: Thu Jan 19, 2006 7:54 pm

What about going the other direction

Post by uiswjd0 »

how can I take an ASP session and log them in to Phpbb directly???

Yeormom
Registered User
Posts: 11
Joined: Fri Mar 19, 2004 9:19 pm
Contact:

Post by Yeormom »

I haven't gotten to use it yet but very nice job.

Post Reply

Return to “[2.0.x] MOD Writers Discussion”