==== Suggestion for Allowing Columns on Wikka Pageindex action ==== By IvanLanin I try to made adjustment to pageindex action to allow column such on category. The following code is what I've came up with, also including tweaking on the index_header. Please comment. Thx. %%(php) LoadAllPages()) { if (!isset($col)) $col = 1; if (isset($_REQUEST["letter"])) $requested_letter = $_REQUEST["letter"]; else $requested_letter = ''; if (!$requested_letter && isset($letter)) $requested_letter = strtoupper($letter); $cached_username = $this->GetUserName(); $link = $this->href("", "", "letter="); $index_header = "" . (($requested_letter != '') ? "All" : "All") . " \n"; $user_owns_pages = false; $index_output = ""; $current_character = ""; $character_changed = false; $char_count = 0; foreach ($pages as $page) { $firstChar = strtoupper($page["tag"][0]); if (!preg_match("/[A-Za-z]/", $firstChar)) $firstChar = "#"; if ($firstChar != $current_character) { $current_character = $firstChar; $character_changed = true; $char_index[$current_character] = 0; } $char_index[$firstChar]++; if ($requested_letter == '' || $firstChar == $requested_letter && $character_changed) $character_changed = false; } $current_character = ""; $character_changed = false; $index_output .= "\n"; 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 .= "" . (($requested_letter != '' && $firstChar == $requested_letter) ? $firstChar : "$firstChar") . " \n"; $current_character = $firstChar; $character_changed = true; } if ($requested_letter == '' || $firstChar == $requested_letter) { if ($character_changed) { $char_count = 0; $index_output .= "\n"; $index_output .= "\n\n"; $character_changed = false; } if ($char_count == $col) { $index_output .= "\n"; $char_count = 0; } $index_output .= '\n"; $char_count++; } } $index_output .= "\n
 
$firstChar
' . $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 .= "
"; $index_header .= "
"; if ($user_owns_pages) $index_output .= "
\n* Indicates a page that you own.
\n"; print $index_header.$index_output; } else { print("No pages found."); } ?> %% ---- CategoryUserContributions