Elakiri Image Viewer.
All right guys. you can see these bunch of codes have been written by myself for viewing images on Elakiri.com. there are 3 varieties.
How to use
Just copy all codes in following and paste them onto the notepad.
now save as name.html or name.htm and run through Firefox (at this time it only works on firefox ,I am pretty sure it doesn't work on IE but Chrome and Safari are unknown)
Please Acknowledge the Developer(Topology-Elakiri.com) prior to redistribution.
Report the bugs of the program if you can.!
All right guys. you can see these bunch of codes have been written by myself for viewing images on Elakiri.com. there are 3 varieties.
- first one is get all images from the 0 index position to available images on elakiri.
- second one is get images from specified location to specified location. it might be 5 to 5 that means return image index number 5(in elakiri images that were uploaded into the server are considered as attachments like other files so only images will be shown)
- third variety is randomly get images within a given range. the range can be any integer value. but it would be considered from 0 position.
How to use
Just copy all codes in following and paste them onto the notepad.
now save as name.html or name.htm and run through Firefox (at this time it only works on firefox ,I am pretty sure it doesn't work on IE but Chrome and Safari are unknown)
Code:
<html>
<head>
<script type='text/javascript'>
var oriStr = "http://www.elakiri.com/forum/attachment.php?attachmentid=";
function zeroTOSpecifiedImg()
{
var tempStr = document.getElementById("elakiri_img0_01").value;
if(tempStr == "")
{
alert("You need to type something.");
}
else
{
var number = parseInt(document.getElementById("elakiri_img0_01").value);
number -= 1;
var i=0;
var clearTimerVar;
function imageLoading()
{
if(i<=number)
{
while(i<=number)
{
document.write("<td>Photo Number<br/>"+ i +"<img src='" + oriStr + i +"' style='width:auto;height:133px;'/> </td>");
i++;
if(i%7 == 0)
{
document.write("<tr>");//start the new row
document.write("</tr>");//end the previous row
}
}
if(i%7 !=0)
{
document.write("</tr>");//end the previous row
}
}
else
{
clearTimeout(clearTimer);
}
document.write("</table>");
}
function initialization()
{
document.write("<table border='0' cellpadding='5' cellspacing='5' style='border:solid black;'>");
imageLoading();
}
initialization();
}
}
function fromToImages()
{
var fromImages= parseInt(document.getElementById("elakiri_img1_01").value);
var toImages = parseInt(document.getElementById("elakiri_img1_02").value);
function imageCall()
{
if(fromImages>toImages)
{
alert("you can't go reverse order so always from value should be less than to value");
}else
{
document.write("<table border='10' cellpadding='5' cellspacing='5' style='border:solid black'>");
document.write("<tr>");
while(fromImages<=toImages)
{
if(fromImages>toImages)
{
break;
}
document.write("<td>Photo Number<br/>"+ fromImages +"<img src='" + oriStr +fromImages +"' style='width:auto;height:133px'/> </td>");
fromImages++;
if(fromImages%7 == 0)
{
document.write("</tr>");//end the previous row
document.write("<tr>");//start the new row
}
}
if(fromImages%7 == 0)
{
document.write("</tr>");//end the previous row
}
document.write("</table>");
}
}
imageCall();
}
function randomImages()
{
var ranNum = parseInt(document.getElementById("elakiri_img3_01").value);
var randNum = parseInt(document.getElementById("elakiri_img3_02").value);
function ranFun()
{
if(ranNum<0 || ranNum == "" || randNum<0 || randNum == 0)
{
alert("value or range is either minus or invalid, check whatever you have typed and repeat the process.");
}else{
//oriStr
document.write("<table border='0' cellpadding='5' cellspacing='5' style='border:solid black' /> ");
document.write("<tr>");
var i=0;//initial value
ranNum -= 1;
while(i<=ranNum)
{
randValue = Math.floor(Math.random()*randNum);//get the random number
document.write("<td>Image Number<br/>"+ randValue +"<img src='"+ oriStr + randValue +"' style='width:auto;height:133px' />");
i++;
if(i%7 == 0)
{
document.write("<tr>");
document.write("</tr>");
}
}
if(i%7 !=0 )
{
document.write("</tr>");
}
document.write("</table>");
}
}
ranFun();// call to the function
}
</script>
</head>
<body>
<fieldset>
<legend>Elakiri Image Viewer</legend>
<table border='1' cellpadding='10' cellspacing='2' style='font-family:georgia;font-size:12px;background-color:milky white;border:double black;margin-left:50px;margin-top:20px'>
<tr>
<td>
From 0 search images to unlimited.
</td>
<td>
Amount of images from 0 index.<br/><input type='text' value='' id='elakiri_img0_01' />
</td>
<td>
<input type='button' value='Submit' onclick="zeroTOSpecifiedImg();" />
</td>
</tr>
<tr>
<td>
From 0 to x number of images.
</td>
<td>
From Number. <br/><input type='text' value='' id='elakiri_img1_01' />
<br/>
To Number. <br/><input type='text' value='' id='elakiri_img1_02' />
</td>
<td>
<input type='button' value='Submit' onclick="fromToImages();" />
</td>
</tr>
<tr>
<td>
Specify the amount of random images and the range too.
</td>
<td>
Amount of Images.<br/><input type='text' value='' id='elakiri_img3_01' />
<br/>
Range 0~Infinity :P.<br/><input type='text' value=''s id='elakiri_img3_02' />
</td>
<td>
<input type='button' value='Submit' onclick="randomImages();" />
</td>
</tr>
</table>
<br/>
<p>This Program was developed by Topology for Elakiri.com.!, 2010/03/05</p>
</fieldset>
</body>
</html>
Report the bugs of the program if you can.!
Last edited:
