Source: site.view [edit]
Function name: picMembersRender
Arguments: data
Description: A render function for displaying members as pictures
Page type: snippet
Render function:  
Module: siteutil

Page source:

<webl>
   var NumMembers = 4;
   var html = "";
   if data != nil then
      var showMembers = [];
      every m in data do
         if Size(showMembers) < NumMembers then
            var finfo = (Wub_GetFunctionInfo(m+".profile") ? nil);
            if finfo != nil then
               var profile = (WubEval(finfo.exec) ? nil);
               if profile != nil then
                  showMembers = showMembers + [ 
                    [. username = m, name = data[m], 
                       img = (profile.photo ? nil) .] ]
               end
            end
         end
      end;
      html = "<table width='100%'><tr>";
      every m in showMembers do
         html = html + "<td align=center><a href='/webl/WubHub_DoIt?cmdline=" + 
            m.username + ".profile'><img height=100 src='" + m.img + "'/></td></a>"
      end;
      html = html + "</tr><tr>";
      every m in showMembers do
         html = html + "<td align=center><a href='/webl/WubHub_DoIt?cmdline=" + m.username
                  + ".profile'>" + m.name + "</a></td>"
      end;
      var more = Size(ToList(data)) - Size(showMembers);
      if more > 0 then
         html = html + "</tr><tr><td><b>" + 
           "<a href='/webl/WubHub_DoIt?cmdline=membersRender(" + wubinfo.cmdline 
           + ")'>" + ToString(more) + " more member(s)</a></b></td>"
      end;
      html = html + "</tr></table>";
   else
      html = "No members."
   end;
   html;
</webl>