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

honeysmom
Registered User
Posts: 65
Joined: Sun Jul 09, 2006 12:11 am

Re: Save posts as drafts

Post by honeysmom »

No I don't have it turned on

But I couldn't even find pruning of drafts so maybe I do have something not quite right.

The weird thing is I can do 30 drafts which each only have 1 line in them and they never disappear.

But when I do this long post it will disappear after a few days. Thanks I will need to look into this some more for now I'm not using it for anything I have like that.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save posts as drafts

Post by asinshesq »

honeysmom wrote: But I couldn't even find pruning of drafts so maybe I do have something not quite right.

You should be able to find draft pruning options by going to the ACP and clicking pruning where it appears on the left panel. When you click that, your screen should have regular forum pruning options at the top of the screen and draft pruning options (clearly marked) at the bottom of the screen. Do you see any of that?
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

Running 2.0.22.

I installed this mod with Easy Mod.

As I finish a post, and hit the save as draft button....this appears in a window above the posting window.

"Invalid Session. Please resubmit the form." Any ideas?

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

Re: Save posts as drafts

Post by asinshesq »

Rep wrote:Running 2.0.22.

I installed this mod with Easy Mod.

As I finish a post, and hit the save as draft button....this appears in a window above the posting window.

"Invalid Session. Please resubmit the form." Any ideas?

TY
Googling that error, I see that a number of people have been receiving it in a variety of contexts having nothing to do with this mod. So my questions are: Does the error always appear when you try to save as draft? Are you using aol or a proxy? Do you use a web accelerator like google web accelerator? Do you still get the error even if you disable the web accelerator and are not using aop or a proxy?

If no to all, I'm not sure what's going on. If you want to pm me your posting.php and functions_post.php files I can take a look.
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

asinshesq wrote:
Rep wrote:Running 2.0.22.

I installed this mod with Easy Mod.

As I finish a post, and hit the save as draft button....this appears in a window above the posting window.

"Invalid Session. Please resubmit the form." Any ideas?

TY
Googling that error, I see that a number of people have been receiving it in a variety of contexts having nothing to do with this mod. So my questions are: Does the error always appear when you try to save as draft? Are you using aol or a proxy? Do you use a web accelerator like google web accelerator? Do you still get the error even if you disable the web accelerator and are not using aop or a proxy?

If no to all, I'm not sure what's going on. If you want to pm me your posting.php and functions_post.php files I can take a look.

I also performed a search on this site and found 175 entries. They appeared to begin after the 2.0.22 version upgrade. So I moved to that December date in this thread and read forward. There are a couple of issues reported but not that many.

I ran into the problem as soon as I went to the board to test the mod right after Mr. Easy Mod did his work. Once I found the error, I did not experiment further. The error did appear each of the oh, three times I attempted to save a draft.

I am not using AOL or a proxy. Although I do run Skype, and MSN chat shows up upon boot up.

I am happy to send the files and will do so. TY for your service.
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

This may be off topic: But it also may relate to some issues related.

Last night as I read through this thread, there was an exchange between you and anothre member about extra spaces found in the code. You eventually helped him get the issue resolved.

Last night, as I ran EM a critical error was found. I went to the file and did a partial search of the code to be replaced. Found the code and noticed extra spaces at the end of the line. I deleted the spaces, reran EM and the sript continued. (Now, this is before I read the thread and discovered that piece of info.) The mod did set up on my board, but I had the error message described above.

This morning I decided to rerun EM through the process before I sent you my files thinking maybe I need to play around a bit with the problem on the board to let you know better what I see.

EM found a DIFFERENT file and reported a could not find critical error.

Upon examining that code, yup, extra spaces were found toward the end of the line. I fixed it and ran EM again. This time, EM found a problem with posting_body.tpl. When I copy the exact code line EM could not find and search for it myself, I find it.

I really like this mod, and would like to install it, but I wonder if it would be best to hand install it? Thoughts?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save posts as drafts

Post by asinshesq »

Rep wrote:I really like this mod, and would like to install it, but I wonder if it would be best to hand install it? Thoughts?
I have on occassion seen easymod do what you describe (be unable to find a line that is actually there), but I can usually get it to go forward by copying the actual code from my file and pasting it into the mod script FIND.

