Changeset 1544
- Timestamp:
- 12/22/2009 12:40:53 PM (8 months ago)
- Location:
- branches/1.3
- Files:
-
- 3 modified
-
actions/mypages/mypages.php (modified) (3 diffs)
-
lang/en/en.inc.php (modified) (1 diff)
-
libs/Wakka.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/actions/mypages/mypages.php
r1490 r1544 10 10 * @uses Wakka::IsAdmin() 11 11 * @uses Wakka::Link() 12 * @uses Wakka::Load AllPages()12 * @uses Wakka::LoadPagesByOwner() 13 13 * 14 14 */ … … 27 27 $my_pages_count = 0; 28 28 29 if ($pages = $this->Load AllPages())29 if ($pages = $this->LoadPagesByOwner($username)) 30 30 { 31 31 $curChar = ''; 32 32 foreach ($pages as $page) 33 33 { 34 if ($username == $page["owner"]) {35 34 $firstChar = strtoupper($page["tag"][0]); 36 if (!preg_match("/[A-Z,a-z]/", $firstChar)) { 35 if (!preg_match("/[A-Z,a-z]/", $firstChar)) 36 { 37 37 $firstChar = "#"; 38 38 } 39 39 40 if ($firstChar != $curChar) { 40 if ($firstChar != $curChar) 41 { 41 42 if ($curChar != '') echo "<br />\n"; 42 43 echo '<strong>'.$firstChar."</strong><br />\n"; … … 45 46 46 47 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>';55 48 } 56 49 } 57 50 else 58 51 { 59 echo '<em class="error">'.MYPAGES_NONE_ FOUND.'</em>';52 echo '<em class="error">'.MYPAGES_NONE_OWNED.'</em>'; 60 53 } 61 54 } -
branches/1.3/lang/en/en.inc.php
r1542 r1544 629 629 define('MYPAGES_HEADER', "This is the list of pages owned by %s"); 630 630 define ('MYPAGES_NONE_OWNED', "You don't own any pages."); 631 define ('MYPAGES_NONE_FOUND', "No pages found");632 631 define ('MYPAGES_NOT_LOGGED_IN', "You're not logged in, thus the list of your pages couldn't be retrieved."); 633 632 /**#@-*/ -
branches/1.3/libs/Wakka.class.php
r1535 r1544 1291 1291 /** 1292 1292 * 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 1295 1296 */ 1296 1297 function LoadPageTitles() 1297 1298 { 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 1301 1313 /** 1302 1314 * Load all pages in the wiki.