Save posts as drafts

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
47
72%
Very Good
10
15%
Good
5
8%
Fair
1
2%
Poor
2
3%
 
Total votes: 65

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Attachment

Post by asinshesq » Tue Sep 21, 2004 7:46 pm

sikita wrote: Does this mod work with attachments? Becuse I have installed this mod and when I attach any file and later come back to this draft I lost any attachment in the draft. So is it error or inability?


I never looked at it with the attachment mod in mind, but I suspect it would drop the attachment since I didn't specifically dealt with attachments. Should be easy to add that functionality, though. I'll look at it tonight if I get a chance and post back here in due course with a fix for those of you with the attachment mod. (Of course, you can save the post as a draft and, when you finally post it, add the attachment at that point, but I'll try to do better than that.)

Is it otherwise working for you?

sikita
Registered User
Posts: 47
Joined: Tue Jun 29, 2004 9:40 am

Re: Attachment

Post by sikita » Tue Sep 21, 2004 9:03 pm

asinshesq wrote:
sikita wrote:Does this mod work with attachments? Becuse I have installed this mod and when I attach any file and later come back to this draft I lost any attachment in the draft. So is it error or inability?


I never looked at it with the attachment mod in mind, but I suspect it would drop the attachment since I didn't specifically dealt with attachments. Should be easy to add that functionality, though. I'll look at it tonight if I get a chance and post back here in due course with a fix for those of you with the attachment mod. (Of course, you can save the post as a draft and, when you finally post it, add the attachment at that point, but I'll try to do better than that.)

Is it otherwise working for you?


Yes that's the problem... it drops attachments. And yes it can be solved by adding attachment later... but it will be better if it can handle attachments... thanx :wink:

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Wed Sep 22, 2004 2:33 am

Sikita, I took a quick look at your issue and I was correct that it should be pretty easy to adapt the mod to work with the attachment mod so that it can save as a draft a post that has an attachment. Unfortunately, I own't be able to get to it until this weekend at the earliest. I'll post back as soon as I do.

But you never answered my question: is the mod otherwise working fine for you?

sikita
Registered User
Posts: 47
Joined: Tue Jun 29, 2004 9:40 am

Post by sikita » Wed Sep 22, 2004 7:57 am

asinshesq wrote: Sikita, I took a quick look at your issue and I was correct that it should be pretty easy to adapt the mod to work with the attachment mod so that it can save as a draft a post that has an attachment. Unfortunately, I own't be able to get to it until this weekend at the earliest. I'll post back as soon as I do.

But you never answered my question: is the mod otherwise working fine for you?


It will be fine... if you find some time to look at that. And finaly: Yes, otherwise the mod is working perfectly... :D I will just change when you post the draft to get back to forum not directly to index.

And one tip: It should be more well-ordered to show author his drafts in correct forums marked as drafts or for example written in Italic text and pinned to the top of the forum like announcement or notice... if it is not too much complicated. What do you think?

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Wed Sep 22, 2004 11:17 am

Thanks for the feedback.

The mod will return to the applicable forum after submitting a draft if you change the redirect lines in posting.php like this:

Code: Select all

find 
		$redirect = "index.$phpEx?";

replace with
		$redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
(I prefer it going back to the index after I submit, so I am not going to change this for the basic mod.)

sikita
Registered User
Posts: 47
Joined: Tue Jun 29, 2004 9:40 am

Post by sikita » Wed Sep 22, 2004 1:30 pm

asinshesq wrote: Thanks for the feedback.

The mod will return to the applicable forum after submitting a draft if you change the redirect lines in posting.php like this:

Code: Select all

find 
		$redirect = "index.$phpEx?";

replace with
		$redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
(I prefer it going back to the index after I submit, so I am not going to change this for the basic mod.)
Thanx... Yes it is individual opinion...

What do you think about my tip of showing drafts to the author in the forums? Is it complicated? I have tried it myself, but my php knowledge is too week... :cry:
I thought it would be something like with announcement in viewforum.php:

Code: Select all

 //
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id 
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_last_post_id
		AND p.poster_id = u2.user_id
		AND t.topic_type = " . POST_ANNOUNCE . "
    AND p.post_draft = 0 
	ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
	$topic_rowset[] = $row;
	$total_announcements++;
}

$db->sql_freeresult($result);
but as I wrote... I am too much weak..
I have tried this.. but it is not correct...

Code: Select all

//
// All drafts, this keeps drafts
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time 
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
						WHERE t.forum_id = $forum_id 
            AND p.poster_id = " . $userdata['user_id'] . "           
            AND p.topic_id = t.topic_id 
		        AND t.topic_type <> " . POST_ANNOUNCE . "
            AND p.post_draft = 1
            $limit_topics_time
            ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
$topic_rowset = array();
$total_drafts = 0;
while( $row = $db->sql_fetchrow($result) )
{
	$topic_rowset[] = $row;
	$total_drafts++;
}

$db->sql_freeresult($result);

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Wed Sep 22, 2004 1:54 pm

sikita wrote: ...What do you think about my tip of showing drafts to the author in the forums? Is it complicated? I have tried it myself, but my php knowledge is too week... :cry: ...


No, it wouldn't be too complicated. I originally had something like that but I didn't like the interface. The draft post would show up in a topic thread in the wrong place (since it is in fact dated earlier than some later posts). I could have aded some more code to correct for that, but I didn't really think it would be useful to the author of the draft to see it sitting with the real posts. I chose instead to keep the topic pristine with only real posts in it.

However, I did recognize that it would be helpful for the author of a draft to see the draft post in the context of other posts in the same topic, and that was exactly the reason that I added to the mod the change that allows the user to see all of the other posts in a topic whenever the user edits a post. Because of that change, when a user opens up a draft post he can see the other posts in the topic in the 'Topic Review' window that appears underneath the edit window.

sikita
Registered User
Posts: 47
Joined: Tue Jun 29, 2004 9:40 am

Post by sikita » Wed Sep 22, 2004 2:21 pm

asinshesq wrote:
sikita wrote:...What do you think about my tip of showing drafts to the author in the forums? Is it complicated? I have tried it myself, but my php knowledge is too week... :cry: ...


No, it wouldn't be too complicated. I originally had something like that but I didn't like the interface. The draft post would show up in a topic thread in the wrong place (since it is in fact dated earlier than some later posts). I could have aded some more code to correct for that, but I didn't really think it would be useful to the author of the draft to see it sitting with the real posts. I chose instead to keep the topic pristine with only real posts in it.

However, I did recognize that it would be helpful for the author of a draft to see the draft post in the context of other posts in the same topic, and that was exactly the reason that I added to the mod the change that allows the user to see all of the other posts in a topic whenever the user edits a post. Because of that change, when a user opens up a draft post he can see the other posts in the topic in the 'Topic Review' window that appears underneath the edit window.


Hmm.. I see... But I still think it would be more comfortable if it is shown as an announcement and pinned up and marked as "Your Draft:" because nobody use many drafts and when you come back to the forum you see you have to finish something. As a reminder. May be I am wrong... because I do not usually use "View all your posts"... May be it is in routine...

TemplaStorm22
Registered User
Posts: 139
Joined: Tue Jun 29, 2004 4:34 am
Contact:

Post by TemplaStorm22 » Wed Sep 22, 2004 9:52 pm

i try to installt his but i get the error:

Code: Select all

Critical Error

FIND FAILED: In file [viewtopic.php] could not find:

ORDER BY p.post_time $post_time_order 
LIMIT $start, ".$board_config['posts_per_page']; 

MOD script line #518 :: FAQ :: Report

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Thu Sep 23, 2004 1:29 am

TemplaStorm22 wrote: i try to installt his but i get the error:

Code: Select all

Critical Error

FIND FAILED: In file [viewtopic.php] could not find:

ORDER BY p.post_time $post_time_order 
LIMIT $start, ".$board_config['posts_per_page']; 

MOD script line #518 :: FAQ :: Report


It looks like you tried to install the mod with easymod and it was telling you with that error message that your viewtopic.php file does not have the following lines:

Code: Select all

ORDER BY p.post_time $post_time_order 
LIMIT $start, ".$board_config['posts_per_page']; 
Those lines in fact appear in viewtopic.php in version phpbb 2.0.10 -- look at lines 394 and 395 of the unmodded version of that file and you will find them.

So that means that you have another mod installed that changed those lines so that easymod cannot figure out what you want it to do (or perhaps you are using an earlier phpbb version than 2.0.10 that does not have those lines??).

Anyway, since you do not have an unmodded 2.0.10 board you will need to figure out what has changed in order to install this mod.

if you wnat to send me your phpbb files, let me know by pm and I will try to take a look at what's going on.

Sammyed
Registered User
Posts: 186
Joined: Fri Mar 12, 2004 11:07 pm
Contact:

Post by Sammyed » Thu Sep 23, 2004 4:52 am

Just in order to say that I downloaded, edited, uploaded and finally came back here to vote as -Excellent-. :!:

Keep the excellent work Mr. asinshesq

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Thu Sep 23, 2004 8:38 am

Sammyed wrote: Just in order to say that I downloaded, edited, uploaded and finally came back here to vote as -Excellent-. :!:

Keep the excellent work Mr. asinshesq


Thanks! I appreciate the kind words. By the way, what did you edit? Was it the stuff I mentioned on the first page of this thread or something else that might be of help for all?

TemplaStorm22
Registered User
Posts: 139
Joined: Tue Jun 29, 2004 4:34 am
Contact:

Post by TemplaStorm22 » Thu Sep 23, 2004 12:09 pm

that would be great asinshesq i will pm them to you later today

Sammyed
Registered User
Posts: 186
Joined: Fri Mar 12, 2004 11:07 pm
Contact:

Post by Sammyed » Fri Sep 24, 2004 12:47 am

asinshesq wrote: Thanks! I appreciate the kind words. By the way, what did you edit? Was it the stuff I mentioned on the first page of this thread or something else that might be of help for all?


Just the files I was told to edit on the MOD file instruction that I downloaded...nothing extra special.

Cheers.

pisqon
Registered User
Posts: 132
Joined: Mon Aug 09, 2004 5:12 am
Contact:

Post by pisqon » Fri Sep 24, 2004 4:01 am

I installed it with easymod. had no problems. but when I tried to test it, i got this problem:
Warning: Missing argument 21 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Missing argument 22 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/includes/functions.php on line 769


and also got this error when posting a regular post:

Code: Select all

Warning: Missing argument 21 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Missing argument 22 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/posting.php on line 673

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/includes/page_header.php on line 477

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/includes/page_header.php on line 479

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/includes/page_header.php on line 480
it would post as it should, though. just gave that error when it showed the "click here to view your post" page right after you posted

Post Reply

Return to “[2.0.x] MOD Database Releases”