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
<?php | |
/** | |
* SIMPLE EXAMPLE | |
*/ | |
$access = new vkAcess($vk_group_id, $vk_app_id, $vk_app_secret); | |
$access->setToken($vk_app_secret); | |
$vkPost = new vkPost($access); | |
$vkPost->setText("test"); | |
$vkPost->setDate(time() + 300); //publish in next 5 minuts. By default: now | |
/** |
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
<?php | |
//see: http://github.com/gettocat/vktoken | |
Class vktoken { | |
public static $_app_id; | |
public static $_app_secret; | |
public static $instance = null; | |
public static $scope = 'wall,offline,photos,docs,audio,video,groups'; | |
public $app_id; | |
public $app_secret; | |
public function __construct($vk_app, $vk_secret, $scope = '') { |
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
<article id="article" class="entry-post"> | |
<header class="entry-header"> | |
<h2 class="entry-title"> | |
<a href="/url.html"> | |
<span id="article_title">Title of article </span> | |
</a> | |
</h2> | |
<div class="meta-line clearfix"> | |
<div class="meta-author-category pull-left"> |
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
<article itemscope="" itemtype="http://schema.org/Article" class="entry-post"> | |
<header class="entry-header"> | |
<h2 class="entry-title"> | |
<a href="/url.html"> | |
<span itemprop="name headline">Title of article </span> | |
</a> | |
</h2> | |
<div class="meta-line clearfix"> |
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
<?php | |
function sanitize_output($buffer) { | |
$search = array( | |
'/\>[^\S ]+/s', // вырезаем после тегов все отступы, кроме пробелов | |
'/[^\S ]+\</s', // вырезаем перед тегами все отступы, кроме пробелов | |
'/(\s)+/s' // заменяем несколько пробелов одним | |
); |
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 loadCss(e) { | |
var t = document.createElement("link"); | |
t.type = "text/css", t.rel = "stylesheet", t.href = e, document.getElementsByTagName("head")[0].appendChild(t) | |
} | |
function loadJs(e) { | |
var t = document.createElement("script"); | |
t.src = e; | |
var n = document.getElementsByTagName("head")[0]; | |
(n || document.body).appendChild(t) | |
} |
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
var itm1 = new items("#tags", { | |
scope: "Выбранные теги: ",//текст футера списка. | |
item_selector: '.item',//селектор элемента списка | |
active_item_class: 'item-selected', //Класс, добавляемый к выбранному элементу | |
header_selector: ".item-header",//селектор шапки списка | |
footer_selector: ".item-footer",//селектор футера списка | |
}); |
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
var itm11 = new items("#tags");//#tag - селектор, внутри которого будет производиться поиск элементов списка, по умолчанию это - document. | |
var itms2 = new items("#categoryes"); |
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
itms.onHasSelected(function() { | |
//Эта функция будет вызвана, если не было выбрано ни одного элемента, | |
//а затем выбран 1 или более | |
}); | |
itms.onHasNoSelected(function() { | |
//Эта функция будет вызвана, если был выбран 1 или более элементов, | |
//а затем стало выбрано 0 элементов | |
}); |
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
<?php | |
/** | |
* Подсвечивает результат var_dump | |
* @param mixed $var | |
* @return string dumpstr | |
*/ | |
function pd($var) { | |
ob_start(); | |
var_dump($var); | |
$v = ob_get_clean(); |
NewerOlder