[MOD-DB] Thanks for Posting v1.0.0
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Thanks for Posting
View previous topic :: View next topic  
Author Message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Sat Nov 20, 2004 1:56 am    Post subject: [MOD-DB] Thanks for Posting v1.0.0 Reply with quote

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note:
This MOD has been kindly approved by the phpBB MOD Team Smile

Check out its Release Announcement topic:
http://www.phpbb.com/phpBB/viewtopic.php?t=240934
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MOD Title: Thanks for Posting

MOD Description: This MOD changes the message issued after posting on a forum without read access. The user is sent to the forum index instead of the login form.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to Create an Easy Contact Us Form?

1) Create a new forum, name it, for instance "Contact Us".

2) Set all permissions to MOD-erator, but allow Post to Guests.

At this point, annonymous users can post to this forum, but can't view/read it (it's hidden).

3) Finally, create a new link to allow them to post easilly:
Code:
<a href="http://www.example.com/forum/posting.php?mode=newtopic&f=xx">Contact Us</a>


A guest can't see the forum, but will be able to post! Smile

When a guest uses this form to send a message to the hidden forum, it will be redirected to the login form as (s)he is not allowed to view/read this hidden forum.

However, with this MOD, it will be redirected to the forum index instead.

Got it? Smile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Download:
See The MOD section below. It's also available in the phpBB MODs Database (Communication category).


The MOD:

Code:
##############################################################
## MOD Title: Thanks for Posting
## MOD Author: markus_petrux < phpbb.mods@phpmix.com > (Markus) http://www.phpmix.com
## MOD Description: This MOD changes the message issued after posting on a forum without read access.
##                  The user is sent to the forum index instead of to the login form.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: 2
##    posting.php
##    language/lang_english/lang_main.php
## Included Files: 0
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD might be useful for instance to create a Contact Us form.
##
## To do so:
##
## 1) Create a new forum, name it, for instance "Contact Us".
##
## 2) Set all permissions to MOD, but allow Post to Guests.
##
## At this point, annonymous users can post to this forum, but can't view/read it (it's hidden).
##
## 3) Finally, create a new link to allow them to post easilly:
##
##    <a href="http://www.example.com/forum/posting.php?mode=newtopic&f=xx">Contact Us</a>
##
## A guest can't see the forum, but will be able to post!
##
## When a guest uses this form to send a message to the hidden forum, it will be redirected
## to the login form as (s)he is not allowed to view/read this hidden forum.
##
## However, with this MOD, it will be redirected to the forum index instead.
##
## Got it? :-)
##
##############################################################
## MOD History:
##
## 2004/11/17 - 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
      if ( $mode == 'newtopic' || $mode == 'reply' )
      {
#
#-----[ AFTER, ADD ]------------------------------------------
#
//+MOD: Thanks for Posting MOD
         if ( !$is_auth['auth_read'] )
         {
            $return_meta = '<meta http-equiv="refresh" content="5;url=' . append_sid("index.$phpEx") . '">';
            $return_message = $lang['Thanks_for_posting'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');
         }
//-MOD: Thanks for Posting MOD

#
#-----[ OPEN ]------------------------------------------------
#
#  NOTE --- Remember to do this for all installed languages
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
$lang['No_post_mode'] =
#
#-----[ AFTER, ADD ]------------------------------------------
#

//+MOD: Thanks for Posting MOD
$lang['Thanks_for_posting'] = "Thanks for taking the time to drop us a note. We'll try to contact you as soon as possible.";
//-MOD: Thanks for Posting MOD
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Sat Nov 20, 2004 5:38 pm    Post subject: Re: [RC] Thanks for Posting v1.0.0 --- Submitted Reply with quote

This MOD has been kindly approved by the phpBB MOD Team. Smile

Check out its Release Announcement topic:
http://www.phpbb.com/phpBB/viewtopic.php?t=240934

Download:
Please, "The MOD" section above. It is also available in the phpBB MODs Database (Communication category).

Support, feeback, suggestions:
Feel free to use this forum, here at phpMiX.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Dec 28, 2004 9:27 am    Post subject: Re: [MOD-DB] Thanks for Posting v1.0.0 Reply with quote

So.... do you want to customize your "Contact Us" form further?

If you're using the MX-Portal, try using the following code within an HTML block.

Code:
<script language="JavaScript" type="text/javascript">
<!--
function checkForm() {

   formErrors = false;

   if (document.post.subject.value.length < 2)
   {
      formErrors = "You must enter a subject when posting.";
   }
   else if (document.post.message.value.length < 2) {
      formErrors = "You must enter a message when posting.";
   }

   if (formErrors) {
      alert(formErrors);
      return false;
   } else {
      return true;
   }
}
//-->
</script>

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" height="25"><b>Contact Us</b></th>
   </tr>
   <tr>
      <td class="row1"><span class="gen">Please, use the following form to send us a message.</span></td>
   </tr>
</table>

<form action="http://www.example.com/phpBB2/posting.php" method="post" name="post" onsubmit="return checkForm(this)">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25"><b>Message</b></th>
   </tr>
   <tr>
      <td class="row1"><span class="gen"><b>Name</b></span></td>
      <td class="row2"><span class="genmed"><input type="text" class="post" name="username" size="25" maxlength="25" value="" /></span></td>
   </tr>
   <tr>
      <td class="row1" width="22%"><span class="gen"><b>Subject</b></span></td>
      <td class="row2" width="78%"><input type="text" name="subject" size="45" maxlength="60" style="width:450px" class="post" value="" /></td>
   </tr>
   <tr>
      <td class="row1" width="22%"><span class="gen"><b>Message</b></span></td>
      <td class="row2" width="78%"><textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" class="post""></textarea></td>
   </tr>
   <tr>
      <td class="catBottom" colspan="2" align="center" height="28"><input type="hidden" name="mode" value="newtopic" /><input type="hidden" name="f" value="99999" /><input type="submit" name="post" class="mainoption" value="Submit" /></td>
   </tr>
</table>
</form>


Just be sure to replace the URL of the FORM. We are using www.example.com/phpBB2/posting.php above. Also, use your own "Contact Us" forum id. We're using 99999 above.

Of course, you can also use your own text in the first table to encourage the visitor to enter a contact method (ie. his/her e-mail), etc.

And you're done. Wink

PS: Just a hint, include the "Contact Us" forum in your LastMsg block, so you'll notice easilly when someone sends a message.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Thanks for Posting All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum