Siemka, mam problem ze stronką, dokładniej z galerią :/. Normalnie działa, jednak po wczytaniu bez przeładowywania strony jest error.
Pliki:
index.php
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript">
function get(plik, target){
var xmlHttp;
xmlHttp=new XMLHttpRequest();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if (target != undefined) {document.getElementById(target).innerHTML=xmlHttp.responseText;}
}
}
xmlHttp.open("GET", plik);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(null);
}
</script>
<title>WhiteDark's gallery</title>
<center>
<div id="logo" class="rogi">
<img src="logo.jpg">
</div>
<div id="menu" class="rogi">
<br>
<br>
<font size="5">
<a href="#" onClick="get('home.php', 'srodek') & get('home.txt', 'srodek_panel')"><img src="home.jpg"></a></img> <br>
<a href="#" onClick="get('portfolio.php', 'srodek') & get('portfolio.txt', 'srodek_panel')"><img src="portfolio.jpg"></a></img> <br>
<a href="#" onClick="get('kontakt.php', 'srodek') & get('kontakt.txt', 'srodek_panel')"><img src="kontakt.jpg"></a></img> <br>
<a href="#" onClick="get('galeria.php', 'srodek') & get('galeria.txt', 'srodek_panel')"><img src="galeria.jpg"></a></img> <br>
<a href="#" onClick="get('mcms.php', 'srodek') & get('mcms.txt', 'srodek_panel')"><img src="mcms.jpg"></a></img>
</font>
</div>
<div id="menu_panel" class="rogi2">
Menu
</div>
<div id="srodek" class="rogi">
</div>
<div id="srodek_panel" class="rogi2">
</div>
<div id="muzyka" class="rogi">
<br>
tu bedzie
</div>
<div id="muzyka_panel" class="rogi2">
Muzyka
</div>
<div id="footer">
(C) 2011/2022 by whitedark.<br>
Mini-CMS by karer. (mozesz usunac ten napis za 10 zl).
</div>
</center>
<script>
get('welcome.txt', 'srodek_panel') & get('welcome.php', 'srodek')
</script>
makro:
flashgallery.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Developed by Reality Software | www.realitysoftware.ca
Released by Flash Gallery | www.flash-gallery.org
Note: This is a free application distributed under the Creative Commons Attribution 3.0 license,
which means you can use it in any way you want provided you keep our links intact.
Don't want our links in the script? You can support this project by purchasing a paid
version: www.flash-gallery.org/buy.html
-->
<html xmlns="http://www.w3.org/1999/xhtml"> body {background-color:#DDDDDD;}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Location of javascript. -->
<script language="javascript" type="text/javascript" src="swfobject.js" ></script>
<!-- Div that contains gallery. -->
<h1>No flash player!
</h1> <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>
<!-- Script that embeds gallery. -->
<script language="javascript" type="text/javascript"> <!-- 800 600 -->
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).
so.addParam("quality", "high");
so.addParam("allowFullScreen", "true");
so.addParam("wmode", "transparent");
so.addVariable("content_path","img"); // Location of a folder with JPG and PNG files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of XML file with settings.
so.addVariable("script_path","flashgallery.php"); // Location of PHP script.
so.write("gallery");
<!--
Please place this link anywhere on the page that uses Flash Gallery.
You can style it anyway you want, but do not change or delete it.
Read the license! Thanks. :-)
-->
Powered by
<a href="http://www.flash-gallery.org">Flash Gallery
</a>
flashgallery.php
<?php
$allowed_formats = array("jpg", "jpeg", "JPG", "JPEG", "png", "PNG"); "_derived",
"_private",
"_vti_cnf",
"_vti_pvt",
"vti_script",
"_vti_txt"
); // add any other folders or files you wish to exclude from the gallery.
function detectUTF8($string)
{
[\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
|\xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
|\xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
|\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|[\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|\xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)+%xs', $string);
}
function cp1251_utf8( $sInput )
{
$sOutput = "";
for ( $i = 0; $i < strlen( $sInput ); $i++ ) {
$iAscii = ord( $sInput[$i] );
if ( $iAscii >= 192 && $iAscii <= 255 )
$sOutput .= "&#".( 1040 + ( $iAscii - 192 ) ).";";
else if ( $iAscii == 168 )
$sOutput .= "&#".( 1025 ).";";
else if ( $iAscii == 184 )
$sOutput .= "&#".( 1105 ).";";
else
$sOutput .= $sInput[$i];
}
return $sOutput;
}
function encoding($string){
if (function_exists('iconv')) {
if (@!iconv('utf-8', 'cp1251', $string)) {
$string = iconv('cp1251', 'utf-8', $string);
}
return $string;
} else {
if (detectUTF8($string)) {
return $string;
} else {
return cp1251_utf8($string);
}
}
}
function ReadFolderDirectory($dir)
{
global $listDir,$exclude_files,$allowed_formats; {
{
while (($sub = readdir($handler)) !== FALSE) {
if ($sub != "." && $sub != ".." && $sub != "Thumb.db" && array_search($sub, $exclude_files)===false) {
if(is_file($dir."/".$sub) && array_search($ext, $allowed_formats)!==false ) $listDir[] = $dir."/".$sub; elseif(is_dir($dir."/".$sub)) ReadFolderDirectory
($dir."/".$sub); }
}
}
}
}
if(isset($_GET['file_dir'])) ReadFolderDirectory
($_GET['file_dir']);
print '<?xml version="1.0" encoding="utf-8"?>'; <pics>';
$directory= $_SERVER['HTTP_HOST'] .$_SERVER['PHP_SELF'];
foreach ($listDir as $val)
{
$title=encoding($title);
$val=encoding($val);
<pic src="'.'http://'.$directory.'/'.$val.'" title="'.$title.'" />';
}
</pics>';
?>
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.