Home > Panele > Losowa fotka

Losowa fotka

Dodane przez: piciu
opis:
panel wyświetla losową fotografie
Kod:
  1. if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
  2.  
  3.  
  4. $result = dbquery("SELECT panel_name FROM ".$db_prefix."panels WHERE panel_filename = 'latest_images_panel'");
  5. if (dbrows($result) != 0) {
  6. $data = dbarray($result);
  7. $panel_name = $data['panel_name'];
  8. }
  9.  
  10. $result=dbquery(
  11. "SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
  12. LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
  13. WHERE ".groupaccess('album_access')." ORDER BY RAND() LIMIT 1"
  14. );
  15. if(dbrows($result)==1){
  16. }
  17.  
  18. openside("Atsitiktinė Foto");
  19.  
  20.  
  21. $data=dbarray($result);
  22. $randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
  23. if(!file_exists($filename)) $filename=$image_url.'/imagenotfound.jpg';
  24. echo "<center>
  25. <a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='gallery'>
  26. <img src='".$randphotodir.$data['photo_thumb1']."' title='".$data['photo_title']."' alt='".$data['photo_title']."'>
  27. </a><br /><a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='side'>".$data['photo_title']."</a>
  28. <br>
  29. <a href='".BASEDIR."photogallery.php?album_id=".$data['album_id']."' class='side'>".$data['album_title']."
  30. </center></a>";
  31.  
  32. closeside();
  33.  

©