This is a pretty long mod and would take quite a while to install and troubleshoot by hand. As you can tell by looking at some of this topic, I am a very very strong believer in easymod - I think it is a huge mistake avoider and time saver (for both the person installing the mod and for the person supporting the mod ;) ). I think if you can get through the installation with easymod you are better off. And if there is an intractable problem where for some reason easymod simply can't find the code even though it is there (which sometimes happens for example when the mod script is out of order with the actual code in the file, as happens if the mod script is wrong or if other mods on your board have changed the order of the code), it makes more sense to do delete that FIND and REPLACE WITH (or whatever) in the mod script, make that single change by hand and then continue with easymod.

But I am on one extreme (an easymod zealot) and you will find others here who don't like to rely on easymod the way I do.
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

asinshesq wrote:
Rep wrote:I really like this mod, and would like to install it, but I wonder if it would be best to hand install it? Thoughts?
I have on occassion seen easymod do what you describe (be unable to find a line that is actually there), but I can usually get it to go forward by copying the actual code from my file and pasting it into the mod script FIND.

This is a pretty long mod and would take quite a while to install and troubleshoot by hand. As you can tell by looking at some of this topic, I am a very very strong believer in easymod - I think it is a huge mistake avoider and time saver (for both the person installing the mod and for the person supporting the mod ;) ). I think if you can get through the installation with easymod you are better off. And if there is an intractable problem where for some reason easymod simply can't find the code even though it is there (which sometimes happens for example when the mod script is out of order with the actual code in the file, as happens if the mod script is wrong or if other mods on your board have changed the order of the code), it makes more sense to do delete that FIND and REPLACE WITH (or whatever) in the mod script, make that single change by hand and then continue with easymod.

But I am on one extreme (an easymod zealot) and you will find others here who don't like to rely on easymod the way I do.

Ok. I will continue with EM. I will have to think through this a bit. I have to figure out how to get EM to work around anything I hand mod. I am not that well acquainted with EM, and actually this is I believe one of my last major mods I feel I need.

I am going to rest this for a day or so, make certain my board has no other problems as I have modded it a bit this week, make certain I have good back up files and then will be back.

TY for your prompt assistance. I will let you know if this turns out fine for me. Of course, if it does not, I will be back asking for help.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save posts as drafts

Post by asinshesq »

Rep wrote:Ok. I will continue with EM. I will have to think through this a bit. I have to figure out how to get EM to work around anything I hand mod. I am not that well acquainted with EM
I'm confused, because installing a mod with easymod on a board that has other mods in it that have changed the lines the mod tells you to FIND has nothing to do with understanding EM and, from what you said in your earlier post, is a process you already understand very well. But just in case, let me describe how I use EM to install mods on my heavily modded board (where there are usually lines the mod tells me to FIND that are no longer there).

I start by backing everything up as you do (or sometimes I just do this on a test board I have that is a clone of my real board).

Next, I run EM to see if the mod will install as is.

If EM gives me a critical error telling me it can't find a particular line that the mod script is looking for (which usually happens at least once given how heavily modded my board is), I use a text editor to open up the copy of the mod script that I have installed under the admin/mods folder and I then take a look at the line easymod is telling me it can't find (easymod tells you exactly what line in the mod script has the code it can't find so that's really easy). I also open up the file on my board that easymod is then trying to find the code for.

I then look at the actual code as it appears on my board and I figure out how to 'adapt' the mod script to what is actually on my board. This process is exactly the same I would have to do if I were installing by hand, so there is no extra step involved there.

Once I figure out how to adapt the mod script (which usually just involves changing the code in the FIND line to whatever the line actually looks like on my board but sometimes is more extensive), I change the mod script and save the changes.

Then I run easymod again, and it will either go through so I'm done or it will tell me the next line it can't find and I repeat the process.

So, easymod completely automates the mechanical process of doing the easy stuff, and for the stuff where other mods have changed the code on your board so that lines the mod asks you to FIND are not there, you do the same thing you would do in a manual install.
Rep wrote:...and actually this is I believe one of my last major mods I feel I need...
Yeah, sure :mrgreen: (I can't tell you how many times I thought that too, but there's always something...)
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

asinshesq wrote:
Rep wrote:Ok. I will continue with EM. I will have to think through this a bit. I have to figure out how to get EM to work around anything I hand mod. I am not that well acquainted with EM
Rep wrote:...and actually this is I believe one of my last major mods I feel I need...
Yeah, sure :mrgreen: (I can't tell you how many times I thought that too, but there's always something...)
No doubt you are correct. I will soon be seaching the mod database for more goodies.

