Warn of New Topic in Thread Before Submitting

Tutorials for <a href="http://www.phpbbstyles.com/viewtopic.php?t=356">eXtreme Styles mod</a> for phpBB 2.0.

Moderator: Moderators

Warn of New Topic in Thread Before Submitting

Postby pentapenguin on Fri Apr 15, 2005 2:20 am

Hello.
This small MOD will add a warning if someone has posted a new message while you are posting yours.
If someone has, a warning will appear so you can see their post first before submitting yours.
It's very handy if you have a busy site. ;)

Credit: this is CyberAlien's MOD for phpbbstyles.com --I just made a few tweaks and am posting it here.

Note: the instructions are for Aphrodite. If you need help for other styles, just say.

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php


#
#-----[ FIND ]------------------------------------------
#
   else if ($mode != 'delete' && $mode != 'poll_delete')
   {
      $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_message'] : $lang['Empty_message'];
   }


#
#-----[ AFTER, ADD ]------------------------------------------
#

   // Check to see if there's a new post while the user is posting
   global $HTTP_POST_VARS;
   global $lang;
   if(!empty($HTTP_POST_VARS['post_time']) && ($mode == 'reply' || $mode == 'quote'))
   {
      global $topic_id;
      $last_post_time = intval($HTTP_POST_VARS['post_time']);
      
         if(isset($topic_id) && $last_post_time)
         {
            $sql = "SELECT post_time FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id ORDER BY post_time DESC LIMIT 0, 1";
            global $db;
            
               if(($result = $db->sql_query($sql)) !== false)
               {
               
                  if( $row = $db->sql_fetchrow($result) )
                  {
                  $last_post_time2 = $row['post_time'];
                  
                     if($last_post_time2 > $last_post_time)
                     {
                     $error_msg .= (empty($error_msg) ? '' : '<br />') . $lang['Warn_new_post'];
                     }
                  }
                  
               $db->sql_freeresult($result);
               }
         }
   } 


#
#-----[ OPEN ]------------------------------------------
#
templates/ca_aphrodite/posting_body.tpl


#
#-----[ FIND ]------------------------------------------
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>


#
#-----[ AFTER, ADD ]------------------------------------------
#
<input type="hidden" name="post_time" value="<?php echo time(); ?>" />


#
#-----[ OPEN ]------------------------------------------
#
templates/ca_aphrodite/xs/xs_topic.tpl


#
#-----[ FIND ]------------------------------------------
#
{S_HIDDEN_FIELDS}


#
#-----[ AFTER, ADD ]------------------------------------------
#
<input type="hidden" name="post_time" value="<?php echo time(); ?>" />


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


#
#-----[ FIND ]------------------------------------------
#
?>


#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['Warn_new_post'] = 'There is at least one new reply in this thread. Please review new replies in topic review and resubmit your post.';
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby mikecp421 on Sun Apr 17, 2005 4:42 am

can you tell me how to do this with Morpheus? and what area of the config I need to mod? Thanks
User avatar
mikecp421
Registered User
Registered User
 
Posts: 431
Joined: Sun Apr 17, 2005 12:18 am
Location: New York

Postby PostBot on Sun Apr 17, 2005 8:01 am

Same way as for Aphrodite, but instead of templates/ca_aphrodite/xs/xs_topic.tpl edit templates/Morpheus/viewtopic_body.tpl
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby DmS on Wed Apr 27, 2005 5:13 am

Credit: this is CyberAlien's MOD for phpbbstyles.com --I just made a few tweaks and am posting it here

May I ask, where is the original MOD? Very interesting to see (I made one MOD with same functionality).
DmS
Registered User
Registered User
 
Posts: 1
Joined: Sun Feb 08, 2004 5:34 am

Postby PostBot on Wed Apr 27, 2005 7:54 am

Original idea is from phpBB 3.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby kukacomone on Wed May 11, 2005 9:18 pm

Cool, i install it now. :)
User avatar
kukacomone
Registered User
Registered User
 
Posts: 184
Joined: Tue Oct 26, 2004 8:24 pm

Postby DooBDee on Wed May 11, 2005 9:21 pm

what i love about most things / mods with phpbbstyles is that you only have to edit the theme skins. Ie - you dont have to edit actual phpBB files.
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby phpBBHomer on Sat May 14, 2005 9:17 pm

thnx for the mod buddy. but i cant find this {S_HIDDEN_FIELDS} in viewtopic.tpl :(
phpBBHomer
Registered User
Registered User
 
Posts: 156
Joined: Sat May 07, 2005 9:40 am

Postby DooBDee on Sat May 14, 2005 9:21 pm

Greetings,

This variable is in :

templates/ca_aphrodite/xs/xs_topic.tpl

not the file you mentioned
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby phpBBHomer on Sat May 14, 2005 10:12 pm

hi again

yeah i know but see what ca told:

[quote user="CyberAlien" post="28867"]Same way as for Aphrodite, but instead of templates/ca_aphrodite/xs/xs_topic.tpl edit templates/Morpheus/viewtopic_body.tpl[/quote]

thats why i thought that it will be also in igloo template.
phpBBHomer
Registered User
Registered User
 
Posts: 156
Joined: Sat May 07, 2005 9:40 am

Postby pentapenguin on Sat May 14, 2005 11:13 pm

The xs/xs_topic.tpl file is for the quick reply box.
It's in a separate file in Aphrodite but is part of viewtopic_body.tpl in Morpheus.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby phpBBHomer on Sun May 15, 2005 6:13 pm

hm k thnx
then it will not working for me because m not using this style :(
phpBBHomer
Registered User
Registered User
 
Posts: 156
Joined: Sat May 07, 2005 9:40 am

Postby pentapenguin on Sun May 15, 2005 7:34 pm

No, the code will work with any style.
Since your template doesn't have quick reply, you don't need to mess with that file then.
Just edit the other 3 files.
User avatar
pentapenguin
Moderator
Moderator
 
Posts: 1466
Joined: Tue Sep 14, 2004 4:15 pm
Location: Georgia, USA

Postby mwx on Sat Nov 26, 2005 10:35 pm

how u do this is morpheusx?
User avatar
mwx
Registered User
Registered User
 
Posts: 1075
Joined: Wed Jul 13, 2005 3:19 pm
Location: long island, new york

Postby UseLess on Sat Nov 26, 2005 11:33 pm

Greetings,

Follow the instructions above, but where it states;

Code: Select all

#-----[ OPEN ]------------------------------------------ 

templates/ca_aphrodite/xs/xs_topic.tpl


do this instead...

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

templates/MorpheusX/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#

{S_HIDDEN_FIELDS}

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#

<input type="hidden" name="post_time" value="<?php echo time(); ?>" />

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Next

Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron