Warning: session_start(): open(/var/cpanel/php/sessions/ea-php70/sess_6l468asm55i1g3bv92cmcbhpu5, O_RDWR) failed: No space left on device (28) in /home/pmwiki/Petko/pm-throttle.php on line 8

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/pmwiki/Petko/pm-throttle.php:8) in /home/pmwiki/Petko/pm-throttle.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /home/pmwiki/Petko/pm-throttle.php:8) in /home/pmwiki/pmwiki/pmwiki.php on line 591

Warning: Cannot modify header information - headers already sent by (output started at /home/pmwiki/Petko/pm-throttle.php:8) in /home/pmwiki/pmwiki/pmwiki.php on line 2371
Simple Discuss Link - Cookbook - PmWiki

Simple Discuss Link

Summary: Add an action (or sidebar) link that leads to and from a -Talk page.
Version: 2007-07-25
Prerequisites: PmWiki 2.1.27 or newer
Status: Initial Release
Maintainer: Hagan Fox

Description

 is to first create a {$BaseName} page variable with the following in config.php :
## Create a {$BaseName} page variable for "-Talk" pages.
if (preg_match('/-Talk$/', $pagename)) { $BaseNamePatterns['/-Talk$/'] = ''; }

Next, put this markup in Site.PageActions:

(:if name *-Draft :)(:else if name *-Talk :)
* %item              class=browse    %[[{*$BaseName} |''Discuss'']]
(:else:)
* %item              class=browse    %[[{*$FullName}-Talk | Discuss ]]
(:if:)

That's it. Obviously you can modify the links to suit your taste.

A discussion link won't be shown for -Draft pages. You can similarly avoid saving drafts of discussion pages by altering the line that enables drafts.

if (! preg_match('/-Talk$/', $pagename)) $EnableDrafts = 1;

CMS enhancements

If you set a sitewide default read password you may not want non-authors to "see" your -Talk pages.

If you have $EnablePageListProtect set to 1 you can set a read password of @_site_edit on your -Talk pages.

TODO: Add note about edit templates here.

In addition, you can largely ensure your -Talk pages are inaccessible with

if (! CondAuth($pagename, 'edit')) {
  $SearchPatterns['default'][] = '!-Talk$!';
  if (preg_match('/-Talk$/', $pagename)) {
    $basename = preg_replace("/-.*\$/", '', $pagename);
    Redirect($basename); }
}

Notes

This solution works if you're using the PmWiki skin or any other skin that is compatible with the default Site.PageActions. It will work in a sidebar, but not as seamlessly (additional development required to suppress ? on non-existent pages).

This recipe only creates a link to and from a -Talk page. It's not a solution similar to that seen on Wikipedia (with a form for adding a new comment).

Comments

See Also

Contributors

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.


Warning: Unknown: open(/var/cpanel/php/sessions/ea-php70/sess_6l468asm55i1g3bv92cmcbhpu5, O_RDWR) failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php70) in Unknown on line 0