• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-jp-ancient: Commit

Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用


Commit MetaInfo

Revisão80c657aaa1b8c5c67b1900523cc798767b3852c3 (tree)
Hora2011-03-21 11:10:30
Autorsakamocchi <sakamocchi@1ca2...>
Commitersakamocchi

Mensagem de Log

Just reviewing code formatting.

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1171 1ca29b6e-896d-4ea0-84a5-967f57386b96

Mudança Sumário

Diff

--- a/utf8/nucleus/libs/COMMENTACTIONS.php
+++ b/utf8/nucleus/libs/COMMENTACTIONS.php
@@ -84,17 +84,19 @@ class COMMENTACTIONS extends BaseActions {
8484 function setParser(&$parser) {
8585 $this->parser =& $parser;
8686 }
87-
87+
8888 function setCommentsObj(&$commentsObj) {
8989 $this->commentsObj =& $commentsObj;
9090 }
91-
91+
9292 function setTemplate($template) {
9393 $this->template =& $template;
9494 }
95-
95+
9696 function setCurrentComment(&$comment) {
97+
9798 global $manager;
99+
98100 // begin if: member comment
99101 if ($comment['memberid'] != 0)
100102 {
@@ -102,9 +104,9 @@ class COMMENTACTIONS extends BaseActions {
102104
103105 $mem =& $manager->getMember($comment['memberid']);
104106 $comment['user'] = $mem->getDisplayName();
105-
107+
106108 // begin if: member URL exists, set it as the userid
107- if ($mem->getURL())
109+ if ($mem->getURL() )
108110 {
109111 $comment['userid'] = $mem->getURL();
110112 }
@@ -113,7 +115,7 @@ class COMMENTACTIONS extends BaseActions {
113115 {
114116 $comment['userid'] = $mem->getEmail();
115117 } // end if
116-
118+
117119 $comment['userlinkraw'] = createLink(
118120 'member',
119121 array(
@@ -121,15 +123,19 @@ class COMMENTACTIONS extends BaseActions {
121123 'name' => $mem->getDisplayName(),
122124 'extra' => $this->commentsObj->itemActions->linkparams
123125 )
124- );
126+ );
127+
125128 }
126129 // else: non-member comment
127130 else
128131 {
132+
129133 // create smart links
134+
130135 // begin if: comment userid is not empty
131136 if (!empty($comment['userid']) )
132137 {
138+
133139 // begin if: comment userid has either "http://" or "https://" at the beginning
134140 if ( (strpos($comment['userid'], 'http://') === 0) || (strpos($comment['userid'], 'https://') === 0) )
135141 {
@@ -140,6 +146,7 @@ class COMMENTACTIONS extends BaseActions {
140146 {
141147 $comment['userlinkraw'] = 'http://' . $comment['userid'];
142148 } // end if
149+
143150 }
144151 // else if: comment email is valid
145152 else if (isValidMailAddress($comment['email']) )
@@ -151,7 +158,9 @@ class COMMENTACTIONS extends BaseActions {
151158 {
152159 $comment['userlinkraw'] = 'mailto:' . $comment['userid'];
153160 } // end if
161+
154162 } // end if
163+
155164 $this->currentComment =& $comment;
156165 global $currentcommentid, $currentcommentarray;
157166 $currentcommentid = $comment['commentid'];
@@ -220,7 +229,7 @@ class COMMENTACTIONS extends BaseActions {
220229 function parse_date($format = '') {
221230 echo formatDate($format, $this->currentComment['timestamp'], $this->template['FORMAT_DATE'], $this->commentsObj->itemActions->blog);
222231 }
223-
232+
224233 /**
225234 * Parse templatevar email
226235 */
@@ -351,14 +360,20 @@ class COMMENTACTIONS extends BaseActions {
351360
352361 /**
353362 * Parse templatevar user
363+ * @param string $mode
354364 */
355- function parse_user($mode='') {
365+ function parse_user($mode = '')
366+ {
356367 global $manager;
357- if ($mode == 'realname' && $this->currentComment['memberid'] > 0) {
368+
369+ if ( $mode == 'realname' && $this->currentComment['memberid'] > 0 )
370+ {
358371 $member =& $manager->getMember($this->currentComment['memberid']);
359372 echo $member->getRealName();
360- } else {
361- echo htmlspecialchars($this->currentComment['user'],ENT_QUOTES);
373+ }
374+ else
375+ {
376+ echo htmlspecialchars($this->currentComment['user'], ENT_QUOTES);
362377 }
363378 }
364379
@@ -410,7 +425,7 @@ class COMMENTACTIONS extends BaseActions {
410425 function parse_userlinkraw() {
411426 echo $this->currentComment['userlinkraw'];
412427 }
413-
428+
414429 /**
415430 * Parse templatevar userwebsite
416431 */
@@ -418,7 +433,7 @@ class COMMENTACTIONS extends BaseActions {
418433 if (!(strpos($this->currentComment['userlinkraw'], 'http://') === false))
419434 echo $this->currentComment['userlinkraw'];
420435 }
421-
436+
422437 /**
423438 * Parse templatevar userwebsitelink
424439 */
@@ -429,9 +444,9 @@ class COMMENTACTIONS extends BaseActions {
429444 echo $this->currentComment['user'];
430445 }
431446 }
432-
447+
433448 // function to enable if-else-elseif-elseifnot-ifnot-endif to comment template fields
434-
449+
435450 /**
436451 * Checks conditions for if statements
437452 *
@@ -480,7 +495,7 @@ class COMMENTACTIONS extends BaseActions {
480495 break;
481496 case 'archivenextexists':
482497 $condition = ($archivenextexists == true);
483- break;
498+ break;
484499 case 'skintype':
485500 $condition = ($name == $this->skintype);
486501 break; */
@@ -492,8 +507,8 @@ class COMMENTACTIONS extends BaseActions {
492507 break;
493508 }
494509 return $condition;
495- }
496-
510+ }
511+
497512 /**
498513 * Different checks for a category
499514 */
@@ -517,16 +532,16 @@ class COMMENTACTIONS extends BaseActions {
517532
518533 return false;
519534 }
520-
521-
535+
536+
522537 /**
523538 * Different checks for an author
524539 */
525540 function _ifAuthor($name = '', $value='') {
526541 global $member, $manager;
527-
542+
528543 if ($this->currentComment['memberid'] == 0) return false;
529-
544+
530545 $mem =& $manager->getMember($this->currentComment['memberid']);
531546 $b =& $manager->getBlog(getBlogIDFromItemID($this->currentComment['itemid']));
532547 $citem =& $manager->getItem($this->currentComment['itemid'],1,1);
@@ -539,26 +554,26 @@ class COMMENTACTIONS extends BaseActions {
539554 // check comment author name
540555 if ($name == 'name') {
541556 $value = trim(strtolower($value));
542- if ($value == '')
557+ if ($value == '')
543558 return false;
544559 if ($value == strtolower($mem->getDisplayName()))
545560 return true;
546561 }
547562
548563 // check if comment author is admin
549- if ($name == 'isadmin') {
550- $blogid = intval($b->getID());
564+ if ($name == 'isadmin') {
565+ $blogid = intval($b->getID());
551566 if ($mem->isAdmin())
552567 return true;
553-
568+
554569 return $mem->isBlogAdmin($blogid);
555570 }
556-
571+
557572 // check if comment author is item author
558- if ($name == 'isauthor') {
573+ if ($name == 'isauthor') {
559574 return (intval($citem['authorid']) == intval($this->currentComment['memberid']));
560575 }
561-
576+
562577 // check if comment author is on team
563578 if ($name == 'isonteam') {
564579 return $mem->teamRights(intval($b->getID()));
@@ -566,13 +581,13 @@ class COMMENTACTIONS extends BaseActions {
566581
567582 return false;
568583 }
569-
584+
570585 /**
571586 * Different checks for a category
572587 */
573588 function _ifItemCategory($name = '', $value='') {
574589 global $catid, $manager;
575-
590+
576591 $b =& $manager->getBlog(getBlogIDFromItemID($this->currentComment['itemid']));
577592 $citem =& $manager->getItem($this->currentComment['itemid'],1,1);
578593 $icatid = $citem['catid'];
@@ -580,7 +595,7 @@ class COMMENTACTIONS extends BaseActions {
580595 // when no parameter is defined, just check if a category is selected
581596 if (($name != 'catname' && $name != 'catid') || ($value == ''))
582597 return $b->isValidCategory($icatid);
583-
598+
584599 // check category name
585600 if ($name == 'catname') {
586601 $value = $b->getCategoryIdFromName($value);
@@ -595,15 +610,15 @@ class COMMENTACTIONS extends BaseActions {
595610 return false;
596611 }
597612
598-
613+
599614 /**
600615 * Checks if a member is on the team of a blog and return his rights
601616 */
602617 function _ifOnTeam($blogName = '') {
603618 global $blog, $member, $manager;
604-
619+
605620 $b =& $manager->getBlog(getBlogIDFromItemID($this->currentComment['itemid']));
606-
621+
607622 // when no blog found
608623 if (($blogName == '') && (!is_object($b)))
609624 return 0;
@@ -626,7 +641,7 @@ class COMMENTACTIONS extends BaseActions {
626641 global $blog, $member, $manager;
627642
628643 $b =& $manager->getBlog(getBlogIDFromItemID($this->currentComment['itemid']));
629-
644+
630645 // when no blog found
631646 if (($blogName == '') && (!is_object($b)))
632647 return 0;
@@ -642,7 +657,7 @@ class COMMENTACTIONS extends BaseActions {
642657 return $member->isBlogAdmin($blogid);
643658 }
644659
645-
660+
646661 /**
647662 * hasplugin,PlugName
648663 * -> checks if plugin exists
@@ -687,5 +702,6 @@ class COMMENTACTIONS extends BaseActions {
687702
688703 return call_user_func_array(array(&$plugin, 'doIf'), $params);
689704 }
705+
690706 }
691707 ?>
\ No newline at end of file
Show on old repository browser