Hello there :)
I would like to know if Krpano Allow that Include Folder rather a file..
Like : <include url="THISFOLDER/%All_XML_File_in_this_folder%" />
Regards.
Hello there :)
I would like to know if Krpano Allow that Include Folder rather a file..
Like : <include url="THISFOLDER/%All_XML_File_in_this_folder%" />
Regards.
Hi,
that's technically not possible - krpano is 'client-side' - that means it runs on the browser-side - and there it doesn't have access to the folder contents on the server.
Although you could write a simple php script on the server that is collecting all xml files in that folder and generates a xml file where all these files get included.
Best regards,
Klaus
thx klaus,
i'll try to make it and share when it's work..
Here a quick try (untested) - a simple php script that should list all xml files in the current folder:
<krpano>
<?php
if ($handle = opendir('.'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && substr($file,-4) == ".xml")
{
echo "<include url='" . $file . "' />\n";
}
}
closedir($handle);
}
?>
</krpano>
Alles anzeigen
E.g. save it as 'include_all.php' and include it in the xml via:
Best regards,
Klaus
it's work !! wow
nothing to add...
Thank you very much
I think it's a good feature.
regards
ps: For ppl interrested you need to upload it on a server to test, because php doesn't execute on local
Found this code really helpful, Thank you Klaus
yeah !! it's open some possibilities !
Hi Klaus!
It's really an interesting example! Сould Krpano handle php actions from XML (like the JavaScript-type actions in current Krpano 1.19.pr 6) ?
That feature could be fantastic!
Hi,
Not sure if you mean this but,
Php stuff like:
Krpano code...
<?php. Php stuff ?>
More krpano code..
Works perfect
Just call the file blabla.php and include it like that.
Hope it helps
Tuur
krpano does not interpret php
the file is interpreted by php on server side,
kprano does not see the php code, only the output.
in this case php generates krpano code
Hi All
Is there anyway to test in PHP <include url="include_all.php" /> which file it has been included inside.Test if embeded in the XML file
<krpano>
<?php
$VRW_URL = $_SERVER["REQUEST_URI"];
echo "<script type='text/javascript'>alert('$VRW_URL');</script>";
if ($VRW_URL === "/VRW/tour.xml") {
if ($handle = opendir('.'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && substr($file,-4) == ".xml")
{
echo "<include url='VRWPlugins/" . $file . "' />\n";
}
}
closedir($handle);
}
}
?>
</krpano>
Alles anzeigen
Thank you
Hello Klaus !
Thanks for the 1.20.9 update, and this major feature => includexml(%file.xml%); that allow to import xml dynamicly...
I'm trying then to create the same action as this exemple but dynamicly... include all file in the folder but with a loop to check if a new one come.
it's work the first check, it get all xml on the folder but if i put another .xml file to the folder it doesn't get it.
here is an example:
<action name="xml_include">
delayedcall(3,
<!-- every 3sec we check to the folder if new xml come -->
includexml("%SWFPATH%/xml/include_all.php");
<!-- loop to the action -->
xml_include();
);
</action>
!! PHP file !!
<krpano>
<action autorun="preinit"> // create action trace..
trace("
<?php
$dir = ("xml_folder"); //
if ($handle = opendir($dir))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && substr($file,-4) == ".xml")
{
echo $file."\n";
}
}
closedir($handle);
}
?>
");
</action>
</krpano>
can you help me ? if i've tested to put an action name and look to this one but it's not work too it's only get the file when the first check is do.
regards
Ok i've found a solution with Js who call my php file...
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!