owls

diff Owls.php @ 2:ab74e95a8040

added display of broken nodes; Header and Footer in Owls.php now; added logos
author "Meillo r e t u r n s <meillo@marmaro.de>"
date Thu, 07 Dec 2006 21:04:30 +0100
parents 3021ce32ee14
children 3cacc24e1774
line diff
     1.1 --- a/Owls.php	Sun Dec 03 22:32:33 2006 +0100
     1.2 +++ b/Owls.php	Thu Dec 07 21:04:30 2006 +0100
     1.3 @@ -1,5 +1,78 @@
     1.4  <?php
     1.5 -  require_once 'Includes/Header.inc.php';
     1.6 +
     1.7 +  define('DB_PREFIX', 'rem__1_');
     1.8 +  define('TITLE', 'Owls');
     1.9 +
    1.10 +  require_once '../Db.inc.php';
    1.11 +  require_once 'Includes/Loginsys.class.php';
    1.12 +  include_once 'Includes/Bbcodeparser.inc.php';
    1.13 +
    1.14 +  $lsys = &new Loginsys();
    1.15 +
    1.16 +?>
    1.17 +<!--
    1.18 +
    1.19 +                       `Owls' - some kind of wiki system
    1.20 +
    1.21 +
    1.22 +                (c) Copyright  2006 &>  by Meillo  r e t u r n s
    1.23 +
    1.24 +         This program is free software; you can redistribute it and/or
    1.25 +          modify it under the terms of the GNU General Public License
    1.26 +         as published by the Free Software Foundation; either version 2
    1.27 +             of the License, or (at your option) any later version.
    1.28 +
    1.29 +        This program is distributed in the hope that it will be useful,
    1.30 +         but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.31 +         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.32 +                  GNU General Public License for more details.
    1.33 +
    1.34 +
    1.35 +                          http://prog.marmaro.de/owls/
    1.36 +
    1.37 +-->
    1.38 +
    1.39 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    1.40 +
    1.41 +<html xml:lang="de" xmlns="http://www.w3.org/1999/xhtml">
    1.42 +<head>
    1.43 +  <title><?php echo htmlentities(TITLE); ?></title>
    1.44 +  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    1.45 +  <link rel="shortcut icon" href="favicon.ico" />
    1.46 +  <link rel="stylesheet" type="text/css" href="Owls.css.php" />
    1.47 +  <script type="text/javascript">
    1.48 +  <!--
    1.49 +    function sureToDelete(id) {
    1.50 +      if (window.prompt("Type 'delete' to delete","") == "delete") {
    1.51 +        location.href = id +"d";
    1.52 +      }
    1.53 +    }
    1.54 +
    1.55 +/*  I want to use this function later ... perhaps
    1.56 +    function toggleVisibility(boxId) {
    1.57 +      if (document.getElementById('node'+ boxId).style.display == 'none') {
    1.58 +        document.getElementById('node'+ boxId).style.display = "";
    1.59 +        document.getElementById('ctrl'+ boxId).firstChild.nodeValue = "-";
    1.60 +      } else{
    1.61 +        document.getElementById('node'+ boxId).style.display = "none";
    1.62 +        document.getElementById('ctrl'+ boxId).firstChild.nodeValue = "+";
    1.63 +      }
    1.64 +    }
    1.65 +*/
    1.66 +  //-->  
    1.67 +  </script>
    1.68 +</head>
    1.69 +
    1.70 +<body>
    1.71 +<div id="websiteContainer">
    1.72 +
    1.73 +  <!-- Banner -->
    1.74 +  <img src="Owls.png" id="banner" alt="<?php echo htmlentities(TITLE); ?>" />
    1.75 +
    1.76 +<?php
    1.77 +
    1.78 +
    1.79 +
    1.80  
    1.81  
    1.82    if ($_GET['action'] == 'show') {    // show
    1.83 @@ -29,7 +102,19 @@
    1.84    }
    1.85  
    1.86  
    1.87 -  require_once 'Includes/Footer.inc.php';
    1.88 +
    1.89 +
    1.90 +
    1.91 +?>
    1.92 +
    1.93 +  </div>
    1.94 +
    1.95 +
    1.96 +</div>
    1.97 +
    1.98 +</body>
    1.99 +</html>
   1.100 +<?php
   1.101  
   1.102  
   1.103  
   1.104 @@ -142,16 +227,34 @@
   1.105  ?>
   1.106        <select name="editDoc_idCategory" style="width: 99%;">
   1.107  <?php
   1.108 -      $result = mysql_query("select * from ". DB_PREFIX ."Owls order by name asc") or die(mysql_error());
   1.109 +      $sql = sprintf("
   1.110 +        select 
   1.111 +          * 
   1.112 +        from %sOwls 
   1.113 +        where 
   1.114 +          id != %d
   1.115 +          and idParent != %d
   1.116 +-- not in (
   1.117 +--            select idParent from %sOwls
   1.118 +--          )
   1.119 +        order by name asc
   1.120 +        ",
   1.121 +        DB_PREFIX,
   1.122 +        $row['id'],
   1.123 +        $row['id'],
   1.124 +        DB_PREFIX
   1.125 +      );
   1.126 +      $result = mysql_query($sql) or die(mysql_error());
   1.127 +      unset($sql);
   1.128        while($rowCats = mysql_fetch_array($result)) {
   1.129 -        echo '  <option value="'.$rowCats['id'].'"'. (($row['idParent'] == $rowCats['id']) ? ' selected="selected"' : '') .'>'.stripslashes($rowCats['name']).'</option>';
   1.130 +        echo '  <option value="'.$rowCats['id'].'"'. (($row['idParent'] == $rowCats['id']) ? ' selected="selected" style="font-weight: bold;"' : '') .'>'.stripslashes($rowCats['name']).'</option>';
   1.131        }
   1.132  ?>
   1.133        </select><br /><br />
   1.134  <?php
   1.135      }
   1.136  ?>
   1.137 -    <input name="editDoc_title" type="text" value="<?php echo stripslashes($row['name']); ?>" style="width: 99%;" /><br />
   1.138 +    <input name="editDoc_title" type="text" value="<?php echo stripslashes($row['name']); ?>" style="width: 99%; font-weight: bold;" /><br />
   1.139      <textarea name="editDoc_text" cols="60" rows="15" style="width: 99%; height: 30em;"><?php
   1.140        echo stripslashes($row['text']);
   1.141      ?></textarea><br /><br />