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

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Sat Mar 19, 2005 4:32 pm

asinshesq wrote: Glad to hear it...di you use easymod? (And by the way, easymod is compatible with 2.0.13).

Also, note that if you click on submit after you already clicked a first time, you end up with a double post like you did in the last few posts here. (If you don't like that behavior, and you want to fix it for your own board, note that there is a mod that disables the submit button after the first time you click it so that your users can't accidentally double post.)

which?

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

Post by asinshesq » Sat Mar 19, 2005 5:06 pm

AaronOwnsYou wrote:
asinshesq wrote:...Also, note that if you click on submit after you already clicked a first time, you end up with a double post like you did in the last few posts here. (If you don't like that behavior, and you want to fix it for your own board, note that there is a mod that disables the submit button after the first time you click it so that your users can't accidentally double post.)

which?


There are a few, but here's one of them: http://www.phpbb.com/phpBB/viewtopic.php?t=201507

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Sat Mar 19, 2005 5:27 pm

asinshesq wrote:
AaronOwnsYou wrote:
asinshesq wrote:...Also, note that if you click on submit after you already clicked a first time, you end up with a double post like you did in the last few posts here. (If you don't like that behavior, and you want to fix it for your own board, note that there is a mod that disables the submit button after the first time you click it so that your users can't accidentally double post.)

which?


There are a few, but here's one of them: http://www.phpbb.com/phpBB/viewtopic.php?t=201507

my phpbb isn't 2.0.8, but 2.0.13.

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

Post by asinshesq » Sat Mar 19, 2005 5:39 pm

That mod works fine on 2.0.13.

More generally, the only thing that a version designation means on any validated mod is that at the time it was formally validated the then current version was that version. Most mods that say they are for versions 2.0.7 or later will work fine without change on a 2.0.13 board (and plenty that say they are for even earlier versions work fine too). If you have any doubts, just post a question in the topic for that mod as to whether anyone has tried it on 2.0.13. In this case, I have already got it running on my board so you're all set.

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Sat Mar 19, 2005 5:51 pm

asinshesq wrote: That mod works fine on 2.0.13.

More generally, the only thing that a version designation means on any validated mod is that at the time it was formally validated the then current version was that version. Most mods that say they are for versions 2.0.7 or later will work fine without change on a 2.0.13 board (and plenty that say they are for even earlier versions work fine too). If you have any doubts, just post a question in the topic for that mod as to whether anyone has tried it on 2.0.13. In this case, I have already got it running on my board so you're all set.

There is already flood control in the forum that won't allow users to post untill 30 seconds.

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

Post by asinshesq » Tue Mar 22, 2005 4:30 pm

AaronOwnsYou wrote:
asinshesq wrote:That mod works fine on 2.0.13.

More generally, the only thing that a version designation means on any validated mod is that at the time it was formally validated the then current version was that version. Most mods that say they are for versions 2.0.7 or later will work fine without change on a 2.0.13 board (and plenty that say they are for even earlier versions work fine too). If you have any doubts, just post a question in the topic for that mod as to whether anyone has tried it on 2.0.13. In this case, I have already got it running on my board so you're all set.

There is already flood control in the forum that won't allow users to post untill 30 seconds.


