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  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  # 

A
AaronSmith [AaronSmith] . . . . Owner: AaronSmith
AbA [AbA] . . . . Owner: AbA
AbbreviationAction [AbbreviationAction] . . . . Owner: ChristianBarthelemy
AbbreviationActionInfo [AbbreviationActionInfo] . . . . Owner: ChristianBarthelemy
AbuZaim [AbuZaim] . . . . Owner: AbuZaim
AcidPhil [AcidPhil] . . . . Owner: AcidPhil
ACLInfo [ACLInfo]
ACLInfoFR [ACLInfoFR] . . . . Owner: SamuelDr
ACLsWithUserGroups [Managing User Groups through ACLs] . . . . Owner: ChristianBarthelemy
AcronymFormatter [AcronymFormatter] . . . . Owner: DarTar
ActionInfo [ActionInfo] . . . . Owner: NilsLindenberg
ActionInfoDE [ActionInfoDE] . . . . Owner: YvesFischer
ActionInfoFR [ActionInfoFR] . . . . Owner: PivWan
ActionInfoTemplate [ActionInfoTemplate] . . . . Owner: JavaWoman
ActionParsQuoting [ActionParsQuoting] . . . . Owner: JavaWoman
ActionsInFooter [ActionsInFooter] . . . . Owner: WillyPs
ActionsWithCheckSum [ActionsWithCheckSum] . . . . Owner: OnegWR
ActionTemplate [ActionTemplate] . . . . Owner: JavaWoman
ActiveDirectory [ActiveDirectory] . . . . Owner: ChristianBarthelemy
ActivitySummaryAction [ActivitySummaryAction] . . . . Owner: KlenWell
AdamCrews [AdamCrews] . . . . Owner: AdamCrews
AdamWhitlock [AdamWhitlock] . . . . Owner: AdamWhitlock
AddCommentHandler [AddCommentHandler] . . . . Owner: AxelMulder
AddingImages [AddingImages] . . . . Owner: DarTar
AddingImagesES [AddingImagesES] . . . . Owner: DiegoBuendia
AddingImagesFR [AddingImagesFR] . . . . Owner: PivWan
AddingLinks [AddingLinks] . . . . Owner: DarTar
AddingLinksFR [AddingLinksFR] . . . . Owner: PivWan
AddLinkAction [AddLinkAction] . . . . Owner: OnegWR
AddLinkActionInfo [AddLinkActionInfo] . . . . Owner: OnegWR
AddThisAction [AddThisAction] . . . . Owner: CimNine
AddThisActionInfo [AddThisActionInfo] . . . . Owner: CimNine
AdminActions [AdminActions] . . . . Owner: OlivierBorowski
AdminHolidays [AdminHolidays] . . . . Owner: DarTar
AdminModules [AdminModules] . . . . Owner: DarTar
AdminPages [AdminPages] . . . . Owner: JsnX
AdminReleaseCheckList12 [AdminReleaseCheckList12] . . . . Owner: BrianKoontz
AdminReleaseCheckList131 [AdminReleaseCheckList131] . . . . Owner: BrianKoontz
AdminReleaseCheckList137 [Release Check List] . . . . Owner: BrianKoontz
AdminReleaseCheckList14 [AdminReleaseCheckList14] . . . . Owner: BrianKoontz
AdminUsers [AdminUsers] . . . . Owner: JsnX
AdrianB [AdrianB] . . . . Owner: AdrianB
AduC812 [AduC812] . . . . Owner: AduC812
AdvancedBacklinksAction [AdvancedBacklinksAction] . . . . Owner: JavaWoman
AdvancedCategoryAction [AdvancedCategoryAction] . . . . Owner: JavaWoman
AdvancedCategorySystem [AdvancedCategorySystem] . . . . Owner: TimoK
AdvancedFormatter [AdvancedFormatter] . . . . Owner: DarTar
AdvancedFormOpen [AdvancedFormOpen] . . . . Owner: JavaWoman
AdvancedReferrersHandler [AdvancedReferrersHandler] . . . . Owner: DarTar
AgeAction [AgeAction] . . . . Owner: PezHore
AhA [AhA] . . . . Owner: AhA
AixosUser [AixosUser] . . . . Owner: AixosUser
AjaxGallery [AjaxGallery] . . . . Owner: YodaHome
AjaxIntegration [AjaxIntegration] . . . . Owner: DarTar
AkinoAme [AkinoAme] . . . . Owner: AkinoAme
AlanBiocca [AlanBiocca] . . . . Owner: AlanBiocca
AlBux [AlBux] . . . . Owner: AlBux
AleOkada [AleOkada] . . . . Owner: AleOkada
AleRecipe [AleRecipe] . . . . Owner: AleOkada
AlessandroMelandri [AlessandroMelandri] . . . . Owner: AlessandroMelandri
AlessandroRonchi [AlessandroRonchi] . . . . Owner: AlessandroRonchi
AlexanderSavintsev [AlexanderSavintsev] . . . . Owner: AlexanderSavintsev
AlexBernstein [AlexBernstein] . . . . Owner: AlexBernstein
AlexFranke [AlexFranke] . . . . Owner: AlexFranke
AliasGalen [AliasGalen] . . . . Owner: AliasGalen
AltUserSettings [AltUserSettings] . . . . Owner: BrianKoontz
AncestorPage [AncestorPage] . . . . Owner: PivWan
AnchorAction [AnchorAction] . . . . Owner: DotMG
AndCod [AndCod] . . . . Owner: AndCod
AndreaRossato [AndreaRossato] . . . . Owner: AndreaRossato
AndreasTengicki [AndreasTengicki] . . . . Owner: AndreasTengicki
AndrewEddie [AndrewEddie] . . . . Owner: AndrewEddie
AndrewLister [AndrewLister] . . . . Owner: AndrewLister
AndyB [AndyB] . . . . Owner: AndyB
AndyGreen [AndyGreen] . . . . Owner: AndyGreen
ANewHomeForWikka [A new home for Wikka] . . . . Owner: DarTar
AngelSummoningSpaceBadgers [AngelSummoningSpaceBadgers] . . . . Owner: CaryCollett
AnotherPage [AnotherPage] . . . . Owner: PgpTag
AnsFans [AnsFans] . . . . Owner: AnsFans
AnthonyPetrillo [AnthonyPetrillo] . . . . Owner: AnthonyPetrillo
AntoineThevenon [AntoineThevenon] . . . . Owner: AntoineThevenon
AntonioGallo [AntonioGallo] . . . . Owner: AntonioGallo
AntonSpiridonov [AntonSpiridonov] . . . . Owner: AntonSpiridonov
AppallingInconsistency [AppallingInconsistency] . . . . Owner: AppallingInconsistency
ArchiveLinkFormattingFix [ArchiveLinkFormattingFix] . . . . Owner: JsnX
ArrayToColumns [ArrayToColumns] . . . . Owner: JavaWoman
ArrayToList [ArrayToList] . . . . Owner: JavaWoman
ArtemBamuratov [ArtemBamuratov] . . . . Owner: ArtemBamuratov
AshCrow [AshCrow] . . . . Owner: AshCrow
AsmaDeus [AsmaDeus] . . . . Owner: AsmaDeus
AttachmentInfo [AttachmentInfo] . . . . Owner: NilsLindenberg
AtulChitnis [AtulChitnis] . . . . Owner: AtulChitnis
AugustBrunsman [AugustBrunsman] . . . . Owner: AugustBrunsman
AuGuy [AuGuy] . . . . Owner: AuGuy
AutomaticUserPageCreation [AutomaticUserPageCreation] . . . . Owner: NilsLindenberg
AutoRefreshFromBody [AutoRefreshFromBody] . . . . Owner: Curucahm
AutoReplace [AutoReplace] . . . . Owner: ChristianBarthelemy
AxelMulder [AxelMulder] . . . . Owner: AxelMulder
AxlYuan [AxlYuan] . . . . Owner: AxlYuan



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