Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id$
23
/**
24
* Phorum
25
*
26
* Application de forums
27
*
28
*@package inscription
29
//Auteur original :
30
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
31
*
32
*@copyright     Outils-Reseaux 2006-2010
33
*@version       $Revision$ $Date$
34
// +------------------------------------------------------------------------------------------------------+
35
*/
36
 
37
// +------------------------------------------------------------------------------------------------------+
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
40
 
41
include_once 'configuration/phorum.config.inc.php';
42
chdir($PHORUM_DIR);
43
 
44
// +------------------------------------------------------------------------------------------------------+
45
// |                                           LISTE de FONCTIONS                                         |
46
// +------------------------------------------------------------------------------------------------------+
47
// create a namespace for Phorum
48
function phorum_namespace($page)
49
{
50
    global $PHORUM;  // globalize the $PHORUM array
51
    include_once("./$page.php");
52
}
53
 
54
function phorum_custom_get_url ($page, $query_items, $suffix)
55
{
56
// on défini l'URL de tous les liens (qui conservent les GET) et rajoute les pages
57
$url_reecrite = $_SERVER['REQUEST_URI'];
58
$decoupe=explode("&param=",$url_reecrite);
59
$url_reecrite = $decoupe[0];
60
$url = "$url_reecrite&param=$page";
61
 
62
if(count($query_items)) $url.=",".implode(",", $query_items);
63
 
64
if(!empty($suffix)) $url.=$suffix;
65
 
66
return $url;
67
}
68
 
69
 
70
function afficherContenuCorps() {
71
	$res = '' ;
72
	ob_start();
73
	$decoupe=explode("&param=",$_SERVER["QUERY_STRING"]);
74
	if (isset($decoupe[1])) $url_reecrite = $decoupe[1]; else $url_reecrite = '';
75
	$match = '' ;
76
	if(preg_match("/^([a-z]+),?/", $url_reecrite, $match)){
77
		$GLOBALS["PHORUM_CUSTOM_QUERY_STRING"] = str_replace($match[0], "", $url_reecrite);
78
		$page = basename($match[1]);
79
	} elseif(isset($_REQUEST["page"])){
80
		$page = basename($_REQUEST["page"]);
81
		$getparts = array();
82
	   	foreach (explode("&", $_SERVER["QUERY_STRING"]) as $q) {
83
	   		if (substr($q, 0, 5) != "page=") {
84
	   			$getparts[] = $q;
85
	   		}
86
	   	}
87
	    $GLOBALS["PHORUM_CUSTOM_QUERY_STRING"] = implode(",", $getparts);
88
	} else {
89
		$page="index";
90
	}
91
	if(file_exists("./$page.php")){
92
		phorum_namespace($page);
93
	}
94
	$res .= ob_get_clean();
95
 
96
	return $res ;
97
}
98
 
99
/* +--Fin du code ----------------------------------------------------------------------------------------+
100
*
101
* $Log$
102
*
103
*
104
*
105
* +-- Fin du code ----------------------------------------------------------------------------------------+
106
*/
107
?>