chrometweaks.org

Can I make a legit website on a free iPage web hosting site?

Click Here To View All Answers...


Quick question: Can I make a legit website on a free iPage web hosting site? Thanks for any answer. Second question.. Hi all:.

I'm in full tweak mode, and I got stuck. I want to have a link on my product_info.php pages that opens a popup window with manufacturer info (as opposed to having that info in the box on the right or left). I have the popup link in place, and the window opens, but I keep getting parse errors on my popup_manufacturer_info.php file. The error return says the problem is in the last line??? Anyway, here is the code for the page (mostly a rip off of the box code). I'm hoping someone can see a problem that I cannot see..

<?php.

/*.

 $Id: popup_search_help.php,v 1.1 2002/05/27 13:31:54 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2002 osCommerce.

 Released under the GNU General Public License.

*/.

 require('includes/application_top.php');.

 require('product_info.php');.

 .

 $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from "TABLE_MANUFACTURERS" m, "TABLE_PRODUCTS" p  where p.products_id = '"$HTTP_GET_VARS['products_id']"' and p.manufacturers_id = m.manufacturers_id");.

 if (tep_db_num_rows($manufacturer_query)) {.

   $manufacturer = tep_db_fetch_array($manufacturer_query);.

   $manufacturer_url_query = tep_db_query("select manufacturers_url from "TABLE_MANUFACTURERS_INFO" where manufacturers_id = '"$manufacturer['manufacturers_id']"'");.

   $manufacturer_url_values = tep_db_fetch_array($manufacturer_url_query);.

   $has_manufacturer_url = ($manufacturer_url_values['manufacturers_url']) ? 'true' : 'false';  .

?>.

<!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; ?>">.

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER)DIR_WS_CATALOG; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="stylesheet.css">.

</head>.

<style type="text/css"><!.

BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }.

//></style>.

<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">.

<?php.

   $info_box_contents = array();.

   $info_box_contents[] = array('align' => 'left',.

                                'text'  => BOX_HEADING_MANUFACTURER_INFO);.

   new infoBoxHeading($info_box_contents, false, false);.

   $manufacturer_info_string = '<div align="center">'tep_image(DIR_WS_IMAGES$manufacturer['manufacturers_image'], $manufacturer['manufacturers_name'])'</div>' ..

                                '<table border="0" width="'BOX_WIDTH'" cellspacing="0" cellpadding="0">';.

   if ($has_manufacturer_url == 'true') $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="'tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id='$manufacturer['manufacturers_id'], 'NONSSL')'" target="_blank"><b>'sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name'])'</b></a></td></tr>';.

   $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="'tep_href_link(FILENAME_DEFAULT, 'manufacturers_id='$manufacturer['manufacturers_id'], 'NONSSL')'"><b>'BOX_MANUFACTURER_INFO_OTHER_PRODUCTS'</b></a></td></tr></table>';.

   $info_box_contents = array();.

   $info_box_contents[] = array('align' => 'left',.

                                'text'  => $manufacturer_info_string);.

   new infoBox($info_box_contents);.

?>.

<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">'TEXT_CLOSE_WINDOW'</a>'; ?></p>.

</body>.

</html>.

If anyone wants to see it in action, check out.

Http://www.virtuallyunique.com/test/catalo...5&products;_id=2.

Thanks in advance for any help/suggestions you might make!.

Jason..

Comments (40)

Yes sir! but you might want to make sure and wait for another person here to confirm it as I am not very confident. Better yet, why don't you contact the iPage guys because they can answer your iPage question better...

Comment #1

Parse error: parse error in /home/virtual1/public_html/test/catalog/popup_manufacturer_info.php on line 59.

The error is still there... nice idea though..

Comment #2

Merci, Xtian. I closed the if statement after the last php call..

<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">'TEXT_CLOSE_WINDOW'</a>'; ?></p>.

<?php.

 }.

?>.

That fixed the parse error. Now, though, I get an error that reads:.

This one, though, is more about the structure of the code. So, if you have any suggestions, I'd love to hear them. I don't know php, but I am trying to follow the logic in the statements. I'll keep digging at it..

