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 »

NicksNet wrote:...today i deleted the direct links in pm mod, because this one error message
([phpBB Debug] PHP Notice: in file /includes/functions_privmsgs.php on line 1660: Missing argument 6 for pm_notification())
and because the link in the email-notification wont work
(http://tattoo-freun.de/ucp.php?i=pm&mode=view&f=0&p=351)
if i recall right, the code in red wouldn't show in the email

i will reinstall this mod with your edits from last post and test it ;)
The fix I gave you for those two mods should avoid the error. The mod to include direct links in pms is supposed to omit that code in red. The reason is that the link is supposed to bring the user to the right pm even if the user has already moved the pm to another folder. Easy enough to put that back but I don't know why you would want to.
NicksNet
Registered User
Posts: 55
Joined: Sat Apr 04, 2009 1:16 pm

Re: Save full drafts

Post by NicksNet »

NicksNet wrote: EDIT:

after reinstall and adding changes NO Error Message appears :D :D :D
BUT... the link in the email is still wrong:

Code: Select all

http://tattoo-freun.de/ucp.php?i=pm&mode=view&p=353
must be:

Code: Select all

http://tattoo-freun.de/ucp.php?i=pm&mode=view&f=0&p=353
sorry, i dont know if this error was there before i updated the forum from 3.0.4 to 3.0.5 or after the update (cant find a mail from before :oops: ) - and i dont know if this error can come from one of the other mods i installed (more than 70 :roll: )

sorry, i think i edited the post while you post your last posting :o
Sorry, my English isn't the best...
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

NicksNet wrote:
NicksNet wrote: EDIT:

after reinstall and adding changes NO Error Message appears :D :D :D
BUT... the link in the email is still wrong:

Code: Select all

http://tattoo-freun.de/ucp.php?i=pm&mode=view&p=353
must be:

Code: Select all

http://tattoo-freun.de/ucp.php?i=pm&mode=view&f=0&p=353
sorry, i dont know if this error was there before i updated the forum from 3.0.4 to 3.0.5 or after the update (cant find a mail from before :oops: ) - and i dont know if this error can come from one of the other mods i installed (more than 70 :roll: )

sorry, i think i edited the post while you post your last posting :o
That's ok. But keep in mind that the link the other mod gives you is correct. It is NOT supposed to have f=0& in it.
NicksNet
Registered User
Posts: 55
Joined: Sat Apr 04, 2009 1:16 pm

Re: Save full drafts

Post by NicksNet »

asinshesq wrote: That's ok. But keep in mind that the link the other mod gives you is correct. It is NOT supposed to have f=0& in it.
o_O this link i have from the forum directly:
pm in forum
pm in forum
Screenshot_236.jpg (169.09 KiB) Viewed 1357 times
same here in forum (phpbb.com) ;)
Sorry, my English isn't the best...
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

NicksNet wrote:
asinshesq wrote: That's ok. But keep in mind that the link the other mod gives you is correct. It is NOT supposed to have f=0& in it.
o_O this link i have from the forum directly
same here in forum (phpbb.com) ;)
I know it's the actual address, but the f part is not necessary and it is NOT supposed to be in the link that gets included in the emails my direct links in pms mod sends out. You can put it back in but I would not recommend that.

If you want to discuss this further, lte's discuss it in the topic for the direct links to pm mod since this has nothing to do with the save full drafts mod.
NicksNet
Registered User
Posts: 55
Joined: Sat Apr 04, 2009 1:16 pm

Re: Save full drafts

Post by NicksNet »

asinshesq wrote: If you want to discuss this further, lte's discuss it in the topic for the direct links to pm mod since this has nothing to do with the save full drafts mod.
o yeah, sorry :oops:

Thanks for all the help!
Sorry, my English isn't the best...
User avatar
DutchToxophilite
Registered User
Posts: 175
Joined: Fri Dec 14, 2007 9:59 pm
Location: Venlo - The Netherlands
Contact:

Re: Save full drafts

Post by DutchToxophilite »

Hi.

Yesterday I tried to install this MOD with automod and ran into issues.
The issues where:
root/viewforum.php
Find:

Code: Select all

		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
The Find specified by the MOD could not be found

root/viewtopic.php
Find:

Code: Select all

" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');
The Find specified by the MOD could not be found

I could not figure them out, so left it to that.
Today I went for a second search, and still could not figure it out. Until I got myself a local copy of viewtopic.php and viewforum.php and manually searched for these lines.
Then I figured out that another MOD had allready altered these lines. And in the case of viewtopic.php had added the same line for a second time. (with the exception that the colon at the end was replaced with a dot in both lines)
Then I did a search through my MOD repository which file had "viewtopic.php " text inside.
Apparently only three MOD's did alterations with viewtopic.php.
Then I did a manual search in all three, which of them uses the same search line.

I found out that Soft Delete was the culprit.
That MOD already altered exactly those lines in both topics.

Could you please tell me how to alter the install script for both MOD's to work, and working from the fact that Soft Delete already is installed.

