Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Suggestions Box for xcart product detail page :)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 02-01-2004, 09:18 PM
 
curpier curpier is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 38
 

Default

Figured it out . Just one last question. When I try to delte a suggestion in the admin area, it goes to a confimation page. Do you have the code for that page?
Reply With Quote
  #12  
Old 02-22-2004, 02:57 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Hi,
This looks like an awesome mod but I'm having trouble implementing it.

I'm using 3.4.9, I think I'm having trouble with the index.php.

I tried creating a new folder called suggestions and putting the index.php in that folder. First I put the new suggestions folder under my main directory (store/suggestions) and then i tried putting it under (store/customer/suggestions)

After I click submit I get this error:

Not Found
The requested URL /store/customer/http://www.pointselect.com/store/suggestions/index.php was not found on this server.

I don't know what is wrong, I placed a folder called suggesstions under "store" and it has the index.php but for some reason it is not reading it.

I also tried going directly to the index.php via: http://www.pointselect.com/store/suggestions/index.php
but all that shows up is a blank page.

Nothing is wrong the the database side of things, just the index.php, please help me out, this is feature that I really need on my site.

Thank you.
Reply With Quote
  #13  
Old 02-23-2004, 04:04 AM
 
deniz deniz is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 70
 

Default ok

You have to make index.php under suggestions directory.Because the main rule is for this mod , importing data files html to php bridge with index.php

here is the index.php

Quote:
<?php require_once('Connections/db_connect.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO suggestions (id, suggestion, name) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['suggestions'], "text"),
GetSQLValueString($_POST['name'], "text"));

mysql_select_db($database_db_connect, $db_connect);
$Result1 = mysql_query($insertSQL, $db_connect) or die(mysql_error());

$insertGoTo = "thanks.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor="#EAF4FF"> Your comments can help make our site better for everyone. If you've found
something incorrect, broken, or frustrating on this page, let us know
so that we can improve it. Please note that we are unable to respond
directly to suggestions made via this form.



If you need help with an order, please <a href="http://www.bookglobal.net/xcart/customer/help.php?section=contactus&mode=update">contact
Customer Service </a>.




Which subjects that you can send us about?:

<table cellspacing="2" cellpadding="0">
<tr>
<td rowspan="2"></td>
<td></td>
</tr>
<tr>
<td>Product information is missing important details. </td>
</tr>
<tr>
<td></td>
<td>Product information is incorrect.</td>
</tr>
<tr>
<td></td>
<td>The page contains typographical errors. </td>
</tr>
<tr>
<td></td>
<td>The page takes too long to load. </td>
</tr>
<tr>
<td></td>
<td>The page has a software bug in it. </td>
</tr>
<tr>
<td></td>
<td>Suggestion want to be in page. </td>
</tr>
<tr>
<td></td>
<td>General Suggestions </td>
</tr>
</table>


Comments or Examples:

Examples: Missing information such as dimensions and model number, typos,
inaccuracies, etc.

<form name="form1" method="POST" action="<?php echo $editFormAction; ?>" target="_blank">
<div align="center">
<input type="hidden" name="id">
<textarea name="suggestions" cols="100" rows="5" id="suggestions"></textarea>


<input name="name" type="text" id="name" value="Please enter your name here" size="55">


<input type="submit" name="Submit" value="Submit">
</div>
<input type="hidden" name="MM_insert" value="form1">
</form></td>
</tr>
</table>
</body>
</html>
Reply With Quote
  #14  
Old 02-23-2004, 04:07 AM
 
deniz deniz is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 70
 

Default maybe

I guess there might be a problem with the TPL file.
in the form action line you might be wrote

Code:
action="store/customer/http://www.pointselect.com/store/suggestions/index.php"

the action must be

Code:
action="http://www.pointselect.com/store/suggestions/index.php"

Regards
Reply With Quote
  #15  
Old 04-06-2004, 10:25 AM
 
jsiefers jsiefers is offline
 

Newbie
  
Join Date: Feb 2004
Posts: 1
 

Default

I am having trouble getting this mod to work.

I keep getting the following error:

Parse error: parse error in /home/.radmilla/libertyb/libertybookshop.com/shop/suggestions/db_connect.php on line 9

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/.radmilla/libertyb/libertybookshop.com/shop/suggestions/index.php on line 39

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/.radmilla/libertyb/libertybookshop.com/shop/suggestions/index.php on line 40

My db_connect.php file (in the suggestions subdirectory) is as follows:

<?
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_db_connect = 'myhostname';
$database_db_connect = 'mydatabase';
$username_db_connect ='myusername';
$password_db_connect = 'mypassword';
$db_connect = mysql_pconnect($hostname_db_connect, $username_db_connect, $password_db_connect) or trigger_error(mysql_error(),E_USER_ERROR;
?>

I have substituted username/password/database/hostname info with my real info.


Lines 39 and 40 from index.php (also in the suggestions subdirectory) are:

mysql_select_db($database_db_connect, $db_connect);
$Result1 = mysql_query($insertSQL, $db_connect) or die(mysql_error());


I have no idea what I am doing wrong. Thanks for any help you can provide.
Reply With Quote
  #16  
Old 04-06-2004, 01:46 PM
 
deniz deniz is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 70
 

Default

there might be a mysql version mistake...

you can try in a signle file connection at index.php
Reply With Quote
  #17  
Old 04-07-2004, 08:43 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

finally got this mod to work, it's excellent!

I have 2 questions though, after deleting a suggestion in the admin area, it takes you to "confirmation.php" which doesn't exist.

Can you tell me a code to put on show.php so that it will redirect back to show.php if a suggestion is deleted.

Also, can you tell me a code for "delete all" instead of deleting each suggestion one by one?

Thanks a lot!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:53 PM.

   

 
X-Cart forums © 2001-2020