Author |
Topic |
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 09 November 2001 : 12:31:53
|
ok,
I'm having some problems with 3.1
I noticed on ExtraFree's site that I could rate his topics even though I was not a memeber.
I am fairly convinced there is a problem with strDBNTUserName, which is causing problems.
I'm working on it slowly.
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 09 November 2001 : 12:55:29
|
Hmm,
Actually I've had some bad news - so I might not be able to do anything until Sunday ...
Sorry about that people..
I'm still confused about this 3.1 thing tho.
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
extrafree
New Member
54 Posts |
Posted - 09 November 2001 : 13:10:51
|
thank you anyway!!! when you have some good news for this mod on 3.1 we are here!!! you are great ! thanks
the italian golden forum
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 10 November 2001 : 12:18:31
|
slow down my friend, no rush
Dayve |
|
|
blackinwhite
Average Member
Turkey
657 Posts |
Posted - 10 November 2001 : 14:49:53
|
I am trying to install that mod, I think I have installed but the file I use is in the first message.
So the problmes I encounter is different. Stars in my forum.asp are not shown.
Does anybody know why? thanks.
____ "I am a legal alien" |
|
|
suhern
Junior Member
186 Posts |
Posted - 11 November 2001 : 10:05:32
|
Just a note and a caution: The installation of this mod will lead to error when you are trying to view the archive topics. The reasons are: 1. the FORUM_A_TOPIC table is not updated with the same field as in the FORUM_TOPIC table.
2. strTablePrefix is used instead of strActivePrefix
I manage to get the archive working by updating the table and changing to strActivePrefix in topic.asp. If there is some interests I will present an updated version here - for simplicity rating is disabled in archive mod. Time needed though for documentation. You can see it here
I notice that this is the case with many mods including the poll mod - the A_TOPIC table was unpdated but strActivePrefix was not used
Despite it all it is a wonderful mod and the poll mod too (indispensible)
|
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 11 November 2001 : 13:04:54
|
Suhern,
Is that a problem with 3.1 or 3.3?
If you could forward the "fix" you have to me, I'll add it to the next version I'm doing.
azaniah@hotmail.com
Thanks Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 11 November 2001 : 14:24:37
|
is it possible to rate replies also? then we can rate all of one's posts.
question about archive: will the archived topics allow rating still? personally I feel yes for this, as archived dosen't mean it's not good or out of time.
thanks, this mod is really helpful.
Edited by - bjlt on 11 November 2001 14:27:00
Edited by - bjlt on 11 November 2001 14:29:35 |
|
|
blackinwhite
Average Member
Turkey
657 Posts |
Posted - 11 November 2001 : 16:38:37
|
are there any progress in this mod, for v3.1
____ "I am a legal alien"
Edited by - blackinwhite on 11 November 2001 16:39:50 |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 11 November 2001 : 18:04:52
|
*ponders the rating replies also*
Thats a nice idea..(wonders how hard it would be to do).
I'm gonna have another long look at 3.1 on Monday (I don't have the code here and it's 11pm now). To be honest I wouldn't install this MOD in 3.1 just yet. As it stands it doesn't work correctly in 3.1
Hopefully in a day or two I will have worked out whats not working right.
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
suhern
Junior Member
186 Posts |
Posted - 11 November 2001 : 21:24:52
|
quote:
Suhern,
Is that a problem with 3.1 or 3.3?
If you could forward the "fix" you have to me, I'll add it to the next version I'm doing.
azaniah@hotmail.com
Thanks Az
------- Eagles fly!, but weasels don't get sucked into jet engines.
I am running on 3.3. While I have fixed the problem it is difficult for me to send you the fix as I kind of fix it on the fly and now having problem trying to document it. But this is what I did to fix the problem:
1. I manually inserted the corresponding new fields that you added in FORUM_TOPIC table to FORUM_A_TOPIC table
2. For all instances of query to to the new fields in FORUM_TOPIC I change strTablePrefix to strActivePrefix and then for reason it still does not work and I had to make the following changes to inc_functions:
Function GetNewTitle(sTempScriptName) Dim StrTempScript Dim strNewTitle strTempScript = Right(sTempScriptName, 9) strTempScript = lcase(strTempScript) Select Case strTempScript Case "topic.asp"
strTempTopic = request.querystring("TOPIC_ID")
if not(strTempTopic = "") then
if request("ARCHIVE") = "true" then strActivePrefix = strTablePrefix & "A_" ArchiveView = "true" ArchiveLink = "ARCHIVE=true&" nDays = "0" else strActivePrefix = strTablePrefix ArchiveView = "" ArchiveLink = "" end if
strsql = "SELECT T_SUBJECT, FORUM_ID FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID=" & strTempTopic set ttopics = my_conn.execute(strsql) strTempTopicTitle = ttopics("T_SUBJECT") strTempForum = ttopics("FORUM_ID") set ttopics = nothing strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum set tforums = my_conn.execute(strsql) strTempForumTitle = tforums("F_SUBJECT") set tforums = nothing strNewTitle = strTempTopicTitle & " - " & strTempForumTitle & " - " & strForumTitle else strNewTitle = strForumTitle end if
and also:
function GetTopicRatingAvg( iTopicID )
strSQL = "" strSQL = "SELECT TOPIC_RATING_TOTAL, TOPIC_RATING_TOTAL_COUNT " strSQL = strSQL & "FROM " & strActivePrefix & "TOPICS WHERE TOPIC_ID =" & iTopicID set rsTopicRating = Server.CreateObject("ADODB.Recordset") rsTopicRating = my_Conn.Execute( strSQL ) if rsTopicRating("TOPIC_RATING_TOTAL_COUNT") = 0 Then iTopicRating = "Not Rated" else iTopicRating = cint(rsTopicRating("TOPIC_RATING_TOTAL") / rsTopicRating("TOPIC_RATING_TOTAL_COUNT") )
end if
set rsTopicRating = nothing
GetTopicRatingAvg = iTopicRating
end function
3. I disabled rating in topic.asp when it is in archive view. Mine is slightly different form your original but the idea is the same
<% ' ################# TOPIC RATING MOD ###################### ' %> <% if request("ARCHIVE") <> "true" then %> <% if intRatingAuth = 1 then %> <% if strDBNTUserName <> "" Then %> <% if ( getMemberID(strDBNTUserName) <> rsTopic("T_AUTHOR") ) then %> <% iTopicRating = GetTopicRating( getMemberID(strDBNTUserName), rsTopic("TOPIC_ID") ) if iTopicRating <> -1 Then %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><i>You Rated this Topic </i></small></font> <img src="<%= iTopicRating %>stars.gif"> <% else %> <% Dim ratei, ratet ratei = "1" ratet = rsTopic("TOPIC_ID") %> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><i><a href="JavaScript:openWindow('rate1.asp?id=<%=rsTopic("TOPIC_ID")%>')">Rate This Topic </a></i> </font>
<%end if%> <% end if%> <% end if %>
<% end if %> <% end if %>
<% ' ################# END TOPIC RATING MOD ###################### ' %>
4. That's about what I did. You can see the result at my test site. It works. But I must say that my case is complexify by the other mods that I have installed such as the poll mod and others.
|
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 12 November 2001 : 05:29:27
|
Thanks for that blacknwhite,
I'll do some testing here and change the next release to take into account archiving (to be honest I had completely forgotten about it).
First however I'm gonna try and fix 3.1
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 12 November 2001 : 10:57:57
|
OK now I'm having some problems with Archiving.
I've "fixed" the initial 3.1 mod, but I'm going to make sure it works with everything before I post it.
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Ez4arab
Junior Member
479 Posts |
Posted - 12 November 2001 : 12:34:40
|
i try to use this mod in my forum i get error in file Inc_function.asp
the problem when vistor want see the topic this error appear while members can see topic fine.
in the line 906 whis this line getMemberID = rsGetMemberID("MEMBER_ID")
the code i have used in my forum this
this is my code in inc function.asp
'############## TOPIC RATING MOD ################### function GetTopicRatingAvg( iTopicID )
strSQL = "" strSQL = "SELECT TOPIC_RATING_TOTAL, TOPIC_RATING_TOTAL_COUNT " strSQL = strSQL & "FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID =" & iTopicID set rsTopicRating = Server.CreateObject("ADODB.Recordset") rsTopicRating = my_Conn.Execute( strSQL ) if rsTopicRating("TOPIC_RATING_TOTAL_COUNT") = 0 Then iTopicRating = 0 else iTopicRating = cint(rsTopicRating("TOPIC_RATING_TOTAL") / rsTopicRating("TOPIC_RATING_TOTAL_COUNT") )
end if
set rsTopicRating = nothing
GetTopicRatingAvg = iTopicRating
end function
function GetTopicRatingPicture( iRating )
select case( iRating ) case 0 strRatingPict = "images\icon_blank.gif" case 1 strRatingPict = "images\user_ratings_1.gif" case 2 strRatingPict = "images\user_ratings_2.gif" case 3 strRatingPict = "images\user_ratings_3.gif" case 4 strRatingPict = "images\user_ratings_4.gif" case 5 strRatingPict = "images\user_ratings_5.gif" end select
GetTopicRatingPicture = strRatingPict
end function
function GetTopicRating( iTopicRatingID, iTopicRatedID )
strSQL = "" strSQL = "Select RATING From " & strTablePrefix strSQL = strSQL & "TOPIC_RATINGS Where RATINGS_BYMEMBER_ID =" & iTopicRatingID & " AND RATINGS_TOPIC_ID =" & iTopicRatedID
set rsRatings = my_Conn.Execute( strSQL )
if not rsRatings.EOF and not rsRatings.BOF Then iRateTopic = rsRatings("RATING") else iRateTopic = -1 end if
set rsRatings = nothing
GetTopicRating = iRateTopic
end function
function RateTopic( iTopicRated, iTopicMemberRatingID, iTopicRatedID )
strSQL = "" strSQL = "Select RATINGS_BYMEMBER_ID, RATINGS_TOPIC_ID From " & strTablePrefix strSQL = strSQL & "TOPIC_RATINGS Where RATINGS_BYMEMBER_ID =" & iTopicMemberRatingID & " AND RATINGS_TOPIC_ID =" & iTopicRatedID
set rsRatings = my_Conn.Execute( strSQL )
if rsRatings.EOF or rsRatings.BOF Then strSQL = "" strSQL = "INSERT INTO " & strTablePrefix & "TOPIC_RATINGS ( RATING, RATINGS_BYMEMBER_ID, RATINGS_TOPIC_ID ) VALUES (" strSQL = strSQL & iTopicRated & ", " & iTopicMemberRatingID & ", " & iTopicRatedID & ") " my_Conn.Execute( strSQL ) iTopicTotalRating = GetTopicTotalRating( iTopicRatedID ) + iTopicRated iTopicRatingsCount = GetTopicTotalRatingsCount( iTopicRatedID ) + 1 strSQL = "" strSQL = "Update " & strTablePrefix & "TOPICS Set " strSQL = strSQL & strTablePrefix & "TOPICS.TOPIC_RATING_TOTAL_COUNT = " & iTopicRatingsCount & ", " strSQL = strSQL & strTablePrefix & "TOPICS.TOPIC_RATING_TOTAL = " & iTopicTotalRating strSQL = strSQL & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & iTopicRatedID & ";" my_Conn.Execute( strSQL ) RateTopic = 0 else RateTopic = -1 end if end function
function GetTopicTotalRatingsCount( iTopicID ) strSQL = "" strSQL = "Select TOPIC_RATING_TOTAL_COUNT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID =" & iTopicID
set rsTopicRatingsTotal = Server.CreateObject("ADODB.Recordset") rsTopicRatingsCount = my_Conn.Execute( strSQL )
iTopicRatingsCount = my_Conn.Execute( strSQL )
GetTopicTotalRatingsCount = rsTopicRatingsCount("TOPIC_RATING_TOTAL_COUNT")
set rsTopicRatingsCount = nothing end function
function GetTopicTotalRating( iTopicID ) strSQL = "" strSQL = "Select TOPIC_RATING_TOTAL FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID =" & iTopicID
set rsTopicRatingsTotal = Server.CreateObject("ADODB.Recordset") rsTopicRatingsTotal = my_Conn.Execute( strSQL )
GetTopicTotalRating = rsTopicRatingsTotal("TOPIC_RATING_TOTAL")
set rsTopicRatingsTotal = nothing
end function
'############## END TOPIC RATING MOD ###################
Arabic snit fourm http://aljish.com.sa/jforum |
|
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 13 November 2001 : 05:24:12
|
OK,
This is a potential fix for those people using version 3.1
This code is a straight replacement for the code in topic.asp
It works here, but if someone could test it that would be great.
Thanks Az
<% ' ################# TOPIC RATING MOD ###################### ' %> <% '## Forum_SQL - Find Topic Author strSql = "SELECT " & strTablePrefix & "TOPICS.T_AUTHOR " strSql = strSql & " FROM " & strTablePrefix & "TOPICS " strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.QueryString("TOPIC_ID") set rsRating = my_Conn.Execute (StrSql) TopicAuthor = rsRating("T_AUTHOR") %>
<% if strDBNTUserName = " " or strDBNTUserName = "" Then %> <% ' do nothing %> <% else %> <% if ( getMemberID(strDBNTUserName) = TopicAuthor ) then %> <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center"> <tr> <td bgColor="<% =strPageBGColor %>" align=left <%= strColspan %>> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small>You Cannot Rate your own Topic: </small></font></td> </tr> <table> <% else %> <% iTopicRating = GetTopicRating( getMemberID(strDBNTUserName), Request.QueryString("TOPIC_ID")) if iTopicRating <> -1 Then %> <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center"> <tr> <td bgColor="<% =strPageBGColor %>" align=left <%= strColspan %>> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small>You Rated this Topic: <%=iTopicRating %></small></font></td> </tr> <table> <% else %> <form action="pop_topic_rating.asp?mode=goRate&id=<%=Request.QueryString("TOPIC_ID")%>" method="Post" id=Form1 name=Form1> <SELECT NAME="rating"> <OPTION value=''>Rate Topic <OPTION value='10'>10: Highest Rating <OPTION value='9'>9 <OPTION value='8'>8 <OPTION value='7'>7 <OPTION value='6'>6 <OPTION value='5'>5 <OPTION value='4'>4 <OPTION value='3'>3 <OPTION value='2'>2 <OPTION value='1'>1: Lowest Rating </SELECT> <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Rate"> </form> <% end if %> <% end if %> <% end if %>
<% rsRating.Close set rsRating = nothing %>
<% ' ################# END TOPIC RATING MOD ###################### ' %>
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
Topic |
|