Changeset 124

Show
Ignore:
Timestamp:
21/06/05 20:07:29 (4 years ago)
Author:
rollercow
Message:

Made daves comment grabing sql more sane
Swaped lots of errors to use the pritty updateinfo style rather than invalid

Files:

Legend:

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

    r122 r124  
    8585                } 
    8686                if ($this->sessionError) { 
    87                         echo "<p class=\"invalid\">*** " . $this->sessionError . " ***</p>\n"; 
     87                        echo "<div class=\"updateinfo\">Error : " . $this->sessionError . " </div>\n"; 
    8888                } 
    8989        } 
     
    138138                echo "<li><a href=\"".$this->adminPath."settings\">"._("Settings")."</a></li>\n"; 
    139139                echo "<li><a href=\"".$this->adminPath."moderatecomments\">"._("Comments"); 
    140                 $result = db_getrow(db_query("SELECT COUNT(id) FROM comments WHERE post IN (SELECT id FROM entries WHERE user_id=".$this->id.") AND moderated=false;")); 
     140                $result = db_getrow(db_query("SELECT count(comments.id) from comments join entries on comments.post = entries.id where moderated = false and entries.user_id = ".$this->id.";")); 
    141141                if($result['count']>0){ 
    142142                        echo "<span style=\"font-size: 0.8em; color: red\"> (".$result['count'].")</span>"; 
     
    162162                echo "<div class=\"td\">\n"; 
    163163                if ($this->sessionError != "") { 
    164                         echo "<p class=\"invalid\">*** " . $this->sessionError . " ***</p>\n"; 
     164                        echo "<div class=\"updateinfo\">Error : " . $this->sessionError . "</div>\n"; 
    165165                } 
    166166                echo "<form action=\"".$this->adminPath."login\" method=\"post\" id=\"commentform\">\n"; 
     
    416416                echo "<div class=\"entry\">\n"; 
    417417                if ($this->inputError != "") { 
    418                         echo "<p class=\"invalid\">*** " . $this->inputError . " ***</p>\n"; 
     418                        echo "<div class=\"updateinfo\">Error : " . $this->inputError . "</div>\n"; 
    419419                } 
    420420                echo "<h2>".((!$edit) ?_("Write Entry") : _("Edit Entry"))."</h2>\n"; 
     
    490490 
    491491        function printComments() { 
    492                 $result = db_query("SELECT comments.*,entries.subject,entries.shortsubject FROM comments,entries WHERE post IN (SELECT id FROM entries WHERE user_id=".$this->id.") AND moderated=false AND comments.post = entries.id ORDER BY entries.subject ASC;"); 
     492                $result = db_query("SELECT comments.*, entries.subject, entries.shortsubject from comments join entries on comments.post = entries.id where moderated = false and entries.user_id = ".$this->id." ORDER BY entries.subject ASC;"); 
    493493                if(db_num_rows($result)==0) { 
    494494                        return; 
     
    819819                echo "<div class=\"adduser\">\n"; 
    820820                if ($this->inputError != "") { 
    821                         echo "<p class=\"invalid\">*** " . $this->inputError . " ***</p>\n"; 
     821                        echo "<div class=\"updateinfo\">Error : " . $this->inputError . "</div>\n"; 
    822822                } 
    823823                elseif (isset($_POST['submit'])) {