@@ -14,7 +14,7 @@ function macro_SlideShow($formatter,$value='',$options=array()) {
14
14
if (!empty ($ options ['d ' ])) $ depth =intval ($ options ['d ' ]);
15
15
$ args =explode (', ' ,$ value );
16
16
$ sz =sizeof ($ args );
17
- for ($ i =0 , $ sz = sizeof ( $ args ) ;$ i <$ sz ;$ i ++) {
17
+ for ($ i =0 ;$ i <$ sz ;$ i ++) {
18
18
if (($ p =strpos ($ args [$ i ],'= ' ))!==false ) {
19
19
$ k =substr ($ args [$ i ],0 ,$ p );
20
20
$ v =substr ($ args [$ i ],$ p +1 );
@@ -23,7 +23,7 @@ function macro_SlideShow($formatter,$value='',$options=array()) {
23
23
$ pgname =$ args [$ i ];
24
24
}
25
25
}
26
- if ($ pgname ) {
26
+ if (isset ( $ pgname[ 0 ]) ) {
27
27
if (!$ DBInfo ->hasPage ($ pgname ))
28
28
return '[[SlideShow( ' ._ ("No page found " ).')]] ' ;
29
29
$ pg =$ DBInfo ->getPage ($ pgname );
@@ -35,9 +35,9 @@ function macro_SlideShow($formatter,$value='',$options=array()) {
35
35
}
36
36
37
37
if (!empty ($ options ['p ' ])) {
38
- list ( $ sect , $ dum)= explode ('/ ' ,$ options ['p ' ]);
39
- $ sect =abs (intval ($ sect ));
40
- $ sect = $ sect ? $ sect :1 ;
38
+ $ dum = explode ('/ ' ,$ options ['p ' ]);
39
+ $ sect =abs (intval ($ dum [ 0 ] ));
40
+ $ sect = ! empty ( $ sect) ? $ sect :1 ;
41
41
} else $ sect =1 ;
42
42
43
43
$ act =!empty ($ options ['action ' ]) ? $ options ['action ' ]:'SlideShow ' ;
@@ -46,9 +46,10 @@ function macro_SlideShow($formatter,$value='',$options=array()) {
46
46
$ icon_dir =$ formatter ->imgs_dir .'/plugin/SlideShow/ ' .$ iconset .'/ ' ;
47
47
48
48
// get head title section
49
+ $ dep = '' ;
49
50
if ($ depth ==2 ) {
50
- list ( $ secthead , $ dumm)= explode ("\n" ,$ sections [0 ]);
51
- preg_match ('/^\s*=\s*([^=].*[^=])\s*=\s?$/ ' ,$ secthead , $ match );
51
+ $ dumm = explode ("\n" ,$ sections [0 ]);
52
+ preg_match ('/^\s*=\s*([^=].*[^=])\s*=\s?$/ ' ,$ dumm [ 0 ], $ match );
52
53
$ secthead =rtrim ($ sections [0 ]);
53
54
if (isset ($ match [1 ])) $ title =$ match [1 ];
54
55
} else {
@@ -64,30 +65,30 @@ function macro_SlideShow($formatter,$value='',$options=array()) {
64
65
65
66
// get prev,next subtitle
66
67
if ($ sz > ($ sect )) {
67
- list ( $ n_title , $ dumm)= explode ("\n" ,$ sections [$ sect +1 ]);
68
- preg_match ("/^\s*={ " .$ depth .'}\s*(.*)\s*={ ' .$ depth .'}\s?$/ ' ,$ n_title , $ match );
68
+ $ dumm = explode ("\n" ,$ sections [$ sect +1 ]);
69
+ preg_match ("/^\s*={ " .$ depth .'}\s*(.*)\s*={ ' .$ depth .'}\s?$/ ' , $ dumm [ 0 ], $ match );
69
70
if (isset ($ match [1 ]))
70
71
$ n_title =$ match [1 ];
71
72
else
72
73
$ n_title ='' ;
73
74
74
- list ( $ e_title , $ dumm)= explode ("\n" ,$ sections [$ sz ]);
75
- preg_match ("/^[ ]*={ " .$ depth ."}\s+(.*)\s+={ " .$ depth ."}\s?/ " ,$ e_title , $ match );
75
+ $ dumm = explode ("\n" ,$ sections [$ sz ]);
76
+ preg_match ("/^[ ]*={ " .$ depth ."}\s+(.*)\s+={ " .$ depth ."}\s?/ " , $ dumm [ 0 ], $ match );
76
77
if (isset ($ match [1 ]))
77
78
$ e_title =$ match [1 ];
78
79
else
79
80
$ e_title ='' ;
80
81
}
81
82
$ s_title = '' ;
82
83
if (!empty ($ sections [1 ]) and (empty ($ options ['action ' ]) or $ sect > 1 )) {
83
- list ( $ s_title , $ dumm)= explode ("\n" ,$ sections [1 ]);
84
- preg_match ("/^\s*={ " .$ depth ."}\s*(.*)\s*={ " .$ depth ."}\s?$/ " ,$ s_title , $ match );
84
+ $ dumm = explode ("\n" ,$ sections [1 ]);
85
+ preg_match ("/^\s*={ " .$ depth ."}\s*(.*)\s*={ " .$ depth ."}\s?$/ " , $ dumm [ 0 ], $ match );
85
86
if (isset ($ match [1 ]))
86
87
$ s_title =$ match [1 ];
87
88
}
88
89
if ($ sect >= 1 ) {
89
- list ( $ p_title , $ dumm)= explode ("\n" ,$ sections [$ sect -1 ]);
90
- preg_match ('/^\s*={ ' .$ depth .'}\s*(.*)\s*={ ' .$ depth .'}\s?$/ ' ,$ p_title , $ match );
90
+ $ dumm = explode ("\n" ,$ sections [$ sect -1 ]);
91
+ preg_match ('/^\s*={ ' .$ depth .'}\s*(.*)\s*={ ' .$ depth .'}\s?$/ ' , $ dumm [ 0 ], $ match );
91
92
if (isset ($ match [1 ]))
92
93
$ p_title =$ match [1 ];
93
94
else
0 commit comments