Skip to content

Instantly share code, notes, and snippets.

View CB9TOIIIA's full-sized avatar
💭
Make JBZoo Great Again ^_^

Eugene Kopylov CB9TOIIIA

💭
Make JBZoo Great Again ^_^
View GitHub Profile
@CB9TOIIIA
CB9TOIIIA / HTTPS Joomla!
Created October 28, 2016 20:58
HTTPS Joomla!
RewriteCond %{HTTP:SSL} !1
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://domain.ru/ [R=301,L]
@CB9TOIIIA
CB9TOIIIA / J3.6.4 - user.php
Created October 27, 2016 20:36
J3.6.4 - user.php
<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@CB9TOIIIA
CB9TOIIIA / gist:e37722839b8fc0b9f687a785ce35f211
Created September 30, 2016 11:27
Текущий url Joomla!
JURI::getInstance()->toString()
// API
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
// Assign paths
$sitePath = JPATH_SITE;
$siteUrl = JURI::root(true);
// Requests
$option = JRequest::getCmd('option');
@CB9TOIIIA
CB9TOIIIA / gist:3167adeda8be79e75030f574e6cee8fb
Created September 3, 2016 14:32
www to without domain - and index.php
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://domain.ru/ [R=301,L]
@CB9TOIIIA
CB9TOIIIA / gist:751a914f79ccc21dfefebf5d8385d2ea
Created September 3, 2016 14:27
.htaccess for yandex robots - склейка
php_flag display_errors Off
###activate mod_deflate
SetOutputFilter DEFLATE
# Add caching headers for all files
ExpiresActive On
<FilesMatch \.css$>
ExpiresDefault "access plus 7 days"
@CB9TOIIIA
CB9TOIIIA / Костыли у клиента
Created September 1, 2016 20:20
session_set_cookie_params и session_start
if ($_GET[from]=='targetmailru'){
session_set_cookie_params(10800);
if (isset($_REQUEST[session_name()])) session_start();
$_SESSION[tel]='216-45-27';
}
if ($_GET[from]=='yadirect'){
session_set_cookie_params(10800);
@CB9TOIIIA
CB9TOIIIA / gist:c89d71b53f78f6c4adc2bd776ee79ece
Created June 28, 2016 12:27
Убрать линию atom
atom-text-editor::shadow {
.wrap-guide {
visibility: hidden;
}
}
@CB9TOIIIA
CB9TOIIIA / JText
Created June 21, 2016 16:04
JText
<?php echo JText::_('COM_ADVPOLL_VOTES'); ?>
@CB9TOIIIA
CB9TOIIIA / Joomla поиск API
Created April 13, 2016 16:14
Joomla поиск API
<?php $alias = JFactory::getURI()->getPath();
$jinput = JFactory::getApplication()->input;
$Itemid = $jinput->getInt('Itemid'); ?>
<form action="<?php echo $alias; ?>" method="post" >
<input name="searchword" id="mod-search-searchword" maxlength="200" class="input-text search" type="search" placeholder="Поиск по сайту">
<input type="hidden" name="task" value="search">
<input type="hidden" name="option" value="com_search">
<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>">
</form>