Revision history for Mod041fPageIndexByLetter


Revision [23288]

Last edited on 2016-05-20 07:38:47 by DavePreston [Replaces old-style internal links with new pipe-split links.]
Additions:
**[[JsnX | Jason Tourtelotte]]** (major refinement to the code -- almost a complete rewrite)
Deletions:
**[[JsnX Jason Tourtelotte]]** (major refinement to the code -- almost a complete rewrite)


Revision [19347]

Edited on 2008-01-28 00:15:25 by DavePreston [Modified links pointing to docs server]

No Differences

Revision [17460]

Edited on 2007-09-01 15:09:02 by DavePreston [reverted]
Additions:
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>");
}
?>
Deletions:
if (!$requested_letter


Revision [17454]

Edited on 2007-09-01 13:08:10 by HajWor [reverted]
Additions:
if (!$requested_letter
Deletions:
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>");
}
?>


Revision [17217]

Edited on 2007-07-07 15:02:03 by JavaWoman [ypot]
Additions:
**[[JsnX Jason Tourtelotte]]** (major refinement to the code -- almost a complete rewrite)
Deletions:
**[[JsnX jason Tourtelotte]]** (major refinement to the code -- almost a complete rewrite)


Revision [17216]

Edited on 2007-07-07 15:01:43 by JavaWoman [standardized credit links]
Additions:
==== 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)
**[[JsnX 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:

{{pageindex letter="d"}}

----
=== 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>");
}
?>
Deletions:
==== 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)
- JsnX (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:

{{pageindex letter="d"}}

----
=== 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>");
}
?>


Revision [16959]

Edited on 2007-05-31 23:27:31 by JsnX [Reverted]
Additions:
==== 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)
- JsnX (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:

{{pageindex letter="d"}}

----
=== 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>");
}
?>
Deletions:
==== 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)
- JsnX (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:

{{pageindex letter="d"}}

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


Revision [16758]

Edited on 2007-05-31 10:44:49 by KxnD0i [Reverted]
Additions:
==== 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)
- JsnX (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:

{{pageindex letter="d"}}

----
=== 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
Deletions:
==== 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)
- JsnX (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:

{{pageindex letter="d"}}

----
=== 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>");
}
?>


Revision [1409]

Edited on 2004-09-26 15:28:52 by JsnX [small code edit]
Additions:
if (!preg_match("/[A-Za-z]/", $firstChar)) $firstChar = "#";
Deletions:
if (!preg_match("/[A-Za-z]/", $firstChar)) {
$firstChar = "#";


Revision [1408]

Edited on 2004-09-26 15:15:50 by JsnX [small edit to code, so that letter clicked takes precedence over action parameter]
Additions:
if (isset($_REQUEST["letter"])) $requested_letter = $_REQUEST["letter"]; else $requested_letter = '';
if (!$requested_letter && isset($letter)) $requested_letter = strtoupper($letter);
Deletions:
if ($letter) $requested_letter = strtoupper($letter); else $requested_letter = $_REQUEST["letter"];


Revision [1407]

The oldest known version of this page was created on 2004-09-26 14:54:01 by JsnX [small edit to code, so that letter clicked takes precedence over action parameter]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki