Siemka, mam problem ze stronką, dokładniej z galerią :/. Normalnie działa, jednak po wczytaniu bez przeładowywania strony jest error.
Pliki:

index.php
  1. <link rel="stylesheet" href="style.css" type="text/css" />
  2.  
  3. <script type="text/javascript">
  4. function get(plik, target){
  5. var xmlHttp;
  6. xmlHttp=new XMLHttpRequest();
  7.  
  8. xmlHttp.onreadystatechange=function(){
  9. if(xmlHttp.readyState==4){
  10. if (target != undefined) {document.getElementById(target).innerHTML=xmlHttp.responseText;}
  11. }
  12. }
  13. xmlHttp.open("GET", plik);
  14. xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  15. xmlHttp.setRequestHeader("Connection", "close");
  16. xmlHttp.send(null);
  17. }
  18. </script>
  19.  
  20.  
  21. <title>WhiteDark's gallery</title>
  22. <center>
  23.  
  24. <div id="logo" class="rogi">
  25. <img src="logo.jpg">
  26. </div>
  27.  
  28. <div id="menu" class="rogi">
  29. <br>
  30. <br>
  31. <font size="5">
  32. <a href="#" onClick="get('home.php', 'srodek') & get('home.txt', 'srodek_panel')"><img src="home.jpg"></a></img> <br>
  33. <a href="#" onClick="get('portfolio.php', 'srodek') & get('portfolio.txt', 'srodek_panel')"><img src="portfolio.jpg"></a></img> <br>
  34. <a href="#" onClick="get('kontakt.php', 'srodek') & get('kontakt.txt', 'srodek_panel')"><img src="kontakt.jpg"></a></img> <br>
  35. <a href="#" onClick="get('galeria.php', 'srodek') & get('galeria.txt', 'srodek_panel')"><img src="galeria.jpg"></a></img> <br>
  36. <a href="#" onClick="get('mcms.php', 'srodek') & get('mcms.txt', 'srodek_panel')"><img src="mcms.jpg"></a></img>
  37. </font>
  38. </div>
  39.  
  40. <div id="menu_panel" class="rogi2">
  41. Menu
  42. </div>
  43.  
  44.  
  45. <div id="srodek" class="rogi">
  46. </div>
  47.  
  48. <div id="srodek_panel" class="rogi2">
  49. </div>
  50.  
  51. <div id="muzyka" class="rogi">
  52. <br>
  53. tu bedzie
  54. </div>
  55.  
  56. <div id="muzyka_panel" class="rogi2">
  57. Muzyka
  58. </div>
  59.  
  60. <div id="footer">
  61. (C) 2011/2022 by whitedark.<br>
  62. Mini-CMS by karer. (mozesz usunac ten napis za 10 zl).
  63. </div>
  64. </center>
  65.  
  66.  
  67. <script>
  68. get('welcome.txt', 'srodek_panel') & get('welcome.php', 'srodek')
  69. </script>


makro:

flashgallery.html
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!--
  3. Developed by Reality Software | www.realitysoftware.ca
  4. Released by Flash Gallery | www.flash-gallery.org
  5. Note: This is a free application distributed under the Creative Commons Attribution 3.0 license,
  6. which means you can use it in any way you want provided you keep our links intact.
  7. Don't want our links in the script? You can support this project by purchasing a paid
  8. version: www.flash-gallery.org/buy.html
  9. -->
  10. <html xmlns="http://www.w3.org/1999/xhtml">
  11. <style type="text/css">
  12. body {background-color:#DDDDDD;}
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  14. <title>Flash Gallery</title>
  15.  
  16. <!-- Location of javascript. -->
  17. <script language="javascript" type="text/javascript" src="swfobject.js" ></script>
  18.  
  19. </head>
  20.  
  21.  
  22. <!-- Div that contains gallery. -->
  23. <div id="gallery">
  24. <h1>No flash player!</h1>
  25. <p>It looks like you don't have flash player installed. <a href="http://www.macromedia.com/go/getflashplayer" >Click here</a> to go to Macromedia download page.</p>
  26. </div>
  27.  
  28. <!-- Script that embeds gallery. -->
  29. <script language="javascript" type="text/javascript">
  30. <!-- 800 600 -->
  31. var so = new SWFObject("flashgallery.swf", "gallery", "920", "365", "8"); // Location of SWF file. You can change gallery width and height here (using pixels or percents).
  32. so.addParam("quality", "high");
  33. so.addParam("allowFullScreen", "true");
  34. so.addParam("wmode", "transparent");
  35. so.addVariable("content_path","img"); // Location of a folder with JPG and PNG files (relative to php script).
  36. so.addVariable("color_path","default.xml"); // Location of XML file with settings.
  37. so.addVariable("script_path","flashgallery.php"); // Location of PHP script.
  38. so.write("gallery");
  39.  
  40. <br/>
  41.  
  42. <!--
  43. Please place this link anywhere on the page that uses Flash Gallery.
  44. You can style it anyway you want, but do not change or delete it.
  45. Read the license! Thanks. :-)
  46. -->
  47. Powered by <a href="http://www.flash-gallery.org">Flash Gallery</a>
  48.  
  49. </body>
  50. </html>


