Index: trunk/phpwiki/fpw/wikiTextEn.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | $wikiMainPage = "Main Page" ; # This is actual the title of the article in the database |
16 | 16 | $wikiErrorPageTitle = "Yikes! An error!" ; |
17 | 17 | $wikiErrorMessage = "<h2>$1!</h2>Return to the [[:Main Page|Main Page]]!" ; |
18 | | -$wikiAllowedSpecialPages = array("userlogin","userlogout","newpages","recentchanges","upload","statistics","lonelypages","popularpages","wantedpages","allpages","randompage","shortpages","listusers","watchlist","special_pages","editusersettings","deletepage","protectpage","contributions","whatlinkshere"); |
| 18 | +$wikiAllowedSpecialPages = array("userlogin","userlogout","newpages","recentchanges","upload","statistics","lonelypages","popularpages","wantedpages","allpages","randompage","shortpages","longpages","listusers","watchlist","special_pages","editusersettings","deletepage","protectpage","contributions","whatlinkshere"); |
19 | 19 | $wikiRecentChangesText = "Track the most recent changes to Wikipedia on this page. [[Welcome, newcomers]]! Please have a look at these pages: [[Wikipedia FAQ]], [[Wikipedia policy]] (especially [[naming conventions]] and [[neutral point of view]]), and [[most common Wikipedia faux pas]].<br>If you want to see the Wikipedia succeed, it's very important that you don't add material restricted by others' [[copyright]]s. The legal liability could really hurt the project, so please don't do it.<br>See also the [http://meta.wikipedia.com/wiki.phtml?title=special:RecentChanges recent meta discussion]" ; |
20 | 20 | $wikiMetaDescription = "$1... Read more here at wikipedia, the free encyclopedia!" ; |
21 | 21 | |
— | — | @@ -78,6 +78,7 @@ |
79 | 79 | $wikiMostWanted = "Most wanted" ; |
80 | 80 | $wikiAllPages = "All pages" ; |
81 | 81 | $wikiStubs = "Stub articles" ; |
| 82 | +$wikiLongPages = "Long articles" ; |
82 | 83 | $wikiListUsers = "List users" ; |
83 | 84 | $wikiMyWatchlist = "My watchlist" ; |
84 | 85 | $wikiBeginDiff = "BEGIN DIFF" ; |
— | — | @@ -303,7 +304,9 @@ |
304 | 305 | $wikiSpecialTitle = "Special Pages" ; |
305 | 306 | $wikiSpecialText = "<b>This is a list of special pages.</b> Some of them are only available if you are logged in. If you are logged in, you can have this list automatically displayed on the right or left of each page as a QuickBar.<br><br>" ; |
306 | 307 | $wikiStubTitle = "Short 'stub' articles" ; |
307 | | -$wikiStubText = "'''These are all the articles in the database, sorted by length.'''<br>''#REDIRECT pages and pages within a namespace (like Talk:) are '''not''' listed here!''\n\n" ; |
| 308 | +$wikiLongPagesTitle = "The longest articles" ; |
| 309 | +$wikiStubText = "'''These are all the articles in the database, sorted by length, shortest first.'''<br>''#REDIRECT pages and pages within a namespace (like Talk:) are '''not''' listed here!''\n\n" ; |
| 310 | +$wikiLongPagesText = "'''These are all the articles in the database, sorted by length, longest first.'''<br>''#REDIRECT pages and pages within a namespace (like Talk:) are '''not''' listed here!''\n\n" ; |
308 | 311 | $wikiStubChars = "$1 chars" ; |
309 | 312 | $wikiStubDelete = "<b>Delete this page!</b>" ; |
310 | 313 | $wikiStubLinkHere = "$1 articles link here." ; |
Index: trunk/phpwiki/fpw/wikiPage.php |
— | — | @@ -934,7 +934,7 @@ |
935 | 935 | |
936 | 936 | # This generates the QuickBar (also used by the list of special pages function) |
937 | 937 | function getQuickBar () { |
938 | | - global $wikiMainPage , $wikiRecentChanges , $wikiRecentChangesLink , $wikiUpload , $wikiPopularPages ; |
| 938 | + global $wikiMainPage , $wikiRecentChanges , $wikiRecentChangesLink , $wikiUpload , $wikiPopularPages , $wikiLongPages; |
939 | 939 | global $user , $oldID , $version , $wikiEditThisPage , $wikiDeleteThisPage , $wikiHistory , $wikiMyWatchlist ; |
940 | 940 | global $wikiStatistics , $wikiNewPages , $wikiOrphans , $wikiMostWanted , $wikiAllPages , $wikiRandomPage , $wikiStubs , $wikiListUsers ; |
941 | 941 | $editOldVersion = "" ; |
— | — | @@ -960,6 +960,7 @@ |
961 | 961 | $column .= "<br>\n<a href=\"".wikiLink("special:AllPages")."\">$wikiAllPages</a>" ; |
962 | 962 | $column .= "<br>\n<a href=\"".wikiLink("special:RandomPage")."\">$wikiRandomPage</a>" ; |
963 | 963 | $column .= "<br>\n<a href=\"".wikiLink("special:ShortPages")."\">$wikiStubs</a>" ; |
| 964 | + $column .= "<br>\n<a href=\"".wikiLink("special:LongPages")."\">$wikiLongPages</a>" ; |
964 | 965 | $column .= "<br>\n<a href=\"".wikiLink("special:ListUsers")."\">$wikiListUsers</a>" ; |
965 | 966 | if ( $user->isLoggedIn ) { |
966 | 967 | $column .= "<br>\n<a href=\"".wikiLink("special:WatchList")."\">$wikiMyWatchlist</a>" ; |
Index: trunk/phpwiki/fpw/special_longpages.php |
— | — | @@ -0,0 +1,78 @@ |
| 2 | +<? |
| 3 | +function LongPages () { |
| 4 | + global $THESCRIPT , $wikiSQLServer , $user , $vpage , $startat , $wikiLongPagesTitle , $wikiLongPagesText , $showLinksThere , $wikiStubShowLinks ; |
| 5 | + if ( !isset ( $startat ) ) $startat = 1 ; |
| 6 | + $perpage = $user->options["resultsPerPage"] ; |
| 7 | + if ( $perpage == 0 ) $perpage = 20 ; |
| 8 | + $vpage->special ( $wikiLongPagesTitle ) ; |
| 9 | + $vpage->namespace = "" ; |
| 10 | + if ( $showLinksThere == "" ) $showLinksThere = 0 ; |
| 11 | + if ( $showLinksThere == 1 ) $sLT2 = 0 ; |
| 12 | + else $sLT2 = 1 ; |
| 13 | + $ret = $wikiLongPagesText ; |
| 14 | + $ret .= str_replace ( "$1" , $sLT2 , $wikiStubShowLinks ) ; |
| 15 | + $connection = getDBconnection () ; |
| 16 | + mysql_select_db ( $wikiSQLServer , $connection ) ; |
| 17 | + $sql = "SELECT COUNT(*) AS number FROM cur WHERE cur_title NOT LIKE \"%:%\" AND cur_text NOT LIKE \"#redirect%\"" ; |
| 18 | + $result = mysql_query ( $sql , $connection ) ; |
| 19 | + $s = mysql_fetch_object ( $result ) ; |
| 20 | + $total = $s->number ; |
| 21 | + $sql = "SELECT cur_title,LENGTH(cur_text) AS len FROM cur WHERE cur_title NOT LIKE \"%:%\" AND cur_title NOT LIKE \"Complete_list_of_encyclopedia_topics/%\" AND cur_text NOT LIKE \"#redirect%\" ORDER BY LENGTH(cur_text) DESC" ; |
| 22 | + $result = mysql_query ( $sql , $connection ) ; |
| 23 | + $cnt = 1 ; |
| 24 | + $color1 = $user->options["tabLine1"] ; |
| 25 | + $color2 = $user->options["tabLine2"] ; |
| 26 | + $color = $color1 ; |
| 27 | + $ret .= "<table width=\"100%\">\n" ; |
| 28 | + $ar = array () ; |
| 29 | + while ( $s = mysql_fetch_object ( $result ) and $cnt < $startat+$perpage ) { |
| 30 | + if ( $cnt >= $startat ) { |
| 31 | + $s->cnt = $cnt ; |
| 32 | + array_push ( $ar , $s ) ; |
| 33 | + } |
| 34 | + $cnt++ ; |
| 35 | + } |
| 36 | + mysql_free_result ( $result ) ; |
| 37 | + |
| 38 | + global $wikiStubChars , $wikiStubDelete , $wikiStubLinkHere ; |
| 39 | + |
| 40 | + foreach ( $ar as $s ) { |
| 41 | + $k = new wikiTitle ; |
| 42 | + $k->setTitle ( $s->cur_title ) ; |
| 43 | + $ret .= "<tr><td$color align=right valign=top nowrap>$s->cnt</td>" ; |
| 44 | + $ret .= "<td$color align=right valign=top nowrap>(".str_replace("$1",$s->len,$wikiStubChars).")</td>\n" ; |
| 45 | + $ret .= "<td$color nowrap valign=top>[[$s->cur_title|".$k->getNiceTitle()."]]</td>\n"; |
| 46 | + if ( in_array ( "is_sysop" , $user->rights ) ) |
| 47 | + $ret .= "<td$color valign=top nowrap><nowiki><a href=\"".wikiLink("special:deletepage&target=$k->url")."\">$wikiStubDelete</a></nowiki></td>" ; |
| 48 | + else $ret .= "<td$color width=\"100%\" nowrap> </td>" ; |
| 49 | + |
| 50 | + if ( $showLinksThere == 1 ) { |
| 51 | + $lf = "" ; |
| 52 | + $lh = pagesThatLinkHere($s->cur_title,$connection); |
| 53 | + if ( count ( $lh ) <= 5 and count ( $lh ) > 0 ) { |
| 54 | + foreach ( $lh as $ll ) { |
| 55 | + if ( $lf == "" ) $lf = " <font size=-1>(" ; |
| 56 | + else $lf .= " - " ; |
| 57 | + $lf .= "[[$ll->cur_title]]" ; |
| 58 | + } |
| 59 | + $lf .= ")</font>" ; |
| 60 | + } |
| 61 | + $ret .= "<td$color width=\"100%\" valign=top>".str_replace("$1",count($lh),$wikiStubLinkHere)."$lf</td>\n"; |
| 62 | + } else $ret .= "<td$color valign=top><nowiki><a href=\"".wikiLink("special:whatlinkshere&target=$k->url")."\">Show pages that link to \"".$k->getNiceTitle()."\"</a></nowiki></td>\n" ; |
| 63 | + |
| 64 | + $ret .= "</tr>" ; |
| 65 | + if ( $color == $color1 ) $color = $color2 ; |
| 66 | + else $color = $color1 ; |
| 67 | + } |
| 68 | + $ret .= "</table>\n" ; |
| 69 | + |
| 70 | + $ret .= "<nowiki>" ; |
| 71 | + $before = $startat - $perpage ; $fin = $before + $perpage - 1 ; |
| 72 | + if ( $startat > 1 ) $ret .= "<a href=\"".wikiLink("special:LongPages&startat=$before&showLinksThere=$showLinksThere")."\">$before-$fin<<</a> "; |
| 73 | + $after = $startat + $perpage ; $fin = $after+$perpage - 1 ; if ( $fin > $total ) $fin = $total ; |
| 74 | + if ( $after-1 < $total ) $ret .= "<a href=\"".wikiLink("special:LongPages&startat=$after&showLinksThere=$showLinksThere")."\">>>$after-$fin</a>" ; |
| 75 | + $ret .= "</nowiki>" ; |
| 76 | + #mysql_close ( $connection ) ; |
| 77 | + return $ret ; |
| 78 | + } |
| 79 | +?> |
\ No newline at end of file |
Property changes on: trunk/phpwiki/fpw/special_longpages.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 80 | + native |
Added: svn:keywords |
2 | 81 | + Author Date Id Revision |