I ended up hand modding this mod and it went up with no problems. BTW, FYI - The, "Invalid Session. Please resubmit the form." has not appeared when using Firefox. I have not tried IE yet.

Not only do I want to thank you for this mod, but the excellent service you provided me. (I will use EM next time. Although, I do like hand coding. :D )
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save posts as drafts

Post by asinshesq »

However you did it, I'm glad you've got it up and running!
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

I spoke to soon.

When I went to draft a private message, I got the following error:

Parse error: syntax error, unexpected $end in /home/.drixyl/Rep/pm.com/phpBB2/privmsg.php on line 2357

That line is the last line in the file ?>

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

Re: Save posts as drafts

Post by asinshesq »

Rep wrote:When I went to draft a private message, I got the following error:

Parse error: syntax error, unexpected $end in /home/.drixyl/Rep/pm.com/phpBB2/privmsg.php on line 2357

That line is the last line in the file ?>

TY in advance.
That's telling you that you made the changes to privmsgs.php wrong. For example, you may have unmatched quotes or brackets. So, check the changes you made to privmsgs.php again, and if you're stuck pm me your privmsgs.php file.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save posts as drafts

Post by asinshesq »

asinshesq wrote:
Rep wrote:When I went to draft a private message, I got the following error:

Parse error: syntax error, unexpected $end in /home/.drixyl/Rep/pm.com/phpBB2/privmsg.php on line 2357

That line is the last line in the file ?>

TY in advance.
That's telling you that you made the changes to privmsgs.php wrong. For example, you may have unmatched quotes or brackets. So, check the changes you made to privmsgs.php again, and if you're stuck pm me your privmsgs.php file.
Rep, I'm gonna go way out on a limb and play the game of guessing where you may have messed up in privmsgs.php without even seeing your file. I am guessing it is in one of the following changes the mod tells you to maie to privmsgs.php:

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
			$delete_sql_id = "AND privmsgs_id IN ($delete_sql_id)";
		}

#
#-----[ AFTER, ADD ]------------------------------------------------
#
		// start mod savae posts as drafts ... added the following block of code to specify, when a draft is being finally submitted, that the
		// pm was a draft and to specify the privmsg_id
		// (note: also added a reference to case 'draft' in the enxt 'switch' and changed the $delete_type reference in that switch to
		// refer to $privmsgs_new_or_draft_mail rather than PRIVMSGS_NEW_MAIL)
		if ( $was_a_draft )
		{
			$delete_sql_id = "AND privmsgs_id = $privmsgs_id ";
			$folder = 'draft';
			$privmsgs_new_or_draft_mail = PRIVMSGS_DRAFT_MAIL;
		}
		else
		{
			$privmsgs_new_or_draft_mail = PRIVMSGS_NEW_MAIL;
		}
		// end mod save posts as drafts
or

Code: Select all

#
#-----[ FIND ]------------------------------------------------
# note: actual line is longer
			$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type,

#
#-----[ BEFORE, ADD ]------------------------------------------------
#
			// start mod save posts as drafts (and end mod too)...added the close bracket that ties to the if statement added earlier by this mod
			}
or

Code: Select all

#
#-----[ REPLACE WITH ]------------------------------------------------
#
		// start mod save posts as drafts (and end mod too)...changed the next line so that the counter will not be incremented
		// when you save a pm as a draft but will in fact be incremented when you submit it
		if ( ( $mode != 'edit' && !$save_as_draft ) || ( $was_a_draft && !$save_as_draft ) )
		{
			//
			// Add to the users new pm counter

#
#-----[ FIND ]------------------------------------------------
#
				$emailer->send();
				$emailer->reset();
			}
		}
Why do I guess it is one of those changes? Because those are the only changes in privmsgs.php where it is easy to inadvertently miss an open or close bracket when making the change. Let's see how clairvoyant I am ;)
Rep
Registered User
Posts: 317
Joined: Sat Jan 15, 2005 11:19 pm

Re: Save posts as drafts

Post by Rep »

You are a very good wizard. It is amazing how one little, ")" can mess up a place. It was the first find & replace in that file.

All is well, TY
Post Reply

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