Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jdice

Pioneers
  • Posts

    105
  • Joined

  • Last visited

Everything posted by jdice

  1. Hi...I uploaded googlesitemap generator by bobby about a year ago. It only has two files...googlesitemapcategories.php & googlesitemapproducts.php. Then I go to google.com/webmasters/sitemaps and put my website in. However, the googlesitecategories.php is fine but googlesitemapproducts.php is not. Google is giving me this error: 1193 Invalid date An invalid date was found. Please fix the date or formatting before resubmitting....FOR MY googlesitemapproducts.php page. does anyone know how I fix this? Here is my products.php page: <?php /** * Google Sitemap Generator * * Script to generate a Google sitemap for osCommerce based stores * * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.2 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @copyright Copyright 2006, Bobby Easland * @author Bobby Easland * @filesource */ /* * Include the application_top.php script */ include_once('includes/application_top.php'); /* * Send the XML content header */ header('Content-Type: text/xml'); /* * Echo the XML out tag */ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <?php /* * Define the uniform node function */ function GenerateNode($data){ $content = ''; $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.trim($data['loc']).'</loc>' . "\n"; $content .= "\t\t" . '<lastmod>'.trim($data['lastmod']).'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.trim($data['changefreq']).'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.trim($data['priority']).'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; return $content; } # end function /* * Define the SQL for the products query */ $sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM " . TABLE_PRODUCTS . " WHERE products_status = '1' ORDER BY products_last_modified DESC, products_date_added DESC, products_ordered DESC"; /* * Execute the query */ $query = tep_db_query($sql); /* * If there are returned rows... * Basic sanity check */ if ( tep_db_num_rows($query) > 0 ){ /* * Initialize the variable containers */ $container = array(); $number = 0; $top = 0; /* * Loop the query result set */ while( $result = tep_db_fetch_array($query) ){ $top = max($top, $result['products_ordered']); $location = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false); if ( tep_not_null($result['last_mod']) ){ $lastmod = $result['last_mod']; } else { $lastmod = $result['date_added']; } $changefreq = 'weekly'; $ratio = ($top > 0) ? ($result['products_ordered']/$top) : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); /* * Initialize the content container array */ $container = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority ); /* * Echo the generated node */ echo generateNode($container); } # end while } # end if /* * Close the urlset */ echo '</urlset>'; /* * Include the application_bottom.php script */ include_once('includes/application_bottom.php'); ?>
  2. Hi...I uploaded googlesitemap generator by bobby about a year ago. It only has two files...googlesitemapcategories.php & googlesitemapproducts.php. Then I go to google.com/webmasters/sitemaps and put my website in. However, the googlesitecategories.php is fine but googlesitemapproducts.php is not. Google is giving me this error: 1193 Invalid date An invalid date was found. Please fix the date or formatting before resubmitting. How do I do that? Also, shouldn't I be submitting an index page to google? Like mysite.com/catalog instead of mysite.com? Thanks for help and time, Sincerely, Janet I am not sure what to do. my server date and time is this: 10/18/2009 22:04:17 Here is my googlesitemapproducts.php page: <?php /** * Google Sitemap Generator * * Script to generate a Google sitemap for osCommerce based stores * * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.2 * @link http://www.oscommerce-freelancers.com/ osCommerce-Freelancers * @copyright Copyright 2006, Bobby Easland * @author Bobby Easland * @filesource */ /* * Include the application_top.php script */ include_once('includes/application_top.php'); /* * Send the XML content header */ header('Content-Type: text/xml'); /* * Echo the XML out tag */ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <?php /* * Define the uniform node function */ function GenerateNode($data){ $content = ''; $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.trim($data['loc']).'</loc>' . "\n"; $content .= "\t\t" . '<lastmod>'.trim($data['lastmod']).'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.trim($data['changefreq']).'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.trim($data['priority']).'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; return $content; } # end function /* * Define the SQL for the products query */ $sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM " . TABLE_PRODUCTS . " WHERE products_status = '1' ORDER BY products_last_modified DESC, products_date_added DESC, products_ordered DESC"; /* * Execute the query */ $query = tep_db_query($sql); /* * If there are returned rows... * Basic sanity check */ if ( tep_db_num_rows($query) > 0 ){ /* * Initialize the variable containers */ $container = array(); $number = 0; $top = 0; /* * Loop the query result set */ while( $result = tep_db_fetch_array($query) ){ $top = max($top, $result['products_ordered']); $location = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false); if ( tep_not_null($result['last_mod']) ){ $lastmod = $result['last_mod']; } else { $lastmod = $result['date_added']; } $changefreq = 'weekly'; $ratio = ($top > 0) ? ($result['products_ordered']/$top) : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); /* * Initialize the content container array */ $container = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority ); /* * Echo the generated node */ echo generateNode($container); } # end while } # end if /* * Close the urlset */ echo '</urlset>'; /* * Include the application_bottom.php script */ include_once('includes/application_bottom.php'); ?>
  3. Okay...you are probably going to think I am the stupidest person on this planet. I did not check any choices in the UPS module setup menu. I should have known to. I guess when I had installed a previous DHL shipping module...I had to go in and comment out code to exclude certain shipping options. In this MVS, you can do that in the adminstration section. I feel so stupid. Now I am getting UPS ground quotes back. Thanks for your time, Janet
  4. I tried disabling everything but ups...just ups symbol and weight shows up...not shipping quote.
  5. Okay I ran a sale through...this is what ups sends me: UPSOnLine4%1DM%08846%US%46219%US%105%2%76.16%0.00%76.16% 8:00 A.M.% 4%1DA%08846%US%46219%US%105%2%44.38%0.00%44.38%10:30 A.M.% 4%1DP%08846%US%46219%US%135%2%40.80%0.00%40.80%End of Day% 4%2DA%08846%US%46219%US%205%2%18.19%0.00%18.19%End of Day% 4%3DS%08846%US%46219%US%305%2%13.48%0.00%13.48%End of Day% 4%GND%08846%US%46219%US%005%2%10.34%0.00%10.34%End of Day%
  6. Okay, I replaced both [email protected] with my email address and took the slashes/star out. what next?
  7. Do you think the fact that I have BTS template would affect the installation of this module. I have installed several contributions splitting files in both the catalog area and template/fallback folder before with no problems. But I did look at the osmax version of MVS and compared it alittle. I do not have Osmax. I just have a bts template. I noticed the sql files were vastly different. If so...do you know what files need to be changed. It is mostly working...flat rates are working just fine. and UPS symbol is showing up during checkout and so are the pounds. I am just not getting ups quotes back during checkout. Just thought I would ask...I know you don't have all day to help us self learners. ...so don't feel like you have to answer all my questions. But I know sometimes...it could be something simple you already know...I could quickly change. Thanks for your help so far, Janet
  8. Okay...it is late....I will look at my version of MVS. When I have MVS turned on...UPS and my flat fee come up...but UPS is not returning quotes. Only my flat fee quote is coming up. Maybe there is another reason I am overlooking. I will look into it some more. Maybe I don't need to modify regular shipping modules as I thought. If MVS is supposed to work after installation..right out of box...then I have done something wrong. Maybe there is another reason UPS is not returning quotes. Well, now I have us both scratching our heads. Janet
  9. Well...my version of oscommerce did not have a ups module at all. I have a shop with two different suppliers. One supplier ships with a flat fee...the other supplier uses ups. i have used Multivendorshipping in the past. This worked quite well with two different shipping methods. So I upload MVSV1.1 like I did before. I first modifed the Table module to work with mvs. This took care of my flat rate shipping. Then I realized I did not even have ups to begin with as one of my shipping modules in my original oscommerce. So I upload UPS Choice. Got it working perfectly by itself...UPS Choice returned quotes just fine. And then I went to modify the UPS Choice file to work with MVS but I have been unsuccessful. When I enable MVS in my administration by clicking TRUE. My checkout page show UPS and flat rate shipping as options however, UPS is not returning any quotes. However, when I click False turning of MVS. UPS choice returns quotes just fine by itself. So I must have modified catalog/shipping/modules/ups wrong. If there is an easier way to do this...I open to suggestions. Janet
  10. Hello, Thank you for your response. However, I believe you have to adapt the existing UPS Choice Shipping Module to work the MVS UPS Choice Module. It involves alot of moifications. I first did the table module which was easy but I am not having such an easy time adapting the UPS choice Shipping Module to work with MVS. There seem to be alot of modifcations. I was hoping to compare my files to someone else's. The needed modified file I am referring to is: catalog/includes/modules/shipping/ups.php. This file I believe must be modified properly to work with MVS. Sorry if anyone thought I was being pushy bumping my post...just thought my post was getting lost in the shuffle. I have spent a month on this total trying to solve this myself and searching/googling oscommerce solutions extensively before asking for help over a week ago. So after a long day of searching again, and repeated attempted trials...I did finally post again in hopes someone would see my post who had knowledge. I honestly meant no harm. Sincere apologizes to anyone I bothered. Thank you again and I will continue working on this:) Janet quote name='kymation' date='Feb 27 2009, 06:45 PM' post='1374335'] Not trying to be rude, but please don't bump your posts. It makes it less likely that you will get an answer. The UPS Choice module is included with the MVS distribution. See catalog/includes/modules/vendors_shipping/ups.php. Regards Jim
  11. Hi....Not to be bum...but was wondering if anyone has modified UPS CHOICE files to work with MVS(multivendor shipping)? I think it is just two files that have to be modified....includes/modules/shipping/ups AND includes/languages/english/modules/shipping/ups files? I have spend all day on this...and taking a break finally. The TABLE file in the example modifications(instructions for modifications) are vastly different from UPS files. I'm not sure I am even doing it right. I have got UPS choice to work just fine in the original shipping modules that come with oscommerce. However, not with MVS. I know I have to do alot of modifications to the two files above to get them to work together. I was just wondering if someone has already conquered this and willing to share it? Thanks for viewing my post, Janet
  12. Okay...that was so silly of me...how could I have overlooked it. I was clicking all those buttons. I had remembered seeing it before...but couldn't remember where. I must have thought I clicked on the manage button the second time around and didn't. Gosh thanks for your help. Janet :rolleyes:
  13. okay...I finally got the vendor module working....I had a couple files in the wrong place...some minor corrections in code as well. So now I have set up a sample vendor 1 ...but I see no shipping option to choose from for each particular vendor I use...like ups or flat rates or table rates... I see a place for handling charges....tare weight...etc...but no shipping option to choose from for each vendor. where do I do this at? Sincerely, Janet
  14. Okay...to anyone who can help...I have finished what I thought were table modifications. However, In the beginning in the module instructions...it says to take the table.php file from catalog/includes/modules/shipping/table.php and to make changes to this file. At the end...after all modifications are done...it says to put it in the file to includes/modules/vendor_shipping/and close it. Now I am confused. Because when I went to my cpanel and tried to upload it to includes/modules/vendor_shipping/ and to save it as table.php. There is already a modified MVS file there... Why don't I just put the table.php file back to where I got it from to begin with ....like the catalog/includes/modules/shipping/table.php ??? Or did I just modify the wrong file???? Please someone respond to this...if you know the answer. Janet
  15. Nevermind...I was looking in the wrong spot...mine are located differently in the file...actually further up the file...and they do look like the example given. Not sure they are the only ones...but from I can see...they look the same. But there was my original post further up...step one of the table module modifications...I still need answered. So if someone has a moment...to look and help to answer my question. Janet
  16. I think I have figured this one out...but now I am stuck on another part of the instructions where it says .... Now things get interesting. The changes in this section vary widely between modules, so I can only give you general instructions. You need to make changes to all of the constants in the quote method, which is all of the code between these lines (where the row of dots is): my function codes look really different compared to the ones in the instructions..mine have no row of dots also...this is what mine looks like...how do I change it: if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; Janet
  17. Okay....I'm a kind of thrown for a loop here. I've been able to manage to upload several contributions...but these instructions are not very clear to me. Next, look at the rest of the constants listed near the ones that you commented out. You can ignore any of the constants that contain the string _TEXT_; those will not change. If there are more that are similar to the ones you have commented out, you'll need to make changes to those as well. For example (from a different module of course), you might have a module that requires a username and password to access a remote server: --------------------------------------------------------------------------------------- $this->access_username = MODULE_SHIPPING_BAX_USERNAME; //Set in admin $this->access_password = MODULE_SHIPPING_BAX_PASSWORD; //Set in admin --------------------------------------------------------------------------------------- First, comment those lines out. Next, copy the following code for each of the constants that you have found: --------------------------------------------------------------------------------------- function foo($vendors_id='1') { $this->foo = constant('CONSTANT_' . $vendors_id); return $this->foo; } Now......do I comment out the $this codes above and what do I do with the function foo codes above...copy them to where? I know if I had an example...I would understand this better....but this is puzzling to me. Janet
  18. Hello, I am now doing the table modules under shipping. I am needing some example. Where it says.... There are six constants in the above code that need to be changed. They are similar to the constants that we commented out in the previous section. Using the commented-out code, make changes to the above constants to make them match the ones that we removed. Don't delete the underscore at the end of the new constants; we need that. Well...here is a commented out constant from above... //$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER; Here is the code I am to change to make it look alike... $this->sort_order = @constant('MODULE_SHIPPING_TABLE_SORT_ORDER_' . $vendors_id); } else { What do I change? What should it look like? do i take $vendors_id out? Janet
  19. Hello, I totally tookout the administrative side and reuploaded. I had a couple files in the wrong place and when I thought I uploaded database files...they weren't there. I reloaded them and now vendor module is in. Janet
  20. Your might take a look at this one below.... I would not suggest Multi-vendor Shipping. There is not much support for it. I tried MVS. I wished I had went this route instead. But I think this contribution has per product shipping. http://www.oscommerce.com/forums/index.php?showtopic=290520
  21. Hi...I am getting this error(below) after I try to login to my administration after trying to install the Multi-vendor shipping contribution. Will dynamic sitemap help me find the problem in my administration? Everyone keeps talking about categories and site pages...so I wondering if it will detect a fix in the administration side. Error! Unable to determine the page link! Function used: tep_href_link('', '', '') Signed, Janet
  22. STILL NEEDING HELP. I just realized that ultimate seo urls also changes the html_output file also....could these two contributions...MVS and ULTIMATE SEO URLS be causing conflict? Could this be why I am shown this error(below) after I login to my administration? Error! Unable to determine the page link! Function used: tep_href_link('', '', '') Anyone familiar with hardcoding enough to help and maybe take a look at my html_output file above??? Janet
  23. Hi...can anyone help??? I have uploaded MVS to my store. I have not done the modules file yet. But when I try to login to my administration...I get a blank page that says this: Error! Unable to determine the page link! Function used: tep_href_link('', '', '') I don't know what I am looking for to fix it? I have a BTS template...but from I am reading other BTS users have used this MVS contribution. You do have to place a couple things in the fallback files...but I have done that lots of times with other contributions...so I am making changes in the correct places. Someone suggested my html_output file. Should I look in ...admin/includes/functions/html_output? Well here is the html_output file...if anyone can look at it and help. Sorry...I hate take up space Janet <?php /* $Id: html_output.php,v 1.29 2003/06/25 20:32:44 hpdl Exp $ Modified for MVS V1.0 2006/03/25 JCK/CWG osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2006 osCommerce Released under the GNU General Public License */ //// // The HTML href link wrapper function // function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL') { if ($page == '') { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>'); } if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_ADMIN; } elseif ($connection == 'SSL') { if (ENABLE_SSL == 'true') { $link = HTTPS_SERVER . DIR_WS_ADMIN; } else { $link = HTTP_SERVER . DIR_WS_ADMIN; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>'); } if ($parameters == '') { $link = $link . $page . '?' . SID; } else { $link = $link . $page . '?' . $parameters . '&' . SID; } while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1); return $link; // } function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') { if ($connection == 'NONSSL') { $link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL_CATALOG == 'true') { $link = HTTPS_CATALOG_SERVER . DIR_WS_CATALOG; } else { $link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>'); } if ($parameters == '') { $link .= $page; } else { $link .= $page . '?' . $parameters; } while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1); return $link; } //// // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title=" ' . tep_output_string($alt) . ' "'; } if (tep_not_null($width) && tep_not_null($height)) { $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"'; } if (tep_not_null($parameters)) $image .= ' ' . $parameters; $image .= '>'; return $image; } //// // The HTML form submit button wrapper function // Outputs a button in the selected language function tep_image_submit($image, $alt = '', $parameters = '') { global $language; $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "'; if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters; $image_submit .= '>'; return $image_submit; } //// // Draw a 1 pixel black line function tep_black_line() { return tep_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '1'); } //// // Output a separator either through whitespace, or with an image function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') { return tep_image(DIR_WS_IMAGES . $image, '', $width, $height); } //// // Output a function button in the selected language function tep_image_button($image, $alt = '', $params = '') { global $language; return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $params); } //// // javascript to dynamically update the states/provinces list when the country is changed // TABLES: zones function tep_js_zone_list($country, $form, $field) { $countries_query = tep_db_query("select distinct zone_country_id from " . TABLE_ZONES . " order by zone_country_id"); $num_country = 1; $output_string = ''; while ($countries = tep_db_fetch_array($countries_query)) { if ($num_country == 1) { $output_string .= ' if (' . $country . ' == "' . $countries['zone_country_id'] . '") {' . "\n"; } else { $output_string .= ' } else if (' . $country . ' == "' . $countries['zone_country_id'] . '") {' . "\n"; } $states_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . $countries['zone_country_id'] . "' order by zone_name"); $num_state = 1; while ($states = tep_db_fetch_array($states_query)) { if ($num_state == '1') $output_string .= ' ' . $form . '.' . $field . '.options[0] = new Option("' . PLEASE_SELECT . '", "");' . "\n"; $output_string .= ' ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $states['zone_name'] . '", "' . $states['zone_id'] . '");' . "\n"; $num_state++; } $num_country++; } $output_string .= ' } else {' . "\n" . ' ' . $form . '.' . $field . '.options[0] = new Option("' . TYPE_BELOW . '", "");' . "\n" . ' }' . "\n"; return $output_string; } //// // Output a form function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = '') { $form = '<form name="' . tep_output_string($name) . '" action="'; if (tep_not_null($parameters)) { $form .= tep_href_link($action, $parameters); } else { $form .= tep_href_link($action); } $form .= '" method="' . tep_output_string($method) . '"'; if (tep_not_null($params)) { $form .= ' ' . $params; } $form .= '>'; return $form; } //// // Output a form input field function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true) { $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"'; if (isset($GLOBALS[$name]) && ($reinsert_value == true) && is_string($GLOBALS[$name])) { $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"'; } elseif (tep_not_null($value)) { $field .= ' value="' . tep_output_string($value) . '"'; } if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; if ($required == true) $field .= TEXT_FIELD_REQUIRED; return $field; } //// // Output a form password field function tep_draw_password_field($name, $value = '', $required = false) { $field = tep_draw_input_field($name, $value, 'maxlength="40"', $required, 'password', false); return $field; } //// // Output a form filefield function tep_draw_file_field($name, $required = false) { $field = tep_draw_input_field($name, '', '', $required, 'file'); return $field; } //// // Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field() function tep_draw_selection_field($name, $type, $value = '', $checked = false, $compare = '') { $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"'; if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"'; if ( ($checked == true) || (isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ($GLOBALS[$name] == 'on')) || (isset($value) && isset($GLOBALS[$name]) && (stripslashes($GLOBALS[$name]) == $value)) || (tep_not_null($value) && tep_not_null($compare) && ($value == $compare)) ) { $selection .= ' CHECKED'; } $selection .= '>'; return $selection; } //// // Output a form checkbox field function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '') { return tep_draw_selection_field($name, 'checkbox', $value, $checked, $compare); } //// // Output a form radio field function tep_draw_radio_field($name, $value = '', $checked = false, $compare = '') { return tep_draw_selection_field($name, 'radio', $value, $checked, $compare); } //// // Output a form textarea field function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"'; if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) { $field .= tep_output_string_protected(stripslashes($GLOBALS[$name])); } elseif (tep_not_null($text)) { $field .= tep_output_string_protected($text); } $field .= '</textarea>'; return $field; } //// // Output a form hidden field function tep_draw_hidden_field($name, $value = '', $parameters = '') { $field = '<input type="hidden" name="' . tep_output_string($name) . '"'; if (tep_not_null($value)) { $field .= ' value="' . tep_output_string($value) . '"'; } elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) { $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"'; } if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; return $field; } //// // Output a form pull down menu function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) { $field = '<select name="' . tep_output_string($name) . '"'; if (tep_not_null($parameters)) $field .= ' ' . $parameters; $field .= '>'; if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]); for ($i=0, $n=sizeof($values); $i<$n; $i++) { $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"'; if ($default == $values[$i]['id']) { $field .= ' SELECTED'; } $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>'; } $field .= '</select>'; if ($required == true) $field .= TEXT_FIELD_REQUIRED; return $field; } //MVS Start //// // Creates a pull-down list of countries function tep_get_country_list($name, $selected = '', $parameters = '') { $countries = tep_get_countries(); return tep_draw_pull_down_menu($name, $countries, $selected, $parameters); } //MVS End ?>
×
×
  • Create New...