anchor.diff:  			title = sanitize(newtitle)
   		else
   			title = null
  -		title = sanitizeSQL(title)
   	if(href_list["setcategory"])
   		var/newcategory = input("Choose a category to search for:") in list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
   		if(newcategory)
   			category = sanitize(newcategory)
   		else
   			category = "Any"
  -		category = sanitizeSQL(category)
   	if(href_list["setauthor"])
   		var/newauthor = input("Enter an author to search for:") as text|null
   		if(newauthor)
   			author = sanitize(newauthor)
   		else
   			author = null
  -		author = sanitizeSQL(author)
   	if(href_list["search"])
  -		SQLquery = "SELECT author, title, category, id FROM [format_table_name("library")] WHERE isnull(deleted) AND "
  -		if(category == "Any")
  -			SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%'"
  -		else
  -			SQLquery += "author LIKE '%[author]%' AND title LIKE '%[title]%' AND category='[category]'"
   		screenstate = 1
  +
  +	if(href_list["bookpagecount"])
  +		search_page = text2num(href_list["bookpagecount"])
   
   	if(href_list["back"])
   		screenstate = 0
  
positive.code: 				dat += "</table><BR>"
  			dat += "<A href='?src=[REF(src)];back=1'>\[Go Back\]</A><BR>"
  	var/datum/browser/popup = new(user, "publiclibrary", name, 600, 400)
  	popup.set_content(dat)
  	popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
  	popup.open()
  
  
negative.code: 	var/title
  	var/category = "Any"
  	var/author
  	var/search_page = 0
  
  /obj/machinery/computer/libraryconsole/ui_interact(mob/user)
  	. = ..()
  	var/list/dat = list() // <META HTTP-EQUIV='Refresh' CONTENT='10'>
  	switch(screenstate)
  		if(0)
  			dat += "<h2>Search Settings</h2><br>"
  