1 | <?php
|
---|
2 |
|
---|
3 | # Add authors to global list
|
---|
4 | function add_authors ( $authors ) {
|
---|
5 | global $wiki2xml_authors ;
|
---|
6 | foreach ( $authors AS $author ) {
|
---|
7 | if ( !in_array ( $author , $wiki2xml_authors ) ) {
|
---|
8 | $wiki2xml_authors[] = $author ;
|
---|
9 | }
|
---|
10 | }
|
---|
11 | }
|
---|
12 |
|
---|
13 | function add_author ( $author ) {
|
---|
14 | add_authors ( array ( $author ) ) ;
|
---|
15 | }
|
---|
16 |
|
---|
17 |
|
---|
18 | # For text file structure creation and browsing
|
---|
19 | function get_file_location_global ( $basedir , $ns , $title , $make_dirs = false ) {
|
---|
20 | $title = urlencode ( $title ) ;
|
---|
21 | $title = str_replace ( ":" , "_" , $title ) ;
|
---|
22 | $m = md5 ( $title ) ;
|
---|
23 | $ret = "" ;
|
---|
24 | $ret->file = $title ;
|
---|
25 | if ( $ret->file == "Con" ) $ret->file = "_Con" ; # Windows can't create files named "con.txt" (!), workaround
|
---|
26 | $ret->dir = $basedir . "/" . $ns ;
|
---|
27 | if ( $make_dirs ) @mkdir ( $ret->dir ) ;
|
---|
28 | $ret->dir .= "/" . substr ( $m , 0 , 1 ) ;
|
---|
29 | if ( $make_dirs ) @mkdir ( $ret->dir ) ;
|
---|
30 | $ret->dir .= "/" . substr ( $m , 1 , 2 ) ;
|
---|
31 | if ( $make_dirs ) @mkdir ( $ret->dir ) ;
|
---|
32 | $ret->fullname = $ret->dir . "/" . $ret->file ;
|
---|
33 | return $ret ;
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 | function xml_articles_header() {
|
---|
38 | global $xmlg ;
|
---|
39 | # if ( !isset ( $xmlg['xml_articles_header'] ) ) return "" ;
|
---|
40 | return $xmlg['xml_articles_header'] ;
|
---|
41 | }
|
---|
42 |
|
---|
43 | ?>
|
---|