From: Shaun M. <sin...@us...> - 2005-03-01 02:08:16
|
Update of /cvsroot/phpwsbb/phpwsbb/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4352 Modified Files: Message.php Log Message: Fixed XHTML issue. Added 'Back to the forum' Don't allow forking if a message has no replies Index: Message.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/class/Message.php,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Message.php 5 Jan 2005 16:39:07 -0000 1.76 --- Message.php 1 Mar 2005 02:08:04 -0000 1.77 *************** *** 183,188 **** } ! ! if ($_SESSION['OBJ_user']->allow_access('phpwsbb', 'fork_messages') && $this->isModerator) $tags['FORK'] = '<a href="./index.php?module=phpwsbb&PHPWSBB_MAN_OP=fork&PHPWS_MAN_ITEMS[]=' . $this->getId() . '"><img src="./images/phpwsbb/fork.png" border="0" alt="' . $_SESSION['translate']->it('Fork') . '" title="' . $_SESSION['translate']->it('Fork') . '" /> ' . $_SESSION['translate']->it('Fork') . '</a>'; --- 183,188 ---- } ! $thread = new PHPWSBB_Thread($this->_tid); ! if (($_SESSION['OBJ_user']->allow_access('phpwsbb', 'fork_messages') && $this->isModerator) && ($thread->_replies > 0)) $tags['FORK'] = '<a href="./index.php?module=phpwsbb&PHPWSBB_MAN_OP=fork&PHPWS_MAN_ITEMS[]=' . $this->getId() . '"><img src="./images/phpwsbb/fork.png" border="0" alt="' . $_SESSION['translate']->it('Fork') . '" title="' . $_SESSION['translate']->it('Fork') . '" /> ' . $_SESSION['translate']->it('Fork') . '</a>'; *************** *** 480,484 **** } ! $GLOBALS['CNT_phpwsbb']['content'] .= '<br /><a href="./index.php?module=phpwsbb&PHPWSBB_MAN_OP=view&PHPWS_MAN_ITEMS[]=' . $thread->getId() . '">' . $_SESSION['translate']->it('Back to the topic.') . '</a><br />'; } --- 480,485 ---- } ! $GLOBALS['CNT_phpwsbb']['content'] .= '<p><a href="./index.php?module=phpwsbb&PHPWSBB_MAN_OP=view&PHPWS_MAN_ITEMS[]=' . $thread->getId() . '">' . $_SESSION['translate']->it('Back to the topic.') . '</a> | '; ! $GLOBALS['CNT_phpwsbb']['content'] .= '<a href="./index.php?module=phpwsbb&PHPWSBB_MAN_OP=viewforum&PHPWS_MAN_ITEMS[]=' . $thread->_fid . '">' . $_SESSION['translate']->it('Back to the forum.') . '</a></p>'; } *************** *** 498,505 **** } - // Need to create thread $oldtid = $this->_tid; $oldthread = new PHPWSBB_Thread($this->_tid); $thread = new PHPWSBB_Thread; $thread->setLabel($this->getLabel()); --- 499,513 ---- } // Need to create thread $oldtid = $this->_tid; $oldthread = new PHPWSBB_Thread($this->_tid); + + if (!$oldthread->_replies > 0) { + $message = $_SESSION['translate']->it('Can\'t fork message [var1] as it contains no replies.', $this->_tid); + $error = new PHPWS_Error('phpwsbb', 'PHPWSBB_Manager::_accessDenied()', $message, 'exit', 1); + $error->message(); + return FALSE; + } + $thread = new PHPWSBB_Thread; $thread->setLabel($this->getLabel()); |