Привет, Гость!
Главная
Вход

Последняя активность

Форум / JohnCMS / моды, дизайн / Модули для JohnCMS 7.x.x
Поиск | Файлы топика (4)
  bbcode php
jimy jimy [Off] [#] (04.06.2017 / 02:21)
Добавлено: 04.06.2017 / 02:18
need help for editing font colour in highlightCode
  1. highlight.keyword, highlight.default, highlight.string, highlight.comment


Добавлено: 04.06.2017 / 02:21
image just example
Прикреплённый файл:
Нажмите для просмотра изображения
(22.01 кб.)
Скачано: 184 раз
Gabriel Gabriel [Off] [#] (04.06.2017 / 02:31)
CyberGhostNet Group
  1. ini_set("highlight.comment", "#008000");
  2. ini_set("highlight.default", "#000000");
  3. ini_set("highlight.html", "#808080");
  4. ini_set("highlight.keyword", "#0000BB; font-weight: bold");
  5. ini_set("highlight.string", "#DD0000");



  1. function highlightText($text, $fileExt="")
  2. {
  3. if ($fileExt == "php")
  4. {
  5. ini_set("highlight.comment", "#008000");
  6. ini_set("highlight.default", "#000000");
  7. ini_set("highlight.html", "#808080");
  8. ini_set("highlight.keyword", "#0000BB; font-weight: bold");
  9. ini_set("highlight.string", "#DD0000");
  10. }
  11. else if ($fileExt == "html")
  12. {
  13. ini_set("highlight.comment", "green");
  14. ini_set("highlight.default", "#CC0000");
  15. ini_set("highlight.html", "#000000");
  16. ini_set("highlight.keyword", "black; font-weight: bold");
  17. ini_set("highlight.string", "#0000FF");
  18. }
  19. // ...
  20.  
  21. $text = trim($text);
  22. $text = highlight_string("<?php " . $text, true); // highlight_string() requires opening PHP tag or otherwise it will not colorize the text
  23. $text = trim($text);
  24. $text = preg_replace("|^\\<code\\>\\<span style\\=\"color\\: #[a-fA-F0-9]{0,6}\"\\>|", "", $text, 1); // remove prefix
  25. $text = preg_replace("|\\</code\\>\$|", "", $text, 1); // remove suffix 1
  26. $text = trim($text); // remove line breaks
  27. $text = preg_replace("|\\</span\\>\$|", "", $text, 1); // remove suffix 2
  28. $text = trim($text); // remove line breaks
  29. $text = preg_replace("|^(\\<span style\\=\"color\\: #[a-fA-F0-9]{0,6}\"\\>)(&lt;\\?php&nbsp;)(.*?)(\\</span\\>)|", "\$1\$3\$4", $text); // remove custom added "<?php "
  30.  
  31. return $text;
  32. }


see here http://php.net/manual/en/funct ... g.php
Изм. Gabriel (04.06.2017 / 02:32) [1]
jimy jimy [Off] [#] (04.06.2017 / 07:24)
Добавлено: 04.06.2017 / 07:03
yeah I know that that, but I'm using bbcode jcms7
I want to know hw to edit geshi->
  1. if (null === $this->geshi) {
  2. $this->geshi = new \GeSHi;
  3. $this->geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2);
  4. $this->geshi->set_line_style('background: rgba(252, 252, 252, 0.7)', 'background: rgba(255, 255, 255, 0.6);', false);
  5. $this->geshi->set_code_style('white-space: pre-wrap');
  6. }
  7.  
  8. $this->geshi->set_language($parser);
  9. $php = strtr($code[2], ['<br />' => '']);
  10. $php = html_entity_decode(trim($php), ENT_QUOTES, 'UTF-8');
  11. $this->geshi->set_source($php);


Добавлено: 04.06.2017 / 07:24
found this but complicated http://qbnz.com/highlighter/ge ... .html
kantry kantry [Off] [#] (04.06.2017 / 10:55)
jimy, Or maybe so?
File /system/johncms/Bbcode.php
  1. $this->geshi = new \GeSHi;
  2. $this->geshi->enable_classes(); // This not inline style(enable classes css)

Your preferences insert in file end /path/theme_name/style.css
e. g css for PHP (+/-)
Прикреплённый файл:
Нажмите для просмотра изображения
(6.93 кб.)
Скачано: 132 раз
Gabriel Gabriel [Off] [#] (04.06.2017 / 14:31)
CyberGhostNet Group
maybe on the file php.php, sql.php ext
Прикреплённый файл:
Нажмите для просмотра изображения
(114.65 кб.)
Скачано: 160 раз
jimy jimy [Off] [#] (04.06.2017 / 18:56)
thx kantry and Gabriel
kantry - it is safe enabling $this->geshi->enable_classes(); ?

Gabriel - then I must editing php.php css.php etc. too?
Gabriel Gabriel [Off] [#] (04.06.2017 / 19:05)
CyberGhostNet Group
yes, because any program not some,, keyboard and another key not some
kantry kantry [Off] [#] (04.06.2017 / 19:23)
jimy, Yes! This is the standard library method.
e. g this html code <span style="color:red">php, css, etc string</span> will be replaced by <span class="red">php, css, etc string</span>
link to url default style.geshi.css /system/vendor/geshi/geshi/contrib/cssgen2.php
jimy jimy [Off] [#] (04.06.2017 / 20:59)
oke om aan
jimy jimy [Off] [#] (04.06.2017 / 21:29)
# kantry (04.06.2017 / 19:23)
jimy, Yes! This is the standard library method.
e. g this html code <span style="color:red">php, css, etc string</span> will be replaced by <span class="red">php, css, etc string</span>
link to url
do know any reference for complete geshi style?
kantry kantry [Off] [#] (04.06.2017 / 21:51)
jimy, In the folder with the library. This is the default geshi.css file
Прикреплённый файл:
geshi_css.zip (33.34 кб.)
Скачано: 141 раз
jimy jimy [Off] [#] (06.06.2017 / 20:28)
Добавлено: 06.06.2017 / 20:26
# kantry (04.06.2017 / 21:51)
jimy, In the folder with the library. This is the default geshi.css file
thx kantry, lets see

Добавлено: 06.06.2017 / 20:28
amazing 6452 lines to edit :imdead :lol
kantry kantry [Off] [#] (06.06.2017 / 22:19)
jimy, Remove unused programming lang.
And then you'll go crazy
Gabriel Gabriel [Off] [#] (09.06.2017 / 00:50)
CyberGhostNet Group
u need a long time
  Всего: 14

Фильтр по автору
Скачать тему

Форум

Новые вверху
Главная
0 / 34

JohnCMS 7.1.0

Яндекс.Метрика
© JohnCMS