Skip to content

Instantly share code, notes, and snippets.

// GET VK ACCESS_TOKEN
// http://zenno.pro/kak-poluchit-access-token-prilozheniya-vk-com/
https://oauth.vk.com/authorize?client_id=CLIENT_ID&scope=offline,photos,audio,video,docs,notes,pages,status,offers,questions,wall,groups,messages,email,notifications,stats,ads,offline,docs,pages,stats,notifications&response_type=token&redirect_uri=REDIRECT_URI
@qwersk
qwersk / gist:0484d7d84576ad2c292c878a07a56ccd
Last active March 16, 2017 09:44
VK VIDEO GET METHOD
// GET VK VIDEO
// https://vk.com/dev/video.get
// VIDEO_ID EX: -97860303_456239329
https://api.vk.com/method/video.get?videos=VIDEO_ID&access_token=ACCESS_TOKEN
По умолчанию компонент "Цепочка навигации" обходит все разделы, ищет в них файлы .section.php и строит из них цепочку.
https://dev.1c-bitrix.ru/support/forum/forum6/topic14880/
/* Sidebar Categories Widget */
// create category list widget
class jpen_Category_List_Widget extends WP_Widget {
// php classnames and widget name/description added
function __construct() {
$widget_options = array(
'classname' => 'jpen_category_list_widget',
'description' => 'Add latest videos to sidebar'
);
parent::__construct(
Правильный AJAX в 1С-Битрикс
https://verstaem.com/ajax/ajax-1c-bitrix/
Ajax-подгрузка контента при прокрутке страницы
http://codeharmony.ru/materials/136
Слайдер с горизонтальной прокруткой колесом мыши
http://darsa.in/sly/
background-image: linear-gradient(to right, #333 10%, rgba(255, 255, 255, 0) 0%);
background-position: bottom;
background-size: 10px 1px;
background-repeat: repeat-x;
@qwersk
qwersk / gist:15378c59c10aba05b464c220eb8e2777
Last active March 21, 2017 09:59
GET ELEMENTS FROM MULTIPLE IBLOCKS BITRIX
if(CModule::IncludeModule("iblock"))
{
// выберем 3 элемента типа "cases" из нескольких информационных блоков (16, 17)
$items = GetIBlockElementListEx("cases", array(16, 17), Array(),
Array("DATE_ACTIVE_FROM"=>"DESC", "SORT"=>"ASC", "NAME" => "ASC"), 3);
// постраничная навигация
$items->NavPrint("Новости компании");
// цикл по всем новостям
while($arItem = $items->GetNext())
@qwersk
qwersk / gist:c452b8862e5b4ae2a128373f96bf4bc9
Created March 22, 2017 02:47
GET IMAGE ARRAY BY IMAGE ID BITRIX #bitrix
$image = CFile::GetFileArray($arItem["DETAIL_PICTURE"]);
@qwersk
qwersk / gist:e081aafaa3561335febf1b28ea0a65fc
Created March 22, 2017 05:21
RESIZE IMAGE WITH CROP BITRIX
$width_height_arr = array('width' => 465, 'height' => 510);
$file = CFile::ResizeImageGet($arItem["DETAIL_PICTURE"], $width_height_arr, BX_RESIZE_IMAGE_EXACT, true);
@qwersk
qwersk / gist:e99550dd46c769b47f729373ffceb273
Last active March 22, 2017 08:10
CALLBACK FUNCTION BITRIX
function ShowBreadcrumbs(){
global $APPLICATION;
return $APPLICATION->GetProperty("show_breadcrumbs");
}
$APPLICATION->AddBufferContent("ShowBreadcrumbs");