Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@

define('AUTOLINK_PAGE_TITLES', false);

// COLORIZE_MISSING_PAGES
//
// Automatically highlights as red links, any linked pages which are
// not yet written. Existing but blank pages are not colorized. This
// might degrade performance if you have thousands of links on a page.

define('COLORIZE_MISSING_PAGES', true);

// -----------------------------
// Security and session settings
Expand Down
4 changes: 4 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ a.tool {
color: #eeeeee;
}

a.missing-link {
color: #ba0000;
}

input.tool {
font-size: 11px;
color: #000000;
Expand Down
13 changes: 12 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@

function _handle_links($match)
{
return "<a href=\"" . SELF . VIEW . "/" . htmlentities($match[1]) . "\">" . htmlentities($match[1]) . "</a>";
$link = $match[1];
if ( COLORIZE_MISSING_PAGES ) {
$link_page = sanitizeFilename($link);
$link_filename = PAGES_PATH . "/$link_page.txt";
$link_page_exists = file_exists($link_filename);
} else {
$link_page_exists = true;
}
if ($link_page_exists)
return "<a href=\"" . SELF . VIEW . "/" . htmlentities($link) . "\">" . htmlentities($link) . "</a>";
else
return "<a href=\"" . SELF . VIEW . "/" . htmlentities($link) . "\" class=\"missing-link\">" . htmlentities($link) . "</a>";
}


Expand Down