Welcome Guest ! Please   Login or Register


Check out our latest Premium Themes, Majestic , Majestic - Dark and Musk Themes for MyBB 1.8 Click to Shop Now

Now open for Custom Theme requests : Click to Order Now





 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slide Out "Contact Us" (no plugin, no additional PHP)

effone Offline
Junior Member
**

Posts: 14
Joined: Jan 2013
Likes Received : 11

Nationality:

Mood: None

Points: 315.96Points
Post: #1
Slide Out "Contact Us" (no plugin, no additional PHP)

So here is the contact form specifically for those users who use hosted services and don't have FTP access or access to core files. No plugin, no additional PHP. It will send a mail with the content to the admin of the site (UID 1).

I'm using the 'send mail to member' feature of MyBB. Its a very basic tutorial just to demonstrate the functionality. You can further modify and reprogram it as per your requirement.

Open your header template and add at the very beginning:

Code:
<script type="text/javascript">
jQuery.noConflict();
            jQuery(document).ready(function(){

                jQuery("#contactLink").click(function(){
                    if (jQuery("#contactForm").is(":hidden")){
                        jQuery("#contactForm").slideDown("slow");
                    }
                    else{
                        jQuery("#contactForm").slideUp("slow");
                    }
                });
                
            });
</script>

Now in the same template locate the code:
Code:
<a name="top" id="top"></a>

and add after that:

Code:
<div id="contactFormContainer">
  <div id="contactForm">
    <form action="member.php" method="post" name="input">
      <input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
      <table border="0" cellspacing="1" cellpadding="1">
        <tr>
          <p><strong>Drop some lines and we will get back to you ...</strong></p>
        </tr>
        <tr>
          <td >Subject:</td >
        </tr>
        <tr>
          <td >
            <input type="text" class="textbox" size="52" name="subject" value="{$subject}" />
          </td>
        </tr>
        <tr>
          <td >Message:</td >
        </tr>
        <tr>
          <td >
            <textarea cols="46" rows="7" name="message">{$message}</textarea>
          </td>
        </tr>
      </table>
      <input type="hidden" name="action" value="do_emailuser" />
      <input type="hidden" name="uid" value="1" />
      <div align="center">
        <input type="submit" class="button" value="Send your Feedback" />
      </div>
    </form>
  </div>
  <div id="contactLink">Contact Us</div>
</div>

Now the CSS Part. Put this at the bottom of your global.css:

Code:
#contactFormContainer {
    position: absolute;
    left: 600px;
    float: right;
}

#contactForm {
    padding: 10px;
    height: 275px;
    width: 350px;
    background: #ADCBE7;
    border: 1px solid #0F5C8E;
    display: none;
}

#contactLink {
    padding: 3px;
    text-align: center;
    color: #fff;
    height: 20px;
    width: 120px;
    background-image: url(images/thead_bg.gif);
    display: block;
    cursor: pointer;
}

You are done. Now you have a jQuery slide-out contact form in your board.

Known issue: After successful submission of the form the page will be redirected to the profile of the administrator (UID 1).

[Image: bZtnY.png]
(This post was last modified: 01-05-2013 03:41 PM by effone.)
01-05-2013 10:19 AM
Find
1
Quote




envira Offline
Doctor Web
*******

Posts: 1,245
Joined: Aug 2012
Likes Received : 306

Facebook Google Plus Twitter
Nationality: India

Mood: Lazy

Points: 63,253.44Points
Post: #2
RE: Slide Out "Contact Us" (no plugin, no additional PHP)

Kool One,
Good work bro Smile

[Image: lt79ucY.png]
01-05-2013 11:16 AM
Find
0
Quote




effone Offline
Junior Member
**

Posts: 14
Joined: Jan 2013
Likes Received : 11

Nationality:

Mood: None

Points: 315.96Points
Post: #3
RE: Slide Out "Contact Us" (no plugin, no additional PHP)

Thank you Envira Big Grin
As I said its specifically for hosted board users.

I'll try to make another tut using same jQ with mailsend php including custom validation and CAPTCHA for general users.
01-05-2013 03:42 PM
Find
0
Quote




Jason Offline
Customer
****

Posts: 62
Joined: Oct 2012
Likes Received : 9

Nationality: India

Mood: None

Points: 982.56Points
Post: #4
RE: Slide Out "Contact Us" (no plugin, no additional PHP)

Great tutorial and slide out contact us script!.

Thank you!
01-05-2013 04:28 PM
Find
0
Quote





Forum Jump:


User(s) browsing this thread: 1 Guest(s)

About Myskins

MySkins Studio is MyBB Themes Resource Website.

At MySkins Studio, We procreate MyBB Themes both custom MyBB Themes and premium Mybb Themes.We believe in quality and assure you the best MyBB themes at a very reasonable price , that suits your taste.

Feel free to drop in a request and get a quote.