Сергей Скат

Сергей Скат

С нами с 08 мая 2014; Место в рейтинге пользователей: #123
Сергей Скат
04 сентября 2014, 18:28
0
получилось, спасибо за помощь
Сергей Скат
04 сентября 2014, 17:20
0
так начал просто отдавать все ресурсы не смотря на цену
<pre class="pdoResourcesLog">0.0000980: pdoTools loaded
0.0000260: xPDO query object created
0.0006058: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
0.0002670: leftJoined <i>modTemplateVarResource</i> as <b>TVimg</b>
0.0002458: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_ot</b>
0.0002582: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_do</b>
0.0002420: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
0.0002398: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
0.0002542: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
0.0002530: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
0.0002410: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
0.0002420: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
0.0002429: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
0.0004730: Added selection of <b>modResource</b>: <small>SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`</small>
0.0000122: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.img`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_ot`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_do`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.street`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.kavdrat_ot`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.okrug`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.metro`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.area`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.object_id`</small>
0.0000360: Replaced TV conditions
0.0005240: Processed additional conditions
0.0009849: Added where condition: <b>0=, modResource.parent:IN(1,38,39,17,19,21,9,18,20,23), modResource.published=1, modResource.deleted=0, modResource.isfolder=0</b>
0.0000331: Replaced TV conditions
0.0001209: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
0.0000021: Limited to <b>9</b>, offset <b></b>
0.0003231: SQL prepared <small>"SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVimg`.`value`, '') AS `tv.img`, IFNULL(`TVprice_ot`.`value`, '') AS `tv.price_ot`, IFNULL(`TVprice_do`.`value`, '') AS `tv.price_do`, IFNULL(`TVprice`.`value`, '') AS `tv.price`, IFNULL(`TVstreet`.`value`, '') AS `tv.street`, IFNULL(`TVkavdrat_ot`.`value`, '') AS `tv.kavdrat_ot`, IFNULL(`TVokrug`.`value`, '') AS `tv.okrug`, IFNULL(`TVmetro`.`value`, '') AS `tv.metro`, IFNULL(`TVarea`.`value`, '') AS `tv.area`, IFNULL(`TVobject_id`.`value`, '') AS `tv.object_id` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVimg` ON `TVimg`.`contentid` = `modResource`.`id` AND `TVimg`.`tmplvarid` = 1 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_ot` ON `TVprice_ot`.`contentid` = `modResource`.`id` AND `TVprice_ot`.`tmplvarid` = 11 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_do` ON `TVprice_do`.`contentid` = `modResource`.`id` AND `TVprice_do`.`tmplvarid` = 12 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice` ON `TVprice`.`contentid` = `modResource`.`id` AND `TVprice`.`tmplvarid` = 13 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVstreet` ON `TVstreet`.`contentid` = `modResource`.`id` AND `TVstreet`.`tmplvarid` = 4 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVkavdrat_ot` ON `TVkavdrat_ot`.`contentid` = `modResource`.`id` AND `TVkavdrat_ot`.`tmplvarid` = 5 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVokrug` ON `TVokrug`.`contentid` = `modResource`.`id` AND `TVokrug`.`tmplvarid` = 8 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmetro` ON `TVmetro`.`contentid` = `modResource`.`id` AND `TVmetro`.`tmplvarid` = 9 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarea` ON `TVarea`.`contentid` = `modResource`.`id` AND `TVarea`.`tmplvarid` = 10 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVobject_id` ON `TVobject_id`.`contentid` = `modResource`.`id` AND `TVobject_id`.`tmplvarid` = 16 WHERE  ( `modResource`.`parent` IN (1,38,39,17,19,21,9,18,20,23) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 AND `modResource`.`isfolder` = 0 )  ORDER BY modResource.publishedon DESC LIMIT 9 "</small>
0.0009940: SQL executed
0.0000660: Total rows: <b>7</b>
0.0000811: Rows fetched
0.0614228: Could not process or prepare TV "kavdrat_do"
0.0055480: Could not process or prepare TV "kavdrat_do"
0.0005412: Could not process or prepare TV "kavdrat_do"
0.0005369: Could not process or prepare TV "kavdrat_do"
0.0005240: Could not process or prepare TV "kavdrat_do"
0.0033970: Could not process or prepare TV "kavdrat_do"
0.0005429: Could not process or prepare TV "kavdrat_do"
0.0725260: Prepared and processed TVs
0.0007949: Loaded chunk "zayavka_block"
0.0961871: Returning processed chunks
0.1753349: <b>Total time</b>
11 534 336: <b>Memory usage</b>
</pre>
Сергей Скат
04 сентября 2014, 17:09
0
так почему то ничего не выводит совсем
<pre class="pdoResourcesLog">0.0000942: pdoTools loaded
0.0000250: xPDO query object created
0.0006039: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
0.0002630: leftJoined <i>modTemplateVarResource</i> as <b>TVimg</b>
0.0002432: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_ot</b>
0.0002389: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_do</b>
0.0002520: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
0.0002360: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
0.0002360: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
0.0002351: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
0.0002470: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
0.0002372: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
0.0002372: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
0.0004630: Added selection of <b>modResource</b>: <small>SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`</small>
0.0000129: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.img`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_ot`</small>
0.0000088: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_do`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.street`</small>
0.0000098: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.kavdrat_ot`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.okrug`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.metro`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.area`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.object_id`</small>
0.0000501: Replaced TV conditions
0.0005021: Processed additional conditions
0.0009050: Added where condition: <b>`TVprice`.`value`:IN=30000 , 4000, modResource.parent:IN(1,38,39,17,19,21,9,18,20,23), modResource.published=1, modResource.deleted=0, modResource.isfolder=0</b>
0.0000319: Replaced TV conditions
0.0001140: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
0.0000021: Limited to <b>9</b>, offset <b></b>
0.0003409: SQL prepared <small>"SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVimg`.`value`, '') AS `tv.img`, IFNULL(`TVprice_ot`.`value`, '') AS `tv.price_ot`, IFNULL(`TVprice_do`.`value`, '') AS `tv.price_do`, IFNULL(`TVprice`.`value`, '') AS `tv.price`, IFNULL(`TVstreet`.`value`, '') AS `tv.street`, IFNULL(`TVkavdrat_ot`.`value`, '') AS `tv.kavdrat_ot`, IFNULL(`TVokrug`.`value`, '') AS `tv.okrug`, IFNULL(`TVmetro`.`value`, '') AS `tv.metro`, IFNULL(`TVarea`.`value`, '') AS `tv.area`, IFNULL(`TVobject_id`.`value`, '') AS `tv.object_id` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVimg` ON `TVimg`.`contentid` = `modResource`.`id` AND `TVimg`.`tmplvarid` = 1 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_ot` ON `TVprice_ot`.`contentid` = `modResource`.`id` AND `TVprice_ot`.`tmplvarid` = 11 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_do` ON `TVprice_do`.`contentid` = `modResource`.`id` AND `TVprice_do`.`tmplvarid` = 12 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice` ON `TVprice`.`contentid` = `modResource`.`id` AND `TVprice`.`tmplvarid` = 13 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVstreet` ON `TVstreet`.`contentid` = `modResource`.`id` AND `TVstreet`.`tmplvarid` = 4 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVkavdrat_ot` ON `TVkavdrat_ot`.`contentid` = `modResource`.`id` AND `TVkavdrat_ot`.`tmplvarid` = 5 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVokrug` ON `TVokrug`.`contentid` = `modResource`.`id` AND `TVokrug`.`tmplvarid` = 8 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmetro` ON `TVmetro`.`contentid` = `modResource`.`id` AND `TVmetro`.`tmplvarid` = 9 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarea` ON `TVarea`.`contentid` = `modResource`.`id` AND `TVarea`.`tmplvarid` = 10 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVobject_id` ON `TVobject_id`.`contentid` = `modResource`.`id` AND `TVobject_id`.`tmplvarid` = 16 WHERE  ( `TVprice`.`value` IN '30000 , 4000' AND `modResource`.`parent` IN (1,38,39,17,19,21,9,18,20,23) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 AND `modResource`.`isfolder` = 0 )  ORDER BY modResource.publishedon DESC LIMIT 9 "</small>
0.0003741: Could not process query, error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''30000 , 4000' AND `modResource`.`parent` IN (1,38,39,17,19,21,9,18,20,23) AND `' at line 1
0.0056310: <b>Total time</b>
10 747 904: <b>Memory usage</b>
</pre>
Сергей Скат
03 сентября 2014, 17:35
0
все равно спасибо
Сергей Скат
03 сентября 2014, 16:21
0
и по хорошему при переключении таба хорошо бы полностью очистить выборку, только я пока не пойму как
Сергей Скат
03 сентября 2014, 16:15
0
Помнишь я пару недель назад писал про табы? чтобы можно было выводить разные группы фильтров? сперва я хотел сделать разные выводы сниппета на одно странице, но понял что не получится, потом я решил вывести все фильтры, а уже своим js раскидать их по разным группам, что бы по факту все они были на странице, но пользователь видел только фильтры относящиеся к этому табу, у меня все получилось, только беда в том что при переходе на другой таб учитывается выборка сделанная ранее, перезагружать страницу пока не хочется, а из выборки (наверное из урла ) убрать нужно только один фильтр, как то так
Сергей Скат
03 сентября 2014, 13:55
0
а потом снова включить?
Сергей Скат
03 сентября 2014, 13:55
0
а какойто конкретный фильтр можно исключить из выборки без гемороя?
Сергей Скат
01 сентября 2014, 01:45
0
если можешь написать, напиши, можешь сделать на modx сделай, в симплдрим достаточно готовых решений чтобы решить твою задачу, смотря сколько у тебя времени и какие цели =)
Сергей Скат
28 августа 2014, 23:46
0
вопрос все еще не решен, помогите пожалуйста, на тему картинок начал ковырять тут mpdf1.com/manual/index.php в документации библиотеки которую использует сниппет, в ней написано что по идее библиотека и так должна обрабатывать изображения, но у меня выводится красный крестик =(
Сергей Скат
28 августа 2014, 15:37
0
в инспекторе посмотри картинки вообще выводятся? потом в чанк вывода посмотри, у меня была похожая проблема, решил тем что убрад все лишние теги в чанке вывода у картинок, попробуй может и тебе поможет
Сергей Скат
27 августа 2014, 00:46
0
спасибо, но не могли бы вы объяснить не много подробнее, вот код сниппета
<?php
$basePath = $modx->getOption('base_path');
$corePath = $modx->getOption('core_path');
$id = $resource->get('id');
$tpl = $modx->getOption('pdfTpl', $scriptProperties, 'pdfTpl');
$css = $modx->getOption('cssTpl', $scriptProperties, 'cssTpl');
$createField = $modx->getOption('pdfTV', $scriptProperties, 'createPDF');
$processTVs = $modx->getOption('processTVs', $scriptProperties, null);
$siteurl = $modx->getOption('site_url');
$params = array();
$assetsPath = $modx->getOption('assets_path');

$createPDF = $resource->getTVValue($createField);
if($createPDF != '1') {
   @unlink($assetsPath.$id.'.pdf'); //remove file if it exists
   return false; //exit plugin
}

$params = $resource->toArray();

$tvs = $modx->getCollection('modTemplateVar');
foreach ($tvs as $tv) {
    $params[$tv->get('name')] = (empty($processTVs) ? $tv->getValue($id) : $tv->renderOutput($id));
    if($tv->get('name') == 'pdfTpl' && $tv->getValue($id) != '' ) {
        $tpl = $tv->getValue($id);
    }
}

$html = $modx->getChunk($tpl, $params);
$css = $modx->getChunk($css, $params);
unset($params);

require_once($corePath.'components/htmltopdf/mpdf.php');

$mpdf = new mPDF('utf-8', 'A4', '8', '', 10, 10, 7, 7, 10, 10);
$mpdf->charset_in = 'utf-8';
$stylesheet = $css;
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->list_indent_first_level = 0; 
$mpdf->WriteHTML($html, 2);
$mpdf->Output($assetsPath.'pdf/'.$id.'.pdf', 'F');
как и куда мне нужно добавить «процессирование»?
Сергей Скат
21 августа 2014, 19:17
+1
как то не подумал, хорошая идея, спасибо
Сергей Скат
21 августа 2014, 19:09
0
Предлагаешь так выбрать $('[value = " Авиамоторная"] ')?
Сергей Скат
21 августа 2014, 19:01
0
либо как то сгенерировать id на основе value?
Сергей Скат
21 августа 2014, 19:00
0
в общем такое дело, нужно дублировать станции метро, хочу чтобы они были в селекте, а так же хочу чтобы можно было открыть карту станции метро и на ней поклацать нужные станции, так как на одной странице нельзя сделать несолько вызовов mFilter2, а так же нельзя вывести один и тот же фильтр в разных местах и с разным шаблоном, решил сговнокодить, просто взять клик по чекбоксу на карте в станции метро и вызвать клик на фильтре который находится в форме поиска, типа того

$(document).ready(function(){

	$('#avaimotornaya').click(function(){
		$('.metro_0').click();
	});
все бы ничего но станции метро у меня генерируются автоматически с помощью геокодера яндекса, и я не могу знать какая и сколько станций добавится, так же заметил что все станции метро выстраиваются по алфавиту, порядок в списке меняется, и обратиться к какойто конкретной станции уже не получится потому что нажмешь на Алексеевскую а попадешь на Бабушкинскую
Сергей Скат
19 августа 2014, 22:45
0
про mSearch2 прекрасно знаю, пользуюсь, просто возник вопрос можно ли подобное организовать в бэкэнде?