close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

disappearing titles and changing drop down menu box sizes

Thread began 10/22/2009 11:55 pm by micja3389704 | Last modified 11/09/2009 6:53 pm by Eric Mittman | 5699 views | 32 replies |

micja3389704

disappearing titles and changing drop down menu box sizes

Three more questions/problems:

1) Some of the product titles in the side boxes disappear after we edit (any other) product in the Admin area. We "update"--go to the page, and other titles lost most of their characters. We do seem to notice a pattern...so far the only ones to lose part of their titles are the ones with quotation marks used to signify inches in the title. Is this a PHP issue?

2) Our categories need to be slightly longer, but the drop down menu boxes are not wide enough, so the characters appear outside of the box. They run right off the box. I have tried to find the right css rule to change, but haven't been able to find it so far.

3) I would like to get rid of google maps, but I don't want to mess up anything else. Can I just delete the code on the "about us" page and leave it alone on the globals file? Or should I take it out of both places?

Thanks,
Michelle

Sign in to reply to this post

Eric Mittman

The easiest way to get rid of the map on the about us page is to just delete the map div on this page:

<div id="wagmp_map_1" style="width: 617px; height: 400px;">



For the categories being too long for the area I'm not sure exactly what you mean about this. A screen shot or a link would be best. You will probably just need to update the css for what you are seeing but I will need a reference for this to point you to the correct location to make this update.

As for the titles that are being cut off try escaping any quotes with a \ like this:

\" or \'
Sign in to reply to this post

micja

google maps

Originally Said By: Eric Mittman
  The easiest way to get rid of the map on the about us page is to just delete the map div on this page:

<div id="wagmp_map_1" style="width: 617px; height: 400px;">


For the categories being too long for the area I'm not sure exactly what you mean about this. A screen shot or a link would be best. You will probably just need to update the css for what you are seeing but I will need a reference for this to point you to the correct location to make this update.

As for the titles that are being cut off try escaping any quotes with a \ like this:

\" or \'
  



Hi Eric, I took your suggestion on deleting that div id code, and took out a couple other div as well (wrapper etc because it left a box with "div" written in it) and got the actual space that the google map occupied removed...and I also deleted the script that comes right after that I assume is what calls for the site to access google maps. However, when I refresh or enter the page I still get a google rejected pop up. Would I fix this in the globals? Or is there another page or script I go to to turn off the process that looks for my api key and accesses google maps?

Thanks,
Michelle

Sign in to reply to this post

micja

disappearing titles

Originally Said By: Eric Mittman
  As for the titles that are being cut off try escaping any quotes with a \ like this:

\" or \'
  



On the disappearing titles, I am attaching two jpgs that show what is happening. Basically, when we are in the Admin area (working on a vista pc) if we click on products it shows the list of all our products. For about four of those products, if we click on "update" to edit anything in that product, we immediately lose most of the characters in the title. All four of these products have quotation marks used in the title as symbols for "inches" (such as 48"X48" Overhead Shelf unit). If we don't notice that the title has changed and we save the update, the web page will disply in the product list boxes as something like 48 48 as all that's left of the title. If we do notice the change, we simply retype or copy and paste the info back into the title...but I hate to hand this over to my client without fixing it.

