Авторизация
 Регистрация   Войти   Забыли пароль? 

Как правильно задать title и description страницы в PHP-Fusion?

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Как правильно задать title и description страницы в PHP-Fusion?


 Russian

$name - название любого элемента

$description - нужно создать в БД дополнительное поле для краткой аннотации в меню и тега description

функции stripinput() и html_to_text() нужны, если в $description могут быть какие-то теги.

stripinput() - из maincore.php

исправьте tab в html_to_text()

How to correctly set the title and description of pages in PHP-Fusion?

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / How to correctly set the title and description of pages in PHP-Fusion?


 English

$name is the name of any element

$description - you need to create an additional field in the database for a brief annotation in the menu and description tag

Functions stripinput() and html_to_text() are needed if there are some tags in $ description.

stripinput() - from maincore.php

Correct tab in html_to_text()

PHP

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 20

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 21

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\search_bbcode_include.php on line 39
PHP
  1. <?php
  2. function html_to_text($text) {
  3.     $text = strip_tags($text);
  4.     $text = str_replace(array("&nbsp;", ">", "<", "    ", "
  5. "), // tab and linebreak // таб и перенос строки
  6. array(" ", " ", " ", " ", " "), $text );
  7.     $text = str_replace("'", "`", $text);
  8.     $text = str_replace('"', '`', $text);
  9.     return $text;
  10. }
  11. require_once THEMES."templates/header.php";
  12. set_title(" ".$name." ");
  13. set_meta("description",   $description);
  14. // set_meta("description",  stripinput(html_to_text($description)) );
  15. ?>

Добавить комментарий

Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
HTML-code and BB-code for blogs and forums

<a href="https://php-fusion.vveb.ws/php-fusion.php?id=31">Как правильно задать title и description страницы в PHP-Fusion?</a>


[url=https://php-fusion.vveb.ws/php-fusion.php?id=31]Как правильно задать title и description страницы в PHP-Fusion?[/url]

Language: Default
 
Код для PHP-Fusion