Exemple #1
0
 function getChunkedAnnotation()
 {
     if (!$this->loaded) {
         $this->load();
     }
     return array('short' => $short = close_dangling_tags(trim(_substr($this->data['description'], 400))), 'html' => $this->data['description']);
 }
Exemple #2
0
 function processBio($fullHtml)
 {
     $body = '';
     $short = '';
     $body = strip_tags($fullHtml, '<p><strong><i><em><b>');
     $body = str_replace('<strong>', '<b>', $body);
     $body = str_replace('</strong>', '</b>', $body);
     $body = str_replace('<i>', '<em>', $body);
     $body = str_replace('</i>', '</em>', $body);
     $short = close_dangling_tags(trim(_substr($body, 900)));
     return array($body, $short);
 }
Exemple #3
0
include_once CONF . 'newsconf.php';
$news_Glink = '/news' . ($news_cat == '1' ? '/' : '-');
$news_Gpage = '/news' . ($news_cat == '1' ? '/' : '.html');
$lastnew = "";
$data = array_reverse(file($newsdbfilename));
$allnews = count($data);
if ($allnews >= 1) {
    for ($i = 1; $i <= min($newsonmainpage, $allnews); $i++) {
        //$datas=unserialize(array_shift($data));
        $datas = unserialize($data[$i - 1]);
        $head = $datas['head'];
        $head = str_replace("&quot;", '"', $datas['head']);
        $mess = strip_tags($datas['mess']);
        $pubdate = $datas['pubdate'];
        $p = $allnews - $i + 1;
        if (fstrlen($head) > $lengthhead) {
            $head = fsubstr($head, 0, $lengthhead);
        }
        if (fstrlen($mess) > $lengthnews) {
            $mess = fsubstr($mess, 0, $lengthnews);
        }
        $head = close_dangling_tags($head);
        $mess = close_dangling_tags($mess);
        $mess .= '&nbsp;&nbsp;<a href="' . cc_link($news_Glink . $p . '.html') . '" class="more">...' . __('читать далее') . '</a>';
        $lastnew .= '<li><p class="title"><span class="news-date-time">' . $pubdate . '</span>, ' . $head . '</p><div class="entry">' . $mess . '</div></li>';
    }
    $lastnew .= '<li id="nobackground"><div class="links"><a href="' . cc_link($news_Gpage) . '" class="more">' . __('все новости') . '</a></div></li>';
    echo $lastnew;
} else {
    echo '<li><p class="title">' . __('Записей нет!') . '</p></li>';
}
                            echo '<div class="title"><h2><a href="' . cc_link($news_Glink . $newnum . '.html') . '">' . $head . '</a></h2></div><div class="entry">' . $startnews . '</div><br />';
                            echo '<p class="links">' . $pubdata_text . '<a href="' . cc_link($news_Glink . $newnum . '.html#comment_begin') . '"> | ' . __('Комментарии') . ': ' . getcountcomments($new['id'], $commentsdbfilename, $moder_comments) . '</a> | <a href="' . cc_link($news_Glink . $newnum . '.html') . '" class="comments">' . __('Читать полностью') . '</a></p><br /><br />';
                        }
                    } elseif (file_exists(ARTICLES . $data[2] . '.dat')) {
                        $artdata = file_get_contents(ARTICLES . $data[2] . '.dat');
                        $hs_text = articlesparam('title', $artdata);
                        $s_text = articlesparam('content', $artdata);
                        $pubdata_text = articlesparam('pubdate', $artdata);
                        if (!empty($pubdata_text)) {
                            $pubdata_text = date('d.m.Y', $pubdata_text) . ' | ';
                        }
                        $pos = strpos($s_text, ' ', min(strlen($s_text), $saftertitle));
                        if ($pos) {
                            $s_text = substr($s_text, 0, $pos);
                        }
                        $s_text .= '....';
                        $s_text = close_dangling_tags($s_text);
                        if (substr($data[2], -4) == 'main') {
                            $aname = fsubstr($data[2], 0, -4);
                        } else {
                            $aname = $data[2] . '.html';
                        }
                        echo '<div class="title"><h2>' . art_catalog($data[2], '->') . '<a href="' . cc_link($aname) . '" name="' . str_replace('/', '--', $aname) . '">' . $hs_text . '</a></h2></div><div class="entry">' . $s_text . '</div><br />';
                        echo '<p class="links">' . $pubdata_text . '<a href="' . cc_link('/' . $aname . '#comment_begin') . '">' . __('Комментарии') . ': ' . getcountcomments(0, ARTICLES . $data[2] . '.dat.comment', $moder_comments) . '</a> | <a href="' . cc_link('/' . $aname) . '" class="comments">' . __('Читать полностью') . '</a></p><br /><br />';
                    }
                    $arrclouds[$data[0]] = $arrclouds[$data[0]] + 1;
                }
            }
        }
    }
}
Exemple #5
0
 private function setShortBody($body)
 {
     $this->data['short'] = close_dangling_tags(trim(_substr($body, 900)));
 }
Exemple #6
0
                        } else {
                            // not our post
                            continue;
                        }
                    }
                }
            }
            $pubtime = $data['update_time'];
            $y = date('Y', $pubtime);
            $m = date('m', $pubtime);
            $tblname = 'posts_data__' . $y . '_' . $m;
            if ($found) {
                $fulltext = preg_replace('/\\<script(.*)\\/script\\>/isU', '', $fulltext);
                $fulltext = preg_replace('/\\<form(.*)\\/form>/isU', '', $fulltext);
                $fulltext = preg_replace('/\\<iframe(.*)\\/iframe>/isU', '', $fulltext);
                $short = close_dangling_tags(_substr(prepare_review($fulltext, ''), 211));
                $query = 'INSERT INTO `' . $tblname . '` SET
				`id`=' . $data['id'] . ',
				`id_author`=' . $data['id_author'] . ',
				`text`=' . Database::escape($fulltext) . ',
				`short`=' . Database::escape($short) . ',
				`has_content`=1
				ON DUPLICATE KEY UPDATE
				`has_content`=1,
				`short`=' . Database::escape($short) . ',
				`text`=' . Database::escape($fulltext);
                Database::query($query);
                Database::query('UPDATE `posts` SET `short`=' . Database::escape($short) . ', `has_content`=1 WHERE `id`=' . $data['id'] . ' AND `id_author`=' . $data['id_author'] . '');
            } else {
                Database::query('UPDATE `posts` SET `has_content`=2 WHERE `id`=' . $data['id'] . ' AND `id_author`=' . $data['id_author'] . '');
            }