Current time: 03-28-2024, 02:13 PM Hello There, Guest! (LoginRegister)


Announcement
We have the biggest collection of MyBB Plugins here on the Net. We have currently 175+ MyBB Exclusive Plugins, 80+ MyBB Compatible MyCodes and 16+ MyBB 1.4.x Themes (Some are still under construction...) Thus, we provide you the largest MyBB Stuff on the net including tutorials. Stay with us, you will find out some more to come.
Now you can easily create your own buttons set for MyBB! Click here to have a look...
*** You cannot do your registration behind any Proxies anymore! ***
Welcome Guest[3.234.177.119], connected from
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slide Out "Contact Us" (no plugin, no additional PHP)
09-11-2017, 09:51 PM
Post: #1
Slide Out "Contact Us" (no plugin, no additional PHP)
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).

bitsbb01's signature
Visit this user's website Find all posts by this user
Quote this message in a reply
1 member(s) viewed this thread in the last 365 days :
Promotionrhito
Post Reply 


Was This Thread Useful ?
Please Link To Us
URL
BBCode
HTML

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Heart [Release 1.4.x] Ultimate Posting Suite Plugin 1.0 ghazal 37 21,105 12-20-2012 09:08 PM
Last Post: ilsuonodelcuore
Heart [Release 1.4.x] My Slide Menu 1.0 ghazal 49 43,740 10-19-2012 03:41 PM
Last Post: ekolcu

Forum Jump:

 
New To Site ?
Some Useful Links
  • Help

  • You Might Need To Register

  • Forum Statistics

  • Mark All Forums Read

  • Forum Staff

  • Log Out
  • Contact Us

  • Mybbcodes

  • Return to Top

  • Return to Content

  • Lite (Archive) Mode

  • RSS Syndication
  • Powered By MyBB, © 2002-2024 MyBB Group.
    Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes.
    Hosting provided by WWWHostingServer.com