BTW, can you recommend a good php editor for Mac OSX? I'm using DreamWeaver MX, but it only recognizes php code, it doesn't debug, or anything..

Salut...

Comment #3

I think I know what the problem is, but I don't know how to fix it yet. I copied the code for the popup window from the manufacturer_info.php box. Since that box was designed to activate in one of the columns on a product page, it could take the info needed for the scripts from the current page..

Since I put it in an independant popup window, I included a require for the product info page (tried both 'product_info.php' and FILENAME_PRODUCT_INFO). However, that is for a generic product info page, not for the page that provided the link for the popup, so the information needed to access the proper database tables and such is not there. If I remove the require from the popup page, then all that is displayed is a blank page..

Therefore, I believe I need to know how to get the information to the popup page from the page that provided the link (a populated product_info page). This seems to make some kind of sense to me, though I don't know php yet. Can anyone help with this?.

Thanks in advance,.

Jason..

Comment #4

For anyone that is interested in how to do this, or can maybe give me some suggestions, here is where this task is at..

I included the $product_id in the popup link that opens popup_manufacturer_info.php. This provides a point of reference for the script in the popup window to create the manufacturers_info box. The link near the bottom of product_info.php now reads:.

<td class="main"><br><?php echo '<a href="javascript:popupWindow(''tep_href_link(FILENAME_POPUP_MANUFACTURER_INFO, 'products_id='$products_id)'')">'TEXT_MANUFACTURER_INFO_LINK'</a>'; ?></td>.

Unfortunately, there is another error. The popup window opens up just fine, and has an infobox with the manufacturers info, but there is an error at the top that I don't understand yet. If anyone could help with that, I'd appreciate it. I may be able to figure it out, but I don't know how long it will take... Anyway, here is what the error says:.

If anyone wants to look at the actual project, feel free:.

Http://www.virtuallyunique.com/test/catalo...p?products_id=2.

So, does anyone know what this means? I know nothing about databases, and I don't know if this is just a result of hackwork coding, or if there is something else wrong..

Thanks,.

Jason..

Comment #5

OK. Problem more or less fixed, except for some niggling layout stuff. If anyone wants to know how to do this, let me know by PM. I'll be happy to explain it. If all goes well, and I can recall the exact steps, I may even submit a contribution for this. If there seems to be interest..

Jason..

Comment #6

Jswan, you have done nice job but:.

When one click on "other products", the next page opens in the same small window which don't look too good..

In my opinion you should do this: if one click on other products, a new window should open and automaticaly the small close...

Comment #7

Hi Salvo:.

I'm working on that right now. I want to get the new file to open in the referring window (product_info.php). I'm not sure how to tell that thing what the window name is, though. So, I'm going to have to figure that one out. Still, that is just html and javascript, more or less. Shouldn't be too tough.



Thanks,.

Jason..

Comment #8

That might be a problem with.

Session.auto_start.

This should be set at 0 in php.ini..

I haven't worked on a Mac for ages. Try and ask the question on the forum. 8)..

Comment #9

Done. Contribution, such as it is, can be found at:.

Http://www.oscommerc...ntributions,914.

Let me know what you think..

Jason..

Comment #10

Hi js.

Just downlaoded the contributions and on the admin part there are two input to upload images, extra but I can't see the details input...

Or did I misunderstood? thas shouldn't be any details?.

In your pop up, there are there...

Salvo..

Comment #11

Hi Salvo:.

I see where I made the error. On new entries, the box for manufacturers is small. You can still put whatever you want there (above the image box), but it is hard to see the whole text. After the manufacturer is entered, the edit feature has a larger "textarea_field" that wraps text and makes it easier to enter. I have updated the file, and will post it shortly. In the mean time, you can fix it by changing one line of code in admin/manufacturers.php.



$contents[] = array('text' => '<br>'TEXT_MANUFACTURERS_TEXT'<br>'tep_draw_file_field('manufacturers_text'));.

And change it to:.

$contents[] = array('text' => '<br>'TEXT_MANUFACTURERS_TEXT'<br>'tep_draw_textarea_field('manufacturers_text', 'soft', '30', '15'));.

