Latest News: (loading..)

vlad36

Members
  • Content count

    7
  • Joined

  • Last visited

About vlad36

  • Birthday 10/06/1962

Profile Information

  • Real Name
    Vlad
  • Gender
    Male
  • Location
    New York, New York
  • Interests
    System Administrator, Cisco, PHP, .NET, Security, SEO, Hosting
  • Website
  1. To notify Bing: catalog/admin/includes/modules/dashboard/d_google_sitemap.php find: $url_gs_ping = 'http://www.google.com/webmasters/sitemaps/ping?sitemap=' . $base_url . 'sitemapindex.xml'; after add: $url_bing_ping = 'http://www.bing.com/ping?sitemap=' . $base_url . 'sitemapindex.xml'; find: ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . ' <td class="dataTableContent" colspan="2"><a href="' . $url_gs_ping . '" target="blank">' . MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING . '</a></td>' . ' </tr>' . after add: ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . ' <td class="dataTableContent" colspan="2"><a href="' . $url_bing_ping . '" target="blank">' . MODULE_ADMIN_DASHBOARD_BING_SITEMAP_PING . '</a></td>' . ' </tr>' . In catalog/admin/includes/languages/english/d_google_sitemap.php find: define('MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING', 'Ping Google (to notify them of the update to your XML sitemap.)'); replace with: define('MODULE_ADMIN_DASHBOARD_GOOGLE_SITEMAP_PING', 'Ping <font color="red">Google</font> (to notify them of the update to your XML sitemap.)'); define('MODULE_ADMIN_DASHBOARD_BING_SITEMAP_PING', 'Ping <font color="red">Bing</font> (to notify them of the update to your XML sitemap.)');
  2. To have products reviews sitemap: create file sitemapreviews.xml changes: googlesitemap/index.php find: if ($google->GenerateProductSitemap()){ echo 'Generated Google Product Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Product Sitemap Generation FAILED!' . "\n\n"; } after add: if ($google->GenerateProductReviewsSitemap()){ echo 'Generated Google Product Reviews Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Product Reviews Sitemap Generation FAILED!' . "\n\n"; } find: echo 'Here is your product sitemap: ' . $google->base_url . 'sitemapproducts.xml' . "\n"; after add: echo 'Here is your reviews sitemap: ' . $google->base_url . 'sitemapreviews.xml' . "\n"; googlesitemap/sitemap.class.php line 490 add: /** * Function to generate product reviews sitemap data * @@author Bobby Easland * @version 1.1 * @@Return boolean */ function GenerateProductReviewsSitemap(){ $quotes = (defined('QUOTES_CATEGORY_NAME') ? " and customers_email_address = '' and quotes_email_address = ''" : ''); $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'" . $quotes . " ORDER BY products_ordered DESC"; if ( $products_query = $this->DB->Query($sql) ){ $this->debug['QUERY']['PRODUCTS']['STATUS'] = 'success'; $this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = $this->DB->NumRows($products_query); $container = array(); $number = 0; $top = 0; while( $result = $this->DB->FetchArray($products_query) ){ $top = max($top, $result['products_ordered']); $location = $this->hrefLink(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $result['pID'], 'NONSSL', false); $lastmod = $this->NotNull($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_PROD_CHANGE_FREQ; $ratio = $top > 0 ? $result['products_ordered']/$top : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); $container[] = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority ); if ( sizeof($container) >= 50000 ){ $type = $number == 0 ? 'reviews' : 'reviews' . $number; $this->GenerateSitemap($container, $type); $container = array(); $number++; } } # end while $this->DB->Free($products_query); if ( sizeof($container) > 0 ) { $type = $number == 0 ? 'reviews' : 'reviews' . $number; return $this->GenerateSitemap($container, $type); } # end if } else { $this->debug['QUERY']['PRODUCTS']['STATUS'] = 'false'; $this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = '0'; } } # end function
  3. Hello, Did modification to code, all credits goes to dmnalven. Run SQL statements: INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Background color', 'BG_COLOR', '#FFFFFF', 'Go to <a href="http://www.w3schools.com/cssref/css_colornames.asp" target="_blank"><font color="darkred">W3schools website</font></a> to pick a color.<br />Color must be in the format:<br />#FFFFFF', '1', '928','NULL', 'tep_cfg_textarea(', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Repeat small image', 'BG_REPEAT', 'no-repeat', 'Repeat small image.', '1', '927','tep_cfg_select_option(array(\'repeat\', \'no-repeat\'),', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Choose horizontal position of the image', 'BG_H_POSITION', 'none', 'Choose horizontal position of the image.', '1', '929','tep_cfg_select_option(array(\'none\', \'center\', \'left\', \'right\'),', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Choose vertical position of the image', 'BG_V_POSITION', 'none', 'Choose vertical position of the image.', '1', '930','tep_cfg_select_option(array(\'none\', \'center\', \'top\', \'bottom\'),', now()); Replace: echo '<body (or table or tr or td or div) background="' . DIR_WS_BGIMAGES . $bg_image . '" the_rest_of_your_tag_parameters">'; with: ?> <style type="text/css"> body {background:<?php echo BG_COLOR; ?> url(<?php echo DIR_WS_BGIMAGES . $bg_image ?>) <?php echo BG_REPEAT; ?> <?php if (BG_H_POSITION == 'none') { } else {echo BG_H_POSITION;} ?> <?php if (BG_V_POSITION == 'none') { } else {echo BG_V_POSITION;} ?>;} </style> Configure your 4 new items in admin Configuration -> My Store Tested with 2.3 Enjoy
  4. Hi, If any one need ability to choose Live or Test server. File to work with is usps.php Find: if ($http->Connect('production.shippingapis.com', 80)) { $http->addHeader('Host', 'production.shippingapis.com'); $http->addHeader('User-Agent', 'osCommerce'); $http->addHeader('Connection', 'Close'); if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody())); // mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $body); $http->Disconnect(); return json_decode(json_encode(simplexml_load_string($body)),TRUE); } Replace with: //Start Live or test server if (MODULE_SHIPPING_USPS_SERVER == 'Live') { if ($http->Connect('production.shippingapis.com', 80)) { $http->addHeader('Host', 'production.shippingapis.com'); $http->addHeader('User-Agent', 'osCommerce'); $http->addHeader('Connection', 'Close'); if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody())); //echo "Body = "; //echo $body; //echo "<br>"; $http->Disconnect(); return json_decode(json_encode(simplexml_load_string($body)),TRUE); } } if (MODULE_SHIPPING_USPS_SERVER == 'Test') { if ($http->Connect('testing.shippingapis.com', 80)) { $http->addHeader('Host', 'testing.shippingapis.com'); $http->addHeader('User-Agent', 'osCommerce'); $http->addHeader('Connection', 'Close'); if ($http->Get('/ShippingAPITest.dll?' . $request)) $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody())); //echo "Body = "; //echo $body; //echo "<br>"; $http->Disconnect(); return json_decode(json_encode(simplexml_load_string($body)),TRUE); } } //End Live or test server Find: tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show International Regulations:', 'MODULE_SHIPPING_USPS_REGULATIONS', 'True', 'Displays international regulations and customs information.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); Add after it: //Start Live or test server tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Server', 'MODULE_SHIPPING_USPS_SERVER', 'Live', 'Use the testing or live server for transactions?<br><b>Live :</b> production.shippingapis.com/shippingapi.dll<br><b>Test :</b> testing.shippingapis.com/ShippingAPITest.dll', '6', '0', 'tep_cfg_select_option(array(\'Live\', \'Test\'), ', now())"); //End Live or test server Find: return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS'); Replace with: //Start Live or test server // return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS'); return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_SERVER', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS'); //End Live or test server For debuging uncomment: //echo "Body = "; //echo $body; //echo "<br>"; Best Regards,