<%
data = Modules.PhotoData; // shortcut to the data module
PicturesIterator = data.PicturesIterator;
Categories = data.Categories;
VoteAdapter = data.VoteAdapter;
viewMode = PicturesIterator.ViewMode.Value;
%>
<%
// If the iterator PicturesIterator. raises any errors, it
// will not "announce" them on top. This will force them
// on top.
picture = new Enumerator(PicturesIterator.Records);
// Display server-side errors that may have occured.
var e = new Enumerator(PicturesIterator.Errors)
if (!e.atEnd())
Response.Write('
The following error(s) happened:');
for (; !e.atEnd(); e.moveNext())
Response.Write('
' + e.item().Message)
function roundIt(number,X) {
// rounds number to X decimal places, defaults to 1
X = (!X ? 1 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}
function formatBytes(b)
{
if (Math.round(10*b/1024/1024) > 10)
return roundIt(b/1024/1024) + ' MB'; // MB
else if (Math.round(10*b/1024) > 10)
return roundIt(b/1024) + ' KB'; //KB
else
return b + ' bytes';
}
%>
<%
count = 0;
i = 1;
for (; !picture.atEnd(); !picture.moveNext())
{
count++
%>
<%
if (i % PicturesIterator.MaxPicsPerRow.Value == 0)
{ %>
<% }
i++
}
%>
<%
if (count == 0)
Response.Write('You have no pictures - first upload some pictures, or view all pictures');
else if (count > 0)
{
var picGoto = PicturesIterator.GotoPage;
var count = 0;
var e = new Enumerator(picGoto.Array)
if (!e.atEnd())
Response.Write('Page ');
for (; !e.atEnd(); e.moveNext())
{
if (count != 0)
Response.Write(' | ');
if (picGoto.Enabled)
{ %>
<%=picGoto.DisplayLabel%>
<%
}
else
{%>
<%=picGoto.DisplayLabel%>
<%}
count++;
}
}
%>