source: trunk/spip/2.1/extensions/magusine-portage2.1/squelettes/blocs/webmaton_dernieres_videos.html @ 756

Last change on this file since 756 was 756, checked in by guillermoacedo@…, 14 years ago

se agrego la correccion de magusine para 2.1 basica

  • Property svn:executable set to *
File size: 2.6 KB
Line 
1<BOUCLE_recup(RUBRIQUES){id_rubrique}>
2#SET{critere_in,#ARRAY{0,0}}
3<BOUCLE_sesarts(ARTICLES){branche}{!par date}>
4<BOUCLE_galerievideo(DOCUMENTS){id_article}{extension==avi|mov|qt|mpg|rm|mp4}{doublons}>
5#SET{critere_in,#GET{critere_in}|array_merge{#ARRAY{#COMPTEUR_BOUCLE,#ID_DOCUMENT}}}
6</BOUCLE_galerievideo></BOUCLE_sesarts>
7<BOUCLE_questions_webmaton(DOCUMENTS){id_rubrique=#ENV{id_rubrique}}{fichier==^.*questions(-[0-9]*)?\.xml$}{0,1}>
8<?php
9include_spip('inc/xml-parser');
10
11$questions = array();
12
13if (file_exists('#FICHIER')) {
14 $p =& new xmlParser();
15 $p->parse('#FICHIER');
16  /* décommenter ceci pour vérifier si le fichier est correctement lu */
17   //print_r($p->output);
18
19  foreach($p->output[0]['child'] as $groupe) {
20    foreach($groupe["child"] as $prop){
21      if ($prop["name"] == "QUESTIONS") {
22        foreach($prop["child"] as $question) {
23          $questions[strtolower($groupe["attrs"]["PREFIX"])][$question["attrs"]["ID"]] = $question["content"];
24        }
25      }
26    }
27  }
28}
29
30//print_r($questions);
31?>
32</BOUCLE_questions_webmaton>
33<B_choosedocs>
34<div id="galerieimg" class="listagebloc">
35<h2><:derniers_webmaton:></h2>
36<ul class="listageconteneur"><li>
37<BOUCLE_choosedocs(DOCUMENTS){id_document IN #GET{critere_in}}{!par date}>
38<div class="webmaton" style="float:left;position:relative;">
39<a href="javascript:void(0);" onclick="popup_page('spip.php?page=popup-webmaton&id_rubrique=#ID_RUBRIQUE&id_document=#ID_DOCUMENT',500,400);">
40[(#INCLURE{fond=formatage_vignette_webmaton}{id_document}{conteneur=#ENV{conteneur}})]
41</a><div class="question" style="position:absolute;bottom:0;z-index:100;display:none;margin:0px;padding:2px;font-size:9px;background-color:#fff;"><a href="javascript:void(0);" onclick="popup_page('spip.php?page=popup-webmaton&id_rubrique=#ID_RUBRIQUE&id_document=#ID_DOCUMENT',500,400);"><?php
42$morceaux = split("/", "#FICHIER");
43$fichier = end($morceaux);
44$resultats = array();
45eregi("([^\-]+)-q([0-9]+)-", $fichier, $resultats);
46if (count($resultats) > 2) {
47  $groupe = $resultats[1];
48  $question = $resultats[2];
49  echo $questions[strtolower($groupe)][$question];
50}
51?></a></div></div>
52
53</BOUCLE_choosedocs>
54<li style="clear:left"></li>
55</li></ul>
56<!-- effet de survol -->
57<script language="javascript">
58
59$("#galerieimg .webmaton").each(function(){
60        $(this).mouseover(function(){
61        largeur=$(this).find("img").width() -4;
62        hauteur=$(this).find("img").height();
63        $(this).height(hauteur);
64        $(this).children(".question").css("width",largeur + "px").css("display","block");
65        });
66       
67        $(this).mouseout(function(){
68                $(this).children(".question").css("display","none");
69        });
70});
71
72</script>
73
74</div>
75</B_choosedocs>
76
77</BOUCLE_recup>
Note: See TracBrowser for help on using the repository browser.