bugfix + custom css classes
[banana.git] / thread.php
index ee12da4..026d8e9 100644 (file)
@@ -7,7 +7,6 @@
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
 
-require("locales/locales.inc.php");
 require("include/session.inc.php");
 require("include/encoding.inc.php");
 require("include/format.inc.php");
@@ -19,16 +18,20 @@ require("include/password.inc.php");
 require("include/profile.inc.php");
 include("include/wrapper.inc.php");
 
-require("include/header.inc.php");
+$profile=getprofile();
+require($profile['locale']);
 
-$profile = getprofile();
+require("include/header.inc.php");
 
 if (isset($_REQUEST['group'])) {
   $group=htmlentities(strtolower($_REQUEST['group']));
 } else {
   $group=htmlentities(strtolower(strtok(str_replace(" ","",$_REQUEST['newsgroups']),",")));
 }
-$id=htmlentities(strtolower($_REQUEST['id']));
+
+if (isset($_REQUEST['id'])) {
+  $id=htmlentities(strtolower($_REQUEST['id']));
+}
 
 //$mynntp = new nntp($news['server'],120,1);
 $mynntp = new nntp($news['server']);
@@ -55,7 +58,7 @@ if (!$spool) {
   exit;
 }
 $max = 50;
-if ($_REQUEST['first']>sizeof($spool->overview))
+if (isset($_REQUEST['first']) && ($_REQUEST['first']>sizeof($spool->overview)))
   $_REQUEST['first']=sizeof($spool->overview);
 $first = (isset($_REQUEST['first'])?
   (floor($_REQUEST['first']/$max)*$max+1):1);
@@ -148,7 +151,9 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type']))) {
     .$locale['thread']['group_a'];?>
 </div>
 <?php
-echo $text;
+if (isset($text)) {
+    echo $text;
+}
 displayshortcuts();
 
 ?>