Вход Регистрация
Файл: modules/diary/inc/functions.php
Строк: 16
<?php

/* Мод "Блоги"
 * Версия v0.0.1
 * Дата последнего редактирования 07.04.2015
 * Двиг DCMS Special
 * Модифицировал densnet
 * Автор неизвестен
 * Файл functions.php
 * Описание: необходимые функции блогов
 */

function text_cutter($text, $maxchar = 50) {
    
$maxwords = 10;
    
$sep = ' ';
    
$sep2 = '...';
    
$words = @split($sep, $text);
    
$char = iconv_strlen($text, 'utf-8');

    if (
count($words) > $maxwords) {
        
$text = join($sep, array_slice($words, 0, $maxwords));
    }
    if (
$char > $maxchar) {
        
$text = iconv_substr($text, 0, $maxchar, 'utf-8');
    }
    return 
$text;
}

function 
output_title($str) {
    return 
stripslashes(stripcslashes(htmlspecialchars($str)));
}
Онлайн: 2
Реклама