New Feature For IP


Subject: New Feature For IP
I didnt know where to post it. There is a simple mod that makes impossible the double posting, i was wondering, if this can be added to Icy Phoenix

Profile PM  
Subject: Re: New Feature For IP
Try this and let me know if it works

Code: [Download] [Hide]
  1. #  
  2. #-----[ OPEN ]------------------------------------------  
  3. #  
  4. posting.php  
  5. #  
  6. #-----[ FIND ]------------------------------------------  
  7. #  
  8. switch ( $mode )  
  9. {  
  10. case 'editpost':  
  11. case 'newtopic':  
  12. case 'reply':  
  13. #  
  14. #-----[ AFTER, ADD ]------------------------------------  
  15. #  
  16. #  
  17. //  
  18. // BEGIN - Anti Double Post Mod  
  19. //  
  20. if ( $mode != 'newtopic' )  
  21. {  
  22. $edit_overtime = false;  
  23. if ( !$is_auth['auth_mod'] && $board_config['edit_time'] != 0 )  
  24. {  
  25. $current_time = time();  
  26. $difference_min = ($current_time - $post_info['post_time']) / 60;  
  27. $edit_overtime = $difference_min > $board_config['edit_time'];  
  28. }  
  29. $sql = "SELECT topic_last_post_id  
  30. FROM " . TOPICS_TABLE . "  
  31. WHERE topic_id = " . $topic_id;  
  32. if (!$topic_query = $db->sql_query($sql))  
  33. {  
  34. message_die(GENERAL_ERROR, $lang['Query_topic']);  
  35. }  
  36. $topic = $db->sql_fetchrow($topic_query);  
  37. $last_post_id = $topic['topic_last_post_id'];  
  38.  
  39. $sql = "SELECT poster_id  
  40. FROM " . POSTS_TABLE . "  
  41. WHERE post_id = " . $last_post_id;  
  42. if (!$post_query = $db->sql_query($sql))  
  43. {  
  44. message_die(GENERAL_ERROR, $lang['Query_post']);  
  45. }  
  46. $post = $db->sql_fetchrow($post_query);  
  47. $last_user = $post['poster_id'];  
  48. if (($userdata['user_id'] == $last_user) && ($is_auth['auth_edit']) && (!$edit_overtime) && (!$is_auth['auth_mod']))  
  49. {  
  50. message_die(GENERAL_MESSAGE,$lang['No_doublepost']);  
  51. }  
  52. }  
  53. //  
  54. // END - Anti Double Posts Mod  
  55. //  
  56. #  
  57. #-----[ OPEN ]------------------------------------------  
  58. #  
  59. language/lang_english/lang_main.php  
  60. #  
  61. #-----[ FIND ]------------------------------------------  
  62. #  
  63. $lang['No_post_mode']  
  64. #  
  65. #-----[ AFTER, ADD ]-----------------------------------  
  66. #  
  67. $lang['No_doublepost'] = 'You cannot post in this topic until another user posts after you. Please edit your message instead.';  
  68. $lang['Query_topic'] = 'Could not query topics table';  
  69. $lang['Query_post'] = 'Could not query posts table'; 


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1239s (PHP: 13% SQL: 87%)
SQL queries: 10 - Debug Off - GZIP Enabled