The module allows you to specify a link that is automatically substituted in the texts on the site with a given keyword or phrase. Module refers to the part of the CMS "Interactive" and can be installed optionally.
Module "Site links" is connected to the other modules. The standard DIAFAN.CMS "Site links" is integrated with the following modules: Photogallery, News, Articles, Question-Answer, Online shop, Files, Site pages, Ads. The module is connected to a specific perelinkovka module settings.
Подключаемая часть – файл modules/keywords/keywords.inc.php. В нем описан класс
Keywords_inc. В модуле к объекту класса можно обратиться через переменную $this->diafan->_keywords
. Экземпляр класса создается при первом вызове
переменной.
void get (string &$text) – Подставляет ключевые слова.
Example:
// replace keywords to site links in text
$this->diafan->_keywords->get($text);
If the module is connected module settings "Site links" the links are inserted in the text, processed function htmleditor.
In the file of module settings (modules/модуль/admin/модуль.admin.config.php) you must add the parameter
'keywords'
:
Example:
public $variables = array(
'main' => array(
'keywords' => 'module',
…
),
…
);
Key words and references to them can be edited directly from the list.
Site links have the following characteristics.
The import file must have the following format:
Example:
keyword 1
link 1
keyword 2
link 2
keyword 3
link 3
...
You can also download a file with keywords on the site in the above link format "Export".
In the settings you can specify:
{keywords} – Ключевые слова для перелинковки
modules/keywords/admin/keywords.admin.php – Редактирование ключевых слов;
modules/keywords/admin/keywords.admin.config.php – Module settings;
modules/keywords/admin/keywords.admin.importexport.php – Импорт и экспорт ключевых слов;
modules/keywords/admin/keywords.admin.inc.php – Connecting the module to the administrative part of other modules;
modules/keywords/keywords.export.php – Экспорт ключевых слов;
modules/keywords/keywords.inc.php – Подключение модуля;
modules/keywords/keywords.install.php – Module installation.