Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

vmn

Members
  • Posts

    204
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by vmn

  1. Hello, I just installed the version 1.4.0 (in Phoenix 1.0.7.14) and found a bug preventing adding 'Required ip': in includes/modules/store/st_store_mode.php in the function htaccess_backup the line: if ( defined('MODULE_STORE_MODE_ALLOWED_IPS ') && tep_not_null(MODULE_STORE_MODE_ALLOWED_IPS) ) { contains an extra space before the closing apostrophe and should be if ( defined('MODULE_STORE_MODE_ALLOWED_IPS') && tep_not_null(MODULE_STORE_MODE_ALLOWED_IPS) ) {
  2. And, in the modern world: $src = Text::ltrim_once(language::map_to_translation('images/' . DEFAULT_IMAGE), DIR_FS_CATALOG);
  3. In 1.0.7.14 the following functions are deprecated in admin: tep_session_id tep_session_name tep_session_register tep_session_is_registered tep_session_unregister It seems to be working with fixes for admin/attributeManager/includes/attributeManagerHeader.inc.php admin/attributeManager/includes/attributeManagerSessionFunctions.inc.php included in the zip. fixes.for.1.0.7.14.zip
  4. Hello @raiwa and thanks again for your great addon. I wanted to have language specific default images. To achieve this I made the following change to kiss_it_image.php: if (defined('DEFAULT_IMAGE') && tep_not_null(DEFAULT_IMAGE) && !is_file(DIR_FS_CATALOG . $src)) { //VMN$src = DEFAULT_IMAGE; $src = 'includes/languages/' . $_SESSION['language'] . '/images/' . DEFAULT_IMAGE; } elseif ( (empty($src) || ($src == 'images/')) && (IMAGE_REQUIRED == 'false') ) { return false; } I wonder whether you would like to include this change into a future version of the addon:).
  5. OK, I thought you might be interested. I have more customised implementation of this supporting image descriptions, hiding htmlcontent, because we are not using it, etc. So, this is a one-time effort.
  6. Hi, I cloned the includes/modules/pi/product_info/pi_gallery_kissit.php gallery functionality to admin/categories product images. The features include: -show product image thumbnails -show image preview, when uploading product images -show product image gallery Tested in Phoenix 1.0.7.9 - 1.0.7.12 If you find this useful, please feel free to use it in any way you like. Here's a screen shot: categories.product.images.hook.zip
  7. There seems to be some confusion about the versions of this addon. I've downloaded 1.0.5 from this thread. I think it contains all the features mentioned in two previous posts. One of my hooks create dynamic content to categories.php. Tinymce was not activated before this change: <script> $(document).ready(function() { //added tinymce.init({ ... }); }); //added </script> Also adding autoresize into plugins is quite handy for me. Our product descriptions are not that long.
  8. You're welcome. I'm not using watermarks. I also tried admin side thumbs. Empty folders are created there, too. For some reason multiple thumbs were placed on some product lines in the category product listing, because your jquery code found multiple th elements to prepend the image to. I couldn't figure out why, so I removed the admin side thumbs functionality. It's not important to me. I was just curious:).
  9. Hi, I'm using Phoenix 1.0.7.11 and KissIT 3.4.2 and noticed that it creates empty folders for gallery images. I verified this using stock versions of 1.0.7.11 and KissIT. The function tep_image in kiss_it_image.php first creates a folder and the function _generateThumbnail in Image_Helper.php does not need it, because thumbs are not used for gallery images. This fix works for me. No empty folders will be created after applying it. In kiss_it_image.php tep_image replace the lines between // Create thumbs sub dirs and .htaccess. and // End create subdirectory and .htaccess. as follows //VMN NOT NEEDED Create thumbs sub dirs and .htaccess. //VMN build thumbs sub dir path, in case it's needed $thumbs_dir_path = str_replace('images/', 'images/' . KISSIT_THUMBS_MAIN_DIR . $width .'_'.$height.'/', dirname($src) . '/'); //VMN MOVED TO Image_Helper _generateThumbnail if(!is_dir($thumbs_dir_path)) { //VMN MOVED TO Image_Helper _generateThumbnail mkdir($thumbs_dir_path,0775,true); //VMN MOVED TO Image_Helper _generateThumbnail } //VMN NOT NEEDED because sub dirs are created using mkdir('path',mode,true) //VMN NOT NEEDED $thumbs_dir = ''; //VMN NOT NEEDED $thumbs_dir_paths = explode("/",$thumbs_dir_path); //VMN NOT NEEDED for ($i=0, $n=sizeof($thumbs_dir_paths); $i<$n; $i++) { //VMN NOT NEEDED $thumbs_dir .= $thumbs_dir_paths[$i] . '/'; //VMN NOT NEEDED if(!is_dir($thumbs_dir)) { //VMN NOT NEEDED mkdir($thumbs_dir, 0775); //VMN NOT NEEDED } //VMN NOT NEEDED create .htacces protection like in main image dir //VMN NOT NEEDED if (($i==$n-1) && (!is_file($thumbs_dir . '.htaccess')) ) { //VMN NOT NEEDED $hpname = $thumbs_dir . '.htaccess'; //VMN NOT NEEDED if ($hp = fopen($hpname,'w')) { //VMN NOT NEEDED fwrite($hp,$htacces); //VMN NOT NEEDED fclose($hp); //VMN NOT NEEDED } //VMN NOT NEEDED } //VMN NOT NEEDED} // end for //VMN NOT NEEDED End create subdirectory and .htaccess. There is no unnecessary creation of thumbs subfolders and htaccess files. The main thumbs folder htaccess will protect supbfolders as well. The only reference of $thumbs_dir_path is in $image = new Image_Helper(...). ================ in Image_Helper.php _generateThumbnail below the line: //make sure the thumbnail directory exists. 1. comment out/remove the lines //VMN NOT NEEDED if ( !is_writable ( $this->thumbs_dir_path ) ) { //VMN NOT NEEDED trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE ); //VMN NOT NEEDED } //VMN The check below is already done in _checkImage returning 'no_thumb_required' //VMN NOT NEEDED if ( is_readable ( $this->_thumb_src ) ) { //VMN NOT NEEDED $this->_calculated_width = (int)$this->attributes['width']; //VMN NOT NEEDED $this->_calculated_height = (int)$this->attributes['height']; //VMN NOT NEEDED return $this->src = $this->_thumb_src; //VMN NOT NEEDED } 2. add //VMN moved from kiss_it_image.php if(!is_dir($this->thumbs_dir_path)) { mkdir($this->thumbs_dir_path,0775,true); // true ->Allows the creation of nested directories specified in the pathname } Do you see any problems with this approach?
  10. Hi, I've upgraded Phoenix from 1.0.7.9->1.0.7.10->1.0.7.11 and noticed that the Gallery Kissit setup stopped working. I think I managed to upgrade pi_gallery_kissit.php to be compatible with 1.0.7.11. Maybe you already have done that. Here's my stuff. pi_gallery_kissit.zip
  11. Sorry, I must have missed something. As to 1.2.9 I think that there is no infoBoxContent style any more in 1.0.7.9. I think I stick to my version with one core change. Hopefully the core in the future will contain this extra hook. I also modify the style of the order list and add order language to the edit link. BTW, I moved the extra hook to the end of this if statement in orders.php before the last break stmt. if (($oInfo ?? null) instanceof objectInfo) { ... echo $OSCOM_Hooks->call('orders', 'orderList'); }
  12. This was an obsolete comment regarding the version 1.2.8. I was writing a comment to when a note of a new version was posted
  13. @SCH_001This was discussed in April 2018 in this topic. I uploaded my version then. As I pointed out my version is heavily mofified.
  14. I think managed to port my OSC 2.3.4.1 BS heavily modified order editor to Phoenix 1.0.7.9. I haven't tested it thoroughly yet. At least taxes are correctly calculated. I only use the following modified hooks from this addon version 1.2.8. The only change to core is to add the 'orderList' hook call to admin/orders.php, as instructed in the readme. *********** includes/hooks/admin/siteWide/listOrders.php <?php /* $Id$ add edit orders to admin / orders.php author: John Ferguson @BrockleyJohn [email protected] osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2019 SE Websites Released under the MITc License without warranty express or implied Modified by vmn for 1.0.7.9 */ class hook_admin_siteWide_listOrders { function listen_injectSiteEnd() { global $PHP_SELF, $oInfo; if (basename($PHP_SELF) == 'orders.php') { $comment = '<!-- ' .__METHOD__ . ' -->'; if (isset($oInfo) && is_object($oInfo)) { $link = tep_href_link('edit_orders.php', 'oID=' . $oInfo->orders_id); return <<<EOD $comment <script> $(function() { $('a.btn-warning').attr('href','$link'); }); </script> $comment EOD; } } } } *********** includes/modules/ hooks/admin/orders_edit_order.php <?php /* $Id$ add edit orders to admin / orders.php author: John Ferguson @BrockleyJohn [email protected] osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2018 osCommerce Released under the GNU General Public License Modified by vmn for 1.0.7.9 */ class hook_admin_orders_edit_orders { function listen_orderTab() { $comment = '<!-- ' .__METHOD__ . ' -->'; $button = tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('edit_orders.php', tep_get_all_get_params(['oID', 'action']) . 'oID=' . $_GET['oID'] . '&action=edit'), null, null, 'btn-warning mr-2'); $output = <<<EOD $comment <script> $('a.btn-info:first').before('$button'); </script> $comment EOD; return $output; } }
  15. Unfortunately, multiple languages are not supported. So, I can't see much use for htmlcontent. I've implemented optional multi-lingual description text for product images in v2.3.4.1 CE (BS). Right now I'm learning hooks and have made the same (still testing) for Phoenix 1.0.7.9 without changing the core. Gallery modules are the next thing to override.
  16. What is the purpose of htmlcontent field nowadays? I tested in 1.0.7.9 and put some plain text into htmlcontent of one gallery image. The text will show in the carousel on the particularly image.
  17. You can also create all folders without looping: if(!is_dir($thumbs_dir_path)) { mkdir($thumbs_dir_path,0777,true); }
  18. OK, it might be safer to always add .htaccess into the thumbs top-level folder.
  19. Thanks, actually, for testing purposes, I commented out everything related creating .htaccess in the file above file before notifying you.The images folder .htaccess already contains the required protection.
  20. Hi, I just installed this addon (3.4.2) into 1.0.7.9. One fix needed in /catalog/includes/modules/pi_gallery_kissit.php move the line #94 containing $other_img_indicator = $other_img = null; upwards after the comment line #81 // now create the thumbs (just like in the stock pi_gallery.php) to get rid of "Notice: Undefined variable: other_img_indicator " later on. Question: Is it really necessary to create .htaccess into every thumbs subfolder? The .htaccess from an upper level folder, like images, will be inherited by every subfolder and should be enough.
  21. I could not get the running from command-line to work without the following changes. My catalog resides in a sub-folder where I also wanted to put the sitemap. I'm redirecting all traffic pointing to document root to a sub-folder called portal. The direcotry structure is: / /portal /shop Maybe this is why it did not work. in index.php after include_once('includes/application_top.php'); insert $run_env = php_sapi_name(); echo 'Environment:' . $run_env . "\n"; if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { //DO NOT CHECK IP } else { if (! empty(GOOGLE_XML_SITEMAP_SECURE_IP)) { $safe_ips = explode(',', GOOGLE_XML_SITEMAP_SECURE_IP); if (! in_array($_SERVER['REMOTE_ADDR'], $safe_ips)) { header("location:http:127.0.0.1"); } } } after echo 'For your convenience here is the <strong>CRON command</strong> for your site:' . "\n\n"; replace echo "\t" . '<strong>php ' . dirname($_SERVER['SCRIPT_FILENAME']) . '/index.php</strong>' . "\n\n"; with echo "\t" . '<strong>php ' . __FILE__ . '</strong>' . "\n\n"; in sitemap.class.php before $this->base_url = $domain_name; add $run_env = php_sapi_name(); if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'this->savepath:' . $this->savepath . "\n"; $temp = getcwd(); $temp .= (substr($temp, -1) !== '/') ? '/' : ''; //append a slash if needed if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'temp:' . $temp . "\n"; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'DIR_FS_CATALOG:' . DIR_FS_CATALOG . "\n"; $this->savepath = substr($temp, 0, strpos($temp, DIR_FS_CATALOG)) . $this->savepath; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'this->savepath:' . $this->savepath . "\n"; } I noticed that categories are retrieved multiple times (in all shop languages): find $sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod replace $sql = "SELECT distinct c.categories_id as cID, c.date_added, c.last_modified as last_mod after $path = (($pos = strpos(DIR_FS_CATALOG, "googlesitemap")) !== FALSE) ? substr(DIR_FS_CATALOG, 0, -strlen('googlesitemap') - $slash) : DIR_FS_CATALOG; insert $run_env = php_sapi_name(); if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'path:' . $path . "\n"; $temp = getcwd(); $temp .= (substr($temp, -1) !== '/') ? '/' : ''; //append a slash if needed if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'temp:' . $temp . "\n"; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'DIR_FS_CATALOG:' . DIR_FS_CATALOG . "\n"; $path = substr($temp, 0, strpos($temp, DIR_FS_CATALOG)) . $path; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'path:' . $path . "\n"; } There is some unnecessary stuff, e.g.: class MySQL_DataBase (because DB handling is done in the core). I removed all usage of the class MySQL_DataBase.
  22. Thanks, GOOGLE_XML_SITEMAP_SECURE_IP is working now.
  23. I could not find any reference to GOOGLE_XML_SITEMAP_SECURE_IP in the code.
  24. I just started using this addon in my v2.3.4.1 CE. I noticed that anybody knowing the name of googlesitemap directory can run the sitemap creation. This may not be harmful, but the result page revealed my full Cpanel path, including my user id. I first renamed the directory. This also required some code changes, which I made. I also protected the directory with .htaccess: Require ip my.server.ip Require forward-dns my.dynamic.vpn.adddress This code seems to have no effect, whether it is in application_top.php or not: /**** Begin Google Sitemap Manual Run ****/ if (strpos(GOOGLE_XML_SITEMAP_MANUAL_IP, $_SERVER['REMOTE_ADDR']) !== FALSE) { $future_date = strtotime('+' . GOOGLE_XML_SITEMAP_MANUAL_RUN . ' day'); if ($future_date <= date('Y-m-d')) { tep_redirect(HTTP_SERVER . DIR_WS_HTTPS_CATALOG . 'googlesitemap/index.php'); // } } /**** End Google Sitemap Manual Run ****/ Did I miss something?
  25. Hi, I noticed that my fix for commenting out the ExpiresDefault line in .htaccess does not check whether the line is already commented out. This happens if I switch between offline and offline-test without switching to online in between. Also someone may have intentionally commented it out. So, in includes/modules/header_tags/ht_store_mode.php: find: $file = preg_replace('@ExpiresDefault@','#ExpiresDefault',$file); //VMN replace the line with: //Is ExpiresDefault already commented out by us? //VMN if ( strpos($file, '#Store Mode comment:ExpiresDefault') === false ) { //VMN $file = preg_replace('@ExpiresDefault@','#Store Mode comment:ExpiresDefault',$file); //VMN } //VMN find: $file = preg_replace('@#ExpiresDefault@','ExpiresDefault',$file); //VMN replace the line with: $file = preg_replace('@#Store Mode comment:ExpiresDefault@','ExpiresDefault',$file); //VMN
×
×
  • Create New...