Source: site.view [edit]
Function name: searchHistoryRender
Arguments: history
Description:
Page type: html
Render function:  
Module: speakaboutai

Page source:

<center>
<h1>Search History</h1>

<webl>
   var count = 0;
   every elt in history do
      count = count + elt.count;
   end;
   
   var res = "<h3>Total queries: " + ToString(count) + "</h3>\n";
   every elt in history do
      var s =  ToString(elt.count / count * 100);
      var i = Str_IndexOf(".", s);
      if i > 0 then
         s = Select(s, 0, i+2)
      end;
      var q = " queries (";
      if elt.count == 1 then
         q = " query ("
      end;
      res = res + "<b>" + elt.searchTerm + "</b>: " + ToString(elt.count) + q + s + "%)<br>\n";
   end;
   res;
</webl>

</center>