![]() ![]() |
sob, 27 sty 2007 - 15:29
Post
#1
|
|
|
Początkujący ![]() Grupa: Użytkownicy Postów: 5 Dołączył: śro, 22 lut 06 |
witam mam taki blad :
KOD ============================================== /** * Work function to convert HTML logic to PHP code * * @param string HTML logic * @return string PHP code block */ function build_section_html_to_php($html="") { if ( preg_match( "##si", $html ) ) { //---------------------------------------- // Does it have logic sections? //---------------------------------------- $html = $this->_convert_html_to_php($html); //---------------------------------------- // Non-logic from top? //---------------------------------------- $html = preg_replace( "#^(.+?)(//startif)#ise", "\$this->_wrap_in_php('\\1', '\\2');", $html ); //---------------------------------------- // Non-logic from between? //---------------------------------------- $html = preg_replace( "#(}//endif|}//endelse)(.+?)(//startif|//startelse|else if)#ise", "\$this->_wrap_in_php('\\2', '\\3', '\\1');", $html ); //$html = str_replace( "}//endif//startif", "}//endif\n//startif", $html ); //---------------------------------------- // Non-logic from after? ENDELSE //---------------------------------------- if ( preg_match( "#^(.*)(}//endelse)(.+?)$#is", $html, $match ) ) { if ( $match[1] and $match[2] and ( ! strstr( $match[3], "<<_wrap_in_php( $html ); } //---------------------------------------- // Unconvert special tags //---------------------------------------- $html = $this->unconvert_tags($html); return $html; } //=================================================== // Convert special tags into HTML safe versions //=================================================== /** * Convert PHP tags to HTML logic safe tags * * @param string HTML/PHP data * @return string Converted Data */ function convert_tags($t="") { $t = preg_replace( "/{?\\\$ibforums->base_url}?/" , "{ipb.script_url}" , $t ); $t = preg_replace( "/{?\\\$ibforums->session_id}?/" , "{ipb.session_id}" , $t ); $t = preg_replace( "#\\\$ibforums->(member|vars|skin|lang|input)#i" , "ipb.\\1" , $t ); # IPB 2.1+ Kernel $t = preg_replace( "/{?\\\$this->ipsclass->base_url}?/" , "{ipb.script_url}" , $t ); $t = preg_replace( "/{?\\\$this->ipsclass->session_id}?/" , "{ipb.session_id}" , $t ); $t = preg_replace( "#\\\$this->ipsclass->(member|vars|skin|lang|input)#i" , "ipb.\\1", $t ); //---------------------------------------- // Make some tags safe.. //---------------------------------------- $t = preg_replace( "/\{ipb\.vars\[(['\"])?(sql_driver|sql_host|sql_database|sql_pass|sql_user|sql_port|sql_tbl_prefix|smtp_host|smtp_port|smtp_user|smtp_pass|html_dir|base_dir|upload_dir)(['\"])?\]\}/", "" , $t ); return $t; } //=================================================== // Uncovert them back again //=================================================== /** * Convert HTML tags to PHP tags * * @param string HTML/PHP data * @return string Converted Data */ function unconvert_tags($t="") { //---------------------------------------- // Make some tags safe.. //---------------------------------------- $t = preg_replace( "/\{ipb\.vars\[(['\"])?(sql_driver|sql_host|sql_database|sql_pass|sql_user|sql_port|sql_tbl_prefix|smtp_host|smtp_port|smtp_user|smtp_pass|html_dir|base_dir|upload_dir)(['\"])?\]\}/", "" , $t ); # IPB 2.1+ Kernel $t = preg_replace( "/{ipb\.script_url}/i" , '{$this->ipsclass->base_url}' , $t); $t = preg_replace( "/{ipb\.session_id}/i" , '{$this->ipsclass->session_id}', $t); $t = preg_replace( "#ipb\.(member|vars|skin|lang|input)#i", '$this->ipsclass->\\1' , $t ); return $t; } //=================================================== // Wrap HTML into PHP //=================================================== /** * Wrap PHP code in HEREDOC tags * * @param string Main HTML code * @param string After Code * @param string Before Code * @return string Converted Data */ function _wrap_in_php( $html, $after="", $before="" ) { $html = $this->_trim_newlines($this->_trim_slashes($html)); $before = $this->_trim_slashes($before); $after = $this->_trim_slashes($after); if ( ! strstr( $before, "\n" ) ) { $before .= "\n"; } if ( ! trim($html) ) { return $before.$html.$after; } return $before."\n\$IPBHTML .= <<_trim_slashes($html); $html = preg_replace( "#(?:\s+?)?(.+?)#ise" , "\$this->_statement_if('\\1', '\\2')" , $html ); $html = preg_replace( "#(?:\s+?)?(.+?)#ise", "\$this->_statement_elseif('\\1', '\\2')", $html ); $html = preg_replace( "#(?:\s+?)?(.+?)#ise" , "\$this->_statement_else('\\1')" , $html ); return $html; } //=================================================== // Convert: PHP logic to HTML logic //=================================================== /** * Convert PHP tags to HTML tags * * @param string PHP data * @return string Converted Data */ function _convert_php_to_html($php) { $php = preg_replace( "#else if\s+?\((.+?)\)\s+?{(.+?)}//endif(\n)?#ise" , "\$this->_reverse_if('\\1', '\\2', 'else if')", $php ); $php = preg_replace( "#//startif\nif\s+?\((.+?)\)\s+?{(.+?)}//endif(\n)?#ise", "\$this->_reverse_if('\\1', '\\2', 'if')" , $php ); $php = preg_replace( "#else\s+?{(.+?)}//endelse(\n)?#ise" , "\$this->_reverse_else( '\\1' )" , $php ); //---------------------------------------- // Parse raw sections //---------------------------------------- $php = $this->_reverse_ipbhtml($php); //---------------------------------------- // Convert ipb-htmllogic tags //---------------------------------------- //$php = preg_replace( "#//start-htmllogic#i" , "", $php ); //$php = preg_replace( "#//end-htmllogic#i", "" , $php ); //---------------------------------------- // Remove start ifs //---------------------------------------- $php = str_replace( "//startif\n" , "\n", $php ); $php = str_replace( "//startelse\n", "\n", $php ); //---------------------------------------- // Remove extra spaces //---------------------------------------- $php = preg_replace( "#(|)\s+?(convert_tags($php); return $php; } //=================================================== // Reverse: PHP IF to HTML IF //=================================================== /** * Reverse the IF tag * * @param string PHP Variables / Operators * @param string PHP data * @param string Tag start * @return string Converted Data */ function _reverse_if( $code, $php, $start='if' ) { $code = $this->_trim_slashes(trim($code)); $code = preg_replace( "/(^|and|or)(\s+)(.+?)(\s|$)/ise", "\$this->_reverse_prep_left('\\3', '\\1', '\\2', '\\4')", ' '.$code ); $php = $this->_reverse_ipbhtml($php); return "<".$start."=\"".trim($code)."\">\n".$php."\n\n"; } //=================================================== // Reverse: PHP else to HTML else //=================================================== /** * Reverse the ELSE tag * * @param string PHP Data * @return string Converted Data */ function _reverse_else( $php ) { $php = $this->_trim_slashes(trim($php)); $php = $this->_reverse_ipbhtml($php); return "\n".$php."\n\n"; } //=================================================== // Reverse: $IPBHTML to normal $HTML //=================================================== /** * Reverse HEREDOC tags * * @param string Raw PHP Data * @return string Converted Data */ function _reverse_ipbhtml( $code ) { $code = $this->_trim_slashes($code); $code = preg_replace("/".'\$'."IPBHTML\s+?\.?=\s+?<<_trim_newlines($code); return $code; } //=================================================== // Reverse PHP IF code to HTML code //=================================================== /** * Prepare: Reverse PHP IF code to HTML safe code * * @param string * @param string * @param string * @param string * @return string Converted Data */ function _reverse_prep_left($left, $andor="", $fs="", $ls="") { $left = trim($this->_trim_slashes($left)); if ( preg_match( "/".'\$'."this->ipsclass->/", $left ) ) { $left = preg_replace( "/".'\$'."this->ipsclass->(.+?)$/", 'ipb.'."\\1", $left ); } else { $left = str_replace( '$', '', $left ); } return $andor.$fs.$left.$ls; } //=================================================== // Statement: Return PHP 'IF' statement //=================================================== /** * Prepare: If code * * @param string If code * @param string HTML * @return string Converted Data */ function _statement_if( $code, $html ) { $html = $this->_func_prep_html($html); $code = $this->_func_prep_if($code); return "\n//startif\nif ( $code )\n{\n\$IPBHTML .= <<_func_prep_html($html); $code = $this->_func_prep_if($code); return "\nelse if ( $code )\n{\n\$IPBHTML .= <<_func_prep_html($html); return "\n//startelse\nelse\n{\n\$IPBHTML .= <<_trim_slashes($html)); //$html = preg_replace( '/"/', '\\"', $html ); return $html; } //=================================================== // Sort out left bit of comparison //=================================================== function _func_prep_left($left, $andor="", $fs="", $ls="") { $left = trim($this->_trim_slashes($left)); if ( preg_match( "/^ipb\./", $left ) ) { $left = preg_replace( "/^ipb\.(.+?)$/", '$this->ipsclass->'."\\1", $left ); } else { $left = '$'.$left; } return $andor.$fs.$left.$ls; } //=================================================== // Statement: Prep AND OR, etc //=================================================== function _func_prep_if( $code ) { $code = $this->_trim_slashes($code); $code = preg_replace( "/(^|and|or)(\s+)(.+?)(\s|$)/ise", "\$this->_func_prep_left('\\3', '\\1', '\\2', '\\4')", ' '.$code ); return trim($code); } //=================================================== // Remove leading and trailing newlines //=================================================== function _trim_newlines($code) { $code = preg_replace("/^\n{1,}/s", "", $code ); $code = preg_replace("/\n{1,}$/s", "", $code ); return $code; } //=================================================== // Remove preg_replace/e slashes //=================================================== function _trim_slashes($code) { $code = str_replace( '\"' , '"', $code ); $code = str_replace( "\\'", "'", $code ); return $code; } } ?> Fatal error: Cannot instantiate non-existent class: class_template in /usr/export/www/vhosts/funnetwork/hosting/tradediablo/sources/lib/admin_cache_functions.php on line 49 taki blad :/ Ten post edytował kwiateusz sob, 27 sty 2007 - 15:53
Powód edycji: stosuj bbcode
-------------------- |
|
|
|
sob, 27 sty 2007 - 15:54
Post
#2
|
|
![]() Sensei Grupa: Administratorzy Postów: 2,467 Dołączył: pon, 05 gru 05 Skąd: iBplanet.pl Korzystam z IPB 2.3 |
wrzuć jeszcze raz sources/lib/admin_cache_functions.php bo brakuje tam funkcji jak widać, zapewne cos robiłeś z tym plikiem
|
|
|
|
sob, 27 sty 2007 - 15:56
Post
#3
|
|
|
Początkujący ![]() Grupa: Użytkownicy Postów: 5 Dołączył: śro, 22 lut 06 |
wzucilem i to samo dalej :/ :
IPB WARNING [2] load_template(/usr/export/www/vhosts/funnetwork/hosting/tradediablo/cache/skin_cache/cacheid_/skin_global.php) [function.load-template]: failed to open stream: No such file or directory (Line: 1362 of /sources/ipsclass.php) - mam skin_global.php w folderze caheid co sie moglo stac? Ten post edytował szefcio sob, 27 sty 2007 - 16:28 -------------------- |
|
|
|
nie, 28 sty 2007 - 09:54
Post
#4
|
|
![]() Sensei Grupa: Administratorzy Postów: 2,467 Dołączył: pon, 05 gru 05 Skąd: iBplanet.pl Korzystam z IPB 2.3 |
a teraz masz błąd skina... brakuje id w skinie (co Ty robiłeś z tym forum)...
|
|
|
|
nie, 28 sty 2007 - 10:55
Post
#5
|
|
|
Początkujący ![]() Grupa: Użytkownicy Postów: 5 Dołączył: śro, 22 lut 06 |
forum ktos mi usunol .. tak jakby ktos sie wkradl do servera gdzie mam konto i bum wzial haslo i usunal all .. ok a mam pytanie Kwiateusz , czy jakbym Ci dal haslo do mojego phpmyadmin , moglbys mi dac all informacje na temat skina? jaka nazwa ktory jest domyslny i jak zmienic zeby dzialalo ?
Czekam na odp. -------------------- |
|
|
|
![]() ![]() |
|
Wersja Lo-Fi | Aktualny czas: wtorek, 22 maj 2012 - 03:15 |