Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    May 2007
    Posts
    36
    Plugin Contributions
    0

    Default Add a upload module on contact us page

    I know Zen Chart got a upload module for product.

    But if I want to Add a upload module on contact us page.
    that will allow the customer upload some file with a message and their email address.

    If someone know how ,please give me some tips, thanks

  2. #2
    Join Date
    Jun 2008
    Location
    Utah, US.
    Posts
    25
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    BUMP

    I am currently attempting to do just that, having some problems though, if i get it, I'll let you know.

    and if any else has this, PLEASE pass it along.
    NooNe

  3. #3
    Join Date
    Jun 2008
    Location
    Utah, US.
    Posts
    25
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Got it!!!!

    upload images on contact page + it will email you the name(s) of the files uploaded.

    With

    Popup (animated.gif) progress bar

    gimme a while to put it together for ya.....

    anyone interested?
    NooNe

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Add a upload module on contact us page

    Quote Originally Posted by NooNe View Post
    Got it!!!!

    upload images on contact page + it will email you the name(s) of the files uploaded.

    With

    Popup (animated.gif) progress bar

    gimme a while to put it together for ya.....

    anyone interested?
    Sounds good..please share..

  5. #5
    Join Date
    May 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Quote Originally Posted by NooNe View Post
    Got it!!!!

    upload images on contact page + it will email you the name(s) of the files uploaded.

    With

    Popup (animated.gif) progress bar

    gimme a while to put it together for ya.....

    anyone interested?

    Hi NooNe, please tell me how, thanks

  6. #6
    Join Date
    Jun 2008
    Location
    Utah, US.
    Posts
    25
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Hiya, alsBB – Misty,

    Okie, I am writing this mod in 2 sections – Section 1) upload mod, and section 2) “dummy” progress bar mod.

    Section 1) Upload Mod

    1) In includes/templates/YOUR_TEMPLATE/templates/tpl_contact_us_default.php
    Find:
    PHP Code:
    <label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL?></label>
    <?php echo zen_draw_input_field('email', ($error $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
    <br class="clearBoth" />
    <label for="enquiry"><?php echo ENTRY_ENQUIRY '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?></label>
    <?php echo zen_draw_textarea_field('enquiry''30''7''''id="enquiry"'); ?>
    Change to:
    PHP Code:
    <label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL?></label>
    <?php echo zen_draw_input_field('email', ($error $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
    <br class="clearBoth" />
    <label for="enquiry"><?php echo ENTRY_ENQUIRY '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?></label>
    <?php echo zen_draw_textarea_field('enquiry''30''7''''id="enquiry"'); ?></fieldset><fieldset>
    <? if ($_SESSION['customer_id'] != ''){ ?>
    <label class="inputLabel" for="image1"><?php echo 'Front image' ?></label>
    <?php echo zen_draw_file_field('ufile[]'); ?>
    <br class="clearBoth" />
    <label class="inputLabel" for="image2"><?php echo 'Back image' ?></label>
    <?php echo zen_draw_file_field('ufile[]'); ?>
    <br class="clearBoth" />
    Then in includes/modules/pages/contact_us/header_php.php

    Find:
    PHP Code:
    <?
    if (isset($_GET['action']) && ($_GET['action'] == 'send')) { ?>
    <?
    change to::
    PHP Code:
    <?
    if (isset($_GET['action']) && ($_GET['action'] == 'send')) { ?>
    <?
     $path1= "images/ YOUR_UPLOAD_FILE ".$HTTP_POST_FILES['ufile']['name'][0];
    $path2= "images/YOUR_UPLOAD_FILE ".$HTTP_POST_FILES['ufile']['name'][1];

    //copy file to where you want to store file
    copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
    copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
    then find:
    PHP Code:
    OFFICE_FROM "\t" $name "\n\n" .
    OFFICE_EMAIL "\t" $email_address "\n\n" .
    '------------------------------------------------------' "\n\n" 
    and change to:
    PHP Code:
    OFFICE_FROM "\t" $name "\n\n" .
    OFFICE_EMAIL "\t" $email_address "\n\n" .
     
    'Front image; '.$HTTP_POST_FILES['ufile']['name'][0] .  "\n\n" .
    'Back image; '.$HTTP_POST_FILES['ufile']['name'][1] .  "\n\n" .
    '------------------------------------------------------' "\n\n" 

    When we added <?php echo zen_draw_file_field('ufile[]'); ?> the name ufile[] is loading & POSTing your image into an array, using this method you can add 100+ of the zen_draw_file_fields without having to rename them.

    When the customer hits the “send now” button, the cart goes to the “send” portion of the cart and this is where we catch your newly POSTed files.

    $HTTP_POST_FILES['ufile']['name'][0]; is the first ufile[] that you placed on the first page (Zero is the first number…lol) and then is goes to HTTP_POST_FILES['ufile']['name'][1]; and then[2], then [3] and so on, up too 100+..

    You will need to change images/YOUR_UPLOAD_FILE into images/uploaded or into images/contact and make sure that you have the same name on your file folder in your “images/”



    MOD dummy progress bar:
    In this section you will also need to ceate a file “popup.html”
    Section 2-A) in popup.html add:
    PHP Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>

    </head><center><img src="/images/popup_image.png" /><br/><? // my header/logo image
    <img src="/images/progress_bar_animated.gif" width="500" height="30" /><br/> <? // my animated.gif progress bar found on the internet
    (Depending on your file size, this page may take up to 10 minutes to refresh).</center> <? // me asking the customer no to touch anything more
    </body>
    </html>
    then upload it in your ROOT docs (next to your main index page).

    Section 2-B) In includes/templates/YOUR_TEMPLATE/templates/tpl_contact_us_default.php

    Find:
    PHP Code:
    </fieldset>

    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SENDBUTTON_SEND_ALT); ?></div>
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACKBUTTON_BACK_ALT) . '</a>'?></div>
    and change to:
    PHP Code:
    </fieldset>
    <script type="text/javascript"><!--
    document.write("<div style='display:none' id='moreinfo'>");
    //-->
    </script><? include ('popup.html'); ?><script type="text/javascript"><!--
    document.write("</div>");
    //--></script>
    </fieldset>
    <div class="buttonRow forward"><? echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT,'','onclick="document.getElementById(\'moreinfo\').style.display = \'block\';"') ;?> </div>
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACKBUTTON_BACK_ALT) . '</a>'?></div>

    What this script does is includes and “hides” popup.html and then when the customer presses the “send now” button, it “shows” popup.html.

    This is a very basic progress bar setup, my customers upload 30m – 350m files and it takes a while, and this stops them from thinking it’s a “Dead page” and isn’t doing anything, and re-clicking the send now button again.

    I hope this helps…….
    Last edited by NooNe; 19 Jun 2008 at 02:23 PM.
    NooNe

  7. #7
    Join Date
    Jun 2008
    Location
    Utah, US.
    Posts
    25
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Just a note:

    if you are attempting to have customers upload images during the purchase process, i highly recommend learning about and using attributes, as the cart uses them extensively, and what can be done with them is simply amazing.

    https://www.zen-cart.com/tutorials/index.php?article=57

    it is much easier for you and your customer in the long run, than the code that i have written.
    NooNe

  8. #8
    Join Date
    Nov 2006
    Posts
    76
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Yes I'm very interested in knowing how to do what you've done.

  9. #9
    Join Date
    Jun 2008
    Location
    Utah, US.
    Posts
    25
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    Its there ^^^^^^^^^^^ Looky up
    NooNe

  10. #10
    Join Date
    May 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Add a upload module on contact us page

    cool!!!
    Thanks very much for shareing!
    I will try your way
    I thing hundred of people in here would like to improve the upload module.
    you are the hero

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Allow Customers To Upload Images Using Contact Us Page?
    By CoolCarPartsOnline in forum General Questions
    Replies: 34
    Last Post: 4 Jan 2017, 05:00 PM
  2. how to add file upload to contact us page?
    By warroyo90 in forum General Questions
    Replies: 6
    Last Post: 19 Jun 2012, 06:28 AM
  3. allow file upload on contact us page
    By bluelightnin6 in forum General Questions
    Replies: 5
    Last Post: 13 Jan 2012, 01:00 AM
  4. Contact Us Page - Add on?
    By AnitaB in forum General Questions
    Replies: 2
    Last Post: 3 Oct 2009, 05:18 AM
  5. Captcha module on contact page
    By Backstage in forum General Questions
    Replies: 4
    Last Post: 26 Mar 2009, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR