Новичок
Покинул форум
Сообщений всего: 22
Дата рег-ции: Окт. 2011
Помог: 0 раз(а)
|
unset( $this->1->$i ); вот сам код где баг если надо вот полный код
CODE ( htmlphp):
скопировать код в буфер обмена
<?php function get_user( ) { global $_conf; if ( $_SESSION[login] != "" && $_SESSION[password] != "" ) { $res = mysql_query( "select * from ".$_conf[table_prefix]."users where name='".$_SESSION[login]."' and password='".$_SESSION[password]."'" ); { mysql_query( "update ".$_conf[table_prefix]."users set last_visit=".time( )." where id='".$row[id]."'" ); return $row; } return -1; } return 0; } function parse_tpl( $tpl, $vars ) { preg_match_all( "|{{([0-9a-z_ ]*?)(\\(.*?\\))?}}|si", $tpl, $matches ); foreach ( $matches[1] as $i => $k ) { if ( substr( $k, 0, 10 ) == "if_exists " ) { { $tpl = preg_replace( "|{{".$k."}}.*?{{end ".$k."}}|si", "", $tpl ); } else { } } if ( substr( $k, 0, 14 ) == "if_not_exists " ) { { $tpl = preg_replace( "|{{".$k."}}.*?{{end ".$k."}}|si", "", $tpl ); } else { } } { $replace = ""; $tpl1 = substr( $tpl, strpos( $tpl, "{{".$k.$matches[2][$i]."}}" ) + strlen( "{{".$k.$matches[2][$i]."}}" ), strpos( $tpl, "{{end ".$k."}}" ) - strpos( $tpl, "{{".$k.$matches[2][$i]."}}" ) - strlen( "{{".$k.$matches[2][$i]."}}" ) ); if ( trim( $matches[2][$i] ) != "" ) { $params = trim( $matches[2][$i], "()" ); preg_match( "|([0-9]*),(.*)|si", $params, $matches1 ); $n = ( integer )$matches1[1]; $delimiter = $matches1[2]; $delimiter = trim( $delimiter, "\"'" ); } $cnt = 0; $cnt_all = 0; foreach ( $vars[$k] as $v ) { ++$cnt_all; ++$cnt; $replace .= parse_tpl( $tpl1, $v ); if ( !( $cnt == ( integer )$n ) && !( $cnt_all < count( $vars[$k] ) ) ) { $replace .= $delimiter; $cnt = 0; } } $tpl = str_replace( substr( $tpl, strpos( $tpl, "{{".$k.$matches[2][$i]."}}" ), strpos( $tpl, "{{end ".$k."}}" ) + strlen( "{{end ".$k."}}" ) - strpos( $tpl, "{{".$k.$matches[2][$i]."}}" ) ), $replace, $tpl ); } else if ( 0 < strpos( $tpl, "{{end ".$k."}}" ) ) { } } foreach ( $matches[1] as $i => $k ) { if ( isset( $vars[$k] ) ) { $tpl = str_replace( "{{".$k.$matches[2][$i]."}}", $vars[$k], $tpl ); } } return $tpl; } function show_main( ) { global $vars; global $_conf; $copyright = @file_get_contents( "http://www.flashscripts.org/copyright.php?mode=forum&catalog=".@urlencode( $_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI] ) ); if ( 0 < strpos( "_".$tpl, "{{authors_link}}" ) ) { $tpl = str_replace( "{{authors_link}}", $copyright, $tpl ); } else if ( 0 < strpos( "_".$tpl, "</body>" ) ) { $tpl = str_replace( "</body>", "<center>".$copyright."</center> </body>", $tpl ); } else { $tpl .= " <center>".$copyright."</center>"; } $tpl = parse_tpl( $tpl, $vars ); echo $tpl; } ?>
|