Skip to content

Commit

Permalink
custom fix
Browse files Browse the repository at this point in the history
- Добавлена совместимость с {custom}
- Добавлен индекс к полю сортировки, это сильно упрощает выборку.
  • Loading branch information
pafnuty committed Jun 28, 2015
1 parent 3a4f73f commit 7d9e538
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions upload/sortindex_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@
<b>Заменить на:</b>
<textarea readonly>p.fixed, p.sorting</textarea>
</li>
<li>
<h3>Открыть: \engine\modules\functions.php</h3>
<b>Найти: </b>
<textarea readonly>$tpl->load_template( $custom_template . '.tpl' );</textarea>
<b>Ниже вставить:</b>

<textarea readonly>$sort_index = "";
if ($config['allow_sort_index']) {
$sort_index = ($config['news_msort_index']) ? "sorting ".$config['news_msort_index'].", " : "sorting ASC, ";
}</textarea>
<b>Найти:</b>
<textarea readonly>$fixed . $news_sort</textarea>
<b>Заменить на:</b>
<textarea readonly>$fixed . $sort_index . $news_sort</textarea>
</li>
<li>
<h3>Открыть: \engine\engine.php</h3>
<b>Найти:</b>
Expand Down Expand Up @@ -284,7 +299,7 @@ function bd_installer()
{

// Cоздание таблицы для хака
$query = "ALTER TABLE `".PREFIX."_post` ADD `sorting` int(10) NOT NULL DEFAULT '500'";
$query = "ALTER TABLE `".PREFIX."_post` ADD `sorting` int(10) NOT NULL DEFAULT '500', ADD INDEX (`sorting`);";
$dle_api->db->query($query);

// Вывод
Expand Down Expand Up @@ -332,4 +347,3 @@ function bd_installer()
}

?>

0 comments on commit 7d9e538

Please sign in to comment.