Changeset 597 for trunk

Show
Ignore:
Timestamp:
09/08/07 18:32:20 (15 months ago)
Author:
michiel
Message:

use authors array in object variables rather then fetching them again from db

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/rss.php

    r595 r597  
    2828require("mvblog.php"); 
    2929$mvblog = new MvBlog(); 
    30 //get all the authors in an array 
    31 $res =& $mvblog->db->query("SELECT * FROM authors"); 
    32  
    33 if (PEAR::isError($res)) { 
    34         die($res->getMessage()); 
    35 } 
    36  
    37 while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { 
    38         $authors[$row["id"]]["fullname"] = $row["fullname"]; 
    39         $authors[$row["id"]]["email"]    = $row["email"]; 
    40 } 
    4130 
    4231//generate url to the root of our website 
     
    10897                echo "\t\t\t<category>asides</category>\n"; 
    10998                echo "\t\t\t<guid isPermaLink=\"false\">".$url."index.php?aside=".$row["id"]."</guid>\n"; 
    110                 echo "\t\t\t<author>".htmlspecialchars($authors[$row["authors_id"]]["email"])." (".htmlspecialchars($authors[$row["authors_id"]]["fullname"]).")</author>\n"; 
     99                echo "\t\t\t<author>".htmlspecialchars($mvblog->authors[$row["authors_id"]]["email"])." (".htmlspecialchars($mvblog->authors[$row["authors_id"]]["fullname"]).")</author>\n"; 
    111100        } else { 
    112101                echo "\t\t\t<link>".$url."index.php?action=view&amp;id=".$row["id"]."$link</link>\n"; 
     
    126115                if (!$comments) { 
    127116                        echo "\t\t\t<comments>".$url."index.php?action=view&amp;id=".$row["id"]."#comments</comments>\n"; 
    128                         echo "\t\t\t<author>".htmlspecialchars($authors[$row["authors_id"]]["email"])." (".htmlspecialchars($authors[$row["authors_id"]]["fullname"]).")</author>\n"; 
     117                        echo "\t\t\t<author>".htmlspecialchars($mvblog->authors[$row["authors_id"]]["email"])." (".htmlspecialchars($mvblog->authors[$row["authors_id"]]["fullname"]).")</author>\n"; 
    129118                } 
    130119        }