diff --git a/e107_plugins/forum/attachments/index.htm b/e107_plugins/forum/attachments/index.htm
new file mode 100755
index 000000000..e69de29bb
diff --git a/e107_plugins/forum/attachments/thumb/index.htm b/e107_plugins/forum/attachments/thumb/index.htm
new file mode 100755
index 000000000..e69de29bb
diff --git a/e107_plugins/forum/e_url/forum.php b/e107_plugins/forum/e_url/forum.php
index 877890a99..28e8861f6 100644
--- a/e107_plugins/forum/e_url/forum.php
+++ b/e107_plugins/forum/e_url/forum.php
@@ -1,5 +1,5 @@
fieldTypes['forum_post']['post_user'] = 'int';
$this->fieldTypes['forum_post']['post_forum'] = 'int';
$this->fieldTypes['forum_post']['post_datestamp'] = 'int';
+ $this->fieldTypes['forum_post']['post_edit_datestamp'] = 'int';
+ $this->fieldTypes['forum_post']['post_edit_user'] = 'int';
$this->fieldTypes['forum_post']['post_thread'] = 'int';
$this->fieldTypes['forum_post']['post_options'] = 'escape';
$this->fieldTypes['forum_post']['post_attachments'] = 'escape';
@@ -248,12 +250,27 @@ class e107forum
return false;
}
- function threadUpdate($threadInfo, $inc)
+ function threadUpdate($threadId, $threadInfo)
{
$e107 = e107::getInstance();
+ $threadInfo['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
+ $threadInfo['WHERE'] = 'thread_id = '.(int)$threadId;
+// var_dump($threadInfo);
+// exit;
+ $e107->sql->db_Update('forum_thread', $threadInfo);
//TODO: Add this
}
+ function postUpdate($postId, $postInfo)
+ {
+ $e107 = e107::getInstance();
+ $postInfo['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
+ $postInfo['WHERE'] = 'post_id = '.(int)$postId;
+// var_dump($postInfo);
+// exit;
+ $e107->sql->db_Update('forum_post', $postInfo);
+ }
+
function threadGet($id, $joinForum = true, $uid = USERID)
{
global $pref;
@@ -433,6 +450,18 @@ class e107forum
}
}
+ /**
+ * Given threadId and postId, determine which number of post in thread the postid is
+ *
+ */
+ function postGetPostNum($threadId, $postId)
+ {
+ $threadId = (int)$threadId;
+ $postId = (int)$postId;
+ $e107 = e107::getInstance();
+ return $e107->sql->db_Count('forum_post', '(*)', "WHERE post_id <= {$postId} AND post_thread = {$threadId} ORDER BY post_id ASC");
+ }
+
function thread_postnum($thread_id)
{
diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php
index d34be908d..115796b49 100644
--- a/e107_plugins/forum/forum_post.php
+++ b/e107_plugins/forum/forum_post.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
-| $Revision: 1.30 $
-| $Date: 2008-12-11 21:50:18 $
+| $Revision: 1.31 $
+| $Date: 2008-12-13 21:52:18 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -69,7 +69,7 @@ switch($action)
}
-echo "forumId = $forumId
";
+//echo "forumId = $forumId
";
// check if user can post to this forum ...
if (!$forum->checkPerm($forumId, 'post'))
{
@@ -322,6 +322,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
$poll->submit_poll(2);
}
+ $e107cache->clear('newforumposts');
$threadLink = $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $threadId));
$forumLink = $e107->url->getUrl('forum', 'forum', array('func' => 'view', 'id' => $forumId));
if ($pref['forum_redirect'])
@@ -345,16 +346,18 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
}
echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED);
- $e107cache->clear('newforumposts');
require_once(FOOTERF);
exit;
}
}
}
-require_once(HEADERF);
if (isset($_POST['update_thread']))
{
+// var_dump($_POST);
+// var_dump($threadInfo);
+// var_dump($postInfo);
+// exit;
if (!$_POST['subject'] || !$_POST['post'])
{
$error = "