From 90962c86ce839a37cbeeec104a73832692591f39 Mon Sep 17 00:00:00 2001 From: x99bachelart Date: Wed, 3 Sep 2003 17:31:44 +0000 Subject: [PATCH] web pages --- article.php | 133 +++++++++++++++++++++++++++++++++++++++++++ disconnect.php | 25 ++++++++ index.php | 96 +++++++++++++++++++++++++++++++ post.php | 149 ++++++++++++++++++++++++++++++++++++++++++++++++ thread.php | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ xface.php | 8 +++ 6 files changed, 588 insertions(+) create mode 100644 article.php create mode 100644 disconnect.php create mode 100644 index.php create mode 100644 post.php create mode 100644 thread.php create mode 100644 xface.php diff --git a/article.php b/article.php new file mode 100644 index 0000000..0df9eb1 --- /dev/null +++ b/article.php @@ -0,0 +1,133 @@ +\n\t".$locale['error']['connect']."\n

"; + require("include/footer.inc.php"); + exit; +} + +if ($news['user']!="anonymous") { + $result = $mynntp->authinfo($news["user"],$news["pass"]); + if (!$result) { + echo "

\n\tYou have provided bad credentials to " + ."the server. Good bye !\n

"; + require("include/footer.inc.php"); + exit; + } +} +$spool = new spool($mynntp,$group,$profile['display'],$profile['lastnews']); +if (!$spool) { + echo "

\n\tError while accessing group.\n

"; + require("include/footer.inc.php"); + exit; +} +$mynntp->group($group); + +$post = new post($mynntp,$_REQUEST['id']); +if (!$post) { + if ($mynntp->lasterrorcode == "423") { + $spool->delid($_REQUEST['id']); + } + echo "

\n\tError while reading message.\n

"; + require("include/footer.inc.php"); + exit; +} + +$ndx = $spool->getndx($_REQUEST['id']); + +?> +
+ +
+ +headers))) { +?> +

+ +

+ + + + +
+

+ + + + + + + $nick) { + if (isset($post->headers->$nick)) + echo "" + ."\n"; +} +?> + + + + + + + + + + + + +
+ +
$real".formatdisplayheader($nick,$post->headers->$nick,$spool) + ."
+ +
+
body); ?>
+
+ +
+ +disp($ndx-$news['threadtop'],$ndx+$news['threadbottom'],$ndx); +?> +
+
+ diff --git a/disconnect.php b/disconnect.php new file mode 100644 index 0000000..516c951 --- /dev/null +++ b/disconnect.php @@ -0,0 +1,25 @@ + +
+ +
+

+ +

