Advertisement
Advertisement
| 09.04.2008 at 10:36AM PDT, ID: 23703569 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: |
<?php
$bg = "336633";
$SCRIPT_NAME=$SERVER_VARS['PHP_SELF'];
$pic=$HTTP_GET_VARS['pic'];
$handle=opendir('.');
$pics=array();
$count=0;
while (($file = readdir($handle))!==false) {
if (substr($file,-4) == ".jpg" || substr($file,-4) == ".gif" || substr($file,-4) == ".png" || substr($file,-4) == ".JPG" || substr($file,-4) == ".GIF" || substr($file,-4) == ".PNG"){
$pics[$count] = $file;
$count++;
}
}
closedir($handle);
sort($pics);
reset($pics);
$nextpicindex = (array_search($pic, $pics) + 1) % count($pics);
$nextpic = $pics[$nextpicindex];
// check to see if $pic is populated
// if not, and $pics has some filenames, set $pic to the first one
if (!$pic && (count($pics)>0)) { $pic=$pics[0]; }
$name="";
// if there is already a pic selected...
if ($pic && !preg_match("/javascript/",$pic)){
// if the text should be displayed
// Capitalize filename for display andf print it
$name=ucfirst(substr($pic,0,-4));
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><?php echo "Image: ".$name." Number: ". ($nextpicindex==0?sizeof($pics):$nextpicindex)."/".sizeof($pics);?></title>
</head>
<body style="padding:0; margin:0; background:right; background-color:#0000FF; float:none " >
<?php
// if there is already a pic selected...
if ($pic && !preg_match("/javascript/",$pic)){
// if the text should be displayed
// Capitalize filename for display andf print it
$name=ucfirst(substr($pic,0,-4));
echo"<a href=\"?pic=" . urlencode($nextpic) . "\"><img src=\"".$pic."\" style = \"border:0; margin:0; padding:0 align:center\" alt=\"".$name."\" /></a><br /><br />";
}
for ($f=0;$f<=sizeof($pics)-1;$f++){if ($pic==$pics[$f]){$selected = $f+1;}}
echo "\t\t<!-- dropdown -->\n\t\t<form name=\"mainform\" style=\"margin:0; padding:0\">\n\t\t\t<select name=\"pic\">\n";
// loop over all pics
for ($f=0;$f<=sizeof($pics)-1;$f++){
// Capitalize filename for display
$name=ucfirst(substr($pics[$f],0,-4));
// if the pic is the selected one set selected status
if ($pic==$pics[$f]){echo "\t\t\t\t<option value=\"".$pics[$f]."\" selected>".$name."</option>\n";}
// or simply render another option
else{echo "\t\t\t\t<option value=\"".$pics[$f]."\">".$name."</option>\n";}
}
// close select statement and display show button with predefined text.
echo "\t\t\t</select>\n\t\t\t<input type=\"submit\" value=\"show\" style=\"height:20; padding:0 0 0 15; margin:0\">\n\t\t</form>\n\t\t<!-- end dropdown --><p />";
?>
</body>
</html>
|