Changeset 1544

Show
Ignore:
Timestamp:
12/22/2009 12:40:53 PM (8 months ago)
Author:
BrianKoontz
Message:

Ported [260] from trunk to 1.3. Refs #398, #912.

Location:
branches/1.3
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/1.3/actions/mypages/mypages.php

    r1490 r1544  
    1010 * @uses        Wakka::IsAdmin() 
    1111 * @uses        Wakka::Link() 
    12  * @uses        Wakka::LoadAllPages() 
     12 * @uses        Wakka::LoadPagesByOwner() 
    1313 *  
    1414 */ 
     
    2727        $my_pages_count = 0; 
    2828 
    29         if ($pages = $this->LoadAllPages()) 
     29        if ($pages = $this->LoadPagesByOwner($username)) 
    3030        { 
    3131                $curChar = ''; 
    3232                foreach ($pages as $page) 
    3333                { 
    34                         if ($username == $page["owner"]) { 
    3534                                $firstChar = strtoupper($page["tag"][0]); 
    36                                 if (!preg_match("/[A-Z,a-z]/", $firstChar)) { 
     35                                if (!preg_match("/[A-Z,a-z]/", $firstChar))  
     36                                { 
    3737                                        $firstChar = "#"; 
    3838                                } 
    3939         
    40                                 if ($firstChar != $curChar) { 
     40                                if ($firstChar != $curChar)  
     41                                { 
    4142                                        if ($curChar != '') echo "<br />\n"; 
    4243                                        echo '<strong>'.$firstChar."</strong><br />\n"; 
     
    4546         
    4647                                echo $this->Link($page["tag"])."<br />\n"; 
    47                                  
    48                                 $my_pages_count++; 
    49                         } 
    50                 } 
    51                  
    52                 if ($my_pages_count == 0) 
    53                 { 
    54                         echo '<em class="error">'.MYPAGES_NONE_OWNED.'</em>'; 
    5548                } 
    5649        } 
    5750        else 
    5851        { 
    59                 echo '<em class="error">'.MYPAGES_NONE_FOUND.'</em>'; 
     52                echo '<em class="error">'.MYPAGES_NONE_OWNED.'</em>'; 
    6053        } 
    6154} 
  • branches/1.3/lang/en/en.inc.php

    r1542 r1544  
    629629define('MYPAGES_HEADER', "This is the list of pages owned by %s"); 
    630630define ('MYPAGES_NONE_OWNED', "You don't own any pages."); 
    631 define ('MYPAGES_NONE_FOUND', "No pages found"); 
    632631define ('MYPAGES_NOT_LOGGED_IN', "You're not logged in, thus the list of your pages couldn't be retrieved."); 
    633632/**#@-*/ 
  • branches/1.3/libs/Wakka.class.php

    r1535 r1544  
    12911291        /** 
    12921292         *  
    1293          * @return unknown_type 
    1294          * @todo        for 1.3:different in trunk: returns owner, too, to be used instead of LoadAllPages() 
     1293         * Load all page titles and owners. 
     1294         * 
     1295         * @return unknown_type 
    12951296         */ 
    12961297        function LoadPageTitles()  
    12971298        {  
    1298                 return $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages order by tag");  
    1299         } 
    1300          
     1299                return $this->LoadAll("select tag, owner from ".$this->config["table_prefix"]."pages where latest='Y' order by tag");  
     1300        } 
     1301 
     1302        /** 
     1303         *  
     1304         * Load page titles by owner. 
     1305         * 
     1306         * @return unknown_type 
     1307         */ 
     1308        function LoadPagesByOwner($owner)  
     1309        {  
     1310                return $this->LoadAll("select tag from ".$this->config['table_prefix']."pages where latest = 'Y' and owner = '".mysql_real_escape_string($owner)."' order by tag"); 
     1311        }  
     1312  
    13011313        /** 
    13021314         * Load all pages in the wiki.