% Set databaseConnection = getDatabaseConnection() // pick a template templateID = 1 templateType = 1 // (rhyming) countTemplatesSQL = "SELECT COUNT(lim_tem_id) AS templates FROM lim_tem_templates" Set countTemplatesRS = createRecordSet(countTemplatesSQL, databaseConnection) If Not countTemplatesRS.EOF Then // get a random int in that range Randomize moveForward = Int(Rnd() * CInt(countTemplatesRS.Fields("templates"))) End If destroyRecordSet(countTemplatesRS) getTemplatesSQL = "SELECT * FROM lim_tem_templates" Set getTemplatesRS = createRecordSet(getTemplatesSQL, databaseConnection) If Not getTemplatesRS.EOF Then // move forward by the random step getTemplatesRS.Move(moveForward) // get content from this record templateID = getTemplatesRS.Fields("lim_tem_id") // decide which type of template it is templateType = CInt(getTemplatesRS.Fields("lim_tem_type")) End If destroyRecordSet(getTemplatesRS) // get hints for each word hintNames = Array("hint1", "hint2", "hint3", "hint4", "hint5") Set allHints = CreateObject("Scripting.Dictionary") // set defaults For Each fieldName In hintNames fieldValue = "No hint available." allHints.Add fieldName, fieldValue Next // now grab from db getHintsSQL = "SELECT * FROM lim_hin_hints WHERE lim_hin_templateID = " & templateID Set getHintsRS = createRecordSet(getHintsSQL, databaseConnection) While Not getHintsRS.EOF // store each hint in the dictionary slotNumber = getHintsRS.Fields("lim_hin_slotNumber") hintText = CStr(getHintsRS.Fields("lim_hin_hintText")) allHints.Item("hint" & slotNumber) = hintText getHintsRS.MoveNext WEnd destroyRecordSet(getHintsRS) destroyConnection(databaseConnection) // if user has requested no colors, turn off style sheet If Request("style") = "off" Then Session("style") = "off" ElseIf Request("style") = "on" Then Session("style") = "on" End If %>
LimGen: The Limerick Generator for Limerick Fanslimerick - noun. A light humorous, nonsensical, or bawdy verse of five lines usually with the rhyme scheme aabba.Example: The limerick is furtive and mean. You must keep it in close quarantine, Or she sneaks to the slums, And promptly becomes Disorderly, drunk and obscene. |
|||||||||||||
|
<%= getRightBarAd() %> |