This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Использование в макетах дизайна/врезках/компонентах: <?= buildMenu(); ?> | |
* Будет сформирован обычный маркированный список без классов, кроме классов с отображением состояния раздела у li. | |
* Внимательно читайте описание функций. Их необходимо разместить в файле /netcat/modules/default/function.inc.php | |
*/ | |
/** | |
* Функция для определения классов для указанного раздела | |
* @param int $given_sub - номер раздела |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Файл: /netcat/modules/default/function.inc.php | |
// Регистрируем шаблон вида %NC_GALLERY_SHOW($args)% в качестве макропеременной (или шорткода, для ясности) | |
// Его параметры, записанные вот так: %NC_GALLERY_SHOW(1, 2)% будут переданы в качестве аргументов в функцию show_gallery | |
nc_Core::get_object()->register_macrofunc('NC_GALLERY_SHOW', 'show_gallery'); | |
// Определяем простую функцию, обрабатывающую такой "шорткод". Проверка аргументов опущена для краткости | |
function show_gallery($sub, $cc) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location @fallback { | |
proxy_pass http://127.0.0.1:8080; | |
proxy_redirect http://127.0.0.1:8080 /; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header If-Modified-Since $http_if_modified_since; | |
access_log off ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^.+\.(css|txt|js)$ { | |
root $root_path; | |
gzip_static on; | |
access_log off; # не пишем логи | |
add_header Cache-Control public; | |
expires 7d; # кешируем у клиента на 7 дней | |
add_header ETag ""; | |
} | |
location ~ ^.+\.(jpg|jpeg|gif|png|ico|pdf|ppt|bmp|js)$ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_deflate.c> | |
#The following line is enough for .js and .css | |
AddOutputFilter DEFLATE js css | |
AddOutputFilterByType DEFLATE text/plain text/xml application/xhtml+xml text/css application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp text/html | |
#The following lines are to avoid bugs with some browsers | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/mgr5/sbin/licctl fetch ispmgr | |
/usr/local/mgr5/sbin/pkgupgrade.sh coremanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// Имя дополнительного шаблона | |
$partial_template_name = 'Test'; | |
// Данные для передачи в дополнительный шаблон | |
$data = array('example' => 'string'); | |
// Переменная с набором свойств текущего шаблона | |
global $template_env; | |
// Функция определяет корневой родительский шаблон для указанного шаблона |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_seo_title($title_delimeter = ' :: ') { | |
global $parent_sub_tree; | |
global $current_sub; | |
global $current_cc; | |
global $action; | |
global $message; | |
global $title_tail; | |
$nc_core = nc_Core::get_object(); |
NewerOlder