Witam mam problem, na mojej stronie http://facemash.com.pl/ zdjęcia wyswietlaja sie za duze, (na cały ekran itd.) chcialbym zeby sie skalowaly ale nie wiem jak to zrobic ze wzgledy na skrypt. Sa losowane z katalogu a nie umieszczone na stałe.

  1. <?php
  2.  
  3.  
  4. include('mysql.php');
  5. include('functions.php');
  6.  
  7.  
  8. // Get random 2
  9. $query="SELECT * FROM images ORDER BY RAND() LIMIT 0,2";
  10. $result = @mysql_query($query);
  11.  
  12. while($row = mysql_fetch_object($result)) {
  13. $images[] = (object) $row;
  14. }
  15.  
  16.  
  17. // Get the top10
  18. $result = mysql_query("SELECT *, ROUND(score/(1+(losses/wins))) AS performance FROM images ORDER BY ROUND(score/(1+(losses/wins))) DESC LIMIT 0,10");
  19. while($row = mysql_fetch_object($result)) $top_ratings[] = (object) $row;
  20.  
  21.  
  22. // Close the connection
  23.  
  24.  
  25. ?>
  26. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  27. <html xmlns="http://www.w3.org/1999/xhtml">
  28. <head>
  29. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  30. <title>Facemash</title>
  31. <style type="text/css">
  32.  
  33. body, html {font-family:Arial, Helvetica, sans-serif;width:100%;margin:0;padding:0;text-align:center;}
  34. h1 {background-color:#600;color:#fff;padding:20px 0;margin:0;}
  35. a img {border:0;}
  36. td {font-size:11px;}
  37. .image {background-color:#eee;border:1px solid #ddd;border-bottom:1px solid #bbb;padding:5px;}
  38.  
  39. </style>
  40. </head>
  41.  
  42. <body>
  43.  
  44.  
  45. <h1>FACEMASH</h1>
  46. <h3>Were we let in for our looks? No. Will we be judged on them? Yes.</h3>
  47. <h2>Who's hotter? Click to choose.</h2>
  48.  
  49. <center>
  50. <table>
  51. <tr>
  52. <td valign="top" class="image"><a href="rate.php?winner=<?=$images[0]->image_id?>&loser=<?=$images[1]->image_id?>"><img src="images/<?=$images[0]->filename?>" /></a></td>
  53. <td valign="top" class="image"><a href="rate.php?winner=<?=$images[1]->image_id?>&loser=<?=$images[0]->image_id?>"><img src="images/<?=$images[1]->filename?>" /></a></td>
  54. </tr>
  55. <tr>
  56. <td>Won: <?=$images[0]->wins?>, Lost: <?=$images[0]->losses?></td>
  57. <td>Won: <?=$images[1]->wins?>, Lost: <?=$images[1]->losses?></td>
  58. </tr>
  59. <tr>
  60. <td>Score: <?=$images[0]->score?></td>
  61. <td>Score: <?=$images[1]->score?></td>
  62. </tr>
  63. <tr>
  64. <td>Expected: <?=round(expected($images[1]->score, $images[0]->score), 4)?></td>
  65. <td>Expected: <?=round(expected($images[0]->score, $images[1]->score), 4)?></td>
  66. </tr>
  67. </table>
  68. </center>
  69.  
  70. <h2>Top Rated</h2>
  71. <center>
  72. <table>
  73. <tr>
  74. <? foreach($top_ratings as $key => $image) : ?>
  75. <td valign="top"><img src="images/<?=$image->filename?>" width="70" /></td>
  76. <? endforeach ?>
  77. </tr>
  78. <? /* Remove this to see the scoring
  79. <tr>
  80. <? foreach($top_ratings as $key => $image) : ?>
  81. <td valign="top">Score: <?=$image->score?></td>
  82. <? endforeach ?>
  83. </tr>
  84. <tr>
  85. <? foreach($top_ratings as $key => $image) : ?>
  86. <td valign="top">Performance: <?=$image->performance?></td>
  87. <? endforeach ?>
  88. </tr>
  89. <tr>
  90. <? foreach($top_ratings as $key => $image) : ?>
  91. <td valign="top">Won: <?=$image->wins?></td>
  92. <? endforeach ?>
  93. </tr>
  94. <tr>
  95. <? foreach($top_ratings as $key => $image) : ?>
  96. <td valign="top">Lost: <?=$image->losses?></td>
  97. <? endforeach ?>
  98. </tr>
  99. */ ?>
  100. </table>
  101. </center>
  102.  
  103. </body>
  104. </html>