Errr.....no, not the same thing. This board (www.phpbb.com) also has flood control and you can see how well that works (or doesn't work) to prevent inadvertent double posting. Flood control is supposed to prevent users from posting a bunch of silly posts just to take up space (it prevents abuse), but if a user clicks twice the board can register both clicks without realizing that he has already posted. So, if you find people are inadvertently double posting despite your flood control, you'll know what to do...

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Thu Mar 24, 2005 9:26 am

asinshesq wrote:
AaronOwnsYou wrote:
asinshesq wrote:That mod works fine on 2.0.13.

More generally, the only thing that a version designation means on any validated mod is that at the time it was formally validated the then current version was that version. Most mods that say they are for versions 2.0.7 or later will work fine without change on a 2.0.13 board (and plenty that say they are for even earlier versions work fine too). If you have any doubts, just post a question in the topic for that mod as to whether anyone has tried it on 2.0.13. In this case, I have already got it running on my board so you're all set.

There is already flood control in the forum that won't allow users to post untill 30 seconds.


Errr.....no, not the same thing. This board (www.phpbb.com) also has flood control and you can see how well that works (or doesn't work) to prevent inadvertent double posting. Flood control is supposed to prevent users from posting a bunch of silly posts just to take up space (it prevents abuse), but if a user clicks twice the board can register both clicks without realizing that he has already posted. So, if you find people are inadvertently double posting despite your flood control, you'll know what to do...

True.

User avatar
Minoesj
Registered User
Posts: 158
Joined: Thu Feb 13, 2003 2:39 pm
Location: Belgium
Contact:

Post by Minoesj » Sat Mar 26, 2005 3:43 am

Does it work when you have the Categories Hierarchy (sub-forums) mod installed ?

Thanks
Animal Rights Concerns offering Animal Rights and Vegan Resources.
Go Vegan and start a more compassionate lifestyle today!

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Sat Mar 26, 2005 3:44 am

Minoesj wrote: Does it work when you have the Categories Hierarchy (sub-forums) mod installed ?

Thanks

I don't know because I don't want to install that.

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

Post by asinshesq » Sat Mar 26, 2005 1:45 pm

Minoesj wrote: Does it work when you have the Categories Hierarchy (sub-forums) mod installed ?

Thanks


Never tried it. My guess (just a guess): it would work fine but you would need to stick in the line
AND post_draft = 1
in the new sql select definitions that mod installs
or its equivalent for multi-table sql select definitions
AND p.post_draft = 1

Anyone out htere already tried the two mods together?

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Thu Mar 31, 2005 6:48 pm

Fantastic mod asinshesq!

It's a great additional feature for my board. I also like the potential of using drafts as templates. I do have an issue concerning the layout of the "egosearch" which I hope you can help me with and also with the mechanics of a draft as a new topic. Let me begin with the second issue.
  1. I've noticed that when a new topic (not a post within an existing topic) is the desired end-result but saved as a draft (with or without a topic name), the draft will not show up in the "egosearch". After investigating this further, I realized that the following seems to be the problem:
    • In search.php --> around line 850...

      // start mod save posts as drafts...show all drafts at the top of the search results page when a user searches for all of his or her posts (egosearch)...

      if ( $draft_on && $start == 0 )
      {
      $sql = "SELECT *
      FROM " . POSTS_TABLE . " p , " . TOPICS_TABLE . " t
      WHERE p.post_draft = 1
      AND p.poster_id = ".$userdata['user_id']."
      AND p.topic_id = t.topic_id
      ORDER BY p.post_time ";
    Since there is no "topic" table adjustments when saved as a draft, p.topic_id != t.topic_id, consequently not displaying that draft. I can manually adjust the "topic_id" number in the "posts" table to an existing topic_id to display the invisible draft, but if I do submit it as is, it ends up being a post in an existing topic and not what I wanted to begin with, which is "the first post of a new topic". Since, after reviewing all 17 pages of this topic I din't see any references to this issue, I'm now wondering if it's simply because no one has encountered this specific scenario or my forum has been "broken" by one of the mods I'm using. Can you confirm if this is the case with you also?
  2. In the "egosearch" result page... clicking on "View your posts and drafts"

    By default, an upper table will show drafts and below another table will show existing topics as topics (not posts), resulting in the number of hits displayed by the search result as being inaccurate for topics, but accurate for posts. This is not related to your mod, but what I would like is to have the upper table remain as is, and have the lower table display individual posts, which would correspond to the number of hits displayed by the search result. I got that one down ok by doing this:
    • In search.php --> around line 235...

      $showresults = "topics" --> $showresults = "posts"

      The problem with this solution being, the drafts are not displayed in an upper individual table anymore, but rather at the top of the posts table and the links provided by this layout sends me to "viewtopic.php" instead of "posting.php", resulting in the drafts not being found.

      I would ideally like to have drafts displayed in an individual table at the top of the page (as is with your mod) and posts as posts in an individual table below.
    Can you take a look and help me find a solution to this one?
Thanks
Wolf

User avatar
Minoesj
Registered User
Posts: 158
Joined: Thu Feb 13, 2003 2:39 pm
Location: Belgium
Contact:

Post by Minoesj » Thu Mar 31, 2005 7:05 pm

asinshesq wrote:
Minoesj wrote:Does it work when you have the Categories Hierarchy (sub-forums) mod installed ?

Thanks


Never tried it. My guess (just a guess): it would work fine but you would need to stick in the line
AND post_draft = 1
in the new sql select definitions that mod installs
or its equivalent for multi-table sql select definitions
AND p.post_draft = 1

Anyone out htere already tried the two mods together?


I don't really understand what to do :oops: sorry
I'm always scared to make sql changes as i have no clue what they mean and don't know how to role back if something goes wrong.

I guess i'll need to wait till anyone else has tried it.

Thanks for the help already!
Animal Rights Concerns offering Animal Rights and Vegan Resources.
Go Vegan and start a more compassionate lifestyle today!

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

Post by asinshesq » Fri Apr 01, 2005 6:28 am

Wo1f wrote: ...I've noticed that when a new topic (not a post within an existing topic) is the desired end-result but saved as a draft (with or without a topic name), the draft will not show up in the "egosearch". After investigating this further, I realized that the following seems to be the problem:
  • In search.php --> around line 850...

    // start mod save posts as drafts...show all drafts at the top of the search results page when a user searches for all of his or her posts (egosearch)...

    if ( $draft_on && $start == 0 )
    {
    $sql = "SELECT *
    FROM " . POSTS_TABLE . " p , " . TOPICS_TABLE . " t
    WHERE p.post_draft = 1
    AND p.poster_id = ".$userdata['user_id']."
    AND p.topic_id = t.topic_id
    ORDER BY p.post_time ";
Since there is no "topic" table adjustments when saved as a draft, p.topic_id != t.topic_id, consequently not displaying that draft. ....


I don't know what you are saying here. When I save a brand new topic as a draft and click 'view your posts and drafts' (what I think you mean when you talk about 'egosearch'), the new topic shows up just fine, as does a new post saved as a draft in an existing topic. If you are saying that a new topic you save as a draft does not show up as a draft when you click 'view your posts and drafts', then either you have done something wrong in installing the mod or another mod is conflicting with it. And your assumption that there is no topic table adjustment when you save a new topic as a draft is not right...the topic table entry actually does get created (though the first and last post id remains zero so long as it is a draft).
...In the "egosearch" result page... clicking on "View your posts and drafts"

By default, an upper table will show drafts and below another table will show existing topics as topics (not posts), resulting in the number of hits displayed by the search result as being inaccurate for topics, but accurate for posts. This is not related to your mod, but what I would like is to have the upper table remain as is, and have the lower table display individual posts, which would correspond to the number of hits displayed by the search result. I got that one down ok by doing this:
  • In search.php --> around line 235...

    $showresults = "topics" --> $showresults = "posts"

    The problem with this solution being, the drafts are not displayed in an upper individual table anymore, but rather at the top of the posts table and the links provided by this layout sends me to "viewtopic.php" instead of "posting.php", resulting in the drafts not being found.

    I would ideally like to have drafts displayed in an individual table at the top of the page (as is with your mod) and posts as posts in an individual table below....


Should be easy to do but I don't have time to do it now. I'll try to look at it some time in the next week or so if I have time.

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

W01f: the answer, I think

Post by asinshesq » Fri Apr 01, 2005 2:25 pm

Wo1f wrote: ...I would ideally like to have drafts displayed in an individual table at the top of the page (as is with your mod) and posts as posts in an individual table below.[/list]
Can you take a look and help me find a solution to this one?[/list]

Thanks
Wolf


You already said you figured out how to change the egosearch so that it would display regular posts by post rather than topic. I haven't checked the code (and don't have time right now), but by I strongly suspect the reason you lose the drafts table when you change from display by topics to display by posts is that when you display by topics you use a different template than you use when you display by posts. So, if you want to try to do this yourself, check how the mod changes search_results_topics.tpl and then try to do the same for search_results_posts.tpl. Search_results_topics probably has one or more 'switches' that turns the draft table on and off and you would need to stick the same switch or switches in search_results.posts.tpl if you want to do egosearch by post and still retain the drafts.

AaronOwnsYou
Registered User
Posts: 131
Joined: Sat Mar 19, 2005 12:41 pm
Location: Singapore
Contact:

Post by AaronOwnsYou » Fri Apr 01, 2005 3:03 pm

I wished I can help but too bad my host is down.

Post Reply

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