if(CModule::IncludeModule("iblock"))
{
$myrow = CIBlockSection::GetByID($id)->GetNext();
$count_str = 2000;
$count_page = ceil(strlen($myrow['DESCRIPTION'])/$count_str)-1;
echo "<table>";
if (strlen($myrow['DESCRIPTION']) > $count_str)
{
if(!$_GET['str'])
{
echo "
<tr><td>".substr($myrow['DESCRIPTION'], 0, $count_str)."...</td></tr>";
echo '<tr><td><a href="?id='.$id.'&str=1">Далее »</a></td></tr>';
}
else
{
echo "
продолжение
<tr><td>".substr($myrow['DESCRIPTION'], $count_str*$_GET['str'], $count_str)."</td></tr>";
echo '<tr><td align=center><a href="?id='.$id.'&str='.($_GET['str']-1).'">Назад</a>';
if ($_GET['str'] != $count_page)
echo ' | <a href="?id='.$id.'&str='.($_GET['str']+1).'">Далее</a></td></tr>';
}
}
else
{
echo "
<tr><td>$myrow[DESCRIPTION]</td></tr>";
}
echo "</table>";
}
|