Wikka Mod 041

Type: Feature Addition

Credit

Mark Kasper and GmBowen (main credit for the idea and initial code)
AHerdOfTurtles (for helping me see that this is a cool idea)
Jason Tourtelotte (major refinement to the code -- almost a complete rewrite)

Description


This modification adds the ability to show an index listing of pages that start with a certain letter. There is also an alphabetical heading at the top of each listing. Just click a letter to see pages that start with that letter.

For example:

Usage:

{{pageindex letter="d"}}


Outcome:

Page Index


This is an alphabetical list of pages you can read on this server.
 
All  #  A  #  A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

T
TableAction [TableAction] . . . . Owner: JavaWoman
TableActionInfo [TableActionInfo] . . . . Owner: JavaWoman
TableExample [TableExample] . . . . Owner: GregorLindner
TableMarkup [TableMarkup] . . . . Owner: JsnX
TableMarkupReference [TableMarkupReference] . . . . Owner: JsnX
TableofcontentsAction [TableofcontentsAction] . . . . Owner: JavaWoman
TableofcontentsActionInfo [TableofcontentsActionInfo] . . . . Owner: JavaWoman
TableOfContentsPseudoAction [TableOfContentsPseudoAction] . . . . Owner: AndreaRossato
TableStyling [TableStyling] . . . . Owner: DarTar
TabNavigation [TabNavigation] . . . . Owner: GmBowen
TabsMenu [TabsMenu] . . . . Owner: AndreasHeintze
TammyCravit [TammyCravit] . . . . Owner: TammyCravit
Team4Wiki [Team4Wiki] . . . . Owner: Team4Wiki
TeaSick [TeaSick] . . . . Owner: TeaSick
TechnicalWriting [TechnicalWriting] . . . . Owner: TechnicalWriting
TehR00t [TehR00t] . . . . Owner: TehR00t
TemplateSystem [TemplateSystem] . . . . Owner: NilsLindenberg
TeseoTeseo [TeseoTeseo] . . . . Owner: TeseoTeseo
Test [Test] . . . . Owner: DarTar
TestActionNewpage [TestActionNewpage] . . . . Owner: DotMG
TestHomePage [TestHomePage] . . . . Owner: DarTar
TestHomePage1 [TestHomePage1] . . . . Owner: DarTar
TestHomePage2 [TestHomePage2] . . . . Owner: DarTar
TestHomePage3 [TestHomePage3] . . . . Owner: JavaWoman
TestHomePage4 [TestHomePage4] . . . . Owner: DarTar
TestHomePageLayout [TestHomePageLayout] . . . . Owner: DarTar
testing [testing] . . . . Owner: BrWyseur
TestLinkHere [TestLinkHere] . . . . Owner: TestWikiUser
TestMaps [TestMaps] . . . . Owner: JsnX
TestPage [TestPage] . . . . Owner: BrianKoontz
TestPage24 [TestPage24] . . . . Owner: WikiJakob
TestTestPage [TestTestPage] . . . . Owner: TestTest
TestTestPage2 [TestTestPage2] . . . . Owner: TestTest
TestUTF8 [TestUTF8] . . . . Owner: DarTar
TeXLogoActions [TeXLogoActions] . . . . Owner: DarTar
TextFormatting [TextFormatting] . . . . Owner: NilsLindenberg
TextSearch [TextSearch]
TextSearchActionInfo [TextSearchActionInfo] . . . . Owner: NilsLindenberg
TextSearchExpanded [TextSearchExpanded]
TextSearchExpandedActionInfo [TextSearchExpandedActionInfo] . . . . Owner: NilsLindenberg
TheBrandNewPage [TheBrandNewPage] . . . . Owner: BoinkFella
TheComputerMutt [TheComputerMutt] . . . . Owner: TheComputerMutt
TheLounge [TheLounge] . . . . Owner: JsnX
TheLoungeLeavingMessages [TheLoungeLeavingMessages] . . . . Owner: JavaWoman
TheodoraBakker [TheodoraBakker] . . . . Owner: TheodoraBakker
TheTestPage [TheTestPage] . . . . Owner: SuFu
TheWikiWay [TheWikiWay] . . . . Owner: DarTar
ThinkingAboutLinking [ThinkingAboutLinking] . . . . Owner: DennyShimkoski
ThirdPartyInfo [ThirdPartyInfo] . . . . Owner: JavaWoman
ThirdPartyIntegration [ThirdPartyIntegration] . . . . Owner: NilsLindenberg
ThisIsANewPage [ThisIsANewPage] . . . . Owner: RedFoot
ThisIsMyNewLink [ThisIsMyNewLink] . . . . Owner: ChuckPheatt
ThoMas [ThoMas] . . . . Owner: ThoMas
ThomasNolte [ThomasNolte] . . . . Owner: ThomasNolte
ThoughtsOnSecurity [ThoughtsOnSecurity] . . . . Owner: TryMe
ThuWe [ThuWe] . . . . Owner: ThuWe
TianB [TianB] . . . . Owner: NickDamoulakis
TianBe [TianBe] . . . . Owner: TianBe
TimeKiller [TimeKiller] . . . . Owner: TimeKiller
TimeWithOffset [TimeWithOffset] . . . . Owner: JasonHuebel
TimF [TimF] . . . . Owner: TimF
TimHodson [TimHodson] . . . . Owner: TimHodson
TimoK [TimoK] . . . . Owner: TimoK
TiMoTeo [TiMoTeo]
TmO [TmO] . . . . Owner: TmO
ToledanoX [ToledanoX] . . . . Owner: ToledanoX
TomEk [TomEk] . . . . Owner: TomEk
TomSalzer [TomSalzer] . . . . Owner: TomSalzer
TomSpilman [TomSpilman] . . . . Owner: TomSpilman
TonExtraWiki [TonExtraWiki] . . . . Owner: PaulWittenbraker
TonyH [TonyH] . . . . Owner: TonyH
TonyLinde [TonyLinde] . . . . Owner: TonyLinde
TonZijlstra [TonZijlstra] . . . . Owner: TonZijlstra
TormodHaugen [TormodHaugen] . . . . Owner: TormodHaugen
TpH [TpH] . . . . Owner: TpH
TrackIPaddressMod [TrackIPaddressMod] . . . . Owner: WazoO
TRBCounter [TRBCounter] . . . . Owner: KrzysztofTrybowski
TRBMostVisited [TRBMostVisited] . . . . Owner: KrzysztofTrybowski
TrickiNicki [TrickiNicki] . . . . Owner: TrickiNicki
TromboneFreakus [TromboneFreakus] . . . . Owner: TromboneFreakus
TruncatedPageWorkaround [TruncatedPageWorkaround] . . . . Owner: JavaWoman
TweedleDumb [TweedleDumb] . . . . Owner: TweedleDumb
TwitterFeed [TwitterFeed] . . . . Owner: PezHore
TwoColumnLayout [TwoColumnLayout] . . . . Owner: BrianKoontz
TwoMCM [TwoMCM] . . . . Owner: TwoMCM
TypedPages [TypedPages] . . . . Owner: MasinAlDujaili