That will enlarge the text area for entering manufacturer details..

Sorry about that. Let me know if anything else doesn't seem to work right..

Jason..

Comment #12

Hi, everyone, can anyone help me?.

I am building up a book store. I found the manufacturers pop up great, because I am just using the manufacturers as authors..

But what I really wanted was for the manufacturer/author information to show with the image when one clicks "other products", then one would see the author picture, a text about the author and bellow it the "other products/titles" for that author..

How do I do that?..

Comment #13

Hi all:.

I'm in full tweak mode, and I got stuck. I want to have a link on my product_info.php pages that opens a popup window with manufacturer info (as opposed to having that info in the box on the right or left). I have the popup link in place, and the window opens, but I keep getting parse errors on my popup_manufacturer_info.php file. The error return says the problem is in the last line??? Anyway, here is the code for the page (mostly a rip off of the box code). I'm hoping someone can see a problem that I cannot see..

<?php.

/*.

 $Id: popup_search_help.php,v 1.1 2002/05/27 13:31:54 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2002 osCommerce.

 Released under the GNU General Public License.

*/.

 require('includes/application_top.php');.

 require('product_info.php');.

 .

 $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from "TABLE_MANUFACTURERS" m, "TABLE_PRODUCTS" p  where p.products_id = '"$HTTP_GET_VARS['products_id']"' and p.manufacturers_id = m.manufacturers_id");.

 if (tep_db_num_rows($manufacturer_query)) {.

   $manufacturer = tep_db_fetch_array($manufacturer_query);.

   $manufacturer_url_query = tep_db_query("select manufacturers_url from "TABLE_MANUFACTURERS_INFO" where manufacturers_id = '"$manufacturer['manufacturers_id']"'");.

   $manufacturer_url_values = tep_db_fetch_array($manufacturer_url_query);.

   $has_manufacturer_url = ($manufacturer_url_values['manufacturers_url']) ? 'true' : 'false';  .

?>.

<!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; ?>">.

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER)DIR_WS_CATALOG; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="stylesheet.css">.

</head>.

<style type="text/css"><!.

BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }.

//></style>.

<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">.

<?php.

   $info_box_contents = array();.

   $info_box_contents[] = array('align' => 'left',.

                                'text'  => BOX_HEADING_MANUFACTURER_INFO);.

   new infoBoxHeading($info_box_contents, false, false);.

   $manufacturer_info_string = '<div align="center">'tep_image(DIR_WS_IMAGES$manufacturer['manufacturers_image'], $manufacturer['manufacturers_name'])'</div>' ..

                                '<table border="0" width="'BOX_WIDTH'" cellspacing="0" cellpadding="0">';.

   if ($has_manufacturer_url == 'true') $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="'tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id='$manufacturer['manufacturers_id'], 'NONSSL')'" target="_blank"><b>'sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name'])'</b></a></td></tr>';.

   $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="'tep_href_link(FILENAME_DEFAULT, 'manufacturers_id='$manufacturer['manufacturers_id'], 'NONSSL')'"><b>'BOX_MANUFACTURER_INFO_OTHER_PRODUCTS'</b></a></td></tr></table>';.

   $info_box_contents = array();.

   $info_box_contents[] = array('align' => 'left',.

                                'text'  => $manufacturer_info_string);.

   new infoBox($info_box_contents);.

?>.

<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">'TEXT_CLOSE_WINDOW'</a>'; ?></p>.

</body>.

</html>.

If anyone wants to see it in action, check out.

Http://www.virtuallyunique.com/test/catalo...5&products;_id=2.

Thanks in advance for any help/suggestions you might make!.

Jason..

Comment #14

This happens generally when a quote, brace, bracket... is not closed properly. The PHP interpreter will hit the end of the file searching for the closing part..

{.

Most often a missing curly brace..

I just pasted your code into my trusted PHP editor, and voil: this bracket has no corresponding closing bracket :roll:.

 if (tep_db_num_rows($manufacturer_query)) {.

By the way, I strongly suggest you used a PHP editor if you're in heavy mods. You will save lots of time...

Comment #15


This question was taken from a support group/message board and re-posted here so others can learn from it.