Author |
Topic |
|
IG-88
Starting Member
8 Posts |
Posted - 18 August 2003 : 01:21:26
|
I was wondering if anyone had an idea about implementing this football pool into a Snitz mod. http://www.brainjar.com/asp/pool/
Could it be done?
I wanted to set up a football pool with a place for my buddies to talk smack during the season.
Thanks for any info! |
|
big9erfan
Average Member
540 Posts |
Posted - 18 August 2003 : 01:48:10
|
It could be done, but IMO I think a fantasy football option is much better suited for a forum. Much more in depth though...
If you've got some knowledge of ASP and database design I'd be more than willing to talk it up with you, but I have far from the time to implement this myself.
|
This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. |
|
|
imotep
Starting Member
23 Posts |
Posted - 18 August 2003 : 06:42:45
|
It was actually fairly easy to do. I just replaced all of the user code in the BrainJar code with Snitz login code. I made the pool a subfolder of my forum folder, so I just used my modified inc_header.asp.
Football Pool |
|
|
Anacrusis
Junior Member
USA
219 Posts |
Posted - 18 August 2003 : 07:59:42
|
I've also used this code for the football pool on my site. It's not too hard to do. I've also integrated it with my points mod so you use your points to enter the pool.
www.internet-clubhouse.com/football |
The Internet ClubHouse www.internet-clubhouse.com
|
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 18 August 2003 : 15:48:01
|
quote: Originally posted by imotep
It was actually fairly easy to do. I just replaced all of the user code in the BrainJar code with Snitz login code. I made the pool a subfolder of my forum folder, so I just used my modified inc_header.asp.
Football Pool
I went to take a look:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/forum/pool/header.asp, line 21
|
v ø d k â f ï § h |
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 18 August 2003 : 16:02:21
|
Does this script support a spread? Doesn't look like it does "out of the box". |
v ø d k â f ï § h |
|
|
Anacrusis
Junior Member
USA
219 Posts |
|
imotep
Starting Member
23 Posts |
Posted - 18 August 2003 : 21:15:51
|
quote: I went to take a look:
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. /forum/pool/header.asp, line 21
Thanks for heads up VodkaFish. Somehow (not too sure how) the permissions changed on my database. |
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 18 August 2003 : 23:34:33
|
Hey, almost like an Easter Egg: http://www.brainjar.com/asp/pool/default7.asp
Found from Google.
Although this isn't necessarily how I'll be doing mine, it should help anyone who needs it. |
v ø d k â f ï § h |
|
|
IG-88
Starting Member
8 Posts |
Posted - 19 August 2003 : 00:23:08
|
Wow! And I thought I'd be the only one who's done this! You guys did a great job integrating it into your sites! Well done!
I haven't integrated it into the forums yet because I'm not quite sure where to put it. I'd like to put it directly under the forum categories, but I'm a severe ASP rookie. I'm really trying to learn and I've learned a lot from just playing with Snitz. But unfortunately even when you're just a really good network guy, your friends just know you as the "computer guy" which means anything and everything that has to do with a computer I must be an expert in. Volunteered against my will I guess you could say!
Our little pool is slightly different than the BrainJar pool though, which is the logic I'm trying to figure out. There's about 6 or 7 of us every year and we each throw in $100 as an entry fee. So week by week it doesn't matter who wins, just who has the most won games under their belt by the end of the season. Then the 1st place winner gets 60% of the pot, 2nd gets 30%, and 3rd place just gets their $100 back. The rest of us gets squat (me every year ). So my two new obstacles to work through are 1) changing it so there is no $5 weekly bet and 2) creating a Year to Date tally with all the current stats
If you guys have any tips that would be great! Would love to see more info on this! |
Edited by - IG-88 on 19 August 2003 00:23:56 |
|
|
big9erfan
Average Member
540 Posts |
Posted - 19 August 2003 : 01:56:34
|
I've used this before...Easy to use, but I don't remember if it has all of what you want.
http://4horsemen.tzo.com/worldpools/index.html |
This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. |
|
|
StephenD
Senior Member
Australia
1044 Posts |
Posted - 19 August 2003 : 03:19:09
|
Anyone care to share their modified code please for integrating this with Snitz? |
|
|
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
|
imotep
Starting Member
23 Posts |
Posted - 19 August 2003 : 09:09:19
|
Here is what I did. Or at least what I remember (I'm still a bit the novice so I don't always document things to well )
I'm using the Football pool database for storing pool related information. I added a column to the MEMBERS_FORUM table called M_NFL. Default value of 0 (meaning not a member of the pool). It gets changed to 1 when someone becomes a member.
I've also used inc_header.asp (minus the html) from Snitz to check the user that I call usercheck.asp. I've changed the chkUser function to: function chkUser(fName, fPassword, fAuthor) dim rsCheck dim strSql '## Forum_SQL strSql = "SELECT MEMBER_ID, M_LEVEL, M_NAME, M_PASSWORD, M_FIRSTNAME, M_LASTNAME, M_NFL " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS " strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fName, "SQLString") & "' " strSql = strSql & " AND M_PASSWORD = '" & ChkString(fPassword, "SQLString") &"'" strSql = strSql & " AND M_STATUS = " & 1 Set rsCheck = objComm.Execute(strSql) if rsCheck.BOF or rsCheck.EOF or not(ChkQuoteOk(fName)) or not(ChkQuoteOk(fPassword)) then MemberID = -1 chkUser = 0 '## Invalid Password if strDBNTUserName <> "" and chkCookie = 1 then Call ClearCookies() strDBNTUserName = "" end if else MemberID = rsCheck("MEMBER_ID") strFirstName = rsCheck("M_FIRSTNAME") strLastName = rsCheck("M_LASTNAME") strNFL = rsCheck("M_NFL") strNFLName = rsCheck("M_NAME") if (rsCheck("MEMBER_ID") & "" = fAuthor & "") and (cLng(rsCheck("M_LEVEL")) <> 3) then chkUser = 1 '## Author else select case cLng(rsCheck("M_LEVEL")) case 1 chkUser = 2 '## Normal User case 2 chkUser = 3 '## Moderator case 3 chkUser = 4 '## Admin case else chkUser = cLng(rsCheck("M_LEVEL")) end select end if end if rsCheck.close set rsCheck = nothing end function
Here I grab the username and check if they are entered in the pool. If they are not entered, they are automatically entered when the visit the pool. This is the header I use for the pool pages.
<!-- #include file="../../includes/usercheck.asp" --> <% If strNFL <> "" Then If (CInt(strNFL)) = 0 Then 'the user hasn't been entered in the NFL database yet call OpenDB() strSql = "Select Username FROM Users WHERE Username = '" & strNFLName & "'" set rs = DbConn.Execute(strSql) If rs.BOF AND rs.EOF Then strSql = "INSERT INTO Users (Username) " & _ "VALUES ('" & strNFLName & "')" DbConn.Execute(strSql) End If rs.Close() set rs = nothing 'Update the forum database to show user is in nfl database MM_Forum_String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WWWRoot\***\snitz_forums_2000.mdb" '## MS Access 2000 set objComm = Server.CreateObject("ADODB.Connection") objComm.Open MM_Forum_String 'add user to nfl database strSql = "UPDATE FORUM_MEMBERS " & _ "SET M_NFL = 1 " & _ "WHERE MEMBER_ID = " & MemberID objComm.Execute(strSql) objComm.Close() set objComm = nothing End If End If
%>
In the pool itself...
I changed protect.asp to: <% 'Buffer output in case of redirection.
Response.Buffer = true
'If not logged in, redirect to the login page.
if mlev < 1 then Response.Redirect("login.asp") end if %>
Since I don't use the Football pools login, I changed that to: <% Response.Buffer = true %>
<!-- #include file="common.asp" --> <!-- #include file="header.asp" --> <% If strNFLName <> "" Then Response.Redirect("default.asp") End If %>
In the users.asp at line 20 I changed the Admin check to <% 'If user is not the Administrator, redirect to the login page.
if strNFLName <> ADMIN_USERNAME then Response.Redirect("login.asp") end if
There may a couple of other things, but that's all I remember off the top of my head
If any of the more experienced coders have suggestions, pass 'em on |
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 24 August 2003 : 12:31:52
|
Just wondering if anyone's modified this to use a spread. |
v ø d k â f ï § h |
|
|
IG-88
Starting Member
8 Posts |
Posted - 07 September 2003 : 01:23:43
|
I got a few ASP guys from work checking this out. I'll post back when it's done! Making it so you can enter a dollar amount per season or per week, and putting a YTD stats page. Don't think we'll use spreads but if anyone has any suggestions let me know! |
|
|
|
Topic |
|