[EDIT]
I have included both my versions of viewtopic.php and viewforum.php
viewtopic.php
(64.57 KiB) Downloaded 49 times
viewforum.php
(28.61 KiB) Downloaded 54 times
The indicated search line for viewtopic.php can be found on line 88 and 421.
[/EDIT]
grtz,
Twan
You are never to old to be stubern.....
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

DutchToxophilite wrote:Hi.

Yesterday I tried to install this MOD with automod and ran into issues...
Okay, so to make this mod work with the soft delete mod you already have installed, you need to change the install instructions to reflect that your viewforum and viewtopic are no longer standard (since they have been changed by the soft delete mod). In particular:

In viewforum, instead of doing this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
		
#
#-----[ REPLACE WITH ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND topic_approved <> ' . POST_DRAFT : 'AND topic_approved = 1');
		// start mod save full drafts (and end mod too)...added test in preceding line to exclude drafts 
you should change the install instructions to do this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1') .
			($auth->acl_get('m_harddelete', $topic_data['forum_id']) || $auth->acl_get('m_delete', $topic_data['forum_id'])) ? '' : (($auth->acl_get('f_delete', $topic_data['forum_id'])) ? " AND (topic_deleted = '0' OR topic_deleted = '{$user->data['user_id']}')" : " AND topic_deleted = '0'");
		
#
#-----[ REPLACE WITH ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND topic_approved <> ' . POST_DRAFT : 'AND topic_approved = 1') .
			($auth->acl_get('m_harddelete', $topic_data['forum_id']) || $auth->acl_get('m_delete', $topic_data['forum_id'])) ? '' : (($auth->acl_get('f_delete', $topic_data['forum_id'])) ? " AND (topic_deleted = '0' OR topic_deleted = '{$user->data['user_id']}')" : " AND topic_deleted = '0'");
		// start mod save full drafts (and end mod too)...added test two lines up to exclude drafts 
And in viewtopic, instead of doing this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');

#
#-----[ REPLACE WITH ]------------------------------------------
#
		" . (($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
you should change the install instructions to do this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') .
				($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) ? '' : (($auth->acl_get('f_delete', $forum_id)) ? " AND (post_deleted = '0' OR post_deleted = '{$user->data['user_id']}')" : " AND post_deleted = '0'");

#
#-----[ REPLACE WITH ]------------------------------------------
#
		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1') .
				($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) ? '' : (($auth->acl_get('f_delete', $forum_id)) ? " AND (post_deleted = '0' OR post_deleted = '{$user->data['user_id']}')" : " AND post_deleted = '0'");
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts
Let me know if that does the job.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

asinshesq wrote:
DutchToxophilite wrote:Hi.

Yesterday I tried to install this MOD with automod and ran into issues...
Okay, so to make this mod work with the soft delete mod you already have installed, you need to change the install instructions to reflect that your viewforum and viewtopic are no longer standard (since they have been changed by the soft delete mod). In particular...
And here are the changes you would make to install.xml if you want to install this mod after installing the soft delete mod (I think I've got this right):

Code: Select all

OPEN
install.xml

FIND
				<find><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');]]></find>
				<action type="replace-with"><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND topic_approved <> ' . POST_DRAFT : 'AND topic_approved = 1');
		// start mod save full drafts (and end mod too)...added test in preceding line to exclude drafts ]]></action>

REPLACE WITH
				<find><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1') .
			($auth->acl_get('m_harddelete', $topic_data['forum_id']) || $auth->acl_get('m_delete', $topic_data['forum_id'])) ? '' : (($auth->acl_get('f_delete', $topic_data['forum_id'])) ? " AND (topic_deleted = '0' OR topic_deleted = '{$user->data['user_id']}')" : " AND topic_deleted = '0'");]]></find>
				<action type="replace-with"><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND topic_approved <> ' . POST_DRAFT : 'AND topic_approved = 1') .
			($auth->acl_get('m_harddelete', $topic_data['forum_id']) || $auth->acl_get('m_delete', $topic_data['forum_id'])) ? '' : (($auth->acl_get('f_delete', $topic_data['forum_id'])) ? " AND (topic_deleted = '0' OR topic_deleted = '{$user->data['user_id']}')" : " AND topic_deleted = '0'");
		// start mod save full drafts (and end mod too)...added test two lines up to exclude drafts ]]></action>

FIND
				<find><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');]]></find>
				<action type="replace-with"><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND topic_approved <> ' . POST_DRAFT : 'AND topic_approved = 1');
		// start mod save full drafts (and end mod too)...added test in preceding line to exclude drafts ]]></action>

REPLACE WITH
				<find><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') .
				($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) ? '' : (($auth->acl_get('f_delete', $forum_id)) ? " AND (post_deleted = '0' OR post_deleted = '{$user->data['user_id']}')" : " AND post_deleted = '0'");]]></find>
				<action type="replace-with"><![CDATA[		" . (($auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved <> ' . POST_DRAFT : 'AND post_approved = 1') .
				($auth->acl_get('m_harddelete', $forum_id) || $auth->acl_get('m_delete', $forum_id)) ? '' : (($auth->acl_get('f_delete', $forum_id)) ? " AND (post_deleted = '0' OR post_deleted = '{$user->data['user_id']}')" : " AND post_deleted = '0'");
		// start mod save full drafts (and end mod too)...added test in preceding $sql definition to exclude drafts]]></action>
User avatar
DutchToxophilite
Registered User
Posts: 175
Joined: Fri Dec 14, 2007 9:59 pm
Location: Venlo - The Netherlands
Contact:

Re: Save full drafts

Post by DutchToxophilite »

Hi asinshesq.

The install now worked like a charm.
Soft Delete still works like expected.
I could save a full draft with poll options and the works.

Thanx.....

BUT......

I have 2 questions:
1) Should a Draft still exsist in the "manage drafts list" after it has been posted? (manually deleting it from the list, is the only way to clear it)
2) Why can a normal user (no additional permissions etc) not access the draft anymore? When I tested with my test account, I could save the draft, it show up in the draft list, but when trying to access the draft, I get the following message:
The requested post does not exist.

So all is not completely as it should be.

I have checked the permissions of the registered users, and they have the permission to save drafts.
Are there additional permissions to set?

grtz,
Twan
You are never to old to be stubern.....
NicksNet
Registered User
Posts: 55
Joined: Sat Apr 04, 2009 1:16 pm

Re: Save full drafts

Post by NicksNet »

DutchToxophilite wrote: 2) Why can a normal user (no additional permissions etc) not access the draft anymore? When I tested with my test account, I could save the draft, it show up in the draft list, but when trying to access the draft, I get the following message:
The requested post does not exist.
same here :shock:
Sorry, my English isn't the best...
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

DutchToxophilite wrote:1) Should a Draft still exsist in the "manage drafts list" after it has been posted? (manually deleting it from the list, is the only way to clear it)
No. Perhaps you left out the last change this mod tells you to make to includes/functions_posting.php, which is this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
	return $url;

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// start mod save full drafts
	if ($data['was_draft']  && !$data['save_as_draft'])
	{
		delete_drafts($old_post_id);
	}
	// end mod save full drafts
Or perhaps you put that code in the wrong place? It belongs before the return $url line, NOT after it.
Why can a normal user (no additional permissions etc) not access the draft anymore? When I tested with my test account, I could save the draft, it show up in the draft list, but when trying to access the draft, I get the following message:
The requested post does not exist.

So all is not completely as it should be.

I have checked the permissions of the registered users, and they have the permission to save drafts.
Are there additional permissions to set?

grtz,
Twan
Don't know. That should not happen and doesn't happen on my test board. So that I can think about this some more: does your board require a moderator to approve each post, or can people with the right to post go ahead and post without special approvals?

Also, can you tell me exactly what url a typical draft is at when you click to get to it from the draft list?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

asinshesq wrote:
Why can a normal user (no additional permissions etc) not access the draft anymore? When I tested with my test account, I could save the draft, it show up in the draft list, but when trying to access the draft, I get the following message:
The requested post does not exist.

So all is not completely as it should be.

I have checked the permissions of the registered users, and they have the permission to save drafts.
Are there additional permissions to set?

grtz,
Twan
Don't know. That should not happen and doesn't happen on my test board. So that I can think about this some more: does your board require a moderator to approve each post, or can people with the right to post go ahead and post without special approvals?

Also, can you tell me exactly what url a typical draft is at when you click to get to it from the draft list?
Hang on, I just replicated that with my test board so I should be able to figure it out. I suspect something happened with the upgrade to phpbb3.0.5...I'll lcheck this later today and get back to you.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Save full drafts

Post by asinshesq »

asinshesq wrote:Hang on, I just replicated that with my test board so I should be able to figure it out. I suspect something happened with the upgrade to phpbb3.0.5...I'll lcheck this later today and get back to you.
Ok, everything worked with phpbb3.0.4 but 3.0.5 added a line to posting.php that messed things up. Try this:

Code: Select all

OPEN
posting.php

FIND
				(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
REPLACE WITH
				(($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved > 0');
Let me know if that works.
User avatar
DutchToxophilite
Registered User
Posts: 175
Joined: Fri Dec 14, 2007 9:59 pm
Location: Venlo - The Netherlands
Contact:

Re: Save full drafts

Post by DutchToxophilite »

Hi asinshesq.

I'm afraid soft delete also altered something here.
I will include the file, so you can figure it out.
(SORRY!!!)

Then about my first question:
As I only use Automod to install MODS, I couldn't have forgotten about that change, nor put it in the incorrect place.
But never the less, I checked the file, and the alteration is there, as it should be.
But the drafts remain in the list.

But first things first.

Please solve the issue with users not being able to access drafts first.

grtz,
Twan
Attachments
functions_posting.php
(82.81 KiB) Downloaded 48 times
You are never to old to be stubern.....
Locked

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