Jump to content



Photo
- - - - -

Super Contact us enhancement 1.0


  • Please log in to reply
339 replies to this topic

#1   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 17 February 2006 - 17:57

Super Contact us enhancement 1.0
=======================

Made to work and tested with OsCommerce 2.2 MS2.

I have make a meltpot of all around contribution for the contact_us.php page. I include the Contact Us Form Vunerability Fix, address of the Online Store, a drop down list or Radio list button or Drop Down list of email departement to send the enquiry, a drop down list for the email reason, Hours of Operation and the Add Customer Details Automatically if the customer is login.

I have made this Contribution multilingual.

I have made this contribution to be very simple for you to install

Time to install : Between 5 to 15 minutes depending on your skill.

Tell me what you think.... And your impression...
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#2   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 17 February 2006 - 20:32

Here a picture for this contribution :



[img]http://www.sultanosto.com/images/Super_Contact_us.jpg[/img]

Edited by Jeep_ice, 17 February 2006 - 20:32.

JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#3   rocket468

rocket468
  • Members
  • 52 posts
  • Real Name:chance mcclurkin
  • Gender:Male
  • Location:oklahoma city

Posted 17 February 2006 - 20:56

I like this. I will have to add this to my store asap.

#4   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 17 February 2006 - 21:16

super boulot merci d'avoir partagé ton travail !!! je vais de ce pas l'installer ! ( = nice work !)
MS2

#5   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 17 February 2006 - 21:34

super boulot merci d'avoir partagé ton travail !!! je vais de ce pas l'installer ! ( = nice work !)


De rien, ça fait plaisir, faut bien s'entraider... /wink.gif' class='bbc_emoticon' alt=';)' />
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#6   draxion

draxion
  • Members
  • 143 posts
  • Real Name:Shayne
  • Location:Ottawa, Canada

Posted 17 February 2006 - 22:04

Nice Contribution. I like it. However, I tried to install. Everything seems to work except that I'm having a hard time integrating it with the Visual Verify Code

http://www.oscommerc...h,visual verify

I'm not much of coder and have very limited php knowledge. I'm wondering if anyone else has had any luck with the two contributions.

Thanks!
Shayne

#7   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 17 February 2006 - 22:27

Nice Contribution. I like it. However, I tried to install. Everything seems to work except that I'm having a hard time integrating it with the Visual Verify Code

http://www.oscommerc...h,visual verify

I'm not much of coder and have very limited php knowledge. I'm wondering if anyone else has had any luck with the two contributions.

Thanks!
Shayne


I will test this contribution and be back with you this week-end...
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#8   draxion

draxion
  • Members
  • 143 posts
  • Real Name:Shayne
  • Location:Ottawa, Canada

Posted 17 February 2006 - 22:41

That's great! Thanks for the reply and the help.

I'm having a hard time integrating your modified code from contact us and the Visual Verify code... specificaly where you modify the top part of the above the </head> section.

Here's your code...

$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

if (tep_validate_email($email_address)) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);


replace with the following lines :

// BOF Super Contact us enhancement 1.0
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email_address)) {
if (CONTACT_US_LIST !=''){
$send_to_array=explode("," ,CONTACT_US_LIST);
preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
$send_to_email= eregi_replace (">", "", $send_email_array[0]);
$send_to_email= eregi_replace ("<", "", $send_to_email);

tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
}else{
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
}
// EOF Super Contact us enhancement 1.0

And here's the modified code from the Visual Verify...

$error = false;
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

if (tep_validate_email($email_address) == false) {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}

//VISUAL VERIFY CODE start
require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');

$code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'");
$code_array = tep_db_fetch_array($code_query);
$code = $code_array['code'];

tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results

$user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
if (!(strcasecmp($user_entered_code, $code) == 0)) { //make the check case insensitive
$error = true;
$messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
}
//VISUAL VERIFY CODE stop

if ($error == false) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
}
}


Thanks again!

#9   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 18 February 2006 - 09:00

1.i don't understand why , but i got a problem in contact us. php , i got to coment the } for th epage to work here :

<?php
  // ishpbe }
?>
<!-- EOF Super Contact us enhancement 1.0 //-->


maybe in the next pacakage u could give in the zip your modified contactus.php for people who never modifed their file

2. my website is 1000 pix width , and with your contrib, the width grow ( le site s'elargi) , is there any way to determine the max width of contact us ?
MS2

#10   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 18 February 2006 - 09:09

ok for the question 2 , i changed the width here :
<td height="200" width="350" valign="top" class="main">


so i changed to
<td height="100" width="200" valign="top" class="main">   <!-- change here the width of the contact us field  //-->


but the problem is that after installing the right corner is now on the right of the header, instead of the right of contact ( le right column monte tout en ahut du site a droite du header
MS2

#11   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 18 February 2006 - 09:23

1.i don't understand why , but i got a problem in contact us. php , i got to coment the } for th epage to work here :

<?php
  // ishpbe }
?>
<!-- EOF Super Contact us enhancement 1.0 //-->


maybe in the next pacakage u could give in the zip your modified contactus.php for people who never modifed their file

2. my website is 1000 pix width , and with your contrib, the width grow ( le site s'elargi) , is there any way to determine the max width of contact us ?


evrything is ok with version 1.1 awesome !
nice work
MS2

#12   azer

azer
  • Members
  • 842 posts
  • Real Name:azer
  • Location:Paris, france

Posted 18 February 2006 - 10:44

REQUEST 1 : is there any solution to be able to have multilanguage for the email descriptions because :
sales <email adresse> would be : ventes <email adresse>

for a way to use a dropdown like for the "The reason of your email : " and then we can use the nlanguage files

question 2 : can we add as many resoan as we want , or is it maximium 6 resaon ? ( porgamming using 6 case of a loop for while ? )
MS2

#13   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 18 February 2006 - 16:46

REQUEST 1 : is there any solution to be able to have multilanguage for the email descriptions because :
sales <email adresse> would be : ventes <email adresse>

for a way to use a dropdown like for the "The reason of your email : " and then we can use the nlanguage files

question 2 : can we add as many resoan as we want , or is it maximium 6 resaon ? ( porgamming using 6 case of a loop for while ? )


Azer,

The only thing which is not multilingual is the email departement drop down list, you right about this. Because it's controled via the MySqL in the admin panel. So you have to choose a name which is similar for french and english /whistling.gif' class='bbc_emoticon' alt=':-"' /> . But maybe we can do something to render this multilingual. I have passed 1 day to built this contrib all in one and I have no time now but maybe the next week.
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#14   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 18 February 2006 - 18:36

REQUEST 1 : is there any solution to be able to have multilanguage for the email descriptions because :
sales <email adresse> would be : ventes <email adresse>

for a way to use a dropdown like for the "The reason of your email : " and then we can use the nlanguage files

question 2 : can we add as many resoan as we want , or is it maximium 6 resaon ? ( porgamming using 6 case of a loop for while ? )


Azer,

You can add many reasons as you want, edit the catalog/contact_us.php go to line around 214 after the 6 th reasons, just add :

<?php echo '<option value="' . REASONS7 . '">' . REASONS7 . '</option>'; ?>

And etc.... for many reason you want... After, do the same thing in catalog/includes/languages/english/contact_us.php and catalog/includes/languages/french/contact_us.php and add the reasons 7th with the definition like this :

define('REASONS7', ' Wow');

That's it....

Edited by Jeep_ice, 18 February 2006 - 18:37.

JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#15   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 18 February 2006 - 21:29

Nice Contribution. I like it. However, I tried to install. Everything seems to work except that I'm having a hard time integrating it with the Visual Verify Code

http://www.oscommerc...h,visual verify

I'm not much of coder and have very limited php knowledge. I'm wondering if anyone else has had any luck with the two contributions.

Thanks!
Shayne


Shayne,

Ok I got it working, you must install my contrib and after do the following :

Search the lines in catalog/contact_us.php :

} else {
	  $error = true;

	  $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
	}

Add just after it, the following lines :
//VISUAL VERIFY CODE start
  require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');

	$code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'");
	$code_array = tep_db_fetch_array($code_query);
	$code = $code_array['code'];

	tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results

	$user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
	if (!(strcasecmp($user_entered_code, $code) == 0)) {	//make the check case insensitive
		$error = true;
		$messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
	}
//VISUAL VERIFY CODE stop

Then search for the following lines :

<td height="200" width="350" valign="top" class="main">
					<?php echo ENTRY_ENQUIRY; ?><BR>
					<!-- BOF This is the change for the Form Vunerability Fix //-->
					<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>
					<!-- EOF This is the change for the Form Vunerability Fix //-->
				</td>
			</tr>
			<tr> 
				<td height="4"></td>
			</tr>

Add the following lines just after it :

<!-- VISUAL VERIFY CODE-- START-->
			<tr>
				<td class="main">
					<?php echo VISUAL_VERIFY_CODE_CATEGORY; ?>
					<br>
					<?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?> <?php echo tep_draw_input_field('visual_verify_code'); ?>
				  <?php
				  //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
				  $visual_verify_code = "";
				  for ($i = 1; $i <= rand(3,6); $i++){
				  $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
				  }
				  $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
				  tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
				  $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
				  tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
				  $visual_verify_code = "";
				  echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
				  ?> <?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?>
				</td>
			</tr>
			<tr> 
				<td height="4"></td>
			</tr>			
<!-- VISUAL VERIFY CODE-- STOP -->

That's it, it's should be work. I have included in this the Cookie fix for VVC /rolleyes.gif' class='bbc_emoticon' alt=':rolleyes:' /> . Let me know if all the thing is ok for you....
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#16   draxion

draxion
  • Members
  • 143 posts
  • Real Name:Shayne
  • Location:Ottawa, Canada

Posted 19 February 2006 - 00:48

Cool! I'll try it out tonight and see what happens. Thanks again! I appriciate the help.

Shayne

#17   buttonfactory

buttonfactory
  • Members
  • 3 posts
  • Real Name:Reinhard

Posted 19 February 2006 - 13:58

Hello,

nice contrib.

But I get this error message:

Parse error: parse error, unexpected ';' in /home/htdocs/web0/html/shop/contact_us.php on line 230

the line looks like these:


echo tep_draw_pull_down_menu('send_to', $send_to_array);
}

echo ; <- Line 230
}
?>


when I change echo; to echo (''); the thing works; do you have a reason for this behavior??

best regards
Reinhard

#18   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 19 February 2006 - 16:35

Hello,

nice contrib.

But I get this error message:

Parse error: parse error, unexpected ';' in /home/htdocs/web0/html/shop/contact_us.php on line 230

the line looks like these:
echo tep_draw_pull_down_menu('send_to', $send_to_array);
}

echo ; <- Line 230
}
?>
when I change echo; to echo (''); the thing works; do you have a reason for this behavior??

best regards
Reinhard


Can you send all your code of the contact_us.php here please, we will check that where is the problem... Did you download the Last version 1.1 ?
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]

#19   buttonfactory

buttonfactory
  • Members
  • 3 posts
  • Real Name:Reinhard

Posted 19 February 2006 - 18:02

Can you send all your code of the contact_us.php here please, we will check that where is the problem... Did you download the Last version 1.1 ?

Hello,

yes we download the latest version.
Here the code:

<?php
/*
$Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

$error = false;
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
// BOF Super Contact us enhancement 1.0
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email_address)) {
if (CONTACT_US_LIST !=''){
$send_to_array=explode("," ,CONTACT_US_LIST);
preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
$send_to_email= eregi_replace (">", "", $send_email_array[0]);
$send_to_email= eregi_replace ("<", "", $send_to_email);

tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
}else{
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
}
// EOF Super Contact us enhancement 1.0

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
} else {
$error = true;

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
}

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
if ($messageStack->size('contact') > 0) {
?>
<tr>
<td><?php echo $messageStack->output('contact'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
<tr>
<td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!-- BOF Super Contact us enhancement 1.0 //-->
<?php
} else {
if (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);

$name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$email = $account['customers_email_address'];
}
?>

<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="650" height="0"></td>
<td width="600"></td>
</tr>

<tr>
<td rowspan="11" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left" valign="top" class="main"></td>
</tr>
<tr>
<td width="38" height="120" align="left" valign="top" class="main"></td>
<td width="334" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="333" height="120" align="left" valign="top" class="main">
<STRONG><?php echo nl2br(STORE_NAME_ADDRESS); ?></STRONG><br><br><br>
<?php echo (OPENING_HOURS); ?>
</td>
<td width="1"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" class="main"><p> </p></td>
</tr>
</table>
</td>
<td height="40" valign="top" class="main">
<?php echo ENTRY_NAME; ?><br>
<?php echo tep_draw_input_field('name'); ?>
</td>
</tr>
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="40" valign="top" class="main">
<?php echo ENTRY_EMAIL; ?><br>
<?php echo tep_draw_input_field('email'); ?>
</td>
</tr>
<tr>
<td height="4"></td>
</tr>

<tr>
<td height="40" valign="top" class="main">
<?php
if (CONTACT_US_LIST !=''){
echo SEND_TO_TEXT . '<br>';
if(SEND_TO_TYPE=='radio'){
foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
if($k==0){
$checked=true;
}else{
$checked=false;
}
echo tep_draw_radio_field('send_to', "$k", $checked). " " .preg_replace('/\<[^*]*/', '', $v);
}

}else{
foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
$send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
}
echo tep_draw_pull_down_menu('send_to', $send_to_array);
}

