ilch Forum » Ilch Clan 1.1 » Allgemein » PHP 7.2

Geschlossen
  1. #1
    User Pic
    saibot852 Mitglied
    Registriert seit
    24.09.2012
    Beiträge
    16
    Beitragswertungen
    0 Beitragspunkte
    Guten Abend zusammen,
    ich bin leider gezwungen meine PHP Version umzustellen oder jeden mon 5,99 Support draufzahlen.
    Leider lässt sich die Seite nicht fehlerfrei aufrufen. Dennoch möchte ich die Seite weiter nutzen. Das ilch 2.xx ist ja toll nur leider ist es schade das es nicht möglich ist die alten Daten zu verwenden:(. Ich kenne mich ein bisschen mit PHP aus, dennoch stehen hier hunderte Fragezeichen über meinem Kopf.

    kann mir vill jemand ein Beispiel zeigen damit es PHP 7.2 kompatible ist?

    function parse($string) {
    		//> Die Blocks werden codiert um sie vor dem restlichen parsen zu schützen.
    		if($this->permitted['php'] == true) {
    			$string = preg_replace("%\[php\](.+)\[\/php\]%esiU","\$this->encode_codec('\$1','php')",$string);
    			$string = preg_replace("%\[php=(.*)\](.+)\[\/php\]%esiU","\$this->encode_codec('\$2','php','\$1')",$string);
    		}
    
    		if($this->permitted['html'] == true) {
    			$string = preg_replace("%\[html\](.+)\[\/html\]%esiU","\$this->encode_codec('\$1','html')",$string);
    			$string = preg_replace("%\[html=(.*)\](.+)\[\/html\]%esiU","\$this->encode_codec('\$2','html','\$1')",$string);
    		}
    
    		if($this->permitted['css'] == true) {
    			$string = preg_replace("%\[css\](.+)\[\/css\]%esiU","\$this->encode_codec('\$1','css')",$string);
    			$string = preg_replace("%\[css=(.*)\](.+)\[\/css\]%esiU","\$this->encode_codec('\$2','css','\$1')",$string);
    		}
    
    		if($this->permitted['code'] == true) {
    			$string = preg_replace("%\[code\](.+)\[\/code\]%esiU","\$this->encode_codec('\$1','code')",$string);
    			$string = preg_replace("%\[code=(.*)\](.+)\[\/code\]%esiU","\$this->encode_codec('\$2','code','\$1')",$string);
    		}
    
    		if($this->permitted['list'] == true) {
    			$string = preg_replace("%\[list\](.+)\[\/list\]%esiU","\$this->encode_codec('\$1','list')",$string);
    		}
    
    		//> BB Code der den Codeblock nicht betrifft.
    		//> Überprüfen ob die wörter nicht die maximal länge überschrieten.
    		$string = $this->_shortwords($string);
    		$string = htmlentities($string);
    		$string = nl2br($string);
    
    		if($this->permitted['url'] == true) {
    			if($this->permitted['autourl'] == true) {
    				//> Format: www.xxx.de
    				$this->pattern[] = "%(( |\n|^)(www.[a-zA-Z\-0-9@:\%_\+.~#?&//=,;]+?))%eUi";
    				$this->replace[] = "\$this->_ws('\$2').\$this->_shorturl('\$3')";
    
    				//> Format: http://www.xxx.de
    				$this->pattern[] = "%(( |\n|^)((http|https|ftp)://{1}[a-zA-Z\-0-9@:\%_\+.~#?&//=,;]+?))%eUi";
    				$this->replace[] = "\$this->_ws('\$2').\$this->_shorturl('\$3')";
    
    				//> Format xxx@xxx.de
    				$this->pattern[] = "%(( |\n|^)[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})%i";
    				$this->replace[] = "<a href=\"mailto:$1\">$1</a>";
    			}
    
    			//> Format: [url=xxx]xxx[/url]
    			$this->pattern[] = "%\[url=([^\]]*)\](.+)\[\/url\]%eUis";
    			$this->replace[] = "\$this->_shorturl('\$1','\$2')";
    
    			//> Format: [url]xxx[/url]
    			$this->pattern[] = "%\[url\](.+)\[\/url\]%esiU";
    			$this->replace[] = "\$this->_shorturl('\$1')";
    		}
    
    		//> Darf BB Code [MAIL] dekodiert werden?
    		if($this->permitted['email'] == true) {
    			//> Format: [mail]xxx@xxx.de[/mail]
    			$this->pattern[] = "%\[mail\]([_\.0-9a-z-]+\@([0-9a-z\-]+)\.[a-z]{2,3})\[\/mail\]%Uis";
    			$this->replace[] = "<a href=\"mailto:$1\">$1</a>";
    
    			//> Format: [mail=xxx@xxx.de]xxx[/mail]
    			$this->pattern[] = "%\[mail=([_\.0-9a-z-]+\@([0-9a-z\-]+)\.[a-z]{2,3})\](.+)\[\/mail\]%Uis";
    			$this->replace[] = "<a href=\"mailto:$1\">$3</a>";
    		}
    
    
    
    		//> Darf BB Code [B] dekodiert werden?
    		if($this->permitted['b'] == true) {
    			//> Format: [b]xxx[/b]
    			$this->pattern[] = "%\[b\](.+)\[\/b\]%Uis";
    			$this->replace[] = "<b>\$1</b>";
    		}
    
    		//> Darf BB Code [I] dekodiert werden?
    		if($this->permitted['i'] == true) {
    			//> Format: [i]xxx[/i]
    			$this->pattern[] = "%\[i\](.+)\[\/i\]%Uis";
    			$this->replace[] = "<i>\$1</i>";
    		}
    
    		//> Darf BB Code [U] dekodiert werden?
    		if($this->permitted['u'] == true) {
    			//> Format: [u]xxx[/u]
    			$this->pattern[] = "%\[u\](.+)\[\/u\]%Uis";
    			$this->replace[] = "<u>\$1</u>";
    		}
    
    		//> Darf BB Code [S] dekodiert werden?
    		if($this->permitted['s'] == true) {
    			//> Format: [s]xxx[/s]
    			$this->pattern[] = "%\[s\](.+)\[\/s\]%Uis";
    			$this->replace[] = "<strike>\$1</strike>";
    		}
    
    
    		###############################################
    
    
    		//> Darf BB Code [LEFT] dekodiert werden?
    		if($this->permitted['left'] == true) {
    			//> Format: [left]xxx[/left]
    			$this->pattern[] = "%\[left\](.+)\[\/left\]%Uis";
    			$this->replace[] = "<div align=\"left\">\$1</div>";
    		}
    
    		//> Darf BB Code [CENTER] dekodiert werden?
    		if($this->permitted['center'] == true) {
    			//> Format: [center]xxx[/center]
    			$this->pattern[] = "%\[center\](.+)\[\/center\]%Uis";
    			$this->replace[] = "<div align=\"center\">\$1</div>";
    		}
    
    		//> Darf BB Code [RIGHT] dekodiert werden?
    		if($this->permitted['right'] == true) {
    			//> Format: [right]xxx[/right]
    			$this->pattern[] = "%\[right\](.+)\[\/right\]%Uis";
    			$this->replace[] = "<div align=\"right\">\$1</div>";
    		}
    
    
    		###############################################
    
    		//> Darf BB Code [EMPH] dekodiert werden?
    		if($this->permitted['emph'] == true) {
    			//> Format: [emph]xxx[/emph]
    			$this->pattern[] = "%\[emph\](.+)\[\/emph\]%Uis";
    			$this->replace[] = "<span style=\"background-color:".$this->info['EmphHintergrundfarbe'].";color:".$this->info['EmphSchriftfarbe'].";\">$1</span>";
    		}
    
    		//> Darf BB Code [COLOR] dekodiert werden?
    		if($this->permitted['color'] == true) {
    			//> Format: [color=#xxxxxx]xxx[/color]
    			$this->pattern[] = "%\[color=(#{1}[0-9a-zA-Z]+?)\](.+)\[\/color\]%Uis";
    			$this->replace[] = "<font color=\"$1\">$2</font>";
    		}
    
    		//> Darf BB Code [SIZE] dekodiert werden?
    		if($this->permitted['size'] == true) {
    			//> Format: [size=xx]xxx[/size]
    			$this->pattern[] = "%\[size=([0-9]+?)\](.+)\[\/size\]%eUi";
    			$this->replace[] = "\$this->_size('\$1','\$2')";
    		}
    
    		//> Darf BB Code [KTEXT] decodiert werden?
    		if($this->permitted['ktext'] == true) {
    			//> Format: [ktext=xxx]
    			$this->pattern[] = "%\[ktext=([^[/]*)\]%esiU";
    			$this->replace[] = "\$this->_addKtextOpen('\\1')";
    
    			//> Format: [/ktext]
    			$this->pattern[] = "%\[/ktext\]%esiU";
    			$this->replace[] = "\$this->_addKtextClose()";
    		}
    
    		//> Darf BB Code [IMG] dekodiert werden?
    		if($this->permitted['img'] == true) {
    			//> Format: [img]xxx.de[/img]
    			$this->pattern[] = "%\[img\]([-a-zA-Z0-9@:\%_\+,.~#?&//=]+?)\[\/img\]%eUi";
    			$this->replace[] = "\$this->_img('\$1')";
          //> Format: [img=left|right]xxx.de[/img]
          $this->pattern[] = "%\[img=(left|right)\]([-a-zA-Z0-9@:\%_\+,.~#?&//=]+?)\[\/img\]%eUi";
    		  $this->replace[] = "\$this->_img('\$2','\$1')";
        }
    
    		//> Darf BB Code [SCREENSHOT] dekodiert werden?
    		if($this->permitted['screenshot'] == true) {
    			//> Format: [shot]xxx.de[/screenshot]
    			$this->pattern[] = "%\[shot\]([-a-zA-Z0-9@:\%_\+.~#?&//=]+?)\[\/shot\]%eUi";
    			$this->replace[] = "\$this->_screenshot('\$1')";
          //> Format: [shot=left|right]xxx.de[/screenshot]
    			$this->pattern[] = "%\[shot=(left|right)\]([-a-zA-Z0-9@:\%_\+.~#?&//=]+?)\[\/shot\]%eUi";
    			$this->replace[] = "\$this->_screenshot('\$2','\$1')";
    
    		}
    
    		//> Farf BB Code [VIDEO] dekodiert werden?
            if($this->permitted['video'] == true) {
                //> Format: [video=xxx]xxx[/video]
                $this->pattern[] = "%\[video=(google|youtube|myvideo|gametrailers|facebook)\](.+)\[\/video\]%eUis";
                $this->replace[] = "\$this->_video('\$1','\$2')";
            }
    
    		//> Darf BB Code [COUNTDOWN] dekodiert werden?
    		if($this->permitted['countdown'] == true) {
    			//> Format: [countdown=Std:Min:Sek]TT.MM.JJJJ[/countdown]
    			$this->pattern[] = "%\[countdown=(([0-9]{2}):([0-9]{2}):([0-9]{2}))\](([0-9]{2})\.([0-9]{2})\.([0-9]{4}))\[\/countdown\]%eUis";
    			$this->replace[] = "\$this->_countdown('\$5','\$1')";
    
    			//> Format: [countdown]TT.MM.JJJJ[/countdown]
    			$this->pattern[] = "%\[countdown\](([0-9]{2})\.([0-9]{2})\.([0-9]{4}))\[\/countdown\]%eUis";
    			$this->replace[] = "\$this->_countdown('\$1')";
    		}
    
    		###############################################
    
    		//> Darf BB Code [QUOTE] dekodiert werden?
    		if($this->permitted['quote'] == true) {
    
    			//> Format: [quote]
    			$this->pattern[] = "%\[quote\]%esiU";
    			$this->replace[] = "\$this->_addQuoteOpen()";
    
    			//> Format: [quote=xxx]
    			$this->pattern[] = "%\[quote=([^[/]*)\]%esiU";
    			$this->replace[] = "\$this->_addQuoteOpen('\\1')";
    
    			//> Format: [/quote]
    			$this->pattern[] = "%\[/quote\]%esiU";
    			$this->replace[] = "\$this->_addQuoteClose()";
    		}
    
    		//> String parsen
    		$string = preg_replace($this->pattern,$this->replace,$string);
    
    		//> Darf BB Code [QUOTE] dekodiert werden?
    		if($this->permitted['quote'] == true) {
    			$string = $this->_quote($string);
    		}
    
    		//> Darf BB Code [KTEXT] decodiert werden?
    		if($this->permitted['ktext'] == true) {
    			$string = $this->_ktext($string);
    		}
    
    		//> Smilies Filtern.
    		$string = $this->_smileys($string);
    
    		//> Zum schluss die blöcke die verschlüsselt wurden wieder entschlüsseln und Parsen.
    		if($this->permitted['php'] == true) {
    			$string = preg_replace("%\[php\](.+)\[\/php\]%esiU","\$this->_phpblock('\$1')",$string);
    			$string = preg_replace("%\[php=([^;]*);(\d+)\](.+)\[\/php\]%esiU","\$this->_phpblock('\$3','\$1','\$2')",$string);
          $string = preg_replace("%\[php=(.*)\](.+)\[\/php\]%esiU","\$this->_phpblock('\$2','\$1')",$string);
    		}
    
    		if($this->permitted['html'] == true) {
    			$string = preg_replace("%\[html\](.+)\[\/html\]%esiU","\$this->_htmlblock('\$1')",$string);
    			$string = preg_replace("%\[html=([^;]*);(\d+)\](.+)\[\/html\]%esiU","\$this->_htmlblock('\$3','\$1','\$2')",$string);
          $string = preg_replace("%\[html=(.*)\](.+)\[\/html\]%esiU","\$this->_htmlblock('\$2','\$1')",$string);
    		}
    
    		if($this->permitted['css'] == true) {
    			$string = preg_replace("%\[css\](.+)\[\/css\]%esiU","\$this->_cssblock('\$1')",$string);
    			$string = preg_replace("%\[css=([^;]*);(\d+)\](.+)\[\/css\]%esiU","\$this->_cssblock('\$3','\$1','\$2')",$string);
          $string = preg_replace("%\[css=(.*)\](.+)\[\/css\]%esiU","\$this->_cssblock('\$2','\$1')",$string);
    		}
    
    		if($this->permitted['code'] == true) {
    			$string = preg_replace("%\[code\](.+)\[\/code\]%esiU","\$this->_codeblock('\$1')",$string);
    			$string = preg_replace("%\[code=([^;]*);(\d+)\](.+)\[\/code\]%esiU","\$this->_codeblock('\$3','\$1','\$2')",$string);
          $string = preg_replace("%\[code=(.*)\](.+)\[\/code\]%esiU","\$this->_codeblock('\$2','\$1')",$string);
    		}
    
    		if($this->permitted['list'] == true) {
    			$string = preg_replace("%\[list\](.+)\[\/list\]%esiU","\$this->_list('\$1')",$string);
    		}
    
    		//> Badwors Filtern.
    		$string = $this->_badwords($string);
    
    		unset($this->pattern);
    		unset($this->replace);
    
    		unset($this->ayCacheQuoteOpen);
    		unset($this->ayCacheQuoteClose);
    
    		unset($this->ayCacheKtextOpen);
    		unset($this->ayCacheKtextClose);
    
    		return $string;
    	}



    verwendete ilch Version: 1.1 P

    betroffene Homepage: externer Link
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beiträge
    7.675
    Beitragswertungen
    1212 Beitragspunkte
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Allgemein

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten