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_SEND, BUTTON_SEND_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_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_BACK, BUTTON_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…….
Bookmarks