+ diff --git a/index.php b/index.php new file mode 100644 index 0000000..47e3ea7 --- /dev/null +++ b/index.php @@ -0,0 +1,96 @@ +authinfo($news["user"],$news["pass"]); + if (!$result) { + echo "

\n\t".$locale['error']['credentials'] + ."\n

"; + require("include/footer.inc.php"); + exit; + } +} +$groups = new groups($nntp); + +?> + +
+ +
+ +overview)) { + echo '

'; + echo "\n".$locale['error']['nogroup']."\n"; + echo "

\n"; + require("include/footer.inc.php"); + exit; +} + +displayshortcuts(); +?> + + + + + + + + +overview as $g => $d) { + $pair = !$pair; + $groupinfo = $nntp->group($g); +?> + " > + + + + + + +
+ + + + + + + +
+ + + 0 + + $g";?> + + +
+quit(); +require("include/footer.inc.php"); +?> diff --git a/post.php b/post.php new file mode 100644 index 0000000..2fc7410 --- /dev/null +++ b/post.php @@ -0,0 +1,149 @@ +\n\t".$locale['error']['connect']."\n

"; + require("include/footer.inc.php"); + exit; +} +if ($news['user']!="anonymous") { + $result = $mynntp->authinfo($news["user"],$news["pass"]); + if (!$result) { + echo "

\n\t".$locale['error']['credentials'] + ."\n

"; + require("include/footer.inc.php"); + exit; + } +} + +if (isset($group) && isset($id) && isset($_REQUEST['type']) && + ($_REQUEST['type']=='followup')) { + $rq=$mynntp->group($group); + $post = new post($mynntp,$id); + if ($post) { + $subject = (preg_match("/^re:/i",$post->headers->subject)?"":"Re: ") + .$post->headers->subject; + $body = $post->headers->name." wrote :\n".wrap($post->body, ">"); + if (isset($post->headers->followup)) + $target=$post->headers->followup; + else + $target=$post->headers->newsgroups; + } +} + +$mynntp->quit(); +?> +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + " /> +
+ + + " /> +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + +
+
+ diff --git a/thread.php b/thread.php new file mode 100644 index 0000000..ee12da4 --- /dev/null +++ b/thread.php @@ -0,0 +1,177 @@ +\n\t".$locale['error']['connect']."\n

"; + require("include/footer.inc.php"); + exit; +} + +if ($news['user']!="anonymous") { + $result = $mynntp->authinfo($news["user"],$news["pass"]); + if (!$result) { + echo "

\n\t".$locale['error']['credentials'] + ."\n

"; + require("include/footer.inc.php"); + exit; + } +} +$spool = new spool($mynntp,$group,$profile['display'], + $profile['lastnews']); +if (!$spool) { + echo "

\n\t".$locale['error']['group']."\n

"; + require("footer.inc.php"); + exit; +} +$max = 50; +if ($_REQUEST['first']>sizeof($spool->overview)) + $_REQUEST['first']=sizeof($spool->overview); +$first = (isset($_REQUEST['first'])? + (floor($_REQUEST['first']/$max)*$max+1):1); +$last = (isset($_REQUEST['first'])? + (floor($_REQUEST['first']/$max+1)*$max):$max); + +if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) { + switch ($_REQUEST['type']) { + case 'cancel': + $mid = array_search($id,$spool->ids); + $mynntp->group($group); + $post = new post($mynntp,$id); + + if (checkcancel($post->headers)) { + $message = 'From: '.$profile['name']."\n" + ."Newsgroups: $group\n" + ."Subject: cmsg $mid\n" + .$news['customhdr'] + ."Control: cancel $mid\n" + ."\n" + ."Message canceled with Banana"; + $result = $mynntp->post($message); + if ($result) { + $spool->delid($id); + $text="

".$locale['post']['canceled'] + ."

"; + } else { + $text="

".$locale['post']['badcancel'] + ."

"; + } + } else { + $text="

\n\t".$locale['post']['rghtcancel'] + ."\n

"; + } + break; + case 'new': + $message = 'From: '.$profile['name']."\n" + ."Newsgroups: ".stripslashes(str_replace(" ","", + $_REQUEST['newsgroups']))."\n" + ."Subject: ".stripslashes($_REQUEST['subject'])."\n" + .($_REQUEST['followup']!=''?'Followup-To: ' + .stripslashes($_REQUEST['followup'])."\n":"") + .$news['customhdr'] + ."\n" + .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']); + $result = $mynntp->post($message); + if ($result) { + $text="

".$locale['post']['posted']."

"; + } else { + $text="

".$locale['post']['badpost']."

"; + } + break; + case 'followupok': + $rq=$mynntp->group($group); + $post = new post($mynntp,$id); + if ($post) { + $refs = $post->headers->references." ".$post->headers->msgid; + } + + $message = 'From: '.$profile['name']."\n" + ."Newsgroups: ".stripslashes($_REQUEST['newsgroups'])."\n" + ."Subject: ".stripslashes($_REQUEST['subject'])."\n" + .($_REQUEST['followup']!=''?'Followup-To: ' + .stripslashes($_REQUEST['followup'])."\n":"") + ."References: $refs\n" + .$news['customhdr'] + ."\n" + .wrap(stripslashes($_REQUEST['body']),"",$news['wrap']); + $result = $mynntp->post($message); + if ($result) { + $text="

".$locale['post']['posted']."

"; + } else { + $text="

".$locale['post']['badpost']."

"; + } + break; + } + $spool = new spool($mynntp,$group,$profile['display'], + $profile['lastnews']); + if (!$spool) { + echo "

\n\t".$locale['error']['group']."\n

"; + require("include/footer.inc.php"); + exit; + } +} + + +?> +
+ +
+ + + + + + + + +disp($first,$last); +$mynntp->quit(); +echo "
+ + + + + +
"; + +displayshortcuts(); + +require("include/footer.inc.php"); +?> diff --git a/xface.php b/xface.php new file mode 100644 index 0000000..4edd725 --- /dev/null +++ b/xface.php @@ -0,0 +1,8 @@ + -- 2.1.4