no double post

Mods etc.

Moderator: Integra Moderator

no double post

PostAuthor: Skywalker » Thu Aug 17, 2006 3:02 am

can someone port this to im140?
the functions_post dus not work so its al small port
Code: Select all
################################################################ MOD Title]paulscripts.nl > (paul sohier) [url=http://www.paulscripts.nl#]http://www.paulscripts.nl#[/url]# MOD Description: Users cannot post a message if they has post last in that topic.## MOD Version: 1.0.1#### Installation Level: (Easy)## Installation Time: 10 Minutes## Files To Edit: viewtopic.php,##               posting.php,##               includes/functions_post.php,##               language/lang_english/lang_main.php## Included Files: n/a## License: [url=http://opensource.org/licenses/gpl-license.php]http://opensource.org/licenses/gpl-license.php[/url] GNU General Public License v2 ################################################################ For security purposes, please check: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]# for the latest version of this MOD. Although MODs are checked## before being allowed in the MODs Database there is no guarantee## that there are no security problems within the MOD. No support## will be given for MODs not found within the MODs Database which## can be found at [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] ################################################################ Author Notes: ################################################################## MOD History:####   2005-10-29 - Version 1.0.1##       - Small changes for submitting.####   2005-10-13 - Version 1.0.0##       - Submitted(No changes :))####   2005-03-20 - Version 0.9.2##      - Edit some stupid bugs :D.######   2005-03-17 - Version 0.9##      - first release.################################################################## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD##############################################################  ##-----[ SQL ]------------------------------------------#ALTER TABLE `phpbb_topics` ADD `topic_last_post_uid` INT( 10 ) NOT NULL ;INSERT INTO phpbb_config (config_name, config_value) VALUES ('double_post', '0.9.1');  ##-----[ OPEN ]------------------------------------------#  viewtopic.php  ##-----[ FIND ]------------------------------------------#  $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "     FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "     WHERE $join_sql         AND f.forum_id = t.forum_id         $order_sql";         ##-----[ IN-LINE FIND ]------------------------------------------#  t.topic_id,  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#  t.topic_last_post_uid,  ##-----[ FIND ]------------------------------------------#  $reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];$reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic']  ##-----[ REPLACE WITH ]------------------------------------------#$reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED || $forum_topic_data['topic_last_post_uid'] == $userdata['user_id'] ) ? $images['reply_locked'] : $images['reply_new'];$reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED) ? $lang['Topic_locked'] : ($forum_topic_data['topic_last_post_uid'] == $userdata['user_id']) ? $lang['reply_last'] : $lang['Reply_to_topic'];  ##-----[ OPEN ]------------------------------------------#  posting.php  ##-----[ FIND ]------------------------------------------#           $sql = "SELECT f.*, t.topic_status, t.topic_title               FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t             WHERE t.topic_id = $topic_id                 AND f.forum_id = t.forum_id";  ##-----[ IN-LINE FIND ]------------------------------------------#  t.topic_status,  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#  t.topic_last_post_uid,        ##-----[ FIND ]------------------------------------------#         $sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_vote, p.post_id, p.poster_id" . $select_sql . "             FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $from_sql . "             WHERE p.post_id = $post_id                 AND t.topic_id = p.topic_id                 AND f.forum_id = p.forum_id                 $where_sql";  ##-----[ IN-LINE FIND ]------------------------------------------#  t.topic_id,  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#  t.topic_last_post_uid,                ##-----[ FIND ]------------------------------------------#       else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])     {        message_die(GENERAL_MESSAGE, $lang['Topic_locked']);     }  ##-----[ AFTER, ADD ]------------------------------------------#    else if ($mode != 'newtopic' && $mode != 'editpost' && $mode != 'delete' && $mode != 'vote' && $post_info['topic_last_post_uid'] == $userdata['user_id'] && !$is_auth['auth_mod']){        message_die(GENERAL_MESSAGE, $lang['reply_last']);           }  ##-----[ OPEN ]------------------------------------------#  includes/functions_post.php  ##-----[ FIND ]------------------------------------------#           $sql = "UPDATE " . TOPICS_TABLE . " SET             $topic_update_sql             WHERE topic_id = $topic_id";  ##-----[ IN-LINE FIND ]------------------------------------------#  $topic_update_sql  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, topic_last_post_uid = " . $user_id . "             ##-----[ OPEN ]------------------------------------------#  language/lang_english/lang_main.php  ##-----[ FIND ]------------------------------------------#  ?>  ##-----[ BEFORE, ADD ]------------------------------------------#  $lang['reply_last'] = 'You have posted the last post at this topic. You cannot post another post before another user has posted.';  ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------## EoM  
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: no double post

PostAuthor: obiku » Sat Aug 19, 2006 12:33 pm

I think there is a better MOD for this. By this one, a poster never can post a new post in a topic if he is the last poster in the topic.
This means he never can post an update to his last post.

