Contact Us form WeBid 1.2.* ONLY

adds a 'Contact Us' form which is emailed to the Administrators email address

  1. Andrew Hacker

    Andrew Hacker New Member

    Joined:
    May 27, 2011
    Messages:
    15
    Likes Received:
    2
    Andrew Hacker submitted a new resource:

    Contact Us form - Contact Us form

    Read more about this resource...
     
    Last edited by a moderator: May 29, 2015
    jjjason84 likes this.
  2. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    line 165 doesnt exist i put it on line 88 so it appears on the nav bar after help
     
  3. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    theres files missing form the package email_request.inc.php
     
  4. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    played with it a bit now i have a email sent to the customer telling them the admin will contact them shortly plus one sent to the admin with customers question
     
  5. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    here are my email files upload them to language/EN/emails/html

    View attachment email.zip

    in /themes/default

    find
    Code:
    </div>
    	<div class="navbar">
    before add

    Code:
    td id="last"><a href="{SITEURL}email_request_support.php" alt="contact" class="">Contact Us</a></td>
    in email_request_support.php

    find

    Code:
    $emailer->email_sender($system->SETTINGS['adminmail'], 'email_request.inc.php', $subject);
    after add
    Code:
    $emailer->email_sender($user->user_data['email'], 'email_requestcust.inc.php', $subject);
     
    Last edited: May 7, 2012
    drakky20 likes this.
  6. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    if you want to add it to the wbcolors theme
    in themes/wbcolors

    find

    Code:
    <li id="faqs"><a href="{SITEURL}faqs.php" alt="faqs" class="new-window"><span>{L_148}</span></a></li>
    after add
    Code:
    <li id="last"><a href="{SITEURL}email_request_support.php" alt="contact" class="">Contact Us</a></li>
     
  7. drakky20

    drakky20 New Member

    Joined:
    Mar 11, 2012
    Messages:
    252
    Likes Received:
    24
    seems to be a bit missing no header or footer

    PHP:
    ## OPEN email_request_support.php

    ## find
    $template->set_filenames(array(
            
    'body' => 'email_request_support_form.tpl'
            
    ));
    $template->display('body');

    ##add before

    include 'header.php';

    ## add after

    include 'footer.php';

    ## SAVE/CLOSE email_request_support.php

     
  8. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    I am having a problem trying to get this mod to work I followed all the step everything seems fine the page loads you can type the message and send a confirm email to the user but it dose not send the message to the admin or is it in the admin panel ?
     
  9. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,569
    Likes Received:
    546
    PLEASE sort this mod out.

    I have just spent 30 mins of my time installing this for another member having to add things to the mod and sort out the layout.

    You forgot to add the

    PHP:
    include 'header.php';
    and

    PHP:
    include 'fotter.php';
    to the email_request_support.php

    And frankly the email_request_support.tpl layout is a total mess.

    If you want me to I can supply you the fixed files to add to your download, all you need to do is ask.

    I have unaproved this mod untill you make contact with me to resolve the isues with the mod
     
    Last edited: Jul 11, 2012
  10. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    Thank you nay for fixing this mod i just installed it and it only took me about 5min to install it and it works grate so thank you very much nay for fixing this mod.
     
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,569
    Likes Received:
    546
    No problem I am here to help and as per my thread 'MOD TESTERS WANTED' I am trying to go through every mod and test them then test them some more basicaly test to destruction. any mod found not to work will be placed into un accepted mode untill its fixed.

    one I need to test in the default theme is the enhanced fees thingy as I never could get that to work in my theme 'I am unsure about in the default theme' so that mod needs looking into.

    I am glad that this mod now works and look like it should for intergration withing the deafult webid
     
  12. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    That sounds like very good idea to test all the mods i could give you the list of mods i have installed and works on webid i use version 1.4 webid the mods i have install works on that version. I would like to see the contact us mod intergration in to the webid it is a very useful mod that help customers get ahold of the website admin.
     
  13. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    There was no subject field in this mod so i added the subject code to this mod on my webid and would like to share the code so that other people can add a subject field in this mod.

    The subject field will display a subject box on the email_request_support.tpl and will also display the subject in the administrator email.

    1. Open themes/your theme/email_request_support.tpl

    PHP:
    -----------Find this code on line 61--------------

    <
    TR
                        <
    TD ALIGN=right width="34%"> <B>{L_002}</B
                        </
    TD>
                        <
    TD width="65%" align="left" ><INPUT TYPE="TEXT" NAME="sender_name" SIZE="25" VALUE="{YOURUSERNAME}"
                        </
    TD>
                    </
    TR>


    --------------
    Add this code after it--------------

    <
    TR
                        <
    TD ALIGN=right width="34%"> <B>Subject:</B
                        </
    TD>
                        <
    TD width="65%" align="left" ><INPUT TYPE="TEXT" NAME="subject" SIZE="25" VALUE="{SUBJECT}"
                        </
    TD>
                    </
    TR>
    This code is for preset subject buttons that will fill in the subject box with a preset text.

    PHP:
    -----------Find this code on line 21--------------

    <
    input type="hidden" name="csrftoken" value="{_CSRFTOKEN}">

    --------------
    Add this code after it--------------

    <
    div align="center" style="color:black; width:100%;" height"30px">Choose a Subject:
    <
    input type="button" onclick="this.form.subject.value=this.value;" value="Request a new Category">
    <
    input type="button" onclick="this.form.subject.value=this.value;" value="Site Suggestions">
    <
    input type="button" onclick="this.form.subject.value=this.value;" value="General Enquiry">
    <
    input type="button" onclick="this.form.subject.value=this.value;" value="Error">
    </
    div>

    ----------
    To change the preset text just change the value="" to what you want it to fill in the subject box-----------
    Save email_request_support.tpl

    2. Open email_request_support.php
    PHP:
    --------------Find this code on line 46--------------

    if (isset(
    $_POST['action']) || !empty($_POST['action']))
    {
        
    $cleaned_question $system->cleanvars($_POST['sender_question']);
        if (
    $system->SETTINGS['wordsfilter'] == 'y')
        {
            
    $cleaned_question $system->filter($cleaned_question);
        }

    --------------
    Change it to this--------------

    if (isset(
    $_POST['action']) || !empty($_POST['action']))
    {
        
    $cleaned_question $system->cleanvars($_POST['sender_question']);
        
    $cleaned_subject $system->cleanvars($_POST['subject']);
        if (
    $system->SETTINGS['wordsfilter'] == 'y')
        {
            
    $cleaned_question $system->filter($cleaned_question);
            
    $cleaned_subject $system->filter($cleaned_subject);    
        }


    --------------
    Find this code on line 62--------------

    if (empty(
    $cleaned_question))
        {
            
    $TPL_error_text $ERR_031;
        }


    --------------
    Add this code after it--------------

    if (empty(
    $cleaned_subject))
        {
            
    $TPL_error_text $ERR_031;
        }

    --------------
    Find this code on line 99--------------

    'SENDER_QUESTION' => $cleaned_question,

    --------------
    Add this code after it--------------

    'SUBJECT' => $cleaned_subject,
    Save email_request_support.php

    3. Open language/EN/emails/html/email_request.inc.php

    PHP:
    --------------Find this code on line 5--------------

    User {SENDER_NAMEHas a question for you {TITLE}.<br>
    <
    br>


    --------------
    Add this code after it--------------

    Subject:<br>
    {
    SUBJECT}<br>
    Save email_request.inc.php

    4. Upload the files to your webid
    5. Clear the webid cache
     
  14. Guest

    Guest Guest

    nice jason looks like you can figure out that mail code :)
    could you add send copy to sender it would be perfect as it is required in danish sites by the law
     
  15. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    I can try add a copy to the sender.
     
  16. mpps

    mpps New Member

    Joined:
    Sep 18, 2012
    Messages:
    8
    Likes Received:
    0
    For compatibility with other languages:

    1. in language/YOURLANG/messages.inc.php
    ADD (before ?>)
    PHP:
    //contact us
    $MSG['CU1'] = "Contact us";
    $MSG['CU2'] = "Site Administrator";
    2. in themes/YOURTHEME/global_header.tpl
    CHANGE (around line 86)
    PHP:
    <li><a href="{SITEURL}email_request_support.php" alt="contact">Contact Us</a></li>
    TO
    PHP:
    <li><a href="{SITEURL}email_request_support.php" alt="contact">{L_CU1}</a></li>
    3. in email_request_support.php
    CHANGE (around line 41)
    PHP:
    $page_title 'Contact Us';
        
    $admin_nick 'Site Administrator';
    TO
    PHP:
    $page_title $MSG['CU1'];
        
    $admin_nick $MSG['CU2'];
    Enjoy!
     
  17. Guest

    Guest Guest

    nice think its better make it 3 digit code like the rest

    PHP:
    //Contact Us form
    $MSG['CU001'] = "Contact us";
    $MSG['CU002'] = "Site Administrator";
    :)
     
    Last edited by a moderator: Sep 23, 2012
  18. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    Here you go Dahl this will send a copy to the sender but i did find 2 problems with the coding if the sender is not logged in the copy will not be sent to the sender and the email that is sent to the admin dose not fill everything in the email so i found a way to fix both problems but the sender would have to be registered to your webid and logged in to send a message to the site admin.

    Here is a copy of my contact us mod it has the subject, preset subject buttons and send a copy to sender installed.

    If you don't want to use my contact us mod but still want the codes to add to the contact us mod.

    open email_request_support.php

    PHP:
    -------------Find on lines 26-31 -------------

    //if (!$user->is_logged_in())
    //{
        //$_SESSION['REDIRECT_AFTER_LOGIN'] = 'email_request_support.php';
        //header('location: login.php');
        //exit;
    //}


    -------------Change-------------

    if (!
    $user->is_logged_in())
    {
        
    $_SESSION['REDIRECT_AFTER_LOGIN'] = 'email_request_support.php';
        
    header('location: login.php');
        exit;
    }

    You don't have to have this code turned on if you choose to leave it turned off the sender will not receive a 
    copy and the email that is sent to the admin will be missing the sender name and email address only if the 
    sender is not logged in. If sender is logged in then the sender will receive a copy and the email that was sent 
    to the admin will have the senders name and email address.'
     
    -------------Find on line 43-------------

    $admin_email $system->SETTINGS['adminmail'];

    -------------
    Add after-------------

    $sender_email $user->user_data['email'];

    -------------
    Find on line 58-------------

    if (isset(
    $_POST['action']) && (!isset($_POST['sender_name']) || !isset($_POST['sender_email']) || empty($admin_nick) || empty($admin_email)))
        {

    -------------
    Change-------------

    if (isset(
    $_POST['action']) && (!isset($_POST['sender_name']) || !isset($_POST['sender_email']) || empty($admin_nick) || empty($admin_email) || empty($sender_email)))
        {

    -------------
    Find on line 73-------------

    if (isset(
    $_POST['action']) && (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i'$_POST['sender_email']) || !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i'$admin_email)))
        {

    -------------
    Change-------------

    if (isset(
    $_POST['action']) && (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i'$_POST['sender_email']) || !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i'$admin_email) || !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i'$sender_email)))
        {

    -------------
    Find on line 111-------------

    $emailer->email_sender($admin_email'email_request.inc.php'$subject);

    -------------
    Add after-------------

    $emailer->email_sender($sender_email'email_request2.inc.php'$subject);
    Upload the email_request_support.php to your webid

    Download the email_request2.inc.zip folder and upload the folder that is in side it to your webid

    That's it your done.
     

    Attached Files:

    Last edited: Sep 29, 2012
  19. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    Maybe it's just me.... But the e-mail is sending, and I'm receiving - no problem, but I do not get the senders e-mail adress - hard to response then.

    \ Audiobay
     
  20. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    61
    The sender has to be logged in to get the sender email and this is a known problem i knew about that i been trying to fix for this mod.
     

Share This Page