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
<?php | |
//... | |
private function getListBitmaskItems($value, $items){ | |
$pos = 0; | |
$_items = []; | |
foreach ($items as $key => $item) { |
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
<?php | |
define('DS', DIRECTORY_SEPARATOR); | |
define('PATH', dirname(__FILE__).DS); | |
define('DOC_ROOT', str_replace(DS, '/', realpath($_SERVER['DOCUMENT_ROOT']))); | |
$doc_root = DOC_ROOT.str_replace(DOC_ROOT, '', str_replace(DS, '/', dirname(PATH))); | |
$php_path = get_program_path('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
<?php | |
$url="http://neotext.ru/files/14/copyright_market/thumb/206397-1326458661.jpg"; | |
$file = '/download/test.dat'; | |
curl_download($url, $file); | |
/** | |
* Функция скачивания удаленного файла на сервер | |
* void curl_download(string $url, string $file) | |
* | |
* @param string url - путь к удаленному файлу |
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
{*На smarty*} | |
<table> | |
<thead> | |
<tr> | |
<th>Header</th> | |
</tr> | |
</thead> | |
<tbody> | |
{foreach from=$items item=item name=foo} |
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
<?php | |
$str = "http://s020.radikal.ru/i712/1301/36/46bac5e8ee92.jpg"; | |
//$str = "/images/photos/medium/0e172b5bd5348d34141788846ad80aae.jpg"; | |
if(preg_match('(http://.*?.(jpg|png|gif))', $str)){ | |
echo "true"; | |
} else { | |
echo "false"; | |
} | |
//поиск и замена |
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
function pushState(){ | |
//1 рабочий вариант | |
// var form = $('#products_filter'); | |
// var params = form.serialize(); | |
// var url = document.products_filter.action+'?'+params; | |
// if(url != window.location){ | |
// window.history.pushState(null, null, url); | |
// } | |
//2 рабочий вариант |
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
<?php | |
/******************************************************************************/ | |
// // | |
// InstantCMS v1.10.3 // | |
// http://www.instantcms.ru/ // | |
// // | |
// written by InstantCMS Team, 2007-2013 // | |
// produced by InstantSoft, (www.instantsoft.ru) // | |
// // | |
// LICENSED BY GNU/GPL v2 // |
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
<?php | |
ini_set('max_execution_time', 0); | |
//ini_set('memory_limit', '128M'); | |
$file = $_SERVER['DOCUMENT_ROOT'].'/import.csv'; | |
$csv_file = @fopen($file, 'r'); | |
if (!$csv_file) { $error = 'Ошибка открытия файла. Код: 003'; } |
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 $articles} | |
ВАРИАНТ 1 (с коррекцией) | |
<div class="well com_cont_view"> | |
<div class="row"> | |
{$cols = 6} | |
{$curcol = 1} | |
{$current = 0} | |
{$total = 0} | |
{$maxincol = ($items_count / $cols) - 3}{* 3 - для коррекции столбцов *} |
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
<?php | |
/* functions for cleaning: | |
replaceLinks(); | |
deleteClasses(); | |
deleteDataAttr(); | |
deleteOther(); | |
full_trim(); | |
*/ |
NewerOlder