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 / CLI JBZoo PHP exec
Created March 19, 2017 14:22
CLI JBZoo PHP exec
<?php
exec('php /h/mysiteby/htdocs/cli/jbzoo/vendor/jbzoo/console/bin/jbzoo import:items -vvv --stepmode --profile=prod >> /h/mysiteby/htdocs/cron.log');
?>
@CB9TOIIIA
CB9TOIIIA / Get SKU JBZoo variations
Created March 16, 2017 08:43
Get SKU JBZoo variations
// Get SKU
$CB_price = 'bbb668d1-5b7c-451a-9af1-6f8cfd3da4bc';
$CB_SKU = $this->_item->getElement($CB_price)->data()->variations;
$CB_SKU_App = $this->app->data->create($CB_SKU);
$CB_SKU = $CB_SKU_App->find('0._sku.value');
$Value_Price = $CB_SKU_App->find('0._value.value');
$CB_SKU = trim(strip_tags($CB_SKU));
$Value_Price = trim(strip_tags($Value_Price));
<field name="myrepeatfield"
type="Repeatable"
icon="list"
description="Field Description here"
label="Field Label Here"
default="{'customfield1':['Custom Field 1 value repeat1', 'Custom Field 1 value repeat2'], 'customfield2':['Custom Field 2 value repeat1','Custom Field 2 value repeat2']}">
<fieldset hidden="true" name="myrepeatfield_modal" repeat="true">
<field name="customfield1"
<field name="myrepeatfield"
type="Repeatable"
icon="list"
description="Field Description here"
label="Field Label Here"
default="">
<fieldset hidden="true" name="myrepeatfield_modal" repeat="true">
<field name="customfield1"
@CB9TOIIIA
CB9TOIIIA / subform repeatable-table joomla
Last active March 15, 2017 11:49
subform repeatable-table joomla
<fieldset name="Todaytags" label="Цвета для тегов">
<field name="repeattable" type="subform" layout="joomla.form.field.subform.repeatable-table"
formsource="/modules/mod_test/repeat.xml" multiple="true"
label="Subform Field" description="Subform Field Description" />
</fieldset>
repeat.xml
@CB9TOIIIA
CB9TOIIIA / Убрать дубли по ключу в многомерном массиве
Created February 19, 2017 08:24
Убрать дубли по ключу в многомерном массиве
$BigArAuto = array_replace_recursive($GetTagsAndCountTodayar,$bigarr);
$CountBigArAuto = count($BigArAuto);
function unique_multidim_array($array, $key) {
$temp_array = array();
$i = 0;
$key_array = array();
foreach($array as $val) {
@CB9TOIIIA
CB9TOIIIA / Хак getByCategory
Created February 3, 2017 11:36
Хак getByCategory
public function getByCategory($application_id, $category_id, $published = false, $user = null, $orderby = "", $offset = 0, $limit = 0, $ignore_order_priority = false) {
// get database
$db = $this->database;
// get dates
$date = $this->app->date->create();
$now = $db->Quote($date->toSQL());
$null = $db->Quote($db->getNullDate());
@CB9TOIIIA
CB9TOIIIA / PHP проверка через файл
Created January 10, 2017 19:30
PHP проверка через файл
$checklastmd5rss = md5($daterss);
$fp = fopen("blablasite.txt", "w+");
fwrite($fp, $checklastmd5rss);
fclose($fp);
$fpvar = file_get_contents("blablasite.txt");
@CB9TOIIIA
CB9TOIIIA / шарить не айтемы
Created January 10, 2017 18:57
шарить не айтемы
$document = JFactory::getDocument();
$zoo = App::getInstance('zoo');
$task = $zoo->jbrequest->get('task');
$jinput = JFactory::getApplication()->input->get('option','');
if ($jinput == 'com_zoo') {
if ($task == 'category' || $task == NULL) {
$oggtitle = addslashes(htmlspecialchars(strip_tags($item->name)));
if (empty($oggtitle)) {
@CB9TOIIIA
CB9TOIIIA / Только цифры в input
Created January 10, 2017 14:34
Только цифры в input
$("input[name='elements[ebdec49f-e1d9-410d-a106-dedbcf41f56a][variations][0][_value][value]']").bind("change keyup input click", function() {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9]/g, '');
}
});
});