Mój problem polega na tym że skrypt 1 pokazuje screeny z youtuba jako miniaturke filmu, ale tworzy pętle x2 i wyświetla podwójnie rekordy. skrypt 2 działa ok ale nie pokazuje miniaturek. nie mam pojęcia co jest. bo co ma $wideoLink do 3 linijek na początku w skrypcie 1.

Skrypt 1:

  1. <?php
  2.  
  3. $x = mysql_query('SELECT * FROM wideo ORDER BY wideoId');
  4.  $g = 0;
  5.  while($row = mysql_fetch_array($x))
  6. {
  7.    echo "<table>";
  8. echo "<tr border=0>";
  9. echo "<td style='width:450px' class=\"light_gray_text\" colspan=3  align=center>";
  10.  
  11. $result = mysql_query('SELECT * FROM wideo ORDER BY wideoId DESC LIMIT 3');
  12. $il=mysql_num_rows($result);
  13. $wiersze=ceil($il/3);
  14. $link = $row[wideoLink];
  15. $screen = substr($link, 24, 35);
  16.  
  17. for ($a=0;$a<$wiersze;$a++)
  18. {
  19.  
  20.  
  21.  
  22. echo "<tr align=center>";
  23.    $b=$a*3;
  24.    $result=('SELECT * FROM wideo ORDER BY wideoId DESC LIMIT '.$b.',3');
  25.    $c=mysql_query($result);
  26.  
  27.    while($row=mysql_fetch_array($c))
  28.    {
  29.    $tekst = ciach(strip_tags(preg_replace("#[tex](.*?)[/tex]#si",'<img alt=";-)" title=";-)" src="http://.pl/cgi-bin/mimetex.cgi?1"/>',$row['wideoTresc'])), 50);
  30.    echo "<td class=\"light_gray_text\" style='width:150px'>";
  31.  
  32. echo"<center><a href=http://.pl/wideo/".$row['wideoId']." >
  33. <img src=http://img.youtube.com/vi/".$screen."/1.jpg></img>
  34. </a></center>";    
  35.  
  36.    echo"<a href=\"http://.pl/wideo/".$row['wideoId']."\"><b><span style=\"color:#0e88af\">".$row['wideoNazwa']."</b></a><br>
  37.    ";
  38.    echo "</td>";
  39.    }
  40. echo "</tr>";
  41. }
  42. echo "</table></span>";
  43.  
  44. }
  45.  
  46.  
  47. ?>





  1. <?php
  2.  
  3.  
  4.  
  5.    echo "<table>";
  6. echo "<tr border=0>";
  7. echo "<td style='width:450px' class=\"light_gray_text\" colspan=3  align=center>";
  8.  
  9. $result = mysql_query('SELECT * FROM wideo ORDER BY wideoId DESC LIMIT 3');
  10. $il=mysql_num_rows($result);
  11. $wiersze=ceil($il/3);
  12. $link = $row[wideoLink];
  13. $screen = substr($link, 24, 35);
  14.  
  15. for ($a=0;$a<$wiersze;$a++)
  16. {
  17.  
  18.  
  19.  
  20. echo "<tr align=center>";
  21.    $b=$a*3;
  22.    $result=('SELECT * FROM wideo ORDER BY wideoId DESC LIMIT '.$b.',3');
  23.    $c=mysql_query($result);
  24.  
  25.    while($row=mysql_fetch_array($c))
  26.    {
  27.    $tekst = ciach(strip_tags(preg_replace("#[tex](.*?)[/tex]#si",'<img alt=";-)" title=";-)" src="http:/.pl/cgi-bin/mimetex.cgi?1"/>',$row['wideoTresc'])), 50);
  28.    echo "<td class=\"light_gray_text\" style='width:150px'>";
  29.  
  30. echo"<center><a href=http://.pl/wideo/".$row['wideoId']." >
  31. <img src=http://img.youtube.com/vi/".$screen."/1.jpg></img>
  32. </a></center>";    
  33.  
  34.    echo"<a href=\"http://.pl/wideo/".$row['wideoId']."\"><b><span style=\"color:#0e88af\">".$row['wideoNazwa']."</b></a><br>
  35.    ";
  36.    echo "</td>";
  37.    }
  38. echo "</tr>";
  39. }
  40. echo "</table></span>";
  41.  
  42.  
  43.  
  44.  
  45. ?>