echo ('');
}
?>
</td>
</tr>
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="40" valign="top" class="main">
<?php echo ENTRY_REASON; ?><br>
<select name="reason">
<?php echo '<option value="' . REASONS1 . '">' . REASONS1 . '</option>'; ?>
<?php echo '<option value="' . REASONS2 . '">' . REASONS2 . '</option>'; ?>
<?php echo '<option value="' . REASONS3 . '">' . REASONS3 . '</option>'; ?>
<?php echo '<option value="' . REASONS4 . '">' . REASONS4 . '</option>'; ?>
<?php echo '<option value="' . REASONS5 . '">' . REASONS5 . '</option>'; ?>
<?php echo '<option value="' . REASONS6 . '">' . REASONS6 . '</option>'; ?>

</select>
</td>
</tr>
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="200" width="350" valign="top" class="main">
<?php echo ENTRY_ENQUIRY; ?><BR>
<!-- BOF This is the change for the Form Vunerability Fix //-->
<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>
<!-- EOF This is the change for the Form Vunerability Fix //-->
</td>
</tr>
<tr>
<td height="4"></td>
</tr>
<tr>
<td height="66" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="547" height="62" valign="top" align="middle"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
</tr>
<tr>
<td height="4"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="41" colspan="2" align="left" class="main"><br> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="41" colspan="2" align="left" class="main"><br> </td>
</tr>
<?php
}
?>
<!-- EOF Super Contact us enhancement 1.0 //-->

</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

best regards
Reinhard

#20   Jeep_ice

Jeep_ice
  • Members
  • 150 posts
  • Real Name:Jean-Pierre

Posted 20 February 2006 - 01:07

Hello,

yes we download the latest version.


Very bizarre, I have taked your code, pasted it in my contact_us.php page and I keep out the echo (''); to echo ; and it's work very good. no problem... I don't understand why you got the Parse error: parse error, unexpected ';' in /home/htdocs/web0/html/shop/contact_us.php on line 230. It's strange because when you add ('') to the echo, it's mean nothing. I can't say why. Sorry. But if it's work. Take it like this /huh.gif' class='bbc_emoticon' alt=':huh:' /> .
JEEP
--------------------
Installed Contributions:
osCommerce 2.2 Milestone MS2 + "Super Contact US Enhancement 1.1" + "Simple Template System (STS) 1.9"  + "SPPC v.4.1.1" + "Column Product Listing for SPPC v4.1  v1.0" + "Quantity Price Breaks for SPPC 4.1.1"+ "Hide Price if $0 for "Quantity Price Breaks for SPPC 4.1.1" + "Show Price list for SPPC 4.1 v1.0"+ "EasyPopulate  2.72" + "Admin Reports Count Reset" + "Control Login 2.1" + "Credit card infobox" + "Customer Export"  + "Customers Email and Phone in Order" + "Email for new customer 1.0" + "Handling fee" + "Phone Payment Credit Card Module 1.5" + "Purchase Orders version 1.3" + "Admin Comments Toolbar 4.0" + "Country-State Selector" + "Cart in Header for STS" + "Category Box Enhancement" + "Docs in Admin 1.0" + "Monthly Sales Report" +  "Who's Online Enhancement" + "Whos Online 2.0" + "Simple Admin Access Control 1.2" and "Login box v2.2a" - Ouffffff !!! [img]http://forums.oscommerce.com/style_emoticons/default/smile.gif[/img]