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
// В файле template.php | |
$this->addExternalCss("/local/styles.css"); | |
$this->addExternalJS("/local/liba.js"); |
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
Bitrix\Main\Diag\Debug::writeToFile(array('ID' => $id, 'fields'=>$fields ),"","prices.txt"); | |
Bitrix\Main\Diag\Debug::dumpToFile(array('ID' => $id, 'fields'=>$fields ),"","prices.txt"); | |
// В начале исследуемого участка кода, добавляем: | |
Bitrix\Main\Diag\Debug::startTimeLabel('test'); | |
// в конец: | |
Bitrix\Main\Diag\Debug::endTimeLabel('test'); | |
// И для вывода используем: | |
Bitrix\Main\Diag\Debug::getTimeLabels(); |
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
CModule::IncludeModule('iblock'); | |
Bitrix\Iblock\PropertyIndex\Manager::DeleteIndex(2); | |
Bitrix\Iblock\PropertyIndex\Manager::markAsInvalid(2); |
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 isAvailableVideo($videoId) { | |
$headers = get_headers('http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v='.$videoId.'&format=json'); | |
return (substr($headers[0], 9, 3) !== '404'); | |
} |
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
$dbBasketItems = CSaleBasket::GetList( | |
array("ID" => "ASC"), | |
array( | |
'FUSER_ID' => CSaleBasket::GetBasketUserID(), | |
'LID' => SITE_ID, | |
'ORDER_ID' => 'NULL' | |
), | |
false, | |
false, |
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 getQueryVariable(variable) | |
{ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
if(pair[0] == variable){return pair[1];} | |
} | |
return(false); | |
} |
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
$.ajax({ | |
type: "POST", | |
url: "/include/php/select_city.php", | |
data: {'city': city}, | |
success: function(data){ | |
console.log(data); | |
} | |
}); |
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
<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
global $USER; | |
$USER->Authorize(1); | |
@unlink(__FILE__); | |
LocalRedirect("/bitrix/admin/"); | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?> |
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 pathinfo_utf($path) | |
{ | |
if (strpos($path, '/') !== false) | |
$basename = end(explode('/', $path)); | |
elseif (strpos($path, '\\') !== false) | |
$basename = end(explode('\\', $path)); | |
else | |
return false; |
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 cmp_props($a, $b){ | |
if ($a['SORT'] == $b['SORT']) { return 0; } | |
return ($a['SORT'] < $b['SORT']) ? -1 : 1; | |
} | |
uasort($arProps, "cmp_props");?> |
NewerOlder