Exemple #1
0
    $headers = readOverview($ns, $group, 1);
    $article_count = count($headers);
    if ($articles_per_page != 0) {
        if (!isset($first) || !isset($last)) {
            if ($startpage == "first") {
                $first = 1;
                $last = $articles_per_page;
            } else {
                $first = $article_count - ($article_count - 1) % $articles_per_page;
                $last = $article_count;
            }
        }
        echo '<p align="center">';
        showPageSelectMenu($group, count($headers), $first);
        echo '</p>';
    } else {
        $first = 0;
        $last = $article_count;
    }
    showHeaders($headers, $group, $first, $last);
    closeNNTPconnection($ns);
}
?>

<p align="right"><a href="#top"><?php 
echo $text_thread["button_top"];
?>
</a></p>

<?php 
include "tail.inc";
Exemple #2
0
function verschicken($subject, $from, $newsgroups, $ref, $body)
{
    global $server, $port, $send_poster_host, $organization, $text_error;
    global $file_footer;
    flush();
    $ns = OpenNNTPconnection($server, $port);
    if ($ns != false) {
        fputs($ns, "post\r\n");
        $weg = lieszeile($ns);
        fputs($ns, 'Subject: ' . quoted_printable_encode($subject) . "\r\n");
        fputs($ns, 'From: ' . $from . "\r\n");
        fputs($ns, 'Newsgroups: ' . $newsgroups . "\r\n");
        fputs($ns, "Mime-Version: 1.0\r\n");
        fputs($ns, "Content-Type: text/plain; charset=ISO-8859-15\r\n");
        fputs($ns, "Content-Transfer-Encoding: 8bit\r\n");
        fputs($ns, "User-Agent: NewsPortal 0.24pre6, http://florian-amrhein.de/newsportal/\r\n");
        if ($send_poster_host) {
            fputs($ns, 'X-HTTP-Posting-Host: ' . gethostbyaddr(getenv("REMOTE_ADDR")) . "\r\n");
        }
        if ($ref != false) {
            fputs($ns, 'References: ' . $ref . "\r\n");
        }
        if (isset($organization)) {
            fputs($ns, 'Organization: ' . quoted_printable_encode($organization) . "\r\n");
        }
        if (isset($file_footer) && $file_footer != "") {
            $footerfile = fopen($file_footer, "r");
            $body .= "\n" . fread($footerfile, filesize($file_footer));
            fclose($footerfile);
        }
        $body = str_replace("\n.\r", "\n..\r", $body);
        $body = str_replace("\r", '', $body);
        $b = split("\n", $body);
        $body = "";
        for ($i = 0; $i < count($b); $i++) {
            if (strpos(substr($b[$i], 0, strpos($b[$i], " ")), ">") != false | strcmp(substr($b[$i], 0, 1), ">") == 0) {
                $body .= textwrap(stripSlashes($b[$i]), 78, "\r\n") . "\r\n";
            } else {
                $body .= textwrap(stripSlashes($b[$i]), 74, "\r\n") . "\r\n";
            }
        }
        fputs($ns, "\r\n" . $body . "\r\n.\r\n");
        $message = lieszeile($ns);
        closeNNTPconnection($ns);
    } else {
        $message = $text_error["post_failed"];
    }
    return $message;
}