Библиотека закрыта!
'; if (empty($_GET['id'])) { echo '';
if ($total > 10)
{
if ($offpg != 1)
{
echo "Страницы:
";
} else
{
echo "Страниц: $ba
";
}
if ($start != 0)
{
echo '<< ';
}
if ($offpg != 1)
{
navigate('index.php?id=' . $id . '', $total, 10, $start, $page);
} else
{
echo "[$page]";
}
if ($total > $start + 10)
{
echo ' >>';
}
echo "
' . htmlentities($tp1['name'], ENT_QUOTES, 'UTF-8') . '
'; $tx = $tp1['text']; # для постраничного вывода используется модифицированный код от hintoz # $strrpos = mb_strrpos($tx, " "); $pages = 1; $t_si = 0; if ($strrpos) { while ($t_si < $strrpos) { $string = mb_substr($tx, $t_si, $simvol); $t_ki = mb_strrpos($string, " "); $m_sim = $t_ki; $strings[$pages] = $string; $t_si = $t_ki + $t_si; if ($page == $pages) { $page_text = $strings[$pages]; } if ($strings[$pages] == "") { $t_si = $strrpos++; } else { $pages++; } } if ($page >= $pages) { $page = $pages - 1; $page_text = $strings[$page]; } $pages = $pages - 1; if ($page != $pages) { $prb = mb_strrpos($page_text, " "); $page_text = mb_substr($page_text, 0, $prb); } } else { $page_text = $tx; } // Текст статьи $page_text = htmlentities($page_text, ENT_QUOTES, 'UTF-8'); $page_text = str_replace("\r\n", "';
$next = $page + 1;
$prev = $page - 1;
if ($pages > 1)
{
if ($offpg != 1)
{
echo "Страницы:
";
} else
{
echo "Страниц: $pages
";
}
if ($page > 1)
{
print " << ";
}
if ($offpg != 1)
{
if ($page > 1)
{
print "1 ";
}
if ($prev > 2)
{
print " .. ";
}
$page2 = $pages - $page;
$pa = ceil($page / 2);
$paa = ceil($page / 3);
$pa2 = $page + floor($page2 / 2);
$paa2 = $page + floor($page2 / 3);
$paa3 = $page + (floor($page2 / 3) * 2);
if ($page > 13)
{
echo ' ' . $paa . ' ' . ($paa + 1) . ' .. ' . ($paa *
2) . ' ' . ($paa * 2 + 1) . ' .. ';
} elseif ($page > 7)
{
echo ' ' . $pa . ' ' . ($pa + 1) . ' .. ';
}
if ($prev > 1)
{
print "$prev ";
}
echo "$page ";
if ($next < $pages)
{
print "$next ";
}
if ($page2 > 12)
{
echo ' .. ' . $paa2 . ' ' . ($paa2 + 1) . ' .. ' . ($paa3) .
' ' . ($paa3 + 1) . ' ';
} elseif ($page2 > 6)
{
echo ' .. ' . $pa2 . ' ' . ($pa2 + 1) . ' ';
}
if ($next < ($pages - 1))
{
print " .. ";
}
if ($page < $pages)
{
print "$pages ";
}
} else
{
echo "[$page]";
}
if ($page < $pages)
{
print " >>";
}
echo "