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
ini_set('error_reporting', E_ALL); | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); |
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
<? | |
$zip = new ZipArchive; | |
$zip->open('assets.zip'); | |
$zip->extractTo('./'); | |
$zip->close(); | |
echo "Ok!"; | |
?> |
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
<?=$_SERVER['DOCUMENT_ROOT']; |
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 | |
$row[2] = preg_replace("/(\n)/", "<br/>", $row[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 | |
/* Двумерный массив с пользователями (например, из БД) */ | |
$array = array(); | |
$array[5] = array("email" => "abc1@mail.ru", "date_reg" => 1272895531); | |
$array[10] = array("email" => "abc2@mail.ru", "date_reg" => 1274429353); | |
$array[3] = array("email" => "abc3@mail.ru", "date_reg" => 1274277050); | |
usort($array, "compare"); // Вызываем пользовательскую сортировку | |
/* Функция для нашей сортировки */ | |
function compare ($v1, $v2) { | |
/* Сравниваем значение по ключу date_reg */ |
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 $key - ключ, по которому будет выборка | |
* @var $array - исходный массив | |
* | |
* @return - Вернет уникальный массив | |
*/ | |
function getUniqueArray($key, $array){ | |
$arrayKeys = array(); // массив для хранения ключей | |
$resultArray = 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
User-agent: * | |
Disallow: / |
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 $comment = mb_convert_encoding($comment, 'utf-8', mb_detect_encoding($comment)); |
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
необходимо заменить в assets/snippets/ditto/classes/ditto.class.inc.php | |
содержимое for ($x = 1; $x <= $totalpages -2; $x++) {… } | |
строки 1127-1156 | |
for ($x = 0; $x <= $totalpages -1; $x++) { | |
$max_paginate = 5; | |
$max_previous = 2; | |
$cur_x = floor($start / $summarize); | |
$min_x = $cur_x - $max_previous; | |
if ($min_x < 0) { |
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
{{search-out}} - шаблон выдачи (вызывается в ресурсе, в который происходит передача параметра) | |
= | |
[!if? &is=`[+search_total+]:!empty` &then=`<div class="results-counter">Результаты поиска: <b>[+search_total+]</b></div>`!] | |
[!evoSearch? &id=`search` &worker=`Ditto` &tpl=`search-results` &extract_with_tv=`1` &show_stat=`1` &statTpl=`search-stat` &noResults=`<p class="noresult">Нет результатов для отображения...</p>` &paginate=`1` &display=`7` &rel=`1` !] | |
[!if? &is=`[+search_currentPage+]:!empty` &then=`<div class="paging"> | |
[+search_previous+] | |
[+search_next+] | |
[+search_pages+] | |
<span class="pager-results">Страницы: [+search_currentPage+] из [+search_totalPages+]</span> | |
</div>`!] |