Пример #1
0
arsort($fileArr);
$numberOfFiles = sizeOf($fileArr);
foreach ($fileArr as $thisName => $thisTime) {
    $thisTime = date("F j, Y, g:i a", $thisTime);
    if ('dat' == getftype($thisName) && 'main.dat' !== basename($thisName)) {
        $data = file_get_contents($kanfile . '/' . $thisName);
        $filecomments = $localpath . $linkinfo . '/' . $plink . '.dat.comment';
        @$dumbcount++;
        $class = 'cline' . $dumbcount % 2;
        $text = articlesparam('title', $data);
        $plink = menulink($thisName);
        if ($cat == '') {
            $linkinfo = '';
        } else {
            if ($subcat == '') {
                $linkinfo = '/' . $cat;
            } else {
                $linkinfo = '/' . $cat . '/' . $subcat;
            }
        }
        $filecomments = ARTICLES . $linkinfo . '/' . $plink . '.dat.comment';
        $contentcenter .= '<tr class="' . $class . '"><td class="line3">' . $dumbcount . '</td><td  class="line3" width="40%">' . $text . '</td>';
        $contentcenter .= '<td class="line3">' . $linkinfo . '/' . $plink . '.html</td>';
        $contentcenter .= '<td class="line3"><a title="Редактровать" href="edit.php' . $editpage . $plink . '"><img alt="Редактровать" src="images/edit.png"></a></td>';
        $contentcenter .= '<td class="line3"><a title="Удалить" href="delete.php' . $editpage . $plink . '"><img alt="Удалить" src="images/delete.png"></a></td>';
        $contentcenter .= '<td class="line3">' . getcountcomments(0, $filecomments) . '</td>';
        $contentcenter .= '<td class="line3"><a title="Комментарии" href="../admin/comments.php' . $editpage . $plink . '"><img src="images/info.png"></a></td></tr>';
    }
}
$contentcenter .= '</tbody></table>';
include $localpath . 'admin/admintemplate.php';
Пример #2
0
        require_once CODE . 'bbParser.php';
        $bbcode = new bbParser($disableURL);
        $msg = $bbcode->getHtml($msg);
        addcomments((int) $idmess, $commentsfilename, $msg, $yourname, $email);
        $msg = '';
        @setcookie('flood_news', $newsflood, time() + $newsflood);
    }
}
if (empty($yourname)) {
    $yourname = $_SESSION['name'];
}
if (file_exists($commentsfilename)) {
    $commentpage = isset($_GET['commentpage']) ? (int) $_GET['commentpage'] : 0;
    $arrcomments = getcomments($commentsid, $commentsfilename, $moder_comments);
    $arrcomments = array_reverse($arrcomments);
    $countcomments = getcountcomments($commentsid, $commentsfilename, $moder_comments);
    echo '<br /><br /><div class="comment_head"><a name="comment_begin"></a><h3>' . __('Комментарии') . ':</h3></div><hr>';
    if (count($arrcomments) == 0) {
        echo '<div class="comment"><br/>' . __('Нет комментариев') . '.<br/></div>';
    } else {
        if ($commentpage * $commentsperpage_comments > count($arrcomments)) {
            $commentpage = 0;
        }
        $i = $commentpage * $commentsperpage_comments;
        if ($commentpage == 0) {
            $j = min(count($arrcomments), $commentsperpage_comments);
        } else {
            $j = min(count($arrcomments), $commentpage * $commentsperpage_comments + $commentsperpage_comments);
        }
        for ($i; $i < $j; $i++) {
            $currentcomment = $arrcomments[$i];
Пример #3
0
                            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;
                }
            }
        }
    }
}
Пример #4
0
            } else {
                echo '<a href="' . cc_link($news_Glink . 'page-' . $i . '.html') . '">' . $i . '</a>&nbsp;';
            }
        }
        echo '</div><div id="allcount-news">' . __('Всего&nbsp;новостей') . ':&nbsp;<b>' . $countallnews . '</b></div>';
    } else {
        if ($countallnews > $viewnews - 1) {
            $new = unserialize($news[$viewnews - 1]);
            inc_newsread_count($new['id']);
            $sitetitle .= ' - ' . $new['head'];
            $metadescription .= ',' . $new['description'];
            $metakeywords .= ',' . $new['keywords'];
            $countcomments = getcountcomments($new['id'], $commentsdbfilename, $newsmoderator);
            echo '<div class="title"><h2>' . $new['head'] . '</h2></div>
				<div class="entry"><p>' . $new['mess'] . '<br />' . $new['extra'] . '</p></div>
				<span class="news-date-time">' . $new['pubdate'] . '</span> | ' . $new['aname'] . ' | ' . __('Просмотров') . ': ' . get_newsread_count($new['id']) . ' | ' . __('Комментариев') . ': ' . getcountcomments($new['id'], $commentsdbfilename, $newsmoderator);
            //Для модуля новости
            $enablecomment = (int) $new['comments'];
            $commentsid = $new['id'];
            $commentsfilename = $commentsdbfilename;
        } else {
            echo '<ul class="error_message"><li>' . __('Записей нет!') . '</li></ul>';
        }
        echo '<br />' . $back;
        if (!empty($error)) {
            echo '<p class="error_header">' . __('Во время добавления записи произошли следующие ошибки') . ':</p>
        	<ul class="error_message">' . $error . '</ul>';
        }
    }
} else {
    echo '<center><font color="red" size="2">' . __('Записей нет!') . '</font></center>';
Пример #5
0
         }
         echo '<div class="title"><h2><a href="' . cc_link($fullcatpage . '/' . $aname . '.html') . '">' . $hs_text . '</a></h2></div>';
         if ($sonlytitle !== "1") {
             if ($saftertitle !== 0) {
                 $s_text = articlesparam('content', $data);
                 $pos = min(strlen($s_text), $saftertitle);
                 $pos = strpos($s_text, ' ', $pos);
                 if ($pos) {
                     $s_text = substr($s_text, 0, $pos);
                 }
                 $s_text .= '....';
                 $s_text = close_dangling_tags($s_text);
                 echo '<div class="entry">' . $s_text . '</div><br />';
             }
             $commentsfilename = ARTICLES . $fullcatpage . '/' . $aname . '.dat.comment';
             echo '<p class="links">' . $pubdata_text . '<a href="' . cc_link($fullcatpage . '/' . $aname . '.html#comment_begin') . '">' . __('Комментарии') . ': ' . getcountcomments(0, $commentsfilename, $moder_comments) . '</a> | ';
             echo '<a href="' . cc_link($fullcatpage . '/' . $aname . '.html') . '" class="comments">' . __('Читать полностью') . '</a></p><br />';
         }
     }
 }
 if ($countallstati > 0) {
     echo '<div id="navigation"><b>' . __('Страницы') . ':</b>&nbsp;';
     $sperpage = empty($sperpage) ? 20 : $sperpage;
     $all = ceil($countallstati / $sperpage);
     for ($i = 1; $i <= $all; $i++) {
         if ($_REQUEST['spage'] == $i) {
             echo '&laquo;<b>' . $i . '</b>&raquo;&nbsp;';
         } else {
             echo '<a href="' . cc_link($fullcatpage . '/spage-' . $i . '.html') . '">' . $i . '</a>&nbsp;';
         }
     }
Пример #6
0
            $startnews = $new['mess'];
            $adminemail = $new['admmail'];
            $adminname = $new['aname'];
            $date = $new['pubdate'];
            $time = $new['pubtime'];
            $description = $new['description'];
            $keywords = $new['keywords'];
            $tags = $new['tags'];
            $idmess = $new['id'];
            $p = $j + 1;
            $contentcenter .= '<tr class="' . $class . '">
			    <td class="line3" width="60">' . $date . '</td>
			    <td  class="line3" width="60%">' . $head . '</td>
			    <td class="line3" colspan="1" width="10%"><a title="Редактировать" href="../admin/news.php?edit=' . $p . '"><img src="images/edit.png"></a></td>
			    <td class="line3" colspan="1" width="10%"><a title="Удалить" href="../admin/news.php?what=' . $p . '"><img src="images/delete.png"></a></td>
			    <td  class="line3" colspan="1" width="6%">' . getcountcomments($idmess, $commentFile) . '</td>
			    <td class="line3" colspan="1" width="4%"><a title="Комментарии" href="../admin/news.php?newsid=' . $idmess . '"><img src="images/info.png"></a></td>
			</tr>';
        }
        $contentcenter .= '</tbody>';
    }
} else {
    $contentcenter .= '<h3>Список опубликованных новостей</h3><br /><br /><div class="message_warn">Новостей нет!</div>';
}
$contentcenter .= '</table>';
$contentcenter .= '<br /><br /> Страницы:';
$all = ceil($countallnews / $newsperpage);
for ($i = 1; $i <= $all; $i++) {
    if ($_REQUEST['newspage'] == $i) {
        $contentcenter .= '&laquo;<b>' . $i . '</b>&raquo;&nbsp;';
    } else {