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 

D
DaC [DaC] . . . . Owner: DaC
DaN [DaN] . . . . Owner: DaN
DanieleCruciani [DanieleCruciani] . . . . Owner: DanieleCruciani
DanieleGaliffa [DanieleGaliffa] . . . . Owner: DanieleGaliffa
DanWest [DanWest] . . . . Owner: DanWest
DanWestCalendar [DanWestCalendar] . . . . Owner: DanWest
DanWestCRT [DanWestCRT] . . . . Owner: DanWest
DanWestCustomNav [DanWestCustomNav] . . . . Owner: DanWest
DanWestIncludeFile [DanWestIncludeFile] . . . . Owner: DanWest
DanWestLink [DanWestLink] . . . . Owner: DanWest
DanWestPgHeader [DanWestPgHeader] . . . . Owner: DanWest
DanWestUserReg [DanWestUserReg] . . . . Owner: DanWest
DanWestWx [DanWestWx] . . . . Owner: DanWest
DanzInde [DanzInde] . . . . Owner: DanzInde
DarTar [DarTar] . . . . Owner: DarTar
DartarI18N [DartarI18N] . . . . Owner: DarTar
DarTarLinks [DarTarLinks] . . . . Owner: DarTar
DatabaseAbstraction [DatabaseAbstraction] . . . . Owner: FrankChestnut
DatabaseConnectionFailed [DatabaseConnectionFailed] . . . . Owner: FrankK
DatabaseInfo [DatabaseInfo] . . . . Owner: JsnX
DateAndTimeFormat [DateAndTimeFormat] . . . . Owner: NilsLindenberg
DateWithOffset [DateWithOffset] . . . . Owner: JasonHuebel
DaveAdmin [DaveAdmin] . . . . Owner: DaveAdmin
DaveBarr [DaveBarr] . . . . Owner: DaveBarr
DaveBradshaw [DaveBradshaw] . . . . Owner: DaveBradshaw
DaveFullard [DaveFullard] . . . . Owner: DaveFullard
DavePawson [DavePawson] . . . . Owner: DavePawson
DavePreston [DavePreston] . . . . Owner: DavePreston
DavidAndrew [DavidAndrew] . . . . Owner: DavidAndrew
DavidCollantes [DavidCollantes] . . . . Owner: DavidCollantes
DaVide [DaVide] . . . . Owner: DaVide
DavidReisner [DavidReisner] . . . . Owner: DavidReisner
DavidRocha [DavidRocha] . . . . Owner: DavidRocha
DbieL [DbieL] . . . . Owner: DbieL
DbInfo [DbInfo] . . . . Owner: JavaWoman
DbInfoAction [DbInfoAction] . . . . Owner: JavaWoman
DeekMa [DeekMa] . . . . Owner: DeekMa
DefaultCategoryPages [DefaultCategoryPages] . . . . Owner: IntElf
DeleteSpamAction [DeleteSpamAction] . . . . Owner: MovieLady
DeliciousAction [DeliciousAction] . . . . Owner: DarTar
DennysAttachmentsActionInfo [DennysAttachmentsActionInfo] . . . . Owner: DennyShimkoski
DennysCalendarExperiments [DennysCalendarExperiments] . . . . Owner: DennyShimkoski
DennyShimkoski [DennyShimkoski] . . . . Owner: DennyShimkoski
DescribeActions [DescribeActions] . . . . Owner: DarTar
DescribeUsers [DescribeUsers] . . . . Owner: GeorgePetsagourakis
DetectingZlibOutputCompression [DetectingZlibOutputCompression] . . . . Owner: DotMG
DetectingZlibOutputCompressionFR [DetectingZlibOutputCompressionFR] . . . . Owner: DotMG
DevNet [DevNet] . . . . Owner: DevNet
DewJoy [DewJoy] . . . . Owner: DewJoy
DidierSpaier [DidierSpaier] . . . . Owner: DidierSpaier
DigitalNomad [DigitalNomad] . . . . Owner: DigitalNomad
DigPatil [DigPatil] . . . . Owner: DigPatil
DiN [DiN] . . . . Owner: DiN
DmitriyArkhipov [DmitriyArkhipov] . . . . Owner: DmitriyArkhipov
DmitryKiselev [DmitryKiselev] . . . . Owner: DmitryKiselev
DnsHosting [DnsHosting] . . . . Owner: TobiasJohanKarlsen
DocsMigrationTemplate [DocsMigrationTemplate] . . . . Owner: DarTar
DocumentationDiscussion [DocumentationDiscussion] . . . . Owner: NilsLindenberg
DocumentationGuidelines [DocumentationGuidelines] . . . . Owner: DarTar
DocumentationGuidelinesES [DocumentationGuidelinesES] . . . . Owner: YanB
DocumentationIndex [DocumentationIndex] . . . . Owner: NilsLindenberg
DocumentationIndexFR [DocumentationIndexFR] . . . . Owner: PivWan
DocumentationLanguageLinking [DocumentationLanguageLinking] . . . . Owner: NilsLindenberg
DocumentationTemplate [DocumentationTemplate] . . . . Owner: DarTar
DocumentationTemplateES [DocumentationTemplateES] . . . . Owner: YanB
DocumentingCodeHowto [DocumentingCodeHowto] . . . . Owner: NilsLindenberg
DocXoc [DocXoc] . . . . Owner: DocXoc
DokuWiki [DokuWiki] . . . . Owner: DarTar
DokuWikiComparison [DokuWikiComparison] . . . . Owner: DarTar
DomBonj [DomBonj] . . . . Owner: MorganHill
DonaldActon [DonaldActon] . . . . Owner: DonaldActon
DotMGTextSearchExpanded [DotMGTextSearchExpanded] . . . . Owner: DotMG
DraftDocument [DraftDocument] . . . . Owner: IntElf
DrahtKnäuel [DrahtKnäuel] . . . . Owner: DrahtKnäuel
DreckFehler [DreckFehler] . . . . Owner: DreckFehler
DreckfehlerArchive [DreckfehlerArchive] . . . . Owner: DreckFehler
DrEvil [DrEvil] . . . . Owner: DrEvil
DudeliDumidi [DudeliDumidi] . . . . Owner: DudeliDumidi
DuK [DuK] . . . . Owner: DuK
DynamicPageGeneration [DynamicPageGeneration] . . . . Owner: ChiWaWa



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