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
/** | |
* берет путь до файла (вложенность директорий) | |
* @param integer $id идентификатор файла | |
* @return string путь до файла | |
*/ | |
function getDir($id) | |
{ | |
return floor($id / 10000).DS.floor($id % 10000 / 100).DS; | |
} |
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
<? | |
/** | |
* | |
* Скрипт ищет файлы, сохраненные с BOM. | |
* | |
* Использование: | |
* 1. залить на сервер в корневую директорию сайта | |
* 2. в адресной строке браузера набрать http://ваш.сайт/bom.php | |
* |
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
/* CSS */ | |
a[href*=youtube] {display: block; position: relative; width: 260px; height: 195px;} | |
a[href*=youtube] img {vertical-align: top; width: 260px; height: 195px;} | |
a[href*=youtube] span {display: block; position: absolute; left: 0; top: 0; background: url('images/play.png') no-repeat center center; width: 260px; height: 195px;} | |
a[href*=youtube]:hover span {opacity: 0.75;} | |
/* JS */ | |
// ссылки на видео youtube | |
$('a[href*=youtube]').each(function(){ |
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); | |
}); |
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
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
$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
<? | |
// Добавление водяного знака на множественное свойство | |
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
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
// 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+)\"\>/"; |
OlderNewer