| 161 |
161 |
*/
|
| 162 |
162 |
function __construct( $template_filename = '' ) {
|
| 163 |
163 |
global $_CONFIG;
|
| 164 |
|
|
|
164 |
// make extension directory setting
|
|
165 |
if (!empty($_CONFIG['extensions_dir'])) {
|
|
166 |
$this->extensions_dir = $_CONFIG['extensions_dir'];
|
|
167 |
}
|
| 165 |
168 |
if (!empty($_CONFIG['quickskin_compiled'])) {
|
| 166 |
169 |
$this->temp_dir = $_CONFIG['quickskin_compiled'];
|
| 167 |
170 |
}
|
| ... | ... | |
| 704 |
707 |
/* END, ELSE Blocks */
|
| 705 |
708 |
$page = preg_replace("/<!-- ENDIF.+?-->/", "<?php\n}\n?>", $this->template);
|
| 706 |
709 |
$page = preg_replace("/<!-- END[ a-zA-Z0-9_.]* -->/", "<?php\n}\n\$_obj=\$_stack[--\$_stack_cnt];}\n?>", $page);
|
|
710 |
$page = preg_replace("/<!-- ENDLOOP[ a-zA-Z0-9_.]* -->/", "<?php\n}\n\$_obj=\$_stack[--\$_stack_cnt];}\n?>", $page);
|
| 707 |
711 |
$page = str_replace("<!-- ELSE -->", "<?php\n} else {\n?>", $page);
|
| 708 |
712 |
|
| 709 |
713 |
/* 'BEGIN - END' Blocks */
|
| 710 |
|
if (preg_match_all('/<!-- BEGIN ([a-zA-Z0-9_.]+) -->/', $page, $var)) {
|
|
714 |
if (preg_match_all('/<!-- LOOP ([a-zA-Z0-9_.]+) -->/', $page, $var)) {
|
| 711 |
715 |
foreach ($var[1] as $tag) {
|
| 712 |
716 |
list($parent, $block) = $this->var_name($tag);
|
| 713 |
717 |
$code = "<?php\n"
|
| ... | ... | |
| 722 |
726 |
. "\$$block"."['ROWBIT']=\$rowcounter%2;\n"
|
| 723 |
727 |
. "\$rowcounter++;"
|
| 724 |
728 |
. "\$_obj=&\$$block;\n?>";
|
| 725 |
|
$page = str_replace("<!-- BEGIN $tag -->", $code, $page);
|
|
729 |
$page = str_replace("<!-- LOOP $tag -->", $code, $page);
|
| 726 |
730 |
}
|
| 727 |
731 |
}
|
| 728 |
732 |
|
| ... | ... | |
| 968 |
972 |
|
| 969 |
973 |
}
|
| 970 |
974 |
|
| 971 |
|
function worx_tpl_swap($tpldata, $data, $supp_templates) { /* do the substitution of the sub templates here */
|
|
975 |
function worx_tpl_swap($tpldata, $data, $supp_templates) { // do the substitution of the sub templates here
|
| 972 |
976 |
|
| 973 |
|
/* do the substitution of the directory names here */
|
| 974 |
|
|
| 975 |
|
/* do image link substitution */
|
|
977 |
// do the substitution of the directory names here
|
|
978 |
/*
|
|
979 |
// do image link substitution
|
| 976 |
980 |
if ( $data['tpl_img'] != '' && $data['url_img'] != '' ) {
|
| 977 |
981 |
$tpldata = str_replace($data['tpl_img'],$data['url_img'],$tpldata);
|
| 978 |
982 |
unset($data['tpl_img']);
|
| ... | ... | |
| 981 |
985 |
$tpldata = str_replace('tplimgs/',_URL_USRIMG,$tpldata);
|
| 982 |
986 |
}
|
| 983 |
987 |
|
| 984 |
|
/* do javascript link substitution */
|
|
988 |
// do javascript link substitution
|
| 985 |
989 |
if ( $data['tpl_js'] != '' && $data['url_js'] != '' ) {
|
| 986 |
990 |
$tpldata = str_replace($data['tpl_js'],$data['url_js'],$tpldata);
|
| 987 |
991 |
unset($data['img_tpl']);
|
| ... | ... | |
| 990 |
994 |
$tpldata = str_replace('tpljs/',_URL_USRJS,$tpldata);
|
| 991 |
995 |
}
|
| 992 |
996 |
|
| 993 |
|
/* do css link substitution */
|
|
997 |
// do css link substitution
|
| 994 |
998 |
if ( $data['tpl_css'] != '' && $data['url_css'] != '' ) {
|
| 995 |
999 |
$tpldata = str_replace($data['tpl_css'],$data['url_css'],$tpldata);
|
| 996 |
1000 |
unset($data['tpl_css']);
|
| ... | ... | |
| 998 |
1002 |
} elseif (defined(_URL_USRCSS)) {
|
| 999 |
1003 |
$tpldata = str_replace('url_css/',_URL_USRCSS,$tpldata);
|
| 1000 |
1004 |
}
|
| 1001 |
|
|
|
1005 |
*/
|
| 1002 |
1006 |
return $tpldata;
|
| 1003 |
|
|
|
1007 |
|
| 1004 |
1008 |
}
|
| 1005 |
1009 |
|
| 1006 |
1010 |
}
|
change block BEGIN to LOOP in quickskin (Tks to Stefek)