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

RexxCrow
I've Been Banned!
Posts: 122
Joined: Mon May 29, 2006 10:43 pm

Post by RexxCrow » Tue Mar 06, 2007 1:28 am

Is anybody using this MOD with the Vote Manger MOD? I am having several issues and am thinking it has do to with that MOD.

http://www.phpbb.com/phpBB/viewtopic.php?t=389862

RexxCrow
I've Been Banned!
Posts: 122
Joined: Mon May 29, 2006 10:43 pm

Post by RexxCrow » Tue Mar 06, 2007 3:48 am

Ok, I went through to double check and found several errors that I corrected, (I manually install everything, hoping to learn things as I go, so I am not using EZMOD.)

After double checking I am now able to make topics (before I was getting a topic does not exist error) I can now post polls (before it did not work), I can edit, quote, and reply, though everything brings up errors (except editing), before I was getting different errors depending on what I was doing, now all the errors say the same thing which is:

Missing argument 24 and 25 for submit_post in functions_post.php line 204
also am getting modify header errors for functions_post.php:204 for 4 different lines in that file.

(I moved the draft inserts to the end hoping that would fix it, but it errors either way.)

Code: Select all

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$undo_vote, &$was_a_draft, &$save_as_draft)
1st header error: posting.php

Code: Select all

setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
2nd, 3rd, and 4th adjacent header errors: page_header.php

Code: Select all

header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');  

header ('Expires: 0');

header ('Pragma: no-cache');
Also, to note I am unable to make drafts they submit errors come up and then just disappear.

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

Post by asinshesq » Tue Mar 06, 2007 4:11 am

RexxCrow wrote: Missing argument 24 and 25 for submit_post in functions_post.php line 204


Take a look in posting.php and find every occurance of submit_post (there is only one such occurance in a clean phpbb2 board, but with your other mods there may be more than one). For each occurance, make sure you added the $save_as_drraft and $was_a_draft parameters, and make sure you added them in exactly the same order that they appear in the line in includes/functions_post.php that begins:

Code: Select all

functions submit_post(...
also am getting modify header errors for functions_post.php:204 for 4 different lines in that file.

See if the above fix also happens to fix this error. If not, let me know and we'll see what else we can figure out.

RexxCrow
I've Been Banned!
Posts: 122
Joined: Mon May 29, 2006 10:43 pm

Post by RexxCrow » Tue Mar 06, 2007 7:13 am

ROFL, yup that is what it was, there were 2 of those snuck in there. I love this MOD, totally kewl! Thx

BTW, where can I find the attachment MOD of this at? I have been UTL so far.

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

Post by asinshesq » Tue Mar 06, 2007 11:52 am

RexxCrow wrote: BTW, where can I find the attachment MOD of this at? I have been UTL so far.

Same place it was located the last time I answered your question ;)
See http://www.phpbb.com/phpBB/viewtopic.ph ... 60#2882560

RexxCrow
I've Been Banned!
Posts: 122
Joined: Mon May 29, 2006 10:43 pm

Post by RexxCrow » Tue Mar 06, 2007 12:01 pm

Opps, sorry I missed that Post and didn't even think to look there, (sorry, got about 50 things floating around in my head at any given time lately) Thank you very much for ur help!

drichardson
Registered User
Posts: 3
Joined: Mon Feb 26, 2007 7:32 pm

Post by drichardson » Tue Mar 06, 2007 3:33 pm

Hey there, i'd just like to say this is a great mod! However, i have a small problem.

When i save a post as a draft or delete a draft, it takes me to a blank page with myurl.com/posting.php in the address bar, so i'm guessing the redirects are not working properly.

The posts are saved and i can go and retrieve them later in the {SEARCH_SELF} page, but i can't see why it's coming up with a blank page.

