Code: Select all
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
ORDER BY p.post_time ASC
LIMIT 1";
#
#-----[ REPLACE WITH ]------------------------------------------------
#
AND p.post_draft = 0
ORDER BY p.post_time ASC
LIMIT 1";
// start mod save posts as drafts (and end mod too): added an AND constraint in the foregoing sql definition that post_draft be zero (i.e. that the post not just be a draft)
Trunks81 wrote: Hi i have a kind of trouble finding the next lines in mij viewtopic
I updated the forum to 2.0.21 i have keep unread flags, file attachement mod installed en some moreCode: Select all
#-----[ OPEN ]------------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------------ # ORDER BY p.post_time ASC LIMIT 1"; # #-----[ REPLACE WITH ]------------------------------------------------ # AND p.post_draft = 0 ORDER BY p.post_time ASC LIMIT 1"; // start mod save posts as drafts (and end mod too): added an AND constraint in the foregoing sql definition that post_draft be zero (i.e. that the post not just be a draft)
Code: Select all
$sql = "SELECT p.post_id
Code: Select all
$sql = "SELECT p.post_id
Code: Select all
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
AND f.forum_id = t.forum_id
$order_sql";
attach_setup_viewtopic_auth($order_sql, $sql);
if ( !($result = $db->sql_query($sql)) )
Code: Select all
{ //added topic_last_post_id, p.post_time to sql
$sql = "SELECT t.forum_id, t.topic_id, t.topic_last_post_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = p.topic_id
AND t.topic_moved_id = 0
AND p.post_id = $post_id";
roadhog wrote: ...Anyway, my problem is that everything seems to work ok, except for the fact that when I click on the link on the index page to access my drafts, there is no way to edit the draft and/or submit it. You say to "click on it". Where? No matter where I click, nothing happens. If I click on the topic link, of course, then that topic will appear, but there is no way to edit or submit the draft. (It appears, as a draft, below the text window, along with the actual posts, but there is no way to edit it). Obviously something on my board is not working correctly. Where did I go wrong?
Trunks81 wrote: Hi
Tried to find this line, but also cant find itOnly thing i can find with p.post_id in it are these linesCode: Select all
$sql = "SELECT p.post_id
And this oneCode: Select all
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC"; $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . " FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . " WHERE $join_sql AND f.forum_id = t.forum_id $order_sql"; attach_setup_viewtopic_auth($order_sql, $sql); if ( !($result = $db->sql_query($sql)) )
Greetings TRunksCode: Select all
{ //added topic_last_post_id, p.post_time to sql $sql = "SELECT t.forum_id, t.topic_id, t.topic_last_post_id, p.post_time FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p WHERE t.topic_id = p.topic_id AND t.topic_moved_id = 0 AND p.post_id = $post_id";
Trunks81 wrote: Hi i have a kind of trouble finding the next lines in mij viewtopic
I updated the forum to 2.0.21 i have keep unread flags, file attachement mod installed en some moreCode: Select all
#-----[ OPEN ]------------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------------ # ORDER BY p.post_time ASC LIMIT 1"; # #-----[ REPLACE WITH ]------------------------------------------------ # AND p.post_draft = 0 ORDER BY p.post_time ASC LIMIT 1"; // start mod save posts as drafts (and end mod too): added an AND constraint in the foregoing sql definition that post_draft be zero (i.e. that the post not just be a draft)
Code: Select all
#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT p.post_id, t.topic_last_post_id
FROM (" . TOPICS_TABLE . " t
LEFT JOIN " . POSTS_TABLE . " p ON p.topic_id = t.topic_id AND p.post_time > $topic_last_read)
WHERE t.topic_id = $topic_id
AND t.topic_moved_id = 0
ORDER BY p.post_time";
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$sql = "SELECT p.post_id, t.topic_last_post_id
FROM (" . TOPICS_TABLE . " t
LEFT JOIN " . POSTS_TABLE . " p ON p.topic_id = t.topic_id AND p.post_time > $topic_last_read)
WHERE t.topic_id = $topic_id
AND t.topic_moved_id = 0
AND p.post_draft = 0
ORDER BY p.post_time";
// start mod save posts as drafts (and end mod too): added an AND constraint in the foregoing sql definition that post_draft be zero (i.e. that the post not just be a draft)
roadhog wrote: Thanks for the response. No, the search links look like this, of course, and seem to work correctly, (drafts are not listed on top, however, unless they were submitted last):
http://www.perskyfarms.com/phpBB2/searc ... ch_by_post
When I look at the draft in the list, however it appears just like any other post, (except that it is not actually posted in the forum to which it is connected). IOW, it is not identified in the list as a draft. The only links on the draft itself, are the usual viewforum, and viewtopic links. No draft link is present, (at least I can't find one).
roadhog wrote: Ok, I just checked it out again to make sure that I was correct, and no, the drafts do not inappropriately show up in either viewtopic or viewforum.
You are correct, when I click on the view your drafts and posts link, on the index page, the resulting list does not include a separate top section for drafts. They are simply mixed in with the posts.
I've already emailed you the search.php file.
If there's supposed to be a separate section for drafts in that search list, then I'm guessing that I must have a template problem. Or am I wrong?