I'm not sure what you mean by "try escaping any quotes with a \ like this." Would we do this in the admin title field, and the slash won't show up? So that in the editing area of the item under title we would type in [\"48"X48" Overhead Shelf Unit\]?

Sign in to reply to this post

Eric Mittman

Sorry about the map think, if the API key is not correct you can still get this error. To delete all of the map code here are the lines to remove starting from the top of the page:

<?php include("google_javascript/wagmp_map_1.php"); ?>

function updateInfoWindow() {
wagmp_map_1_obj.markers[0].openInfoWindowHtml('<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: black;"><strong>from address:</strong><br><input id="fromaddress" type="text"><br><strong>city, state:</strong><br><input id="fromcity" type="text"><br><input type="button" value="get directions" onClick="wagmp_map_1(document.getElementById(\'fromaddress\').value+\', \'+document.getElementById(\'fromcity\').value)"></span>')
}

<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=<?php echo($WAGLOBAL_GoogleAPIKey); ?>">/*wagmp*/</script>

<div class="mapWrapper"><div id="wagmp_map_1" style="width: 617px; height: 400px;"></div></div>
<div id="wagmp_directions_1"></div>
<script type="text/javascript" src="google_javascript/wagmp_maps.js">/*wagmp*/</script>



As for the product names where you are setting them you try adding in the back slashes before the quote marks. This should preserve the quotes in the name for you. Please give this a try and let us know how it works for you.

Sign in to reply to this post

micja

  As for the product names where you are setting them you try adding in the back slashes before the quote marks. This should preserve the quotes in the name for you. Please give this a try and let us know how it works for you.  



Hey Eric...got the google thing taken care of, thanks!

The back slashes didn't work, at least not by putting them in through Admin. Seems to be an odd quirk of the program.

Sign in to reply to this post

Eric Mittman

Ok, I have got it now. The problem is that the double quotes are stored in the db, so when you view the product on the update page the double quotes cause it to break out of the value attribute for that form element and create some new attributes in there.

The fix is to use htmlentities() around the value before it is inserted or updated. This is done in the following locations:

Products Insert line 139
Find the second occurrence of $_POST["ProductName"] and wrap the function around it like this:

php:
htmlentities($_POST["ProductName"])



Products Update line 268
Find the second occurrence of $_POST["ProductName"] and wrap the function around it like this:

php:
htmlentities($_POST["ProductName"])



This should make it so it stores the encoded versions of these characters in the db, but the browser will still display them as quotes. Let me know if you have any other problems with this.

Sign in to reply to this post

micja

Originally Said By: Eric Mittman
  Ok, I have got it now. The problem is that the double quotes are stored in the db, so when you view the product on the update page the double quotes cause it to break out of the value attribute for that form element and create some new attributes in there.

The fix is to use htmlentities() around the value before it is inserted or updated. This is done in the following locations:

Products Insert line 139
Find the second occurrence of $_POST["ProductName"] and wrap the function around it like this:
php:
htmlentities($_POST["ProductName"])


Products Update line 268
Find the second occurrence of $_POST["ProductName"] and wrap the function around it like this:
php:
htmlentities($_POST["ProductName"])


This should make it so it stores the encoded versions of these characters in the db, but the browser will still display them as quotes. Let me know if you have any other problems with this.  



Eric, I am sorry, I'm sure this is a pretty simple fix, but I am just not finding the code you show.

I have the Products_Update.php (inside the Admin folder) open, I've been combing through the code looking for the lines you describe in the vicinity of the line numbers you give, and I am not finding it. For the second occurance, I find something similar but not the same.

Starting at line 123, here is what I have:

mysql_select_db($database_localhost, $localhost);
$query_ProductOptions = sprintf("SELECT DISTINCT optiongroups.OptionGroupName, optiongroups.OptionGroupID FROM optiongroups INNER JOIN options ON optiongroups.OptionGroupID = options.OptionGroupID INNER JOIN productoptions ON productoptions.OptionID = options.OptionID WHERE ProductID = %s ORDER BY optiongroups.OptionGroupID", GetSQLValueString($PIDParam_ProductOptions, "int"));
$ProductOptions = mysql_query($query_ProductOptions, $localhost) or die(mysql_error());
$row_ProductOptions = mysql_fetch_assoc($ProductOptions);
$totalRows_ProductOptions = mysql_num_rows($ProductOptions);
?>
<?php
$PIDParam_SelectedOptions = "1";
if (isset($_GET['ProductID'])) {
$PIDParam_SelectedOptions = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_localhost, $localhost);
$query_SelectedOptions = sprintf("SELECT options.OptionID, options.OptionGroupID FROM options INNER JOIN productoptions ON productoptions.OptionID = options.OptionID WHERE ProductID = %s", GetSQLValueString($PIDParam_SelectedOptions, "int"));
$SelectedOptions = mysql_query($query_SelectedOptions, $localhost) or die(mysql_error());
$row_SelectedOptions = mysql_fetch_assoc($SelectedOptions);
$totalRows_SelectedOptions = mysql_num_rows($SelectedOptions);
?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../Images/Upload/",
'FileName' => "[FileName]",
'DefaultFileName' => "" . $row_WADAProducts["ProductImage"] . "",
'ResizeType' => "1",
'ResizeWidth' => "400",
'ResizeHeight' => "400",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End?>

I pasted up to line 155

Line 268 reads:
$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"]))?$_POST["ProductName"]:"") **is this where I would place the code you gave?** ."" . "|" . "".((isset($_POST["ProductPrice"]))?$_POST["ProductPrice"]:"") ."" . "|" . "".((isset($_POST["ProductWeight"]))?$_POST["ProductWeight"]:"") ."" . "|" . "".((isset($_POST["ProductCartDesc"]))?$_POST["ProductCartDesc"]:"") ."" . "|" . "".((isset($_POST["ProductShortDesc"]))?$_POST["ProductShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProductLongDesc"]))?$_POST["ProductLongDesc"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["ProductCategoryID"]))?$_POST["ProductCategoryID"]:"") ."" . "|" . "".(date('Y-m-d H:i:s')) ."" . "|" . "".((isset($_POST["ProductStock"]))?$_POST["ProductStock"]:"") ."" . "|" . "".((isset($_POST["ProductLive"]))?$_POST["ProductLive"]:"") ."" . "|" . "".((isset($_POST["ProductUnlimited"]))?$_POST["ProductUnlimited"]:"") ."";


One thought: I had an earlier (unrelated) problem that evidently was caused by not having the template files in the root folder, all my powerstore files are in a subfolder of the site root folder (it is an existing site that I added powerstore to). Could this be causing the problem?

Sign in to reply to this post

Eric Mittman

I don't think that this issue would be related to the location you have the files in. I think it is just because of the double quotes being interpreted by the browser under certain conditions.

The code that you highlighted in red is exactly where this should be done. The code should look very similar on both pages. Once you wrap the function around the value it should preserve the quotes as their html entities, this way the browser will not display them incorrectly. Please give this a try on this value and let us know if there are any problems.

Sign in to reply to this post

micja

Originally Said By: Eric Mittman
  I don't think that this issue would be related to the location you have the files in. I think it is just because of the double quotes being interpreted by the browser under certain conditions.

The code that you highlighted in red is exactly where this should be done. The code should look very similar on both pages. Once you wrap the function around the value it should preserve the quotes as their html entities, this way the browser will not display them incorrectly. Please give this a try on this value and let us know if there are any problems.  



Thanks for hanging in there with me on this, Eric. I obviously did it wrong, because it caused a "Parse error: syntax error, unexpected T_STRING" error.

I'll post the original code, from both pages, then how I changed it. Thanks for being patient with me.

Product insert page:
Original:
$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"]))?$_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST["ProductPrice"]))?$_POST[

Mine:
$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"])) htmlentities ($_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST[

Product update page:
Original:
$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"]))?$_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST["ProductPrice"]))?

Mine:
$WA_fieldValuesStr = "".((isset($_POST["ProductSKU"]))?$_POST["ProductSKU"]:"") ."" . "|" . "".((isset($_POST["ProductName"])) htmlentities ($_POST["ProductName"]:"") ."" . "|" . "".((isset($_POST["ProductPrice"]))?

Again, thanks for the help with this.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...