This file contains 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
if (!function_exists('BITGetDeclNum')) { | |
/** | |
* Функция возвращает окончание слова, в зависимости от примененного к ней числа | |
* Например: 5 товаров, 1 товар, 3 товара | |
* | |
* @param int $value - число, к которому необходимо применить склонение | |
* @param array $status - массив возможных окончаний | |
* @return mixed | |
*/ | |
function BITGetDeclNum($value = 1, $status = array('','а','ов')) { |
This file contains 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
<div class="iframe-responsive"> | |
<img src="/upload/images/640x360.gif" alt=""> | |
<iframe width="640" height="360" src="https://www.youtube.com/embed/CWaZrgc-g9A?rel=0" frameborder="0" allowfullscreen></iframe> | |
</div> | |
.iframe-responsive {position: relative;} | |
.iframe-responsive img {display: block; width: 100%; height: auto;} | |
.iframe-responsive iframe {position: absolute; top:0; left: 0; width: 100%; height: 100%; display: block; vertical-align: top;} |
This file contains 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 leftDaysHoursMinutes = function(){ | |
var today = new Date(); | |
var nextEVENT = new Date(2015, 10, 11, 0, 0, 0, 0); // месяц начинается с нуля | |
var msDelta = nextEVENT.getTime() - today.getTime(); | |
if (msDelta > 0) { | |
// дней | |
var msPerDay = 24 * 60 * 60 * 1000; | |
var daysLeft = Math.floor(msDelta / msPerDay); | |
var sDaysLeft = String(daysLeft); | |
var sDaysText = "дней"; |
This file contains 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
// result_modifier.php | |
$search = array(); | |
$search["text"] = "/class=\"inputtext\"/"; | |
$search["email"] = "/class=\"inputtext\"/"; | |
$search["url"] = "/class=\"inputtext\"/"; | |
$search["date"] = "/\<input /"; | |
$search["textarea"] = "/class=\"inputtextarea\"/"; | |
$search["dropdown"] = "/\<select /"; | |
$search["radio"] = "/\<\/label\>\<label for=\"(\d+)\"\>/"; |
This file contains 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
error_reporting(E_ALL); | |
$links = array("bitrix", "local", "upload"); | |
foreach ($links as $key => $value) { | |
$target = str_replace("current_domain", "target_domain", $_SERVER["DOCUMENT_ROOT"])."/".$value; | |
echo $target; | |
echo "<br>"; | |
if (is_link($value) && is_file($value)) { |
This file contains 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
<? | |
// Добавление водяного знака на множественное свойство | |
AddEventHandler("iblock", "OnBeforeIBlockElementAdd", array("SrWatermark", "OnBeforeIBlockElementAdd")); | |
AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", array("SrWatermark", "OnBeforeIBlockElementUpdate")); | |
class SrWatermark | |
{ | |
function OnBeforeIBlockElementAdd (&$arFields) |
This file contains 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
$geo = json_decode(file_get_contents('http://api.sypexgeo.net/json/'.$_SERVER["REMOTE_ADDR"])); |
This file contains 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
defaults delete ~/Library/Preferences/com.teamviewer.teamviewer9.plist | |
defaults delete ~/Library/Preferences/com.teamviewer.teamviewer9.Machine.plist | |
sudo defaults delete /Library/Preferences/com.teamviewer.teamviewer9.plist | |
rm -f ~/Library/Preferences/com.teamviewer.teamviewer9.plist | |
rm -f ~/Library/Preferences/com.teamviewer.teamviewer9.Machine.plist | |
sudo rm -f /Library/Preferences/com.teamviewer.teamviewer9.plist |
This file contains 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
// create new file | |
/local/templates/TEMPLATE_NAME/components/bitrix/news/news_list/bitrix/news.detail/.default/component_epilog.php | |
<? | |
global $APPLICATION; | |
$APPLICATION->AddChainItem($arResult["NAME"]); | |
?> |
This file contains 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
// прокрутка на все якоря (#) на странице | |
$('a[href^="#"]').click(function(event){ | |
event.preventDefault(); | |
var h = $(this).attr('href'); | |
var to = $('a[name=' + h.substr(1) + ']'); | |
$('html, body').stop().animate({ | |
'scrollTop': to.offset().top | |
}, 250); | |
}); |