Jump to content

gvv

Members
  • Content count

    54
  • Joined

  • Last visited


Reputation Activity

  1. Like
    gvv reacted to Jack_mcs in Header Tags SEO   
    Try this:
    <?php echo '<a itemprop="url" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', (tep_not_null($header_tags_array['logo_text']) ? $header_tags_array['logo_text'] : STORE_NAME), '','',' itemprop="logo" ') . '</a>';
  2. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    @@altoid
    I have just rewrited the csvExpImp for better compatibility
     
    Here is
    very usefull for all excell users.when you edited the file save into CSV (MS-DOS) mode!
     
    Well, the new compatibility mode should be CSV (comma-separated values) and double qouted strings as phpMyAdmin do the same by default.
     
    <?php /* Copyright by Gergely Tóth http://oscom.hu v1.2b Export from query 1. parse query 2. get header fields 3. run query and save results into temporary csv file 4. download if need 5. delete temporary file */ define('FS_OUTPUT_PATH', ''); class export2csv { // public variables var $filename, $lines_terminated, $fields_terminated, $optionally_enclosed, $output, $sql_result, $tmpfname = ''; var $inistatus = false; // run the export //$query could be sql string or object results function downloadCsv($query = Null) { // default init call from built in $this->inisetCSV() function if (!$this->inisatus) { $this->inisetCSV(); } if (!$this->filename) { $this->setFilename(); } if (!is_object($query)) { $this->getResult($query); } $this->buildDatasheet($this->sql_result); $this->downloadFile(); unlink(FS_OUTPUT_PATH . $this->tmpfname); } function getResult($query) { $this->sql_result = tep_db_query($query); } function buildHeader($sql_result) { // Get The Field Name from query while ( $columns = tep_db_fetch_fields($sql_result) ) { $this->output .= $columns->name . $this->fields_terminated; } $this->output = substr($this->output, 0, -(strlen($this->fields_terminated))); $this->output .= $this->lines_terminated; } function buildDatasheet($sql_result) { // init $this->tmpfname = strftime('%Y%m%d-%H%M%S') . '.csv'; $fp = fopen(FS_OUTPUT_PATH . $this->tmpfname, "a+"); // reset output and build csv header line $this->setOutput(); $this->buildHeader($sql_result); fwrite($fp, $this->output); // Get Records from the query while ($row = tep_db_fetch_array($sql_result)) { fputcsv($fp, $row, $this->fields_terminated, $this->optionally_enclosed); } fclose($fp); } function downloadFile() { // Download the file $file_size = filesize(FS_OUTPUT_PATH . $this->tmpfname); $file = @fopen(FS_OUTPUT_PATH . $this->tmpfname,"rb"); header("Content-Encoding: UTF-8"); header("Content-type: text/csv; charset=UTF-8"); header("Content-Disposition: attachment; filename=" . $this->tmpfname . ""); header("Content-Length: " . $file_size . ""); header("Pragma: no-cache"); header("Expires: 0"); set_time_limit(0); fseek($file, $seek_start); while(!@feof($file)) { print(@fread($file, 1024*8)); ob_flush(); flush(); if ( connection_status() != 0 ) { @fclose($file); exit; } } } function setOutput($string = '') { $this->output = $string; } // set the download filename function setFilename($filename = 'csvexport.csv') { $this->filename = $filename; } // set the CSV file function inisetCSV($optionally_enclosed = '"', $fields_terminated = ",", $lines_terminated = "\n") { $this->lines_terminated = $lines_terminated; $this->fields_terminated = $fields_terminated; $this->optionally_enclosed = $optionally_enclosed; $this->inistatus = true; } } /* Import from upload 1. upload csv file 2. parse csv 3. get header 4. slice file if need 5. insert into data table 6. delete uploaded files */ class CSVImport { var $data; function csv_to_array($filename = '', $delimiter = ",") { if(!file_exists($filename) || !is_readable($filename)) return false; $header = null; $this->data = array(); if (($handle = fopen($filename, 'r')) !== false) { while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) { if (!$header) { $header = $row; } else { $this->data[] = array_combine($header, $row); } } fclose($handle); } return true; } function get_data() { return $this->data; } } ?>
  3. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    If someone would like to test message_stack redirection than install first the Mesage Stack Notifications header module.
     
     
    Hard coded testing mod in URL redirection addon:
    includes/modules/url_redirects/redirects_handler.php
     
    change

    function http_error_handler($error_id = '999') { global $request_type, $requested_url, $HTTP_GET_VARS, $PHP_SELF; to
    function http_error_handler($error_id = '999') { global $request_type, $requested_url, $HTTP_GET_VARS, $PHP_SELF, $messageStack; change: 

    if (tep_not_null($redirect['new_url']) && $redirect['url_redirects_status'] == 1) { // self or foreign host? $host = ((preg_match('[://]', $redirect['new_url'])) ? "" : ($request_type == 'SSL' ? HTTPS_SERVER : HTTP_SERVER)); //header("HTTP/1.0 301 Moved Permanently"); header("Location: " . $host . $redirect['new_url'] . "", TRUE, $redirect['url_redirects_mode']); exit(); To: 

    if (tep_not_null($redirect['new_url']) && $redirect['url_redirects_status'] == 1) { // self or foreign host? $host = ((preg_match('[://]', $redirect['new_url'])) ? "" : ($request_type == 'SSL' ? HTTPS_SERVER : HTTP_SERVER)); // add messages for users $messageStack->add_session('header', 'The original product/category is no longer available, but we redirect you which is similar/here is a useful category.', 'success'); //header("HTTP/1.0 301 Moved Permanently"); header("Location: " . $host . $redirect['new_url'] . "", TRUE, $redirect['url_redirects_mode']); exit();
  4. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    sorry my bad I forget something
    includes/modules/url_redirects/redirects_handler.php
    change
    function http_error_handler($error_id = '999') { global $request_type, $requested_url, $HTTP_GET_VARS, $PHP_SELF; to
    function http_error_handler($error_id = '999') { global $request_type, $requested_url, $HTTP_GET_VARS, $PHP_SELF, $messageStack;
  5. Like
    gvv reacted to De Dokta in Wish List for osC 2.3.4 BS GOLD   
    @@gvv
     
    Yes! For includes/modules/new_products.php e.g. it should be something like this:
     
                          $new_prods_content .= tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link('wishlist.php', tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $new_products['products_id']), NULL, NULL, 'btn-default btn-sm');
     
    Add it where you want the wishlist button to appear. And in other modules similar....
     
    J.J.
     
  6. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    Yes its true. /index.php/cPath/222 HTTP header response is 200 and say
     
     
    so if you would like to do something with fake categories you should install a cpath validation mod like this
    https://github.com/Gergely/oscommerce2-addons/compare/cPath_validation
     
    or probably could help a redirection directly from the .htaccess
     
    See previous discussions http://forums.oscommerce.com/topic/381443-google-duplicate-content-with-strange-cpath-variable-indexed/
     
     
  7. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    @@burt

    Sorry i forgot to show product_info.php code reorganization for redirections.
    <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); if (!isset($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_DEFAULT)); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); if ($product_check['total'] < 1) $result = http_error_handler('302'); require(DIR_WS_INCLUDES . 'template_top.php');
  8. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    Hi everybody!

    The next important addon will be supported in next release http://addons.oscommerce.com/info/9206for inside default_missing_image errors.
  9. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    Change the code in server_error.php
     
    $result = http_error_handler($_GET['id']);
  10. Like
    gvv reacted to tgely in Fake URL redirection by administration   
    @@gvv
     
    I think yes. You should put one row into server_error.php
     
    After:
    require('includes/application_top.php'); Add:
    $eID = http_error_handler(); And ignore upload the following files from url redirect addon
    - catalog/http_error.php
    - catalog/includes/languages/english/http_error.php
  11. Like
    gvv reacted to Tsimi in Wish List for osC 2.3.4 BS GOLD   
    @@grandpaj
     
    Thanks for another feedback John! Appreciated! :thumbsup:
     
    Regarding the buttons;
    Inside the wishlist.php look for this code
    <script> function addNewEmailField() { $('#EmailList').append('<div id="added"><div class="form-group has-feedback"><label for="recvName" class="control-label col-sm-3"><?php echo TEXT_NAME . ':'; ?></label><div class="col-sm-6"><?php echo tep_draw_input_field('friend[]', NULL, 'id="recvName" placeholder="' . TEXT_NAME . '"'); echo FORM_REQUIRED_INPUT;?></div></div><div class="form-group has-feedback"> <label for="recvEmail" class="control-label col-sm-3"><?php echo TEXT_EMAIL . ':'; ?></label> <div class="col-sm-6"><?php echo tep_draw_input_field('email[]', NULL, 'id="recvEmail" placeholder="' . TEXT_EMAIL . '"'); echo FORM_REQUIRED_INPUT;?></div></div><hr /></div></div>'); $('.button_more').replaceWith('<div class="row button_added"><div class="col-sm-6"><a class="btn btn-default btn-block" role="button" href="#" onclick="addNewEmailField();return false;"><i class="glyphicon glyphicon-plus"></i><?php echo TEXT_WISHLIST_ADD_EMAIL; ?></a></div><div class="col-sm-6"><a class="btn btn-default btn-block" role="button" href="#" onclick="removeEmailField();return false;"><i class="glyphicon glyphicon-minus"></i><?php echo TEXT_WISHLIST_REMOVE_EMAIL; ?></a></div></div>'); } function removeEmailField() { $('#added').remove(); } </script> and replace with this
    <script> function addNewEmailField() {   $('#EmailList').append('<div id="added"><div class="form-group has-feedback"><label for="recvName" class="control-label col-sm-3"><?php echo TEXT_NAME . ':'; ?></label><div class="col-sm-6"><?php echo tep_draw_input_field('friend[]', NULL, 'id="recvName" placeholder="' . TEXT_NAME . '"'); echo FORM_REQUIRED_INPUT;?></div></div><div class="form-group has-feedback"> <label for="recvEmail" class="control-label col-sm-3"><?php echo TEXT_EMAIL . ':'; ?></label> <div class="col-sm-6"><?php echo tep_draw_input_field('email[]', NULL, 'id="recvEmail" placeholder="' . TEXT_EMAIL . '"'); echo FORM_REQUIRED_INPUT;?></div></div><hr /></div></div>'); $('.button_more').replaceWith('<div class="row button_added"><div class="col-sm-3"><a class="btn btn-default" role="button" href="#" onclick="addNewEmailField();return false;"><i class="glyphicon glyphicon-plus"></i><?php echo TEXT_WISHLIST_ADD_EMAIL; ?></a></div><div class="col-sm-3"><a class="btn btn-default" role="button" href="#" onclick="removeEmailField();return false;"><i class="glyphicon glyphicon-minus"></i><?php echo TEXT_WISHLIST_REMOVE_EMAIL; ?></a></div></div>'); } function removeEmailField() {   $('#added').remove(); } </script> Is this better?
  12. Like
    gvv reacted to Tsimi in Wish List for osC 2.3.4 BS GOLD   
    And to make it complete here the uninstall sql query. Something that I intend to add to the update later on.
    DROP TABLE IF EXISTS customers_wishlist; DROP TABLE IF EXISTS customers_wishlist_attributes; DELETE FROM configuration_group WHERE configuration_group_title LIKE 'Wish List Settings'; DELETE FROM configuration WHERE configuration_key LIKE 'MAX_DISPLAY_WISHLIST_PRODUCTS'; DELETE FROM configuration WHERE configuration_key LIKE 'MAX_DISPLAY_WISHLIST_BOX'; DELETE FROM configuration WHERE configuration_key LIKE 'DISPLAY_WISHLIST_EMAILS'; DELETE FROM configuration WHERE configuration_key LIKE 'WISHLIST_REDIRECT'; I tested it and it worked but here again...confirmation from someone else would be appreciated. Thanks.
  13. Like
    gvv reacted to Tsimi in Wish List for osC 2.3.4 BS GOLD   
    @@greasemonkey
     
    Thanks for the report Scott.
     
    I fixed the sql query I think it should work now either with or without AUTO_INCREMENT checked.
    DROP TABLE IF EXISTS customers_wishlist; CREATE TABLE customers_wishlist ( customers_wishlist_id int unsigned NOT NULL auto_increment, customers_id int unsigned NOT NULL default '0', products_id tinytext NOT NULL, customers_wishlist_quantity int(2) NOT NULL, final_price decimal(15,4), customers_wishlist_date_added char(8), PRIMARY KEY (customers_wishlist_id), KEY idx_wishlist_customers_id (customers_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; DROP TABLE IF EXISTS customers_wishlist_attributes; CREATE TABLE customers_wishlist_attributes ( customers_wishlist_attributes_id int unsigned NOT NULL auto_increment, customers_id int unsigned NOT NULL default '0', products_id tinytext NOT NULL, products_options_id int unsigned NOT NULL default '0', products_options_value_id int unsigned NOT NULL default '0', PRIMARY KEY (customers_wishlist_attributes_id), KEY idx_wishlist_att_customers_id (customers_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible ) VALUES ( '12954', 'Wish List Settings', 'Settings for your Wish List', '25', '1' ); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Max Wish List', 'MAX_DISPLAY_WISHLIST_PRODUCTS', '10', 'How many wish list items to show per page on the main wishlist page', '12954', '', now(), now(), NULL, NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Max Wish List Box', 'MAX_DISPLAY_WISHLIST_BOX', '4', 'How many wish list items to display in the infobox before it changes to a counter', '12954', '', now(), now(), NULL, NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Emails', 'DISPLAY_WISHLIST_EMAILS', '5', 'How many emails to display when the customer emails their wish list link', '12954', '', now(), now(), NULL, NULL); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Wish List After Adding Product', 'WISHLIST_REDIRECT', 'Yes', 'Display the Wish List after adding a product (or stay on product_info.php page)', '12954', '', now(), now(), NULL, 'tep_cfg_select_option(array(\'Yes\', \'No\'),'); I tested it and it worked but would appreciate if you could run it again through your phpMyAdmin just to make sure.
     
    Regarding the install manual, yes i forgot to hit the enter button there. :blush: Fixed now.
    Once the sql is confirmed working I will upload it to the add-ons area.
     
    Thanks
  14. Like
    gvv reacted to De Dokta in Wish List for osC 2.3.4 BS GOLD   
    Hi
     
    yes it's possible with a little trick! :rolleyes:
    In includes/modules/product_listing.php somewhere around the buttons area add (depends on where you want to have the wishlist button):
    $prod_list_contents .= '       <div class="col-xs-6">' . tep_draw_form('cart_quantity', tep_href_link('product_info.php', tep_get_all_get_params(array('action')) . 'action=add_product')) . tep_draw_hidden_field('products_id', $listing['products_id']) . tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', null, 'primary', array('params' => 'name="wishlist" value="wishlist"')) . '</form ></div>'; J.J.
     
  15. Like
    gvv reacted to Tsimi in Wish List for osC 2.3.4 BS GOLD   
    @@gvv @@De Dokta
     
    Thanks for the code J.J. :thumbsup:
    Be aware that a button inside the product listing works only if the product doesn't have attributes.
    Other solution would be to build in the same redirect to the application_top.php for thew wishlist button, similar to the buy now button.
    If attributes -> redirect to product_info.php else -> add to wishlist.
  16. Like
    gvv reacted to De Dokta in Wish List for osC 2.3.4 BS GOLD   
    @@Tsimi
     
    Yes, you are right! :-
    The only way to add a wishlist button to the product_listing seems to be to define a new case 'add_to_wishlist' in application_top:
     
    Right before:  case 'notify' :         if (tep_session_is_registered('customer_id')) {
    insert:
    /*Wish List */      case 'add_to_wishlist' : if (isset($_GET['products_id'])) {                                if (tep_has_product_attributes($_GET['products_id'])) {                                tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_GET['products_id']));                                 } else {                                $wishList->add_wishList($_GET['products_id'], $wishList->get_quantity($_GET['products_id'])+1);                                }                               }                               tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters)));                               break; /* /Wish List End */                          And then in product_listing add something like:       
    $prod_list_contents .= '       <div class="col-xs-6">' . tep_draw_button(TEXT_ADD_WISHLIST, 'glyphicon glyphicon-heart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $listing['products_id']), NULL, NULL, 'btn-default btn-sm') . '</div>'; Works for me on bs-gold........
     
    J.J.
  17. Like
    gvv reacted to Tsimi in Wish List for osC 2.3.4 BS GOLD   
    @@gvv
    Did you add the "new files" and installed the new product_info module under Modules -> Content -> wishlist?
    And before you do this backup the two tables that are mentioned in the upgrade manual.
  18. Like
    gvv reacted to De Dokta in Wish List for osC 2.3.4 BS GOLD   
    If you want to remove the add-to-cart button but use the wishlist function, keep the hidden field intact.
     
    <div class="col-xs-6 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'glyphicon glyphicon-shopping-cart', null, 'primary', null, 'btn-success'); ?></div>
×