![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 194 Pomógł: 2 Dołączył: 12.04.2004 Skąd: Częstochowa Ostrzeżenie: (10%) ![]() ![]() |
mam taki pliczek bbcode.php:
(nie mogę użyć BBCODE {php} bo przy wyrażeniach regularnych sie zaczyna krzaczyć) Kod Function pokazhtml($str){ //$str = str_replace ( '&', '&', $str); //$str = str_replace ( ''', "'", $str); $str = str_replace("<", "<", $str); $str = str_replace(">", ">", $str); $str = str_replace("<br />", "", $str); $str = str_replace ('"', '"', $str); return $str;} function phpHighlight($text){ $text = str_replace('[php]', "[php]<?php\n", $text); $text = str_replace('[/php]', "\n?>[/php]", $text); $temp = ''; $st = 0; $c = preg_match_all('#\[php](.+?)\[/php]#is', $text, $m, PREG_PATTERN_ORDER|PREG_OFFSET_CAPTURE); for($x = 0; $x < $c; $x++) { $temp .= substr($text, $st, $m[0][$x][1] - $st).tloNumeracja(highlight_string(pokazhtml(str_replace('<br />', '', $m[1][$x][0])), true)); $st = $m[0][$x][1] + strlen($m[0][$x][0]);} return ($st > 0) ? $temp . substr($text, $st) : $text;} Function tloNumeracja($input){ $scheiden = explode("<br />", $input); $regels = count($scheiden); $return = "<table cellpadding=2 cellspacing=0 width='100%' style='table-layout:fixed;'>"; $return .= "<tr><td bgcolor=#D3D3D3 align=right width='25'><font color=\"#000000\">"; $return .= ""; for($i=1; $i <= $regels; $i++){$return .= $i."<br>";} $return .= "</font></td><td bgcolor=#FBFBFB>"; $return .= $input; $return .= "</td></tr></table>"; return $return;} Function bbcode($str){ $str=nl2br(stripslashes(htmlspecialchars(trim($str)))); $str = preg_replace("#\[b\](.*?)\[/b\]#si", "<b>\\1</b>", $str); $str=phpHighlight($str); return $str;} która ma fajnie formatować kod php. Zarzucam prościuchny pliczek
i otrzymuję błąd: Cytat Warning: Wrong parameter count for highlight_string() in c:\apache\htdocs\phpstart\extensions\bbcode.php on line 18 Problem w tym, że błąd wyskakuje na moim kompiem podczas gdy na serwecie już działa. ERROR_REPORTING mam ustawiony domyślnie. Nie proszę o gotowe rozwiązanie tylko podpowiedź w którą stronę muszę pójść. |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarząd Postów: 3 503 Pomógł: 28 Dołączył: 17.10.2002 Skąd: Wrocław ![]() |
Stawiam na stare php na serwerze.
Jak pisze w opisie do highlight_string" title="Zobacz w manualu PHP" target="_manual Cytat Notatka: The return parameter became available in php 4.2.0. Before this time it behaved like the default, which is FALSE
-------------------- |
|
|
![]()
Post
#3
|
|
![]() Grupa: Zarejestrowani Postów: 194 Pomógł: 2 Dołączył: 12.04.2004 Skąd: Częstochowa Ostrzeżenie: (10%) ![]() ![]() |
strzał w dyche instalka nowszej versji php dała radę - dzieki.
![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 24.07.2025 - 16:05 |