flashgallery.php
  1. <?php
  2. $allowed_formats = array("jpg", "jpeg", "JPG", "JPEG", "png", "PNG");
  3. $exclude_files = array(
  4. "_derived",
  5. "_private",
  6. "_vti_cnf",
  7. "_vti_pvt",
  8. "vti_script",
  9. "_vti_txt"
  10. ); // add any other folders or files you wish to exclude from the gallery.
  11.  
  12. $listDir = array();
  13.  
  14. function detectUTF8($string)
  15. {
  16. return preg_match('%(?:
  17. [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
  18. |\xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
  19. |[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
  20. |\xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
  21. |\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
  22. |[\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
  23. |\xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
  24. )+%xs', $string);
  25. }
  26.  
  27. function cp1251_utf8( $sInput )
  28. {
  29. $sOutput = "";
  30.  
  31. for ( $i = 0; $i < strlen( $sInput ); $i++ )
  32. {
  33. $iAscii = ord( $sInput[$i] );
  34.  
  35. if ( $iAscii >= 192 && $iAscii <= 255 )
  36. $sOutput .= "&#".( 1040 + ( $iAscii - 192 ) ).";";
  37. else if ( $iAscii == 168 )
  38. $sOutput .= "&#".( 1025 ).";";
  39. else if ( $iAscii == 184 )
  40. $sOutput .= "&#".( 1105 ).";";
  41. else
  42. $sOutput .= $sInput[$i];
  43. }
  44.  
  45. return $sOutput;
  46. }
  47.  
  48. function encoding($string){
  49. if (function_exists('iconv')) {
  50. if (@!iconv('utf-8', 'cp1251', $string)) {
  51. $string = iconv('cp1251', 'utf-8', $string);
  52. }
  53. return $string;
  54. } else {
  55. if (detectUTF8($string)) {
  56. return $string;
  57. } else {
  58. return cp1251_utf8($string);
  59. }
  60. }
  61. }
  62.  
  63.  
  64. function ReadFolderDirectory($dir)
  65. {
  66. global $listDir,$exclude_files,$allowed_formats;
  67. if($handler = opendir($dir))
  68. {
  69. {
  70. while (($sub = readdir($handler)) !== FALSE)
  71. {
  72.  
  73. if ($sub != "." && $sub != ".." && $sub != "Thumb.db" && array_search($sub, $exclude_files)===false)
  74. {
  75. $ext = substr($sub, strrpos($sub, ".")+1);
  76. if(is_file($dir."/".$sub) && array_search($ext, $allowed_formats)!==false ) $listDir[] = $dir."/".$sub;
  77. elseif(is_dir($dir."/".$sub)) ReadFolderDirectory($dir."/".$sub);
  78. }
  79. }
  80. }
  81. closedir($handler);
  82. }
  83. }
  84.  
  85. if(isset($_GET['file_dir'])) ReadFolderDirectory($_GET['file_dir']);
  86.  
  87. natcasesort($listDir);
  88.  
  89. print '<?xml version="1.0" encoding="utf-8"?>';
  90. <pics>';
  91.  
  92. $directory= $_SERVER['HTTP_HOST'] .$_SERVER['PHP_SELF'];
  93. $directory=dirname($directory);
  94.  
  95. foreach ($listDir as $val)
  96. {
  97. $title = substr(strrchr($val, '/'), 1);
  98. $title=encoding($title);
  99. $val=encoding($val);
  100.  
  101. <pic src="'.'http://'.$directory.'/'.$val.'" title="'.$title.'" />';
  102. }
  103.  
  104. </pics>';
  105. ?>


Funkcja get() wczytuje plik do diva. Kiedy wejde na adresstrony/makro/flashgallery.html to ładnie działa wszystko, jednak po "specjalnym" załadowaniu, mam errora (No flash itd.)

Pomoże mi ktoś? :/ Jestem w tym świeżakiem.