Changeset 106

Show
Ignore:
Timestamp:
31/05/05 14:03:11 (4 years ago)
Author:
dez
Message:

There were still files with spaces instead of tabs. Done a search and replace to fix.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.lib.php

    r102 r106  
    294294                        $this->printEntryForm($row,true,true); 
    295295                } else { 
    296             error(2, _("Could not find the requested entry.")); 
    297        
     296           error(2, _("Could not find the requested entry.")); 
     297       
    298298        } 
    299299 
     
    443443    function printEntries($amount=0, $title=TRUE) 
    444444    { 
    445         $limit = ($amount > 0) ? " LIMIT $amount" : ""; 
    446         $result = db_query("SELECT shortsubject,timestamp,subject FROM entries WHERE user_id = '".$this->id."' ORDER BY timestamp DESC $limit;"); 
    447         if(db_num_rows($result)==0){ 
    448             error(5, _("No entries found.")); 
    449         } else { 
    450             if($title){ 
    451                 echo "<h2>"._("Edit Entries")."</h2>\n"; 
    452             } 
    453             echo "<ul>\n"; 
    454             while($row = db_getrow($result)){ 
    455                 echo "<li>".date("r", strtotime($row['timestamp']))." <a href=\"".$this->adminPath."update/".$row['shortsubject']."\">".$row['subject']."</a></li>\n"; 
    456             } 
    457             echo "</ul>\n"; 
    458        
     445       $limit = ($amount > 0) ? " LIMIT $amount" : ""; 
     446       $result = db_query("SELECT shortsubject,timestamp,subject FROM entries WHERE user_id = '".$this->id."' ORDER BY timestamp DESC $limit;"); 
     447       if(db_num_rows($result)==0){ 
     448           error(5, _("No entries found.")); 
     449       } else { 
     450           if($title){ 
     451               echo "<h2>"._("Edit Entries")."</h2>\n"; 
     452           } 
     453           echo "<ul>\n"; 
     454           while($row = db_getrow($result)){ 
     455               echo "<li>".date("r", strtotime($row['timestamp']))." <a href=\"".$this->adminPath."update/".$row['shortsubject']."\">".$row['subject']."</a></li>\n"; 
     456           } 
     457           echo "</ul>\n"; 
     458       
    459459    } 
    460460 
     
    474474                //if (check_auth($user)) {} 
    475475                //sanitise username 
    476                 if (isset($_POST['username']) && trim($_POST['username']) != "" && (int)$_POST['username'] == 0) { 
    477                         $username = $_POST['username']; 
    478                 } else { 
    479                         $this->inputError = _("Bad Input - Username"); 
    480                         $err = 1; 
    481                
     476               if (isset($_POST['username']) && trim($_POST['username']) != "" && (int)$_POST['username'] == 0) { 
     477                       $username = $_POST['username']; 
     478               } else { 
     479                       $this->inputError = _("Bad Input - Username"); 
     480                       $err = 1; 
     481               
    482482 
    483483                //sanitise password, assume it will be hashed before sending :) 
    484                 if (isset($_POST['password']) && trim($_POST['password']) != "" && (int)$_POST['password'] == 0) { 
    485                         $password = $_POST['password']; 
    486                 } else { 
    487                         $this->inputError = _("Bad Input - Password"); 
    488                         $err = 1; 
    489                
     484               if (isset($_POST['password']) && trim($_POST['password']) != "" && (int)$_POST['password'] == 0) { 
     485                       $password = $_POST['password']; 
     486               } else { 
     487                       $this->inputError = _("Bad Input - Password"); 
     488                       $err = 1; 
     489               
    490490 
    491491                //sanitise type 
    492                 if (isset($_POST['type']) && trim($_POST['type']) != "" && (int)$_POST['type'] > 0) { 
    493                         $type = (int)$_POST['type']; 
    494                 } else { 
    495                         $this->inputError = _("Bad Input - Type"); 
    496                         $err = 1; 
    497                
     492               if (isset($_POST['type']) && trim($_POST['type']) != "" && (int)$_POST['type'] > 0) { 
     493                       $type = (int)$_POST['type']; 
     494               } else { 
     495                       $this->inputError = _("Bad Input - Type"); 
     496                       $err = 1; 
     497               
    498498 
    499499                //sanitise name 
    500                 if (isset($_POST['name']) && trim($_POST['name']) != "" && (int)$_POST['name'] == 0) { 
    501                         $name = addslashes(urldecode($_POST['name'])); 
    502                 } else { 
    503                         $this->inputError = _("Bad Input - Realname"); 
    504                         $err = 1; 
    505                
     500               if (isset($_POST['name']) && trim($_POST['name']) != "" && (int)$_POST['name'] == 0) { 
     501                       $name = addslashes(urldecode($_POST['name'])); 
     502               } else { 
     503                       $this->inputError = _("Bad Input - Realname"); 
     504                       $err = 1; 
     505               
    506506 
    507507                //sanitise title 
    508                 if (isset($_POST['title']) && trim($_POST['title']) != "" && (int)$_POST['title'] == 0) { 
    509                         $title = addslashes(urldecode($_POST['title'])); 
    510                 } else { 
    511                         $this->inputError = _("Bad Input - Title"); 
    512                         $err = 1; 
    513                
     508               if (isset($_POST['title']) && trim($_POST['title']) != "" && (int)$_POST['title'] == 0) { 
     509                       $title = addslashes(urldecode($_POST['title'])); 
     510               } else { 
     511                       $this->inputError = _("Bad Input - Title"); 
     512                       $err = 1; 
     513               
    514514 
    515515                //sanitise description 
    516                 if (isset($_POST['description']) && trim($_POST['description']) != "" && (int)$_POST['description'] == 0) { 
    517                         $description = addslashes(urldecode($_POST['description'])); 
    518                 } else { 
    519                         $this->inputError = _("Bad Input - Description"); 
    520                         $err = 1; 
    521                
     516               if (isset($_POST['description']) && trim($_POST['description']) != "" && (int)$_POST['description'] == 0) { 
     517                       $description = addslashes(urldecode($_POST['description'])); 
     518               } else { 
     519                       $this->inputError = _("Bad Input - Description"); 
     520                       $err = 1; 
     521               
    522522 
    523523                //sanitise css 
    524                 if (isset($_POST['css'])) { // if its not set its defaulted... 
     524               if (isset($_POST['css'])) { // if its not set its defaulted... 
    525525                        if (trim($_POST['css']) != "" && (int)$_POST['css'] == 0 && is_file($_POST['css'])) { 
    526                                 $css = $_POST['css']; 
    527                        } else { 
    528                                $this->inputError = _("Bad Input - CSS location"); 
    529                               $err = 1; 
    530                        
     526                               $css = $_POST['css']; 
     527                       } else { 
     528                               $this->inputError = _("Bad Input - CSS location"); 
     529                              $err = 1; 
     530                       
    531531                } 
    532532 
    533533                //sanitise enabled -- not really sure about this. i think creation and enabling should be  
    534534                // done seperately... ??? 
    535                 /*if (isset($_POST['enabled'])) { // if its not set its defaulted... 
    536                         if (trim($_POST['enabled']) != "" && (int)$_POST['enabled'] == 0)) { 
    537                                 $css = $_POST['enabled']; 
    538                         } else { 
    539                                 $this->inputError = _("Bad Input - Enabled"); 
    540                                 $err = 1; 
    541                        
    542                 }*/ 
     535               /*if (isset($_POST['enabled'])) { // if its not set its defaulted... 
     536                       if (trim($_POST['enabled']) != "" && (int)$_POST['enabled'] == 0)) { 
     537                               $css = $_POST['enabled']; 
     538                       } else { 
     539                               $this->inputError = _("Bad Input - Enabled"); 
     540                               $err = 1; 
     541                       
     542               }*/ 
    543543 
    544544                if ($err == 0) { // and insert... 
     
    559559        { 
    560560                echo "<div class=\"adduser\">\n"; 
    561                 if ($this->inputError != "") { 
    562                       echo "<p class=\"invalid\">*** " . $this->inputError . " ***</p>\n"; 
     561               if ($this->inputError != "") { 
     562                      echo "<p class=\"invalid\">*** " . $this->inputError . " ***</p>\n"; 
    563563                } 
    564564                elseif (isset($_POST['submit'])) { 
  • admin.php

    r97 r106  
    55 
    66// Check if we're logging in or out - must be done before any HTML is displayed 
    7         switch ($request[0]) { 
     7       switch ($request[0]) { 
    88        case "login": 
    99                $admin->login(); 
     
    1212                $admin->logout(); 
    1313                break; 
    14        
     14       
    1515?> 
    1616<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     
    2424<div id="container"> 
    2525    <div id="toppanel"> 
    26         <h1><a href="<? echo $admin->adminPath;?>"><? echo _("SUCS Blogs"); ?></a></h1> 
     26       <h1><a href="<? echo $admin->adminPath;?>"><? echo _("SUCS Blogs"); ?></a></h1> 
    2727            <h2>Blog management</h2> 
    28         <h3> </h3> 
     28       <h3> </h3> 
    2929        </div> 
    3030    <div id="content"> 
    31         <div id="sidepanel"> 
    32             <p class="sideblurb"> 
    33                 <? if($_SESSION['userName']) $admin->menu(); ?><br /> 
    34                 <a href="http://sucs.org"><img src="<? echo $admin->httpPath."img/sucspow.png"; ?>" alt="Powered by SUCS" height="13" width="80" /></a> 
    35             </p> 
    36         </div> 
    37         <div id="maincontent"><? 
    38               if($_SESSION['userName']) { 
     31       <div id="sidepanel"> 
     32           <p class="sideblurb"> 
     33               <? if($_SESSION['userName']) $admin->menu(); ?><br /> 
     34               <a href="http://sucs.org"><img src="<? echo $admin->httpPath."img/sucspow.png"; ?>" alt="Powered by SUCS" height="13" width="80" /></a> 
     35           </p> 
     36       </div> 
     37       <div id="maincontent"><? 
     38              if($_SESSION['userName']) { 
    3939                                if ($_SESSION['userName']) echo "<div class=\"login\"><h3>"._("Hello")." {$admin->realName} (<a href=\"{$admin->adminPath}logout\">"._("Log out")."</a>)</h3></div>"; 
    4040                                switch (array_shift($request)) { 
     
    7676                } 
    7777 
    78         ?></div> 
     78       ?></div> 
    7979    </div> 
    8080    <div id="bottompanel"> 
    81         <p>Validate : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a></p> 
     81       <p>Validate : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a></p> 
    8282    </div> 
    8383</div> 
  • blog.lib.php

    r105 r106  
    187187                $sqlNum = db_num_rows($sql); 
    188188                if ($sqlNum > 0) { 
    189             while ($sqlRow = db_getrow($sql)) { 
     189                       while ($sqlRow = db_getrow($sql)) { 
    190190                                $this->printComment($sqlRow); 
    191191                        } 
  • feed.php

    r31 r106  
    2727switch(array_shift($request)){ 
    2828    case "category": 
    29         $extra = " AND category=".(int)array_shift($request); 
    30         break; 
     29       $extra = " AND category=".(int)array_shift($request); 
     30       break; 
    3131    default: 
    32         $extra = ""; 
     32       $extra = ""; 
    3333    } 
    3434 
     
    4343do { 
    4444    $entrydate = date("r",strtotime($row['timestamp'])); 
    45     $entries .= "       <item>\n"; 
    46     $entries .= "           <title>" . $row['subject'] . "</title>\n"; 
    47     $entries .= "           <description><![CDATA[" . substr(strip_tags($row['body']),0,150) . " [...]]]></description>\n"; 
    48     $entries .= "           <link>".$user['link']."entry/".$row['id']."</link>\n"; 
    49     $entries .= "           <pubDate>" . $entrydate . "</pubDate>\n"; 
    50     $entries .= "           <dc:creator>".$user['name']."</dc:creator>\n"; 
    51     $entries .= "           <content:encoded><![CDATA[" . str_replace("'", "&#8217;", $row['body']) . "]]></content:encoded>\n"; 
    52     $entries .= "       </item>\n"; 
     45    $entries .= "      <item>\n"; 
     46    $entries .= "              <title>" . $row['subject'] . "</title>\n"; 
     47    $entries .= "              <description><![CDATA[" . substr(strip_tags($row['body']),0,150) . " [...]]]></description>\n"; 
     48    $entries .= "              <link>".$user['link']."entry/".$row['id']."</link>\n"; 
     49    $entries .= "              <pubDate>" . $entrydate . "</pubDate>\n"; 
     50    $entries .= "              <dc:creator>".$user['name']."</dc:creator>\n"; 
     51    $entries .= "              <content:encoded><![CDATA[" . str_replace("'", "&#8217;", $row['body']) . "]]></content:encoded>\n"; 
     52    $entries .= "      </item>\n"; 
    5353} while ($row = db_getrow($result)); 
    5454 
     
    6363> 
    6464    <channel> 
    65         <title><?php print $user['title']?></title> 
    66         <description><?php print $user['description']?></description> 
    67         <link><?php print $user['link']?></link> 
    68         <pubDate><?php echo $pubdate; ?></pubDate> 
    69         <generator>wBlog @ sucs</generator> 
    70         <language>en</language> 
    71         <?php echo $entries; ?> 
     65       <title><?php print $user['title']?></title> 
     66       <description><?php print $user['description']?></description> 
     67       <link><?php print $user['link']?></link> 
     68       <pubDate><?php echo $pubdate; ?></pubDate> 
     69       <generator>wBlog @ sucs</generator> 
     70       <language>en</language> 
     71       <?php echo $entries; ?> 
    7272    </channel> 
    7373</rss> 
  • index.php

    r105 r106  
    55        $blog = new blogs(array_shift($request)); 
    66    } else { 
    7         $blog = new bloglist(); 
    8         $request = array("list"); 
     7       $blog = new bloglist(); 
     8       $request = array("list"); 
    99    } 
    1010         
     
    2121<div id="container"> 
    2222    <div id="toppanel"> 
    23         <h1><a href="<?php echo $blog->blogPath; ?>"><? echo $blog->title; ?></a></h1> 
     23       <h1><a href="<?php echo $blog->blogPath; ?>"><? echo $blog->title; ?></a></h1> 
    2424        <h2><? echo $blog->description; ?></h2> 
    2525    <h3><? if ($blog->userName != "") echo _("A weblog by")." ".$blog->userName; ?></h3> 
    2626    </div> 
    2727    <div id="content"> 
    28         <div id="sidepanel"> 
    29             <p class="sideblurb"> 
    30                 <?php $blog->menu(); ?> 
     28       <div id="sidepanel"> 
     29           <p class="sideblurb"> 
     30               <?php $blog->menu(); ?> 
    3131                <br /> 
    32                 <a href="http://sucs.org"><img src="<? echo $blog->httpPath."img/sucspow.png"; ?>" alt="<? echo _("Powered by SUCS"); ?>" height="13" width="80" /></a> 
    33             </p> 
    34         </div> 
    35         <div id="maincontent"> 
    36             <? 
     32               <a href="http://sucs.org"><img src="<? echo $blog->httpPath."img/sucspow.png"; ?>" alt="<? echo _("Powered by SUCS"); ?>" height="13" width="80" /></a> 
     33           </p> 
     34       </div> 
     35       <div id="maincontent"> 
     36           <? 
    3737                switch (array_shift($request)) { 
    3838                        case "entry": 
     
    4646                                break; 
    4747                        case "archive": 
    48                         $blog->printArchive($request); 
    49                         break; 
     48                       $blog->printArchive($request); 
     49                       break; 
    5050                        case "list": 
    51                         $blog->listBlogs(); 
    52                         break; 
     51                       $blog->listBlogs(); 
     52                       break; 
    5353                        default: 
    5454                                $blog->printEntries();  
    5555                } 
    56              ?> 
    57         </div> 
     56            ?> 
     57       </div> 
    5858    </div> 
    5959    <div id="bottompanel"> 
    60         <p><? echo _("Validate"); ?> : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a></p> 
     60       <p><? echo _("Validate"); ?> : <a href="http://validator.w3.org/check?uri=referer">XHTML</a> / <a href="http://jigsaw.w3.org/css-validator/check/referer/">CSS</a></p> 
    6161    </div> 
    6262</div> 
  • template.html

    r9 r106  
    22<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > 
    33<head> 
    4     <title>SUCS Blog</title> 
    5     <link rel="Stylesheet" href="blog.css" type="text/css" /> 
     4       <title>SUCS Blog</title> 
     5       <link rel="Stylesheet" href="blog.css" type="text/css" /> 
    66</head> 
    77<body> 
    88<div id="container"> 
    9     <div id="toppanel"> 
    10         #toppanel 
    11     </div> 
    12     <div id="content"> 
    13         <div id="sidepanel"> 
    14             #sidepanel 
    15         </div> 
    16         <div id="maincontent"> 
    17             #maincontent 
    18         </div> 
    19     </div> 
    20     <div id="bottompanel"> 
    21         #bottompanel 
    22     </div> 
     9       <div id="toppanel"> 
     10               #toppanel 
     11       </div> 
     12       <div id="content"> 
     13               <div id="sidepanel"> 
     14                       #sidepanel 
     15               </div> 
     16               <div id="maincontent"> 
     17                       #maincontent 
     18               </div> 
     19       </div> 
     20       <div id="bottompanel"> 
     21               #bottompanel 
     22       </div> 
    2323</div> 
    2424</body>