PageRenderTime 60ms CodeModel.GetById 35ms RepoModel.GetById 0ms app.codeStats 0ms

/plugins/tiny_mce/slideshow/slideshow.php

https://bitbucket.org/mpercy/deeemm-cms
PHP | 57 lines | 38 code | 14 blank | 5 comment | 2 complexity | 64e8e57c150ec68f26ea24468fe70f24 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause
  1. <?php
  2. $INDM = TRUE;
  3. defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );
  4. /*===========================================================================
  5. //>required files
  6. ===========================================================================*/
  7. require './initialise.php';
  8. require './config.php';
  9. require './functions.php';
  10. require './db_access.php';
  11. require './site_structure.php';
  12. require './site_status.php';
  13. $pattern="(\.jpg$)|(\.jpeg$)"; //valid image extensions
  14. //echo file header
  15. header('Content-Type: text/xml');
  16. echo'<gallery timer="5" order="random" fadetime="3" looping="yes" xpos="0" ypos="0">';
  17. $value = NULL;
  18. foreach($imagebox_libraries as $value){
  19. $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "core_structure` WHERE `table` = '$value'");
  20. while($sql_result = mysql_fetch_array($sql_query)){
  21. $media_library_enabled = $sql_result[media_library_enabled];
  22. $media_library_default_view = $sql_result[media_library_default_view];
  23. $num_slideshow_images = $sql_result[num_slideshow_images];
  24. $imagebox_type = $sql_result[imagebox_type];
  25. }
  26. //get imagelist from media library
  27. $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . $value . "` ORDER BY `date` DESC");
  28. $count = 0;
  29. while(($sql_result = @mysql_fetch_array($sql_query)) && ($count < $num_slideshow_images)){
  30. $slideshow_image_name = $sql_result[image];
  31. if(eregi($pattern, $slideshow_image_name)) {
  32. $count = $count + 1;
  33. $slideshow_image_title = $sql_result[title_lan_.$language];
  34. $slideshow_image_description = $sql_result[description_lan_.$language];
  35. $slideshow_image_num = $sql_result[id];
  36. $slideshow_image_name = $sql_result[image];
  37. echo"<image path='./" . $media_dir . "thumbnail.php?height=288&amp;width=432&amp;filename=" . $slideshow_image_name . "' link='$default_url" . "index.php?page=" . $value . "&amp;id=$slideshow_image_num' /> ";
  38. }
  39. }
  40. }
  41. echo'</gallery>';
  42. $value = NULL;
  43. ?>