Revision history for SlideshowHandler


Revision [19223]

Last edited on 2008-01-28 00:14:44 by AhA [Modified links pointing to docs server]

No Differences

Revision [17008]

Edited on 2007-05-31 23:27:40 by AhA [Reverted]
Additions:
die ("accès direct interdit");
}
// On teste si l'utilisateur peut lire la page
if (!$this->HasAccess("read"))
return;
}
else
// On teste si la page existe
if (!$this->page)
{
return;
}
else
{
/*
Exemple de page :

(1) Présentation xxxxxxxxxxxxxx

===== (2) Titre =====
Diapo 2.

===== (3) Titre =====
Diapo 3.

===== (4) Titre =====
Diapo 4.

===== (5) Titre =====
Diapo 5.

===== (6) Titre =====
Diapo 6.

===== (7) Titre =====
Diapo 7.

Autre exemple :

===== (1) Titre =====
Diapo 1.

===== (2) Titre =====
Diapo 2.

===== (3) Titre =====
Diapo 3.

===== (4) Titre =====
Diapo 4.

===== (5) Titre =====
Diapo 5.

===== (6) Titre =====
Diapo 6.

===== (7) Titre =====
Diapo 7.

*/
//
// découpe la page
$body_f = $this->format($this->page["body"]);
$body = preg_split('/(.*<h2>.*<\/h2>)/',$body_f,-1,PREG_SPLIT_DELIM_CAPTURE);
if ($_REQUEST["debug"] == "1") print_r("<div style=\"display: none\">".$body."</div>");
// Si la première diapositive commence par un titre de niveau 1
if (preg_match('/^<h2>.*<\/h2>/', $body_f)) $major = "0";
else $major = "1";

$user = $this->GetUser(); // echo $this->GetUser();
// On teste toutes les paramètres du handler "slide_show" ; s'il n'y en a pas, c'est le paramètre "slide=1" qui est invoqué par défaut
/*
switch ($_REQUEST["method"])
{
case "export":
export();
break;
case "show":
showSlide();
break;
default:
showSlide();
break;
}
*/
//if ($_REQUEST["export"]) { return; }

if (!$body)
{
return;
}
else
{
// Si on ne précise pas de paramètre, on affiche par défaut la première diapo
if (!$_REQUEST["slide"] or $_REQUEST["slide"] == "1") $slide = "1";
else $slide = $_REQUEST["slide"];
// Affiche l'en-tête
echo
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo
"<html>\n\n\n",
"<head>\n",
"<title>", $this->GetWakkaName(), ":", $this->GetPageTag(), "</title>\n",
"<meta name=\"robots\" content=\"noindex, nofollow\" />\n",
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
echo
"<style type=\"text/css\" media=\"all\"> @import \"wakka.css\";</style>\n";
// Teste s'il existe une feuille de style externe, sinon utilise des styles par défaut
if (!file_exists("css/slideshow.css"))
{
echo "<style type=\"text/css\">\n",
".slide { font-size: 160%; margin: 5%; background-color: #CCCCCC; padding: 30px; border: 1px inset; line-height: 1.5; }\n",
".slide UL, LI { font-size: 100%; }\n",
".slide LI LI { font-size: 90% }\n",
".sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; }\n",
".sl_nav A { text-decoration: none; }\n",
".sl_nav a:hover { color: #CF8888 }\n",
".sum { font-size: 8px; }\n",
"</style>\n";
}
else
{
echo "<style type=\"text/css\" media=\"all\"> @import \"css/slideshow.css\";</style>\n";
}
echo
"</head>\n\n\n";

// Affiche le corps de la page
echo
"<body ";
echo (!$user || ($user["doubleclickedit"] == 'Y')) ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "", ">\n";
// Affichage du sommaire [à compléter]
/*
if ($_REQUEST["sum"] == "on")
{
echo "<ul class=\"sum\">\n";
if ($major = "1") echo "<li>", $this->format($body[0]), "</li>\n";
foreach ($body as $title_sum)
{
$i = $i + 1;
$type = gettype($i/2);
// Ne retourne que les 50 premiers caractères du titre
$title_sum = substr($title_sum, 0, 50);
if ($type == "integer")
{
echo "<li>",$this->format($title_sum),"</li>\n";
}
}
echo "</ul>\n\n";
}
*/
// Affichage du menu de navigation
echo
"<div class=\"sl_nav\">\n",
"<p>";
if ($slide !== "1")
echo
"<a href=\"",$this->href(),"/slide_show&slide=",$_REQUEST['slide']-1,"\"><< previous</a>",
" :: <a href=\"",$this->href(),"/slide_show&slide=1\">[start]</a>\n";
echo " :: ";
if ($body[($slide)*2-($nb*2)+2] or $slide == "1")
echo "<a href=\"",$this->href(),"/slide_show&slide=",$slide+1,"\">next >></a>\n";
echo
"</p>\n";
echo "<p>";
// echo "<a href=\"",$this->href(),"/edit\">Editor </a> :: ";
echo "<a href=\"",$this->href(),"\">[end]</a></p>\n";
echo
"</div>\n";
echo
"<div class=\"slide\">\n";

// Si c'est la première diapositive
if ($slide == "1" and $major == "1")
{
echo $body[0], "<br /><br />";
}
// A partir de la deuxième diapositive
else
{
echo
$body[($slide*2)-($major*2)-1].$body[($slide*2)-($major*2)],"\n";
echo "\n";
}
echo
"</div>\n\n";
echo
"</body>\n",
"</html>";
}
}
}
die (0);
?>
</div>
</body>
</html>
%%
and this one as ##slideshow.css## in the directory css....
%%
%%
Deletions:
die ("acc


Revision [16807]

Edited on 2007-05-31 10:49:51 by Vl9Yq8 [Reverted]
Additions:
die ("acc
Deletions:
die ("accès direct interdit");
}
// On teste si l'utilisateur peut lire la page
if (!$this->HasAccess("read"))
return;
}
else
// On teste si la page existe
if (!$this->page)
{
return;
}
else
{
/*
Exemple de page :

(1) Présentation xxxxxxxxxxxxxx

===== (2) Titre =====
Diapo 2.

===== (3) Titre =====
Diapo 3.

===== (4) Titre =====
Diapo 4.

===== (5) Titre =====
Diapo 5.

===== (6) Titre =====
Diapo 6.

===== (7) Titre =====
Diapo 7.

Autre exemple :

===== (1) Titre =====
Diapo 1.

===== (2) Titre =====
Diapo 2.

===== (3) Titre =====
Diapo 3.

===== (4) Titre =====
Diapo 4.

===== (5) Titre =====
Diapo 5.

===== (6) Titre =====
Diapo 6.

===== (7) Titre =====
Diapo 7.

*/
//
// découpe la page
$body_f = $this->format($this->page["body"]);
$body = preg_split('/(.*<h2>.*<\/h2>)/',$body_f,-1,PREG_SPLIT_DELIM_CAPTURE);
if ($_REQUEST["debug"] == "1") print_r("<div style=\"display: none\">".$body."</div>");
// Si la première diapositive commence par un titre de niveau 1
if (preg_match('/^<h2>.*<\/h2>/', $body_f)) $major = "0";
else $major = "1";

$user = $this->GetUser(); // echo $this->GetUser();
// On teste toutes les paramètres du handler "slide_show" ; s'il n'y en a pas, c'est le paramètre "slide=1" qui est invoqué par défaut
/*
switch ($_REQUEST["method"])
{
case "export":
export();
break;
case "show":
showSlide();
break;
default:
showSlide();
break;
}
*/
//if ($_REQUEST["export"]) { return; }

if (!$body)
{
return;
}
else
{
// Si on ne précise pas de paramètre, on affiche par défaut la première diapo
if (!$_REQUEST["slide"] or $_REQUEST["slide"] == "1") $slide = "1";
else $slide = $_REQUEST["slide"];
// Affiche l'en-tête
echo
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo
"<html>\n\n\n",
"<head>\n",
"<title>", $this->GetWakkaName(), ":", $this->GetPageTag(), "</title>\n",
"<meta name=\"robots\" content=\"noindex, nofollow\" />\n",
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
echo
"<style type=\"text/css\" media=\"all\"> @import \"wakka.css\";</style>\n";
// Teste s'il existe une feuille de style externe, sinon utilise des styles par défaut
if (!file_exists("css/slideshow.css"))
{
echo "<style type=\"text/css\">\n",
".slide { font-size: 160%; margin: 5%; background-color: #CCCCCC; padding: 30px; border: 1px inset; line-height: 1.5; }\n",
".slide UL, LI { font-size: 100%; }\n",
".slide LI LI { font-size: 90% }\n",
".sl_nav p { text-decoration: none; text-align: right; font-size: 80%; line-height: 0.4; }\n",
".sl_nav A { text-decoration: none; }\n",
".sl_nav a:hover { color: #CF8888 }\n",
".sum { font-size: 8px; }\n",
"</style>\n";
}
else
{
echo "<style type=\"text/css\" media=\"all\"> @import \"css/slideshow.css\";</style>\n";
}
echo
"</head>\n\n\n";

// Affiche le corps de la page
echo
"<body ";
echo (!$user || ($user["doubleclickedit"] == 'Y')) ? "ondblclick=\"document.location='".$this->href("edit")."';\" " : "", ">\n";
// Affichage du sommaire [à compléter]
/*
if ($_REQUEST["sum"] == "on")
{
echo "<ul class=\"sum\">\n";
if ($major = "1") echo "<li>", $this->format($body[0]), "</li>\n";
foreach ($body as $title_sum)
{
$i = $i + 1;
$type = gettype($i/2);
// Ne retourne que les 50 premiers caractères du titre
$title_sum = substr($title_sum, 0, 50);
if ($type == "integer")
{
echo "<li>",$this->format($title_sum),"</li>\n";
}
}
echo "</ul>\n\n";
}
*/
// Affichage du menu de navigation
echo
"<div class=\"sl_nav\">\n",
"<p>";
if ($slide !== "1")
echo
"<a href=\"",$this->href(),"/slide_show&slide=",$_REQUEST['slide']-1,"\"><< previous</a>",
" :: <a href=\"",$this->href(),"/slide_show&slide=1\">[start]</a>\n";
echo " :: ";
if ($body[($slide)*2-($nb*2)+2] or $slide == "1")
echo "<a href=\"",$this->href(),"/slide_show&slide=",$slide+1,"\">next >></a>\n";
echo
"</p>\n";
echo "<p>";
// echo "<a href=\"",$this->href(),"/edit\">Editor </a> :: ";
echo "<a href=\"",$this->href(),"\">[end]</a></p>\n";
echo
"</div>\n";
echo
"<div class=\"slide\">\n";

// Si c'est la première diapositive
if ($slide == "1" and $major == "1")
{
echo $body[0], "<br /><br />";
}
// A partir de la deuxième diapositive
else
{
echo
$body[($slide*2)-($major*2)-1].$body[($slide*2)-($major*2)],"\n";
echo "\n";
}
echo
"</div>\n\n";
echo
"</body>\n",
"</html>";
}
}
}
die (0);
?>
</div>
</body>
</html>
%%
and this one as ##slideshow.css## in the directory css....
%%
%%


Revision [15884]

Edited on 2007-01-14 11:46:49 by AhA [Reverted]
Additions:
Otherwise, the handler is called (as per normal) with //pagename/slide_show//. If you want to see an example page setup, go and look at http://www.wikini.net/wakka.php?wiki=DocumentationSlideShow .
Deletions:
Otherwise, the hander is called (as per normal) with //pagename/slide_show//. If you want to see an example page setup, go and look at http://www.wikini.net/wakka.php?wiki=DocumentationSlideShow .


Revision [11681]

Edited on 2005-11-06 17:40:30 by NilsLindenberg [small correction (formatting of the code)]
Additions:
%%(php)
Deletions:
%%php


Revision [11501]

The oldest known version of this page was created on 2005-10-20 19:10:47 by GmBowen [small correction (formatting of the code)]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki