home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iirtehd.asp < prev    next >
Text File  |  1997-11-12  |  7KB  |  276 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. Const L_ENABLE_TEXT = "Enable Ratings for this resource"
  11. Const L_MOVESLIDE_TEXT = "To set the rating value assigned to this resource, select the category and move the slider bar."
  12. Const L_LANGUAGE_TEXT = "Language"
  13. Const L_SEX_TEXT = "Sex"
  14. Const L_NUDITY_TEXT = "Nudity"
  15. Const L_VIOLENCE_TEXT = "Violence"
  16.  
  17. 'Rating Levels... eventually, these should come from an object...
  18. Const L_PICLABEL_TEXT = "PICS-Label: "
  19. Const L_PICVER_TEXT = "PICS-1.0"
  20. Const L_PICURL_TEXT = "http://www.rsac.org/ratingsv01.html"
  21. Const L_BY_TEXT = "by"
  22. Const L_ON_TEXT = "on"
  23. Const L_EXP_TEXT = "exp"
  24. Const L_NONE_TEXT = "None"
  25. Const L_SLANG_TEXT = "Inoffensive Slang"
  26. Const L_MILD_TEXT = "Mild Explicatives"
  27. Const L_MODERATE_TEXT = "Moderate Explicatives"
  28. Const L_OBSCENE_TEXT = "Obscene Gestures"
  29. Const L_CRUDE_TEXT = "Explicit or Crude Language"
  30. Const L_REVEALING_TEXT = "Revealing Attire"
  31. Const L_PARITAL_TEXT = "Partial Nudity"
  32. Const L_FRONTAL_TEXT = "Frontal Nudity"
  33. Const L_PROVACTIVE_TEXT = "Provacative Frontal Nudity"
  34. Const L_KISSING_TEXT = "Passionate Kissing"
  35. Const L_CLOTHED_TEXT = "Clothed Sexual Touching"
  36. Const L_TOUCHING_TEXT = "Non-explicit Sexual Touching"
  37. Const L_EXPLICIT_TEXT = "Explicit Sexual Activity"
  38. Const L_NOVIOLENCE_TEXT = "No Violence"
  39. Const L_FIGHTING_TEXT = "Fighting"
  40. Const L_KILLING_TEXT = "Killing"
  41. Const L_BLOOD_TEXT = "Killing with Blood and Gore"
  42. Const L_WANTON_TEXT = "Wanton and Gratuitous Violence"
  43.  
  44.  
  45.  
  46. On Error Resume Next 
  47.  
  48. Dim path, currentobj, baseobj, newname,quote
  49. quote = chr(34)
  50.  
  51. path=Session("dpath")
  52. Session("path")=path
  53. Session("SpecObj")=""
  54. Session("SpecProps")=""
  55. Set currentobj=GetObject(path)
  56. Dim PICsArray, PICstring, email, seton, expon, ratings, noslider,aratings
  57. PICsArray = currentobj.HttpPics
  58. %>
  59.  
  60. <HTML>
  61. <HEAD>
  62. <TITLE></TITLE>
  63. <SCRIPT LANGUAGE="JavaScript">
  64.  
  65.     function loadHelp(){
  66.         top.title.Global.helpFileName="iipy_39";        
  67.     }
  68.  
  69.     function disableDefault(dir,fromCntrl, toCntrl){
  70.         if (!dir){
  71.             if (fromCntrl.value != ""){
  72.                 toCntrl.value = fromCntrl.value;
  73.                 fromCntrl.value = "";
  74.             }
  75.         }
  76.         else{
  77.             if (toCntrl.value != ""){
  78.                 fromCntrl.value = toCntrl.value;
  79.                 toCntrl.value = "";
  80.             }
  81.         }
  82.     }
  83.  
  84.     function enableDefault(chkCntrl){
  85.         chkCntrl.checked = true;
  86.     }
  87.  
  88.  
  89.     function SetIndex(){
  90.         document.hiddenform.index.value = document.cacheform.selCategory.selectedIndex; 
  91.         parent.list.location.href = "iirtels.asp?level=" +cachedList[document.hiddenform.index.value].sel; 
  92.     }
  93.  
  94.  
  95. </SCRIPT>
  96. </HEAD>
  97.  
  98. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=10 TEXT="#000000" LINK="#FFFFFF" onLoad="loadList();loadHelp();">
  99.  
  100.  
  101. <FORM NAME="userform" onSubmit="return false">
  102. </FORM>
  103.  
  104. <FORM NAME="cacheform">
  105. <TABLE BORDER=0 CELLPADDING=0>
  106. <TR>
  107.     <TD>
  108.         <FONT SIZE=1 FACE="HELV,ARIAL">
  109.  
  110.             <% if PICSArray(0) <> "" then %>
  111.                 <INPUT TYPE="checkbox" NAME="chkEnableRatings" CHECKED>
  112.             <% else %>
  113.                 <INPUT TYPE="checkbox" NAME="chkEnableRatings" >                
  114.             <% end if %>
  115.             <%= L_ENABLE_TEXT %>
  116.             <P>
  117.             <%= L_MOVESLIDE_TEXT %>
  118.             <P>
  119.  
  120.             <SELECT NAME="selCategory" SIZE = 4 OnChange="SetIndex()";>
  121.                 <OPTION VALUE=0 SELECTED><%= L_LANGUAGE_TEXT %>
  122.                 <OPTION VALUE=1><%= L_NUDITY_TEXT %>
  123.                 <OPTION VALUE=2><%= L_SEX_TEXT %>
  124.                 <OPTION VALUE=3><%= L_VIOLENCE_TEXT %>
  125.             </SELECT>
  126.     </TD>
  127. </TR>
  128.  
  129.  
  130.  
  131. </TABLE>
  132. </FORM>
  133.  
  134. <FORM name="hiddenform">
  135.     <INPUT TYPE="hidden" NAME="index" VALUE=0>
  136. </FORM>
  137.  
  138.  
  139. <%
  140.  
  141.  
  142. PICString = PICSArray(0)
  143.  
  144. email = parsePIC(PICstring,L_BY_TEXT,chr(34),chr(34))
  145. seton = parsePIC(PICstring,L_ON_TEXT,chr(34),chr(34))
  146. expon = parsePIC(PICstring,L_EXP_TEXT,chr(34),chr(34))
  147. ratings = parsePIC(PICstring,"(","(",")")
  148.  
  149. aratings = setRatingsArray(ratings)
  150.  
  151. function parsePIC(picrating,delimiter,openswith,closeswith)
  152.  
  153.     Dim newString
  154.     if InStr(picrating,delimiter) > 0 then
  155.         newString = Mid(picrating,InStr(picrating,delimiter)+1)
  156.         newString = Mid(newString,InStr(newString,openswith)+1)
  157.         newString = Mid(newString,1,InStr(newString,closeswith)-1)
  158.     end if
  159.         parsePIC = newString
  160.         
  161. end function
  162.  
  163. function setRatingsArray(rs)
  164.  
  165.     Dim v,s,n,l
  166.     
  167.     rs = LCase(rs)
  168.     v = getRating(rs,"v")
  169.     s = getRating(rs,"s")
  170.     n = getRating(rs,"n")
  171.     l = getRating(rs,"l")
  172.  
  173.     setRatingsArray = Array(v,s,n,l)
  174.  
  175. end function
  176.  
  177. function getRating(rs,rt)
  178.  
  179.     rt = Left(Trim(Mid(rs,InStr(rs,rt)+1)),1)
  180.     if IsNumeric(rt) then
  181.         getRating = rt
  182.         noslider = False
  183.     else
  184.         getRating = 0
  185.         noslider = True
  186.     end if
  187. end function
  188. %>
  189.  
  190. <SCRIPT LANGUAGE="JavaScript">
  191.  
  192.     function loadList(){
  193.         parent.list.location.href="iirtels.asp?level=" + cachedList[document.hiddenform.index.value].sel + "&noslider=<%= noslider %>";
  194.     }
  195.     
  196.     function listFuncs(){
  197.         this.writeList = buildListForm;
  198.         this.SetListVals = SetListVals;
  199.         this.email = "<%= email %>"
  200.         this.seton = "<%= seton %>"
  201.         this.expon = "<%= expon %>"
  202.         this.mainframe = top.opener.top;                                
  203.     }    
  204.     
  205.     function ratingsObj(key,l0,l1,l2,l3,l4,sel){
  206.         this.key=key;
  207.         this.level=new Array(5)
  208.         this.level[0]=l0;
  209.         this.level[1]=l1;
  210.         this.level[2]=l2;
  211.         this.level[3]=l3;
  212.         this.level[4]=l4;
  213.         this.sel=sel;
  214.         this.ratingsok = !(isNaN(sel));
  215.     }
  216.     
  217.     function buildListForm(){
  218.         numrows = 1        
  219.         qstr = "numrows="+numrows;
  220.         qstr = qstr+"&cols=HttpPics";
  221.  
  222.         top.hlist.location.href = "iihdn.asp?"+qstr;
  223.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  224.     }
  225.  
  226.     function SetListVals(){
  227.     
  228.         listForm = top.hlist.document.hiddenlistform;    
  229.         
  230.         if (document.cacheform.chkEnableRatings.checked){
  231.         
  232.             str = '<%= L_PICLABEL_TEXT & "(" & L_PICVER_TEXT & " " & quote & L_PICURL_TEXT & quote %> l'
  233.             
  234.             if (listFunc.email != ""){
  235.                 str += ' <%= L_BY_TEXT %> "' + listFunc.email + '"';
  236.             }
  237.             
  238.             if (listFunc.seton != ""){
  239.                 str += ' <%= L_ON_TEXT %> "'  + listFunc.seton + '"';
  240.             }
  241.             
  242.             if (listFunc.expon != ""){
  243.                 str += ' <%= L_EXP_TEXT %> "'  + listFunc.expon + '"';
  244.             }
  245.     
  246.             str += " r (";
  247.     
  248.             for (i=cachedList.length-1;i>-1;i--)
  249.                 {
  250.                     str += cachedList[i].key + " " + cachedList[i].sel + " ";
  251.                 }
  252.     
  253.             //lop off the last space...
  254.             str = str.substring(0,str.length-1);
  255.             str += "))";
  256.         }
  257.         else{
  258.             str = "";
  259.         }
  260.  
  261.         listForm.HttpPics.value = str;
  262.  
  263.     }
  264.     
  265.     cachedList = new Array(4)
  266.     cachedList[0] = new ratingsObj("l","<%= L_SLANG_TEXT %>","<%= L_MILD_TEXT %>","<%= L_MODERATE_TEXT %>","<%= L_OBSCENE_TEXT %>","<%= L_CRUDE_TEXT %>",<%= aratings(3) %>);
  267.     cachedList[1] = new ratingsObj("n","<%= L_NONE_TEXT %>","<%= L_REVEALING_TEXT %>","<%= L_PARITAL_TEXT %>","<%= L_FRONTAL_TEXT %>","<%= L_PROVACTIVE_TEXT %>",<%= aratings(2) %>);
  268.     cachedList[2] = new ratingsObj("s","<%= L_NONE_TEXT %>","<%= L_KISSING_TEXT %>","<%= L_CLOTHED_TEXT %>","<%= L_TOUCHING_TEXT %>","<%= L_EXPLICIT_TEXT %>",<%= aratings(1) %>);
  269.     cachedList[3] = new ratingsObj("v","<%= L_NOVIOLENCE_TEXT %>","<%= L_FIGHTING_TEXT %>","<%= L_KILLING_TEXT %>","<%= L_BLOOD_TEXT %>","<%= L_WANTON_TEXT %>",<%= aratings(0) %>);
  270.     listFunc = new listFuncs();
  271. </SCRIPT>
  272.  
  273. </BODY>
  274. </HTML>
  275.  
  276. <% end if %>