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
$zoo = App::getInstance('zoo');
$element = $item->getElement('aaccae40-ef6b-479c-8a2f-9f344d94d8a7');
$data = (array)$element->data();
echo "<pre>";
print_r($data);
echo "</pre>";
@CB9TOIIIA
CB9TOIIIA / gist:ebc6add6245abd72396f
Created March 29, 2016 11:06
Создать модуль Joomla php
<?php
$pos = "honda-probeg-txt";
$modules =& JModuleHelper::getModules($pos);
$attribs['style'] = 'xhtml';
foreach ($modules as $module){
echo JModuleHelper::renderModule($module, $attribs);
}
?>
@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>
@CB9TOIIIA
CB9TOIIIA / JText
Created June 21, 2016 16:04
JText
<?php echo JText::_('COM_ADVPOLL_VOTES'); ?>
@CB9TOIIIA
CB9TOIIIA / gist:c89d71b53f78f6c4adc2bd776ee79ece
Created June 28, 2016 12:27
Убрать линию atom
atom-text-editor::shadow {
.wrap-guide {
visibility: hidden;
}
}
@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: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 / 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]
// API
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
// Assign paths
$sitePath = JPATH_SITE;
$siteUrl = JURI::root(true);
// Requests
$option = JRequest::getCmd('option');
@CB9TOIIIA
CB9TOIIIA / gist:e37722839b8fc0b9f687a785ce35f211
Created September 30, 2016 11:27
Текущий url Joomla!
JURI::getInstance()->toString()