Code


[26/9/04] actions/pageindex.php file after this mod:

<?php
if ($pages = $this->LoadAllPages())
{
	if (isset($_REQUEST["letter"])) $requested_letter = $_REQUEST["letter"]; else $requested_letter = '';
	if (!$requested_letter && isset($letter)) $requested_letter = strtoupper($letter); 
	$cached_username = $this->GetUserName();
	$user_owns_pages = false;
	$link = $this->href("", "", "letter=");
	$index_header = "<strong><a href='$link'>All </a></strong> \n";
	$index_output = "";
	$current_character = "";
	$character_changed = false;
	foreach ($pages as $page)
	{
		$page_owner = $page["owner"];
		// $this->CachePage($page);
		$firstChar = strtoupper($page["tag"][0]);
		if (!preg_match("/[A-Za-z]/", $firstChar)) $firstChar = "#";
		if ($firstChar != $current_character) {
			$index_header .= "<strong><a href='$link$firstChar'>$firstChar</a></strong> \n";
			$current_character = $firstChar;
			$character_changed = true;
		}
		if ($requested_letter == '' || $firstChar == $requested_letter) {
			if ($character_changed) {
				$index_output .= "<br />\n<strong>$firstChar</strong><br />\n";
				$character_changed = false;
			}
			$index_output .= $this->Link($page["tag"]);
			if ($cached_username == $page_owner) {                       
				$index_output .= "*";
				$user_owns_pages = true;
			} elseif ($page_owner != '(Public)' && $page_owner != '') {
				$index_output .= " . . . . Owner: ".$page_owner;
			}
			 	$index_output .= "<br />\n";    
		}
	}
	$index_header .= "<br />";
	if ($user_owns_pages) $index_output .= "<br />\n* Indicates a page that you own.<br />\n";    
	print $index_header.$index_output;
} else {
	print("<em>No pages found.</em>");
}
?>
There are 5 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki