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

User avatar
tbtguide
Registered User
Posts: 29
Joined: Sat Sep 25, 2004 7:34 am

Post by tbtguide » Sat Sep 25, 2004 8:04 pm

Thanks for the quick reply Alan, unfortunately it is a bit premature for me to test. After I installed the mod I checked to see how it functioned by starting a new topic and saving it as a draft. It worked like a charm. However, for whatever resson I didn't check to see that everything else still worked. I seem to be having a conflict with the "keep unread" mod. When I try to read a post I get an error message "unexpected T_LOGICAL_AND" in viewtopic.php. The line it points to is right in the midst of stuff I commented out for the "keep unread" mod. I'm going to have to figure out what's up before I feel confident to tell you whether your delete draft fix works. But I will get back to you.

EDIT

I think I hammered out what I needed for the "keep unread" mod. I applied your fix to posting.php and it seems to be working perfectly. Many Thanks.
Last edited by tbtguide on Fri Jan 26, 2007 1:14 am, edited 1 time in total.

elfy
Registered User
Posts: 25
Joined: Sat Jan 05, 2002 5:42 am
Location: Poland

Post by elfy » Sat Sep 25, 2004 11:24 pm

Excellent work asinshesq!!! I have a lot of mods (I think about 100) installed on my board but there is no conflict with your mod. After attachment mod this one is my favourite :) btw: all your corrections after official release are very useful and work like a charm ;)

Thank you for your great mod :)

Regards
elfy

gambolmaker
Registered User
Posts: 28
Joined: Sat Sep 18, 2004 1:41 pm
Contact:

Post by gambolmaker » Mon Sep 27, 2004 8:36 am

Hi,

I very much like your mod and I'm using it on my board.

But is there any way of integrating it into other languages? My forum is in German and when German is selected as language, all I get is an empty button which actually deletes the post.

I think I have to put something in the lang_main.php, but I'm really not sure what.

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

Post by asinshesq » Mon Sep 27, 2004 10:55 am

gambolmaker wrote: Hi,

I very much like your mod and I'm using it on my board.

But is there any way of integrating it into other languages? My forum is in German and when German is selected as language, all I get is an empty button which actually deletes the post.

I think I have to put something in the lang_main.php, but I'm really not sure what.


Sorry, I know absolutely nothing about using other languages in phpbb. I would have guessed that all you need to do is to add the same entries to the language/lang_german/lang_main.php file that the main mod adds to the language/lang_english/lang_main.php file (leaving the variable name on the left of the equals sign in english but transalating the words to the right of the equals sign). In other words, I would have guessed that you do this:

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_german/lang_main.php

#
#-----[ FIND ]------------------------------------------------
# note the actual line is longer because it will have definition in it
$lang['Search_your_posts'] = 

#
#-----[ REPLACE WITH ]------------------------------------------------
#
$lang['Search_your_posts'] = '[insert translation of 'View your drafts and posts']';

#
#-----[ FIND ]------------------------------------------------
#note the actual line is longer because it will definition in it
$lang['A_critical_error'] =

#
#-----[ AFTER, ADD ]-----------------------------------------
#
// start mod save draft posts
$lang['Draft_posts'] = '[insert translation of 'Your draft posts']';
$lang['Save_as_draft'] = '[insert translation of''Save as draft']';
// end mod save draft posts

gambolmaker
Registered User
Posts: 28
Joined: Sat Sep 18, 2004 1:41 pm
Contact:

Post by gambolmaker » Mon Sep 27, 2004 11:18 am

Hey cool it works now :)

Not quite as complicated as you suggested though...

I searched the english lang_main for the code, to see where I have to insert it, but all I found was

Code: Select all

// start mod save draft posts
$lang['Draft_posts'] = 'Your draft posts';
$lang['Save_as_draft'] = 'Save as draft';
// end mod save draft posts
right at the bottom of the file. I put that in the german lang_main.php, translated the descriptions and it works :)

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

Post by asinshesq » Mon Sep 27, 2004 11:46 am

But don't you also need to change the definition of lang['search_your_posts'] to something in german that tells the user that the link on the index page is to a list of the users drafts and posts? Otherwise how will users know where their drafts have disappeared to when they click to save as draft?

gambolmaker
Registered User
Posts: 28
Joined: Sat Sep 18, 2004 1:41 pm
Contact:

Post by gambolmaker » Mon Sep 27, 2004 11:50 am

They know where to look 'cause I told them where ;)

I propably would have to change the "search your posts" link to include drafts, but I'm too lazy to do that right now *g*

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

Post by asinshesq » Mon Sep 27, 2004 12:16 pm

LOL. When you do change it, you don't need to do anything fancy. All you ned to do is to open language/german/lang_main.php, look for the entry that says $lang['search your posts'] = ... And change the definition on the right of the equals sign to whatever german is for 'search your drafts and posts'. That's it, should take 30 seconds.

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

Post by asinshesq » Mon Sep 27, 2004 10:31 pm

[deleted]
Last edited by asinshesq on Tue Sep 28, 2004 10:34 am, edited 1 time in total.

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

Post by asinshesq » Tue Sep 28, 2004 12:31 am

Grrrr.... I messed up the attachment mod fix again, but now the version posted above (here: http://www.phpbb.com/phpBB/viewtopic.ph ... 17#1256817 ) is correct (honest). Give it a try.

anime_honeydew
Registered User
Posts: 11
Joined: Tue Sep 28, 2004 1:04 am

Post by anime_honeydew » Tue Sep 28, 2004 1:13 am

pisqon wrote: I installed it with easymod. had no problems. but when I tried to test it, i got this problem:
Warning: Missing argument 21 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Missing argument 22 for submit_post() in /usr/home/matt/corbantis/forums/includes/functions_post.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/matt/corbantis/forums/includes/functions_post.php:216) in /usr/home/matt/corbantis/forums/includes/functions.php on line 769



I'm having a similar problem only I installed it by hand. 2.0.10

When I save it as a draft,

Code: Select all

Warning: Missing argument 22 for submit_post() in /includes/functions_post.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:222) in /includes/functions.php on line 1010
And when I try to post

Code: Select all


Warning: Missing argument 22 for submit_post() in /includes/functions_post.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:222) in /posting.php on line 737

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:222) in /includes/page_header.php on line 633

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:222) in /includes/page_header.php on line 635

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:222) in /includes/page_header.php on line 636
I have several other mods installed and working at this point. I suspect it's either the PCP or the Icon for Topic mod. Post Icon is more likely because it affects the same area. Or maybe Log Actions?

There are two calls to submit_post on posting.php and one is not affected by this mod? I'm not sure why...

I also have:
Log Actions
PCP
Moderator Button
Smilies Order
Who Viewed
Yellow Card + Dirty Hack
Force Wrap
Icon for Topic

anime_honeydew
Registered User
Posts: 11
Joined: Tue Sep 28, 2004 1:04 am

Post by anime_honeydew » Tue Sep 28, 2004 1:32 am

Ok, fixed.

In the submit_post function in functions_post.php, the &$was_a_draft and &$save_as_draft variables have to be last.

Then in posting.php, in both calls to submit_post(

on the first one, the two variables $was_a_draft and $save_as_draft have to be last

and on the second one, the two variables $was_a_draft and $save_as_draft have to be added and they have to be last.

Edit: Wait, it's still breaking in like 10 other places... I'm thinking the variables need to be added to much more than submit_post.

And um, the PMs dont have buttons now. This needs some tweaks.

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

Post by asinshesq » Tue Sep 28, 2004 2:41 am

anime_honeydew wrote: Ok, fixed.

In the submit_post function in functions_post.php, the &$was_a_draft and &$save_as_draft variables have to be last.

Then in posting.php, in both calls to submit_post(

on the first one, the two variables $was_a_draft and $save_as_draft have to be last

and on the second one, the two variables $was_a_draft and $save_as_draft have to be added and they have to be last.

Edit: Wait, it's still breaking in like 10 other places... I'm thinking the variables need to be added to much more than submit_post.

And um, the PMs dont have buttons now. This needs some tweaks.


Sounds to me like it hasn't been installed correctly on your board.

1. Those variables don't have to be last, they just have to be in the same order as the order of the function call that appears in posting.php. That's why in both cases the mod says to add them right after $poll_length - they don't really have to be there, but they need to be in the same place in both places and every variable in teeh list needs to be separated by commas (and of course the last variable should not have a comma after it).

2. The mod works as is...on a clean phpbb 2.0.10 you don't need to add things anywhere but where it tells you to. You mentioned that there are two calls to submit_post in your posting.php file. A clean phpbb 2.0.10 file has only one call - that's the reason the mod only has one change to submit_post in posting.php - so one of your other mods must have another call that is screwing things up. You'll need to figure out how to harmonize that mod and this since I am not familiar with your mods.

3. The pms are not supposed to have buttons. In fact, the mod specifically instructs post_body.tpl NOT to display the save as draft button for a pm because the mod does not allow you to save pms as drafts (it only allows you to save 'posts' as drafts). The mod for saving pms as drafts would be additional work (pms are stored differently from posts so it is not completely straightforward). I'm not saying it would be terribly difficult, but I am saying that my boss (a/k/a my wife) tells me she doesn't need the ability to save pms as drafts so I won't be going through the added effort to create a mod for that. Someone else may do that at some point (or maybe if I get bored at some point in the future I wil do that).

Did you try installing this via easymod? I have become a real believer in easymod...it's just too easy to mess things up when you do install a mod by hand. And if your other mods conflict so easymod can't find something, it stops and tells you exactly what it can't find before it changes any files. You can then investigate, see what is different from a clean 2.0.10 phpbb board, tweak the mod commands to reflect the change and then run easymod again. Much better way than trying to install this stuff by hand!

anime_honeydew
Registered User
Posts: 11
Joined: Tue Sep 28, 2004 1:04 am

Post by anime_honeydew » Tue Sep 28, 2004 2:59 am

asinshesq wrote: Sounds to me like it hasn't been installed correctly on your board.

1. Those variables don't have to be last, they just have to be in the same order as the order of the function call that appears in posting.php. That's why in both cases the mod says to add them right after $poll_length - they don't really have to be there, but they need to be in the same place in both places and every variable in teeh list needs to be separated by commas (and of course the last variable should not have a comma after it).

2. The mod works as is...on a clean phpbb 2.0.10 you don't need to add things anywhere but where it tells you to. You mentioned that there are two calls to submit_post in your posting.php file. A clean phpbb 2.0.10 file has only one call - that's the reason the mod only has one change to submit_post in posting.php - so one of your other mods must have another call that is screwing things up. You'll need to figure out how to harmonize that mod and this since I am not familiar with your mods.

3. The pms are not supposed to have buttons. In fact, the mod specifically instructs post_body.tpl NOT to display the save as draft button for a pm because the mod does not allow you to save pms as drafts (it only allows you to save 'posts' as drafts). The mod for saving pms as drafts would be additional work (pms are stored differently from posts so it is not completely straightforward). I'm not saying it would be terribly difficult, but I am saying that my boss (a/k/a my wife) tells me she doesn't need the ability to save pms as drafts so I won't be going through the added effort to create a mod for that. Someone else may do that at some point (or maybe if I get bored at some point in the future I wil do that).

Did you try installing this via easymod? I have become a real believer in easymod...it's just too easy to mess things up when you do install a mod by hand. And if your other mods conflict so easymod can't find something, it stops and tells you exactly what it can't find before it changes any files. You can then investigate, see what is different from a clean 2.0.10 phpbb board, tweak the mod commands to reflect the change and then run easymod again. Much better way than trying to install this stuff by hand!


No, it was installed correctly. I know php very well. An error to me means woot, here's your problem, go an fix it, not something scary and terrible. And another user has the same exact problem... so I would say it's a conflict, not a bad install.

1. Right.

2. Right.

3. By no buttons, I mean there is no way to submit a PM. No submit button. I suspect it is a conflict with PCP.

No I installed it by hand. I know php and don't want to lose control of the board via Easy Mod. This board will have the potential of being very busy and will continue to become a hybrid.

Have you considered that it is highly unlikely that users will install this mod and only this mod? This mod is new and I'm sure you will have other users come along with answers to these conflicts. Hang in there.

I just don't have time to deal with it and am backing out of this mod until you get more answers in the thread. I gave you a good rating tho, because I can see where it will rock. :)

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

Post by asinshesq » Tue Sep 28, 2004 3:16 am

anime_honeydew wrote: ...No, it was installed correctly. I know php very well. An error to me means woot, here's your problem, go an fix it, not something scary and terrible. And another user has the same exact problem... so I would say it's a conflict, not a bad install.

You're probably right.
...By no buttons, I mean there is no way to submit a PM. No submit button. I suspect it is a conflict with PCP.

Ouch, that is a problem!. Sounds like something going on in posting_body.tpl.
...No I installed it by hand. I know php and don't want to lose control of the board via Easy Mod. This board will have the potential of being very busy and will continue to become a hybrid....

Fair enough.
Have you considered that it is highly unlikely that users will install this mod and only this mod? This mod is new and I'm sure you will have other users come along with answers to these conflicts. Hang in there.

You're absolutely right. I know some users have this installed with a ton of other mods, but each mod is unique in its ability to wreak havoc on other mods (or vice versa since it takes two to tango ;) ). I have a ton of mods myself and it works on my board, but of course that's not surprising since I designed it and was aware of anything on my board that would have conflicted.
...I just don't have time to deal with it and am backing out of this mod until you get more answers in the thread. I gave you a good rating tho, because I can see where it will rock. :)


Fair enough. Thanks for the look.

Post Reply

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