Hi,
habe mal versucht eine box mit {_boxes_download} in das downloads_show.htm einzubinden hat aber leider nich ganz geklapt. Müsste ich das erst in die PHP datei eintrage?
verwendete ilchClan Version: 1.1
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
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 | function get_boxcontent ( $box ) { global $lang, $allgAr, $menu; if ( file_exists('include/boxes/'.$box ) ) { $pfad = 'include/boxes/'.$box; } elseif ( file_exists ( 'include/contents/selfbp/selfb/'. str_replace('self_','',$box) ) ) { $pfad = 'include/contents/selfbp/selfb/'. str_replace('self_','',$box); } elseif ( file_exists('include/boxes/'.$box.'.php' ) ) { $pfad = 'include/boxes/'.$box.'.php'; } elseif ( file_exists('include/boxes/'.$box.'.htm' ) ) { $pfad = 'include/boxes/'.$box.'.htm'; } elseif ( file_exists ( 'include/contents/selfbp/selfb/'. str_replace('self_','',$box).'.php' ) ) { $pfad = 'include/contents/selfbp/selfb/'. str_replace('self_','',$box).'.htm'; } elseif ( file_exists ( 'include/contents/selfbp/selfb/'. str_replace('self_','',$box).'.htm' ) ) { $pfad = 'include/contents/selfbp/selfb/'. str_replace('self_','',$box).'.htm'; } else { return ( FALSE ); } ob_start(); require_once( $pfad ); $buffer = ob_get_contents(); ob_end_clean(); return($buffer); } function replace_boxes ( $save ) { $speicher = array(); preg_match_all ( "/\{_boxes_([^\{\}]+)\}/" , $save , $speicher ); foreach ($speicher[1] as $v) { $dat = strtolower($v); $buffer = $this->get_boxcontent ( $dat ); if ( $buffer !== FALSE ) { $save = str_replace('{_boxes_'.$v.'}',$buffer ,$save); } } return ( $save ); } |
1 2 3 4 5 | global $lang; $this->lang = $lang; $inhalt = $this->replace_lang($inhalt); $inhalt = $this->replace_list($inhalt); $this->parts = explode ( '{EXPLODE}', $inhalt ); |
1 2 3 4 5 6 | global $lang; $this->lang = $lang; $inhalt = $this->replace_boxes($inhalt); $inhalt = $this->replace_lang($inhalt); $inhalt = $this->replace_list($inhalt); $this->parts = explode ( '{EXPLODE}', $inhalt ); |
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | <?php # Copyright by Manuel # Support www.ilch.de defined ( 'main' ) or die ( 'no direct access' ); class tpl { var $parts ; var $keys ; var $lists ; var $lang ; var $ort ; function tpl ( $file , $ort = 0) { $this ->parts = array (); $this ->keys = array (); $this ->lists = array (); $this ->lang = array (); $this ->ort = $ort ; # file bearbeiten, weil file auch ohne .htm angegeben werden kann. if ( substr ( $file , -4 ) != '.htm' ) { $file .= '.htm' ; } # ort 0 = include /templates, ort 1 = include /admin/templates # bei ort 0 wird ausserdem gecheckt ob das template # evtl. im ordner include /design/DESIGN/templates liegt. # ort = 2 das template kommt von der design classe der pfad ist ab include $design = $this ->get_design (); if ( $this ->ort == 0 ) { if ( file_exists ( 'include/designs/' . $design . '/templates/' . $file ) ) { $file = 'include/designs/' . $design . '/templates/' . $file ; } else { $file = 'include/templates/' . $file ; } } elseif ( $this ->ort == 1 ) { $file = 'include/admin/templates/' . $file ; } elseif ( $this ->ort == 2 ) { $file = 'include/' . $file ; } $inhalt = implode( "" , file( $file ) ); global $lang ; $this ->lang = $lang ; $inhalt = $this ->replace_boxes( $inhalt ); $inhalt = $this ->replace_lang( $inhalt ); $inhalt = $this ->replace_list( $inhalt ); $this ->parts = explode ( '{EXPLODE}' , $inhalt ); } function get_design () { if ( file_exists ( 'include/designs/' . $_SESSION [ 'authgfx' ]. '/index.htm' )) { return ( $_SESSION [ 'authgfx' ] ); } elseif ( file_exists ( 'include/designs/ilchClan/index.htm' )) { return ( 'ilchClan' ); } else { $od = opendir( 'include/designs' ); while ( $f = readdir( $od ) ) { if ( file_exists ( 'include/designs/' . $f . '/index.htm' )) { return ( $f ); break ; } } closedir ( $od ); } } function get_boxcontent ( $box ) { global $lang , $allgAr , $menu ; if ( file_exists ( 'include/boxes/' . $box ) ) { $pfad = 'include/boxes/' . $box ; } elseif ( file_exists ( 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ) ) ) { $pfad = 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ); } elseif ( file_exists ( 'include/boxes/' . $box . '.php' ) ) { $pfad = 'include/boxes/' . $box . '.php' ; } elseif ( file_exists ( 'include/boxes/' . $box . '.htm' ) ) { $pfad = 'include/boxes/' . $box . '.htm' ; } elseif ( file_exists ( 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ). '.php' ) ) { $pfad = 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ). '.htm' ; } elseif ( file_exists ( 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ). '.htm' ) ) { $pfad = 'include/contents/selfbp/selfb/' . str_replace ( 'self_' , '' , $box ). '.htm' ; } else { return ( FALSE ); } ob_start(); require_once ( $pfad ); $buffer = ob_get_contents(); ob_end_clean(); return ( $buffer ); } function replace_boxes ( $save ) { $speicher = array (); preg_match_all ( "/\{_boxes_([^\{\}]+)\}/" , $save , $speicher ); foreach ( $speicher [1] as $v ) { $dat = strtolower ( $v ); $buffer = $this ->get_boxcontent ( $dat ); if ( $buffer !== FALSE ) { $save = str_replace ( '{_boxes_' . $v . '}' , $buffer , $save ); } } return ( $save ); } function replace_lang ( $var ) { $lang_zwischenspeicher = array (); preg_match_all ( "/\{_lang_([^\{\}]+)\}/" , $var , $lang_zwischenspeicher ); foreach ( $lang_zwischenspeicher [1] as $v ) { if ( empty ( $this ->lang[ $v ])) { $this ->lang[ $v ] = str_replace ( '_' , '' , $v ); } $var = str_replace ( '{_lang_' . $v . '}' , $this ->lang[ $v ], $var ); } return ( $var ); } function replace_list ( $var ) { $zwischenspeicher = array (); preg_match_all ( "/\{_list_([^\{\}]+)\}/" , $var , $zwischenspeicher ); foreach ( $zwischenspeicher [1] as $v ) { list ( $key , $val ) = explode ( '@' , $v ); $this ->lists[ $key ] = $val ; $var = str_replace ( '{_list_' . $v . '}' , '{' . $key . '}' , $var ); } return ( $var ); } function list_get ( $key , $ar ) { $zwischenspeicher = $this ->lists[ $key ]; krsort( $ar ); foreach ( $ar as $k => $v ) { $i = $k + 1; $zwischenspeicher = str_replace ( '%' . $i , $v , $zwischenspeicher ); } return ( $zwischenspeicher ); } function list_exists ( $key ) { if ( isset ( $this ->lists[ $key ] ) ) { return ( true ); } else { return ( false ); } } function list_out ( $key , $ar ) { echo $this ->list_get ( $key , $ar ); } function set ( $k , $v ) { # $this ->keys[ $k ] = unescape( $v ); $this ->keys[ $k ] = $v ; } function set_ar ( $ar ) { foreach ( $ar as $k => $v ) { # $this ->keys[ $k ] = unescape( $v ); $this ->keys[ $k ] = $v ; } } function set_ar_out ( $ar , $pos ) { $this ->set_ar( $ar ); $this ->out( $pos ); } function set_out ( $k , $v , $pos ) { $this ->set( $k , $v ); $this ->out( $pos ); } function set_ar_get ( $ar , $pos ) { $this ->set_ar( $ar ); return ( $this ->get( $pos )); } function set_get ( $k , $v , $pos ) { $this ->set( $k , $v ); return ( $this ->get( $pos )); } function del ( $k ) { unset ( $this ->keys[ $k ]); } function del_ar ( $ar ) { foreach ( $ar as $k => $v ) { unset ( $this ->keys[ $k ]); } } function parse_if_do ( $tr ) { if (isset( $this ->keys[ $tr [1]]) AND ( ( $tr [2] == '==' AND $this ->keys[ $tr [1]] == $tr [3]) OR (( $tr [2] == '!=' OR $tr [2] == '<>' ) AND $this ->keys[ $tr [1]] != $tr [3]) OR ( $tr [2] == '<=' AND $this ->keys[ $tr [1]] <= $tr [3]) OR ( $tr [2] == '>=' AND $this ->keys[ $tr [1]] >= $tr [3]) ) ) { return ( $tr [4]); } return ( '' ); } function parse_if ( $pos ) { $toout = $this ->parts[ $pos ]; $toout = preg_replace_callback ( "/\{_if_\{([^\}]+)\}([<>=!]{2})'([^']+)'\}(.*)\{\/_endif\}/Us" , array (& $this , 'parse_if_do') , $toout ); return ( $toout ); } function get ( $pos ) { $toout = $this ->parse_if( $pos ); mt_srand((double)microtime()*1000000); $z = '##@@' .mt_rand(). '@@##' ; foreach ( $this ->keys as $k => $v ) { $toout = str_replace ( '{' . $k . '}' , '{' . $z . $k . '}' , $toout ); } foreach ( $this ->keys as $k => $v ) { $toout = str_replace ( '{' . $z . $k . '}' , $v , $toout ); } return ( $toout ); } function out ( $pos ) { echo $this ->get ( $pos ); } /* @ Diese Funktion war mal eingebaut ich denke aber wenn jemand die seite suchmaschienen optimieren will, dann sollte er schon soviel ahnung haben es selber hinzubekommen. diese funktion kann aber dabei helfen! ... ansonsten wird es von mir sicher mal einen mod geben der die aufgabe uebernimmt! diese funktion kann nicht einfach freigeschaltet (auskommentiert) werden sie hat dann ueberhaupt keine auswirkung ;)... function giveback ($c) { global $allgAr; # diese funktion gibt den inhalt aus. # damit kann der inhalt nochmal nachbereitet werden. # pruefen ob alle ?... durch ....htm ersetzt werden sollen # wenn ja tun und return c ;-) if ( $allgAr['replace_template_to_html'] == 1 AND ($this->ort == 0 OR $this->ort == 2) ) { $c = preg_replace ('%href=\"\?([^\"]+)\"%Uis',"href=\"index.php?\\1\"",$c); $c = preg_replace ('%href=\"index.php\?([-0-9A-Z]+)#([a-zA-Z0-9]+)\">%Uis',"href=\"\\1.html#\\2\">",$c); $c = preg_replace ('%href=\"index.php\?([-0-9A-Z]+)\">%Uis',"href=\"\\1.html\">",$c); $c = preg_replace ('%action=\"\?([^\"]+)\"%Uis',"action=\"index.php?\\1\"",$c); $c = preg_replace ('%URL=\?([^\"]+)\"%Uis',"URL=index.php?\\1\"",$c); } return ( $c ); } */ } ?> |
Geschlossen | ||
![]() |
Zurück zu Allgemein |