Пример установочного скрипта для Joomla
- What is a modular approach?
- The functionality is broken down into individual components, files. There is no one file approach as it was with Bootstrap in Joomla 3. This was done for efficiency and performance gains (send only the code that is needed instead of delivering everything in case some page will need so component).
- Load what you need per case! There are helper functions that will help you achieve this and, it is dead easy just call the function with the appropriate arguments.
This file contains hidden or 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 | |
/** | |
* getDominantColor | |
* Получение доминантного цвета. Функция требует наличия библиотеки GD. | |
* | |
* @param string $fname полный путь к файлу относительно сервера | |
* @param bool $skipBlackAndWhite пропускать чисто белый и чисто чёрный тона | |
* @return array | |
*/ |
This file contains hidden or 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
let request = new XMLHttpRequest(), | |
requestUrl = '', // Указываем url запроса | |
formData = new FormData(); // Перадаем <form> или просто добавляем ниже через append что нужно | |
request.open('POST', requestUrl); | |
request.send(formData); | |
request.onreadystatechange = function () { | |
if (this.readyState === 4 && this.status === 200) { | |
let response = false; | |
try { |
This file contains hidden or 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
function countdown(endDate) { | |
let days, hours, minutes, seconds; | |
endDate = new Date(endDate).getTime(); | |
if (isNaN(endDate)) { | |
return; | |
} | |
setInterval(calculate, 1000); |
This file contains hidden or 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
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) === | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated September 2024 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
This file contains hidden or 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 | |
/** | |
* @package MyExtension.Library | |
* @subpackage Helper | |
* | |
* @copyright Copyright (C) 2014 Roberto Segura. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
defined('_JEXEC') or die; |
This file contains hidden or 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 | |
/** | |
* Password Reset Script | |
* | |
* This command line script can be run as a cron job or on user request to flag user accounts on a site | |
* as requiring their passwords reset. This script flags all users who have not reset their passwords | |
* in the number of days specified by the user and compares to the lastResetTime column in the #__users | |
* table. | |
* | |
* The number of days can be specified in one of two manners: |
This file contains hidden or 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
/** | |
* frontpage check | |
*/ | |
$menu = JFactory::getApplication()->getMenu(); | |
$defaultmenuitems = array($menu->getDefault()->id, $menu->getDefault(JFactory::getLanguage()->getTag())->id); | |
$isFrontpage = in_array($menu->getActive()->id, $defaultmenuitems); |
NewerOlder