/
index.php
97 lines (83 loc) · 2.35 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
require_once('../include/frontend/init.inc.php');
require_once(PATH_INC_FRONTEND.'FrontService.class.php');
require_once(PATH_INC_FRONTEND.'html_listedoc.inc.php');
$fs = new FrontService($db);
$rub = array();
$fs->nbLineParPage = 1;
$OW_presentation = $fs->getListPage(array('type' => 'openwebgroup', 'repertoire' => 'openwebgroup'), $rub);
ob_start();
?>
<!-- Début Texte -->
<div xmlns="http://www.w3.org/1999/xhtml" id="texteaccueil">
<!-- Début Intro -->
<div id="intro">
<!-- Début Présentation -->
<div id="presentation">
<h2>Présentation</h2>
<p><?php
if(count($OW_presentation) == 0)
{
echo 'Pas de présentation pour le moment';
}
else
{
$OW_presentation = $OW_presentation[0];
echo $OW_presentation['accroche'];
echo ' <a href="', $OW_presentation['repertoire'],'">Présentation complète</a>.';
}
?></p>
</div>
<!-- Fin Présentation -->
<!-- Début Humeur -->
<div id="humeur">
<?php
OW_liste_document(array('type' => 'H'), 1, 'Humeur…');
?>
<p class="tous"><a href="/humeurs/">Toutes les humeurs</a></p>
</div>
<!-- Fin Humeur -->
</div>
<!-- Fin Intro -->
<!-- Début Actualité -->
<div id="actualite">
<h2>Actualité</h2>
<?php
require_once('dotclear/inc/prepend.php');
$con = new connection($dbuser, $dbpass, $dbhost, $dbbase);
$blog = new blog($con, DB_PREFIX, 1, dc_encoding);
$news = $blog->getLastNews(3, 'actualite');
if($news->isEmpty())
echo " <p>Aucune actualité</p>\n";
else
while(!$news->EOF())
{
echo ' <h3>', $news->f('post_titre'), "</h3>\n";
echo ' <h4>', strftime('%x', strtotime($news->f('post_dt'))), "</h4>\n";
echo ' ', $news->f('post_content'), "\n\n";
$news->moveNext();
}
$con->close();
?>
<p class="tous"><a href="/actualite/">Toutes les actualités</a></p>
</div>
<!-- Fin Actualité -->
<!-- Début Derniers Articles -->
<div id="articles">
<?php
OW_liste_document(array('type' => 'A'), 3, 'Derniers articles…');
?>
<p class="tous"><a href="/articles/">Tous les articles</a></p>
</div>
<!-- Fin Derniers Articles -->
</div>
<?php
$buf = ob_get_contents();
$xh = xslt_create();
$args = array('/_xml' => '<'.'?xml version="1.0" encoding="utf-8"?'.'>'.$buf);
ob_end_clean();
$params = array('path_site_root' => PATH_SITE_ROOT);
$result = xslt_process($xh, 'arg:/_xml', PATH_INC_FRONTEND.'index.xsl',
null, $args, $params);
eval('?>'.$result);
?>