для редактировании HTML кода. Хак Подсветка HTML кода для dle
можно установить подсветку HTML кода, что позволит легко редактировать интернет страницу прямо в Dle.
Открываем файл engine/classes/parse.class.php и находим в нём следующие строки:
function decodeBBCodes($txt, $use_html=TRUE, $wysiwig = "no") {global $config;$find = array (); $result = array ();$txt=stripslashes($txt);
после них вставляем:
$txt = preg_replace( "#<font color="#(.+?)">#", '', $txt ); $txt = preg_replace( "#</font>#", '', $txt );
далее ниже находим строки:
$txt = preg_replace( "#s{1};#" , ";" , $txt );$txt = preg_replace( "#t#" , " ", $txt );$txt = preg_replace( "#s{2}#", " " , $txt );
и после них вставляем:
// Открывающие и закрывающие тэги$tegs = array("'<?php'si", "'<?'si", "'?>'si");$replace = array("<font color="#FF0000"><?php</font>","<font color="#FF0000"><?</font>","<font color="#FF0000">?></font>");$txt = preg_replace($tegs, $replace, $txt);// Подсветка комментариев $txt = preg_replace("'(/*.*?*/)'si", "<font color="#777777">1</font>", $txt);// Подсветка переменных $txt = preg_replace("'([$]{1,2}[0-9A-Za-z_]+)'si", "<font color="#660000">1</font>", $txt); // Подсветка знаков равенства $txt = preg_replace("'(s={1,3}s)'", "<font color="#8000FF">1</font>", $txt);// Подсветка зарезервированных слов$str = array("'(becho)'si", "'(bprint)'si", "'(bwhile)'si", "'(bif)'si","'(bifelse)'si","'(belse)'si", "'(bforb)'si", "'(bswitchb)'si","'(bcase)'si", "'(breturnb)'si", "'(barray)'si", "'(bfunctionb)'si","'(bforeach)'si","'(bclassb)'si", "'(bglobalb)'si", "'(bvarb)'si","'(bisset)'si", "'(bempty)'si", "'(bfalseb)'si", "'(btrueb)'si","'(basb)'si", "'(bempty)'si", "'(bfalseb)'si", "'(btrueb)'si","'(binclude)'si","'(binclude_once)'si", "'(brequire)'si", "'(brequire_once)'si");$replace = array_fill(0, count($str), "<font color="#0000FF">1</font>");$txt = preg_replace($str, $replace, $txt);