Page 5 of 5

Re: Save full drafts

Posted: Wed Aug 12, 2009 4:13 pm
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).

Re: Save full drafts

Posted: Wed Aug 12, 2009 7:38 pm
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.

Save full drafts

Posted: Fri Jan 22, 2010 4:45 am
by DavidIQ
MOD Updated to version 1.0.1
See first post for Download Link

Re: Save full drafts

Posted: Fri Jan 22, 2010 2:26 pm
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.

Re: Save full drafts

Posted: Sun Jan 24, 2010 3:13 am
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!

Re: Save full drafts

Posted: Sun Jan 24, 2010 11:41 pm
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.

Re: Save full drafts

Posted: Fri Apr 09, 2010 7:08 am
by Verbal
Great mod...really streamlines and improves upon the draft system beautifully.

Thanks! 5/5

Re: Save full drafts

Posted: Fri Apr 09, 2010 1:46 pm
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.

Re: Save full drafts

Posted: Thu Apr 15, 2010 2:49 pm
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);

Re: Save full drafts

Posted: Thu Jan 20, 2011 8:18 am
by Paul
MOD Updated to version 1.0.2
See first post for Download Link

Re: Save full drafts

Posted: Thu Feb 23, 2012 8:46 am
by Paul
MOD Updated to version 1.0.3
See first post for Download Link