The mod installed with few problems, i had to edit 2 FIND commands to get the script installed
1. $params = array('submit' => 'post'...
2. FIND submit_post(...

But i don't think that would affect the redirects would it?

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

Post by asinshesq » Tue Mar 06, 2007 4:51 pm

drichardson wrote: When i save a post as a draft or delete a draft, it takes me to a blank page with myurl.com/posting.php in the address bar, so i'm guessing the redirects are not working properly.

The posts are saved and i can go and retrieve them later in the {SEARCH_SELF} page, but i can't see why it's coming up with a blank page.


Here's the mod changes in posting.php that deals with redirection after you save a post as a draft:

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
		message_die(GENERAL_MESSAGE, $return_message);
	}

#
#-----[ AFTER, ADD ]------------------------------------------------
#
// start mod save draft posts...since the previous block of code excludes the case where user is saving as draft or there is a deletion of something that was just a draft,
// and in that case skipps the update_stats function that otherwise would do an END_TRANSACTION sql query, this next block does a meaningless END_TRANSACTION query
// and tells the script where to return in that case
	if ( $error_msg == '' && $save_as_draft || ($mode == 'delete' && $was_a_draft) )
	{

		$sql = "DROP TABLE IF EXISTS temporary_table";
		if (!$db->sql_query($sql, END_TRANSACTION))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}

		$redirect = "index.$phpEx?";
		redirect(append_sid($redirect, true) . $post_append);
		$template->assign_vars(array(
			'META' => $return_meta)
		);
		message_die(GENERAL_MESSAGE, $return_message);
	}
// end mod save draft posts
Take a look at that change in posting.php and see whether you did that one right.

If you can't figure it out, pm me your posting.php file (with code tags around it) and I'll take a look.

drichardson
Registered User
Posts: 3
Joined: Mon Feb 26, 2007 7:32 pm

Post by drichardson » Tue Mar 06, 2007 7:06 pm

I installed the mod with EasyMod so the changes have been made successfully. I'll send you a link to my posting.php so you can see what the problem is...

drichardson
Registered User
Posts: 3
Joined: Mon Feb 26, 2007 7:32 pm

Post by drichardson » Thu Mar 08, 2007 11:23 am

The problem is now resolved, thanks for all your help asinshesq!

Little tip for other users, there must be no spaces or characters before the <? or after the ?> in your php files :P

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

Post by asinshesq » Thu Mar 08, 2007 12:04 pm

drichardson wrote: Little tip for other users, there must be no spaces or characters before the <? or after the ?> in your php files :P

Good tip. But note that some files begin with <?php and some begin with <? (they all end with ?>). The important thing is that there should be no characters, spaces, line skips or anything before the opening <? or <?php or after the final ?>.

And a final point: there are some editors that have an annoying habbit of sticking hiden codes, spaces etc. in your document when you haven't told them to. That's why a lot of people run into this problem...they open up a php file in an editor that isn't a real 'plain text editor', make some changes, close the file and suddenly things don't work right because the editor has stuck in some extra coding, lines, etc. A lot of people using dreamweaver have this problem, because it is pretty tricky to configure dreamweaver not to stick in anything extra.

My advice: get a real plain text editor (there are lots of free ones out there...just google for them).

User avatar
End of a Shadow
Registered User
Posts: 1557
Joined: Sun Apr 27, 2003 6:39 pm
Location: Washington
Name: J G
Contact:

Re: Save posts as drafts

Post by End of a Shadow » Tue Mar 20, 2007 2:31 am

By chance can you provide a mirror download of this version or if not email it to me at webmaster@insyderonline.com and I'll add it as a mirror on my web space.

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

temporary download link while mod links are down:

Post by asinshesq » Tue Mar 20, 2007 1:34 pm

End of a Shadow wrote: By chance can you provide a mirror download of this version or if not email it to me...

Sure. You can download it here: http://www.phpbb.com/files/mods/save_po ... 1-0-25.zip
Last edited by Paul on Tue Mar 20, 2007 1:44 pm, edited 1 time in total.
Reason: Please read the forum rules in the big pink box, updated link

User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Re: Save posts as drafts

Post by thewizard » Thu Mar 29, 2007 1:59 am

I'm a little curious about how this works. Does it just store the post away until it is completed and they submit it as final that it shows up? Does it leave something as a place holder? I've got a forum where people tend to post community maintained stories. Each person writes their own chapter and was looking to see if something was already out that not only saved the post they were working on, but had a visual placeholder without showing the actual text.

MitchSchaft
Registered User
Posts: 292
Joined: Fri Jun 06, 2003 10:22 pm
Location: exiled

Re: Save posts as drafts

Post by MitchSchaft » Thu Mar 29, 2007 2:29 am

No, it just saves it. When you submit, it shows up at the end like normal.

Post Reply

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