Chrome
Safari
Edge
Firefox
Chrome (Android)
Нажмите на иконку замка рядом с адресной строкой. Нажмите Права доступа -> Уведомления . Измените свои настройки.
Chrome (компьютер)
Нажмите на иконку замка в адресной строке. Выберите Настройки сайта . Найдите Уведомления и измените свои настройки.
Safari (iOS 16.4+)
Убедитесь, что сайт установлен через Добавить на главный экран . Откройте Приложение «Настройки» -> Уведомления . Найдите название вашего приложения и измените свои настройки.
Safari (macOS)
Перейдите в Safari -> Настройки . Нажмите вкладку Веб-сайты . Выберите Уведомления в боковой панели. Найдите этот сайт и измените свои настройки.
Edge (Android)
Нажмите на иконку замка рядом с адресной строкой. Нажмите Права доступа .
Найдите Уведомления и измените свои настройки.
Edge (компьютер)
Нажмите на иконку замка в адресной строке. Нажмите Права доступа для этого сайта . Найдите Уведомления и измените свои настройки.
Firefox (Android)
Перейдите в Настройки -> Права доступа сайта . Нажмите Уведомления . Найдите этот сайт в списке и измените свои настройки.
Firefox (компьютер)
Откройте настройки Firefox. Найдите раздел Уведомления . Найдите этот сайт в списке и настройте свои предпочтения.
И так. Geshi - набор классов и функций для красивого отображения различных языков программирования.
Архив
Php файл bb-code.
Строго не судите т.к. это мои первые шаги (я сам программист c, c++, asm).
<?php class bbcode_cppcode extends bbcode_parent_class implements bbcodePlugin { /** * Constructor * * @access public * @param object Registry object * @return void */ public function __construct( ipsRegistry $registry ) { $this->currentBbcode = 'cppcode'; parent::__construct( $registry ); } public function preDbParse( $txt ) { return parent::preDbParse( $txt ); } public function preDisplayParse( $txt ) { return parent::preDisplayParse( $txt ); } /** * Do the actual replacement * * @access protected * @param string $txt Parsed text from database to be edited * @return string BBCode content, ready for editing */ protected function _replaceText( $txt ) { $_tags = $this->_retrieveTags(); foreach( $_tags as $_tag ) { $open_tag = '[' . $_tag; $close_tag = '[/' . $_tag . ']'; while( ( $this->end_pos = stripos( $txt, $close_tag, $this->end_pos ) ) !== false ) { $this->cur_pos = $this->end_pos; while( $this->cur_pos > 0 ) { $this->cur_pos = $this->cur_pos - 1; if( $this->cur_pos < 0 ) { break; } if( stripos( $txt, $open_tag, $this->cur_pos ) === $this->cur_pos ) { $open_length = strlen($open_tag); $_content = substr( $txt, ($this->cur_pos + $open_length + strlen($_option) + 1)); $txt = substr_replace( $txt, $this->_buildOutput( $_content), $this->cur_pos, (stripos( $txt, $close_tag, $this->cur_pos ) + strlen($close_tag) - $this->cur_pos) ); break; } } $this->end_pos += 1; if( $this->end_pos > strlen($txt) ) { $this->end_pos = 0; break; } } } return $txt; } /** * Raw options string * * @access private * @param string $string The options submitted with the post as a string * @return array Key => value Option pairs */ private function _extractSurgicallyTehOptions( $options='' ) { return $finalOpts; } /** * Build the actual output to show * * @access private * @param integer $option Font size * @param string $content Text * @return string Content to replace bbcode with */ private function _buildOutput( $content) { // Include the GeSHi library// require_once('***************/includes/geshi.php'); //// Define some source to highlight, a language to use // and the path to the language files// ; $lang = 'cpp'; $geshi = new GeSHi($content, $lang); return $geshi->parse_code(); } }Ввожу у себя на формуе:
Цвет, отступы распознает, но
получаю:
Хотя отдельно php скрипт пашет без проблем. Как быть?