GithubHelp home page GithubHelp logo

Comments (2)

foosel avatar foosel commented on July 18, 2024

If $conf['allowguests'] is set to false, show message for guests in place of
of the comment form instead of showing nothing. Closed by 7c8e18f

from plugin-discussion.

einhirn avatar einhirn commented on July 18, 2024

Thanks for your patch, foosel - I modified it a little further. Now the "you could leave a comment..."-line also shows a login link, and the "Discussion wrapper" is always shown so that the "You could leave a comment..."-Line doesn't appear alone on pages without comments. I hope this patch doesn't break anything.
diff -ru dokufreaks-plugin-discussion-89d0cb9/action.php /usr/local/www/dokuwiki/lib/plugins/discussion/action.php
--- dokufreaks-plugin-discussion-89d0cb9/action.php 2010-07-15 02:52:44.000000000 +0200
+++ /usr/local/www/dokuwiki/lib/plugins/discussion/action.php 2010-08-09 17:30:02.000000000 +0200
@@ -343,7 +343,6 @@
// show discussion wrapper only on certain circumstances
$cnt = count($data['comments']);
$keys = @array_keys($data['comments']);
- if($cnt > 1 || ($cnt == 1 && $data['comments'][$keys[0]]['show'] == 1) || $this->getConf('allowguests') || isset($_SERVER['REMOTE_USER'])) {
$show = true;
// section title
$title = ($data['title'] ? hsc($data['title']) : $this->getLang('discussion'));
@@ -352,7 +351,6 @@
ptln($title, 4);
ptln('', 2);
ptln('

', 2);
- }

         // now display the comments
         if (isset($data['comments'])) {
@@ -795,7 +793,11 @@
         if (!$_SERVER['REMOTE_USER'] && !$this->getConf('allowguests')) {
             ?>
             <div class="comment_form">
-                <?php echo $this->getLang('noguests'); ?>
+           <?php
+                           @require_once(DOKU_INC.'inc/template.php');
+                   echo $this->getLang('noguests');
+                   tpl_actionlink($type="login",$return=false);
+            ?>
             </div>
             <?php
             return false;
diff -ru dokufreaks-plugin-discussion-89d0cb9/lang/de/lang.php /usr/local/www/dokuwiki/lib/plugins/discussion/lang/de/lang.php
--- dokufreaks-plugin-discussion-89d0cb9/lang/de/lang.php   2010-07-15 02:52:44.000000000 +0200
+++ /usr/local/www/dokuwiki/lib/plugins/discussion/lang/de/lang.php 2010-08-09 17:36:26.000000000 +0200
@@ -34,7 +34,7 @@
 $lang['wordblock']       = 'Ihr Kommentar wurde als Spam blockiert.';
 $lang['mail_newcomment'] = 'Neuer Kommentar';
 $lang['subscribe']       = 'Kommentare abonnieren';
-$lang['noguests']        = 'Wenn Sie eingeloggt wären, könnten Sie einen Kommentar hinterlassen.';
+$lang['noguests']        = 'Wenn Sie eingeloggt wären, könnten Sie einen Kommentar hinterlassen: ';

 $lang['status']          = 'Status';
 $lang['off']             = 'aus';
diff -ru dokufreaks-plugin-discussion-89d0cb9/lang/en/lang.php /usr/local/www/dokuwiki/lib/plugins/discussion/lang/en/lang.php
--- dokufreaks-plugin-discussion-89d0cb9/lang/en/lang.php   2010-07-15 02:52:44.000000000 +0200
+++ /usr/local/www/dokuwiki/lib/plugins/discussion/lang/en/lang.php 2010-08-09 17:36:38.000000000 +0200
@@ -35,7 +35,7 @@
 $lang['moderation']      = 'Your comment has been added and awaits moderation.';
 $lang['mail_newcomment'] = 'New Comment';
 $lang['subscribe']       = 'Subscribe to comments';
-$lang['noguests']        = 'You could leave a comment if you were logged in.';
+$lang['noguests']        = 'You could leave a comment if you were logged in: ';

 $lang['status']          = 'Status';
 $lang['off']             = 'off';

from plugin-discussion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.