Adding the Avg. Critique Rating to the Search Details Web page affects the DDetails.asp file.
The major addition to the script in the DDetails ASP page is a code section that checks whether the application is critique-enhanced. Adding Application Settings tells you how to enable and disable critique functionality in the CML/LitCrit application. When the application first starts the value True or False is stored in the Application("CritiqueEnabled") global variable. Updating Global.asa describes the CML/LitCrit additions to the file and global.asa, in the code section, contains the entire file.
When the application is critique-enabled the View Critique and Add Critique buttons appear.
<% If Application("CritiqueEnabled") = True Then %>
<div ID="ReviewButtons" STYLE="DISPLAY: none; POSITION: absolute; LEFT: 265; TOP: 78px; HEIGHT: 15px">
<span class="UpButton" onClick="ViewCritiques()"
OnMouseDown="javascript:push()" OnMouseUp="javascript:unPush()"
style="POSITION: relative; TOP: 5px; WIDTH: 120px" title="View existing critques for this title">View Critiques</span>
<span class="UpButton" onClick="NewCritique()"
OnMouseDown="javascript:push()" OnMouseUp="javascript:unPush()"
style="POSITION: relative; TOP: 5px; WIDTH: 100px" title="Add new critique for this title">Add Critique</span>
</div>
<% End If %>
Next, code runs that displays the Avg Critique Rating when the application is critique-enabled.
<% If Application("CritiqueEnabled") = True Then %>
<tr><td WIDTH="30%">Avg. Critique Rating: </td><td><a onMouseOver="javascript:ShowRatings()" onMouseOut="javascript:HideRatings()"><img DATAFLD="rating" BORDER=0 ALIGN=Bottom></a></td></tr>
<% End If %>. The query that
The updated script in DDetails.asp also has two subroutines:
When the application is critique-enabled, the title does not have a media type of "reference," and the title has no critiques, a disabled View Critiques button appears.
<% If Application("CritiqueEnabled") = True Then %>
If LCase(RDS_LongDisplay.Recordset("coll")) <> "ref" Then
If InStr(RDS_LongDisplay.Recordset("rating"),"0.0") > 0 Then
ReviewButtonsHalf.style.display = ""
Else
ReviewButtonsFull.style.display = ""
End If
End If
<% End If %>
Reviewers are not allowed to submit critiques of reference materials, and the Add Critique and View Critique buttons do not appear if the reviewer selects a library item that has a media type of "reference."