#11 fix for Related items trailing commas

1.2.x
closed
nobody
None
5
2012-10-11
2001-11-08
No

This patch to /lib/stdlib.php eliminates the trailing commas in the LinkRelatedpages section at the bottom of each page in phpwiki 1.2.1.

stdlib-121-LinkRelatedPages-commafix.patch

--- /Library/WebServer/Documents/phpwiki-1.2.1/lib/stdlib.php Wed Nov 7 22:17:32 2001
+++ /Library/WebServer/Documents/phpwiki-1.2.1v/lib/stdlib.php Thu Nov 8 15:40:18 2001
@@ -390,7 +390,10 @@
for($i = 0; $i < NUM_RELATED_PAGES; $i++) {
if(isset($links['in'][$i])) {
list($name, $score) = $links['in'][$i];
- $txt .= LinkExistingWikiWord($name) . " ($score), ";
+ if($i>0) {
+ $txt .= ", ";
+ }
+ $txt .= LinkExistingWikiWord($name) . " ($score)";
}
}

@@ -401,7 +404,10 @@
if(isset($links['out'][$i])) {
list($name, $score) = $links['out'][$i];
if(IsWikiPage($dbi, $name))
- $txt .= LinkExistingWikiWord($name) . " ($score), ";
+ if($i>0) {
+ $txt .= ", ";
+ }
+ $txt .= LinkExistingWikiWord($name) . " ($score)";
}
}

@@ -411,7 +417,10 @@
for($i = 0; $i < NUM_RELATED_PAGES; $i++) {
if(isset($links['popular'][$i])) {
list($name, $score) = $links['popular'][$i];
- $txt .= LinkExistingWikiWord($name) . " ($score), ";
+ if($i>0) {
+ $txt .= ", ";
+ }
+ $txt .= LinkExistingWikiWord($name) . " ($score)";
}
}

Discussion

  • Geoffrey T. Dairiki

    Logged In: YES
    user_id=45814

    Thanks! Your patch has been applied to the code in the
    release-1_2-branch of the CVS repository.

     

Log in to post a comment.