Lines Matching +full:comments +(+path:plugin +path:discussion) -(+path:plugin +path:discussion +path:lang)

43                 'comments',
112 * Preview Comments
234 $file = metaFN($ID, '.comments');
266 // do the data processing for comments
270 if(empty($_REQUEST['text'])) return; // don't add empty comments
276 … if(empty($_REQUEST['name']) or empty($_REQUEST['mail'])) return; // don't add anonymous comments
319 public function comments(Doku_Event $event, $param) { function in action_plugin_discussion
394 * Shows all comments of the current page
400 // get .comments meta file name
401 $file = metaFN($ID, '.comments');
410 if (!$data['status']) return false; // comments are turned off
418 $cnt = empty($data['comments']) ? 0 : count($data['comments']);
420 if (is_array($data['comments'])){
421 $keys = @array_keys($data['comments']);
424 …if($cnt > 1 || ($cnt == 1 && $data['comments'][$keys[0]]['show'] == 1) || $this->getConf('allowgue…
435 // now display the comments
436 if (isset($data['comments'])) {
438 $data['comments'] = $this->_flattenThreads($data['comments']);
439 uasort($data['comments'], '_sortCallback');
442 $data['comments'] = array_reverse($data['comments']);
444 foreach ($data['comments'] as $key => $value) {
468 * @param array $comments
472 protected function _flattenThreads($comments, $keys = null) { argument
474 $keys = array_keys($comments);
477 if (!empty($comments[$cid]['replies'])) {
478 $rids = $comments[$cid]['replies'];
479 $comments = $this->_flattenThreads($comments, $rids);
480 $comments[$cid]['replies'] = array();
482 $comments[$cid]['parent'] = '';
484 return $comments;
488 * Adds a new comment and then displays all comments
510 return false; // guest comments not allowed
516 $file = metaFN($ID, '.comments');
518 // create comments file if it doesn't exist yet
524 if ($data['status'] != 1) return false; // comments off or closed
539 if (!is_array($data['comments'][$parent])) {
547 $data['comments'][$cid] = array(
582 $data['comments'][$parent]['replies'][] = $cid;
585 // update the number of comments
589 $data['comments'][$cid]['cid'] = $cid;
590 $this->_notify($data['comments'][$cid], $data['subscribers']);
601 * Saves the comment with the given ID and then displays all comments
629 $file = metaFN($ID, '.comments');
635 if (is_array($data['comments'][$cid]['user'])) {
636 $user = $data['comments'][$cid]['user']['id'];
639 $user = $data['comments'][$cid]['user'];
650 $data['comments'][$cid]['user'] = array(
652 'name' => $data['comments'][$cid]['name'],
653 'mail' => $data['comments'][$cid]['mail'],
654 'url' => $data['comments'][$cid]['url'],
655 'address' => $data['comments'][$cid]['address'],
657 $data['comments'][$cid]['date'] = array(
658 'created' => $data['comments'][$cid]['date']
663 $now = $data['comments'][$cid]['show'];
664 $data['comments'][$cid]['show'] = !$now;
667 $type = ($data['comments'][$cid]['show'] ? 'sc' : 'hc');
670 $data['comments'][$cid]['show'] = true;
676 $data['comments'][$cid]['show'] = false;
682 $data['comments'] = $this->_removeComment($cid, $data['comments']);
691 $data['comments'][$cid]['date']['modified'] = $date;
692 $data['comments'][$cid]['raw'] = $raw;
693 $data['comments'][$cid]['xhtml'] = $xhtml;
710 protected function _removeComment($cid, $comments) { argument
711 if (is_array($comments[$cid]['replies'])) {
712 foreach ($comments[$cid]['replies'] as $rid) {
713 $comments = $this->_removeComment($rid, $comments);
716 unset($comments[$cid]);
717 return $comments;
731 if (!isset($data['comments'][$cid])) return false; // comment was removed
732 $comment = $data['comments'][$cid];
764 $comment = $data['comments'][$cid];
881 $comment = $data['comments'][$cid];
941 // not for unregistered users when guest comments aren't allowed
969 // for guest/adminimport: show name, e-mail and subscribe to comments fields
1114 * Adds an entry to the comments changelog
1158 * Trims the recent comments cache to the last $conf['changes_days'] recent
1353 * Counts the number of visible comments
1360 foreach ($data['comments'] as $comment) {
1380 if (!isset($data['comments'][$rid])) continue; // reply was removed
1381 if (!$data['comments'][$rid]['show']) continue;
1383 $rids = $data['comments'][$rid]['replies'];
1419 $cfile = metaFN($ID, '.comments');
1429 $comments = unserialize(io_readFile($cfile, false));
1431 if ($comments['title']) {
1432 $title = hsc($comments['title']);
1434 $num = $comments['number'];
1435 if ((!$comments['status']) || (($comments['status'] == 2) && (!$num))) return false;
1575 * This means that all pages will be indexed again in order to add the comments
1586 * Adds the comments to the index
1593 // get .comments meta file name
1594 $file = metaFN($event->data[$param['id']], '.comments');
1598 if ((!$data['status']) || ($data['number'] == 0)) return; // comments are turned off
1600 // now add the comments
1601 if (isset($data['comments'])) {
1602 foreach ($data['comments'] as $key => $value) {
1611 // get .comments meta file name
1612 $file = metaFN($event->data['id'], '.comments');
1616 if ((!$data['status']) || ($data['number'] == 0)) return; // comments are turned off
1620 // now add the comments
1621 if (isset($data['comments'])) {
1622 foreach ($data['comments'] as $key => $value) {
1633 if (!isset($data['comments'][$cid])) return false; // comment was removed
1634 $comment = $data['comments'][$cid];
1656 * Saves the current comment status and title in the .comments file
1665 $file = metaFN($ID, '.comments');
1672 … // Don't enable comments when automatic comments are on - this already happens automatically
1673 // and if comments are turned off in the admin this only updates the .comments file
1703 if (!isset($data['comments'][$cid])) return ''; // comment was removed
1704 $comment = $data['comments'][$cid];