Save full drafts

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

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

MKULTRA wrote:...I still cannot quote posts, unless I do it as admin. Would the issue with quoting have to do with something in posting.php?

Also I do have the MOD quote to new posts installed, though I don't think that has anything of conflict with either of these other MODS, right?
The quoting code is in posting.php. I can't imagine a problem with quoting has anything to do with this mod or the soft delete one, unless you've totally messed up posting.php somehow. Sounds more like that other mod you mentioned - quote to new posts (whatever that is) - might be the problem.

What do you mean when you say you can't quote posts? What happens when a user who is not an admin clicks to quote a post? Any error message?

Since this has nothing to do with save full drafts, please move this conversation to pm if you want to continue it (or you can post in the support area or the quote to new posts topic).
MKULTRA
Registered User
Posts: 188
Joined: Tue Oct 16, 2007 12:07 pm
Contact:

Re: Save full drafts

Post by MKULTRA »

Sorry, yea, they get a post does not exist type of message. I just went back to a posting.php from a couple of days ago and redid all of the MODS for that file only and it seems to be working as should now. Sort of perplexing since I had scanned over it 2-3 before getting the bright idea of just doing it over. Hopefully, all is good now. :?

Thanks for your help.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17314
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Save full drafts

Post by DavidIQ »

MOD Updated to version 1.0.1
See first post for Download Link
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

DavidIQ wrote:MOD Updated to version 1.0.1
See first post for Download Link
Thanks for validating, guys. Here's the changelog showing changes from version 1.0.0:

Code: Select all

##  2010-01-10 - Version 1.0.1
##			fixed bug in functions_save_full_drafts that prevented left behind drafts
##			from being deleted when posted live;
##			multiple changes to distinguish more carefully between a draft post or topic
##			versus an approved post or topic;
##			added change to posting.php that was required when phpbb upgraded to 3.0.5;
##			fixed bug that prevented list drafts button from working in edit mode;
##			other minor changes requested in validation process;
##			changed install instructions to dovetail with changes when phpbb upgraded to 3.0.6
In the contrib folder, I've included instructions for upgrading from version 1.0.0 to the current version.
Webbstre
Registered User
Posts: 32
Joined: Mon Apr 20, 2009 8:06 am

Re: Save full drafts

Post by Webbstre »

Hello! I just tried installing this mod with Automod on a fresh 3.0.6 board. It went mostly fine, but I had to manually insert two lines that didn't want to install correctly. Now I have this error every time I go to a topic:
Parse error: syntax error, unexpected T_LOGICAL_AND in /home/myusername/mydomainname/forum/viewtopic.php on line 96
The line that I pasted in was this:
" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1');
// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts
Oh, and this was in viewtopic.php . I had to post a similar line in viewforum.php, but that one went without any problems. This occurs in both the default prosilver theme and the prosilver-based ca_black theme. Any suggestions?


EDIT: And of course, moments after I post this I figure it out. The original line was:

Code: Select all

				" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
And not (as listed in the instructions):

Code: Select all

		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');
So instead of:

Code: Select all

		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1');
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts 
I changed it to:

Code: Select all

				" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1') . "
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts 
[/i]

And now it works!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

Webbstre wrote:Hello! I just tried installing this mod with Automod on a fresh 3.0.6 board. It went mostly fine, but I had to manually insert two lines that didn't want to install correctly. Now I have this error every time I go to a topic:
Parse error: syntax error, unexpected T_LOGICAL_AND in /home/myusername/mydomainname/forum/viewtopic.php on line 96
The line that I pasted in was this:
" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1');
// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts
Oh, and this was in viewtopic.php . I had to post a similar line in viewforum.php, but that one went without any problems. This occurs in both the default prosilver theme and the prosilver-based ca_black theme. Any suggestions?


EDIT: And of course, moments after I post this I figure it out. The original line was:

Code: Select all

				" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
And not (as listed in the instructions):

Code: Select all

		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');
So instead of:

Code: Select all

		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1');
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts 
I changed it to:

Code: Select all

				" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1') . "
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts 
[/i]

And now it works!
I just tried this (again) with a completely clean board using automod and there are no issues (not surprisign since the validators check that and deny all mods that don't cleanly install into phpbb3.0.6 using automod). The instructions are correct for a clean board, so if automod has problems with your board it's because you've modified some of the lines or have some problem with automod. The lines you mention above appear in both ways in those files, so the fact that you found a place that reads one way does not mean that the other ones are wrong. Let me know if you have any problems in the way things work.
Verbal
Registered User
Posts: 27
Joined: Sat Oct 11, 2008 4:43 am

Re: Save full drafts

Post by Verbal »

Great mod...really streamlines and improves upon the draft system beautifully.

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

Re: Save full drafts

Post by asinshesq »

Thanks, verbal! I was surprised with the way drafts got implemented in phpbb3. Pretty awkward. Glad that this mod helps turn drafts into a feature that is (IMO) more intuitive.

On my own board, I don't use the list drafts button at all. Instead, I have a link in the header called 'View your drafts' that is similar to 'View your posts'. But I didn't want to stray that far from the regular phpbb3 interface in the official version of the mod.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

I just realized that there is a small bug that messes up bbcodes if you happen to open a draft and then submit it as a live post without making any changes. Here's the fix (a single find and replace):

Code: Select all

OPEN
posting.php

FIND
	// Check checksum ... don't re-parse message if the same
	$update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;

	// Also check if subject got updated...
	$update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject']));

REPLACE WITH
	// start mod save full draft (and end mod too)...added a test in $update_message and $update_subject lines below to cover a draft (always treated as edit mode) that is now being submitted as a live post
	// Check checksum ... don't re-parse message if the same
	$update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN || (isset($post_data['post_approved']) && $post_data['post_approved'] == POST_DRAFT && !$save_as_draft)) ? true : false;

	// Also check if subject got updated...
	$update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject'])) || (isset($post_data['post_approved']) && $post_data['post_approved'] == POST_DRAFT && !$save_as_draft);
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26730
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Save full drafts

Post by Paul »

MOD Updated to version 1.0.2
See first post for Download Link
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26730
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Save full drafts

Post by Paul »

MOD Updated to version 1.0.3
See first post for Download Link
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development
Locked

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