Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
function html_substr($posttext, $minimum_length = 170, $length_offset = 0, $cut_words = FALSE, $dots = TRUE)
{
$tag_counter = 0;
$quotes_on = true;
if (mb_detect_encoding($posttext) != 'UTF-8')
{
$posttext = mb_convert_encoding($posttext, 'UTF-8', 'auto');
}
if (mb_strlen($posttext, 'UTF-8') > $minimum_length) {
$c = 0;
for ($i = 0; $i < mb_strlen($posttext, 'UTF-8'); $i++)
{
$current_char = mb_substr($posttext,$i,1, 'UTF-8');
if ($i < $this->_utf8_strlen($posttext) - 1)
{
$next_char = mb_substr($posttext,$i + 1,1, 'UTF-8');
}
else
{
$next_char = "";
}
if (!$quotes_on)
{
if ($current_char == '<') {
if ($next_char == '/') {
$tag_counter += 1;
}
else {
$tag_counter += 3;
}
}
if ($current_char == '/' && $tag_counter <> 0) $tag_counter -= 2;
if ($current_char == '>') $tag_counter -= 1;
if ($current_char == '"') $quotes_on = TRUE;
}
else
{
if ($current_char == '"') $quotes_on = FALSE;
}
if($tag_counter == 2 || $tag_counter == 0)
{
$c++;
}
if ($c > $minimum_length - $length_offset && $tag_counter == 0 && ($next_char == ' ' || $cut_words == TRUE)) {
$posttext = mb_substr($posttext,0,$i + 1, 'UTF-8');
if($dots)
{
$posttext .= ' ...';
}
return $posttext;
}
}
}
return $posttext;
}
function _utf8_strlen($str, $encoding = 'UTF-8')
{
if (mb_detect_encoding($str) != 'UTF-8')
{
$str = mb_convert_encoding($str, 'UTF-8', 'auto');
}
return mb_strlen(stripslashes($str), $encoding);
}
html_substr($row['content'], 700)
$news = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT ".($limit*$page).",$limit") or die (mysql_error());
while($rnews = mysql_fetch_array($news)) {
echo "<div id='news_contact'>
<img width='225' height='175' src='img/news_images/".$rnews['news_img']."' style='float: left; margin-right: 9px;' />
<h3>".$rnews['news_title']."</h3>
<p>";
//Тука трябва да се изважда информация
echo "</p>
</div>";
$news = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT ".($limit*$page).",$limit") or die (mysql_error());
while($rnews = mysql_fetch_array($news)) {
$kratko2 = $rnews['news_kratko_ops'];
$kratko = substr($kratko2,0 , 775);
echo "<div id='news_contact'>
<img width='225' height='175' src='img/news_images/".$rnews['news_img']."' style='float: left; margin-right: 9px;' />
<h3>".$rnews['news_title']."</h3>
<p> $kratko </p>
</div>";
$news = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT ".($limit*$page).",$limit") or die (mysql_error());
while($rnews = mysql_fetch_array($news)) {
$kratko2 = $rnews['news_kratko_ops'];
$kratko = mb_substr($kratko2,0 , 775, 'utf-8');
echo "<div id='news_contact'>
<img width='225' height='175' src='img/news_images/".$rnews['news_img']."' style='float: left; margin-right: 9px;' />
<h3>".$rnews['news_title']."</h3>
<p> $kratko </p>
</div>";