There is a MOD out there that compares the posted message with the last posted message. If they are exactly the same, then dont post the message, and let see why not....
Last edited by obiku on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
http://www.familie-smit.nl
http://portfolio.familie-smit.nl

Do not tsunami my inbox... instead use the forums...
Hard work may not kill me, but why take a chance?

[hr]
User avatar
obiku
Dev Team
Dev Team
 
Posts: 218
Likes: 0 post
Liked in: 0 post
Joined: Tue May 02, 2006 10:22 am
Cash on hand: 0.00
Location: level 8

Re: no double post

PostAuthor: obiku » Sat Aug 19, 2006 1:00 pm

Found it....
You beter use this MOD
Code: Select all
################################################################ MOD Title]http://www.ikrontik.tk#[/url]# MOD Description: This MOD effectively stops users from posting the same message##                  twice in a row.## MOD Version: 1.0.0#### Installation Level: Easy## Installation Time: 1 Minute## Files To Edit: 2: includes/functions_post.php ##                   language/lang_english/lang_main.php ## Included Files: 0################################################################ For Security Purposes, Please Check: [url=http://www.phpbb.com/mods/]http://www.phpbb.com/mods/[/url] for the## latest version of this MOD. Downloading this MOD from other sites could cause malicious code## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered## in our MOD-Database, located at: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################### Author Notes: None.################################################################## MOD History:  None.################################################################## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD##############################################################  # IMPORTANT: Some FIND commands only contain partial lines.  Unless the script calls for an# "IN-LINE ADD," always add new segments of code on separate lines.  Also, before an In-Line# Find, you'll often see a FIND.  These FINDS are there to help you locate the lines where# In-Line FIND will work.# #-----[ OPEN ]------------------------------------------ #includes/functions_post.php# #-----[ FIND ]------------------------------------------ #         //         // Flood control         //         $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];         $sql = "SELECT MAX(post_time) AS last_post_time             FROM " . POSTS_TABLE . "             WHERE $where_sql";         if ($result = $db->sql_query($sql))         {             if ($row = $db->sql_fetchrow($result))             {                 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) <intval>sql_query($sql))             {                 if ($row = $db->sql_fetchrow($result))                 {                     if ($row['post_text'] == $post_message)                     {                         message_die(GENERAL_MESSAGE, $lang['Double_Post_Error']);                     }                 }                 $db->sql_freeresult($result);             }         }# #-----[ OPEN ]------------------------------------------ #language/lang_english/lang_main.php# #-----[ FIND ]------------------------------------------ #$lang['Flood_Error'] = 'You cannot make another post so soon after your last; please try again in a short while.';# #-----[ AFTER, ADD ]------------------------------------------ #$lang['Double_Post_Error'] = 'You cannot make another post with the exact same text as your last.';# #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM
Last edited by obiku on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
http://www.familie-smit.nl
http://portfolio.familie-smit.nl

Do not tsunami my inbox... instead use the forums...
Hard work may not kill me, but why take a chance?

[hr]
User avatar
obiku
Dev Team
Dev Team
 
Posts: 218
Likes: 0 post
Liked in: 0 post
Joined: Tue May 02, 2006 10:22 am
Cash on hand: 0.00
Location: level 8

Re: no double post

PostAuthor: Skywalker » Sat Aug 19, 2006 1:27 pm

i'm using that already but that one don't lets users post the same tekst again that one only works when they try to spam and post the same message over again this one don't let them post a reply if they have the last post.
and thats what i need
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00

Re: no double post

PostAuthor: evolver » Thu Aug 24, 2006 6:00 am

"Skywalker";p="13781" wrote:the functions_post dus not work so its al small port

So you are just looking for the functions_post.php part?
Code: Select all
##-----[ OPEN ]------------------------------------------#  includes/functions_post.php  ##-----[ FIND ]------------------------------------------#         $sql = "UPDATE " . TOPICS_TABLE . " SET          $topic_update_sql          WHERE topic_id = $topic_id";  ##-----[ IN-LINE FIND ]------------------------------------------#  $topic_update_sql  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, topic_last_post_uid = " . $user_id . "

It can't be found like that in there, indeed...

But I do have a feeling that it should be there]        // update the topics table         $sql = "UPDATE " . TOPICS_TABLE . "                 SET topic_poster = ".$topicposter.",                         topic_time = ".$topictime    .",                         topic_replies = ".$replies    .",                         topic_first_post_id = ".$firstpost    .",                         topic_last_post_id  = ".$lastpost ."                         ".$extra."                 WHERE topic_id = ".$topic_id; [/code]
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

Re: no double post

PostAuthor: Skywalker » Fri Aug 25, 2006 5:56 am

i tried but stil it does not work. maybe someone can try to port it to im?
Last edited by Skywalker on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 4:25 pm
Cash on hand: 0.00


Return to IntegraMOD Modifications

Who is online

Registered users: Bing [Bot], Google [Bot]