|
From: <dts...@us...> - 2003-06-03 20:46:09
|
Update of /cvsroot/phpwebsite-comm/modules/phpwsbb/class
In directory sc8-pr-cvs1:/tmp/cvs-serv22963/class
Modified Files:
Manager.php Message.php Thread.php
Log Message:
phat tight boss updatez
Index: Manager.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/phpwsbb/class/Manager.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Manager.php 3 Jun 2003 20:07:10 -0000 1.8
--- Manager.php 3 Jun 2003 20:45:29 -0000 1.9
***************
*** 53,56 ****
--- 53,57 ----
$this->setTable("mod_phpwsbb_threads");
+ $this->setOrder("updated DESC");
$GLOBALS["CNT_phpwsbb"]["content"] .= $this->getList("threads", $_SESSION["translate"]->it("Bulletin Board Topics"));
}// END FUNC _list
***************
*** 63,66 ****
--- 64,79 ----
+ function _delete() {
+ $this->thread = new PHPWSBB_Thread($_REQUEST["PHPWS_MAN_ITEMS"][0]);
+ $_REQUEST["PHPWSBB_THREAD_OP"] = "delete";
+ }// END FUNC _delete
+
+
+ function _deleteMessage() {
+ $this->message = new PHPWSBB_Message($_REQUEST["PHPWS_MAN_ITEMS"][0]);
+ $_REQUEST["PHPWSBB_MESSAGE_OP"] = "delete";
+ }// END FUNC _deleteMessage
+
+
function _new() {
$this->message = new PHPWSBB_Message;
***************
*** 84,94 ****
function action() {
switch($_REQUEST["PHPWSBB_MAN_OP"]) {
case "new":
! $content = $this->_new();
break;
case "reply":
! $content = $this->_reply();
break;
case "access_denied":
$this->_accessDenied();
--- 97,112 ----
function action() {
+ if(PHPWS_Message::isMessage($this->notice))
+ $this->notice->display();
+
switch($_REQUEST["PHPWSBB_MAN_OP"]) {
case "new":
! $this->_new();
break;
+
case "reply":
! $this->_reply();
break;
+
case "access_denied":
$this->_accessDenied();
Index: Message.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/phpwsbb/class/Message.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Message.php 3 Jun 2003 20:07:10 -0000 1.9
--- Message.php 3 Jun 2003 20:45:29 -0000 1.10
***************
*** 73,79 ****
$poster = $this->getOwner();
! if(empty($poster)) {
! $poster = $this->guestname;
! $posteremail = $this->guestemail;
}
--- 73,79 ----
$poster = $this->getOwner();
! if(is_null($poster)) {
! $poster = $this->_guestname;
! $posteremail = $this->_guestemail;
}
***************
*** 107,111 ****
/* Guest information, if not registered user */
if(empty($_SESSION["OBJ_user"]->user_id)) {
- $tags["GUESTNAME_TEXT"] = $_SESSION["translate"]->it("Guest Name");
$form->add("Message_guestname", "text", $this->_guestname);
$form->setSize("Message_guestname", 33);
--- 107,110 ----
***************
*** 114,118 ****
$tabs++;
- $tags["GUESTEMAIL_TEXT"] = $_SESSION["translate"]->it("Guest Email");
$form->add("Message_guestemail", "text", $this->_guestemail);
$form->setSize("Message_guestemail", 33);
--- 113,116 ----
***************
*** 146,149 ****
--- 144,152 ----
$tags = $form->getTemplate();
+ if(empty($_SESSION["OBJ_user"]->user_id)) {
+ $tags["GUESTNAME_TEXT"] = $_SESSION["translate"]->it("Guest Name");
+ $tags["GUESTEMAIL_TEXT"] = $_SESSION["translate"]->it("Guest Email");
+ }
+
$tags["LABEL_TEXT"] = $_SESSION["translate"]->it("Subject");
$tags["BODY_TEXT"] = $_SESSION["translate"]->it("Body");
***************
*** 182,186 ****
else {
// Need to create thread
- echo "<h3>creating new thread</h3>";
$thread = new PHPWSBB_Thread;
$thread->setLabel($this->getLabel());
--- 185,188 ----
***************
*** 188,192 ****
$thread->commit();
$this->_tid = $thread->getId();
- echo "<h3>thread has tid " . $this->getId() . "</h3>";
}
--- 190,193 ----
Index: Thread.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/phpwsbb/class/Thread.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Thread.php 3 Jun 2003 20:07:10 -0000 1.1
--- Thread.php 3 Jun 2003 20:45:29 -0000 1.2
***************
*** 96,100 ****
}
$this->commit();
! }
--- 96,149 ----
}
$this->commit();
! }// END FUNC updateThreadStats
!
!
! function _delete() {
! if(!$_SESSION["OBJ_user"]->allow_access("phpwsbb", "delete_threads")) {
! $message = $_SESSION["translate"]->it("Access to delete this thread was denied due to lack of proper permissions.");
! $error = new PHWPS_Error("phpwsbb", "PHPWSBB_Thread::_delete()", $message, "exit", 1);
! $error->message();
! return FALSE;
! }
!
! if(isset($_REQUEST["Thread_yes"])) {
! $this->kill();
!
! // Need to delete all messages
! $GLOBALS["core"]->sqlDelete("mod_phpwsbb_messages", "tid", $this->getId());
!
! $message = $_SESSION["translate"]->it("The thread [var1] was successfully deleted from the database.", "<b><i>" . $this->getLabel() . "</i></b>");
! $_SESSION["PHPWSBB_Manager"]->notice = new PHPWS_Message($message, "CNT_phpwsbb");
! $_REQUEST["PHPWSBB_MAN_OP"] = "list";
! $_SESSION["PHPWSBB_Manager"]->action();
! $_SESSION["PHPWSBB_Manager"]->managerAction();
!
! } elseif(isset($_REQUEST["Thread_no"])) {
! $message = $_SESSION["translate"]->it("No thread was deleted from the database.");
! $_SESSION["PHPWSBB_Manager"]->notice = new PHPWS_Message($message, "CNT_phpwsbb");
! $_REQUEST["PHPWSBB_MAN_OP"] = "list";
! $_SESSION["PHPWSBB_Manager"]->action();
! $_SESSION["PHPWSBB_Manager"]->managerAction();
!
! } else {
! $title = $_SESSION["translate"]->it("Delete Thread Confirmation");
!
! $form = new EZform("PHPWSBB_Thread_delete");
! $form->add("module", "hidden", "phpwsbb");
! $form->add("PHPWSBB_THREAD_OP", "hidden", "delete");
!
! $form->add("Thread_yes", "submit", $_SESSION["translate"]->it("Yes"));
! $form->add("Thread_no", "submit", $_SESSION["translate"]->it("No"));
!
! $tags = array();
! $tags = $form->getTemplate();
! $tags["MESSAGE"] = $_SESSION["translate"]->it("Are you sure you want to delete this thread?");
!
! $content = $GLOBALS["core"]->processTemplate($tags, "phpwsbb", "delete_thread.tpl");
! $_SESSION["OBJ_layout"]->popbox($title, $content, NULL, "CNT_phpwsbb");
! }
!
!
! }// END FUNC _delete
***************
*** 106,110 ****
--- 155,163 ----
$content .= $this->_view();
break;
+
case "delete":
+ $this->_delete();
+ break;
+
case "fork":
case "lock":
|