Jump to content
Latest News: (loading..)

ArtcoInc

Members
  • Content count

    1,472
  • Joined

  • Last visited

  • Days Won

    30

Reputation Activity

  1. Like
    ArtcoInc reacted to bruyndoncx in Removal of Legacy Code: Directory Structure / Namespaces   
    Noop, change in configure.php with the define is one change, change in application_top directly would also mean having to change every instance throughout the code, exactly what I don't want
  2. Like
    ArtcoInc reacted to bruyndoncx in Removal of Legacy Code: Directory Structure / Namespaces   
    ooh, yes, I am familiar with symbolic links in unix, but I feel much more comfortable if I can get things done with just a browser, ftp and a text editor. When you are away from home, on holiday or on the road or having bad luck and (unexpectingly) ending up in the hospital, the wifi doesn't allow all kinds of network protocols and you get stuck, http and ftp access are sure things, others are not.
  3. Like
    ArtcoInc reacted to kymation in Removal of Legacy Code: Directory Structure / Namespaces   
    Using mv works as well, assuming that you have root access, which is not always available. I suppose I could use the PHP rename() statement in another custom file.
     
    The point is that you are removing an easy way of doing the job, and leaving us with less optimal solutions that don't always work, or need extra steps. I don't see this as an improvement; rather the opposite.
     
    I'm not at all adverse to learning a better way of doing something. I just need to see an improvement resulting from the change.
     
    Regards
    Jim
     
  4. Like
    ArtcoInc reacted to kymation in Removal of Legacy Code: Directory Structure / Namespaces   
    I think you misunderstood. The functions in /includes/functions and includes/functions2 are different. With the current code, I can switch between the two with a simple change to /includes/configure.php. This is useful for testing in cases where no development site is possible and testing must be done on the live server. Yes, this happens.
     
    Symlinks could be used to do the same thing, but that assumes that you have root access to the server. Again, this is not always possible when working on a site on a cheap hosting service.
     
    Regards
    Jim
     
  5. Like
    ArtcoInc reacted to bruyndoncx in Removal of Legacy Code: Directory Structure / Namespaces   
    by having this level of abstraction I can run a site with just the catalog files, includes/application top, includes/configure and a few other specific to one spinoff www.xyz.com, while for other includes referring to the main www site.
     
    I don't see how it is possible to do that without that level of abstraction that you can introduce in the configure.php file
     
    Secondly, as for a cdn like solution for images, with limited changes throughout the codebase to handle the images, I have
     
    on mysite main site

    define('DIR_WS_IMAGE_HOST', 'http://www.mysite.com/'); define('DIR_WS_IMAGE_DIR','images/'); define('DIR_WS_IMAGES', DIR_WS_IMAGE_HOST . DIR_WS_IMAGE_DIR); and on the spinoff site
    define('DIR_WS_IMAGE_HOST', 'http://img.spinoffsite.com/'); define('DIR_WS_IMAGE_DIR','images/'); define('DIR_WS_IMAGES', DIR_WS_IMAGE_HOST . DIR_WS_IMAGE_DIR); where in the DNS img.spinoffsite.com is mapped to www.mysite.com ip-address 
    this allows me to just have the images on the mainsite, and the spinoff referring to the same images without duplicating the files.
  6. Like
    ArtcoInc reacted to kymation in Removal of Legacy Code: Directory Structure / Namespaces   
    It appears that this "optimizing" is removing useful features. Perhaps we could discuss this first, instead of implementing changes by fiat?
     
    Regards
    Jim
  7. Like
    ArtcoInc reacted to De Dokta in Categories Menu with multiple subs in the header navbar   
    Hi
     
    I have long been looking for a way to integrate the categories menu with multiple sub categories into  the header navbar, but I always failed to embed the appropriate code into the category_tree.php.  :(  With the help of the code gadlol has recently posted, some JS and CSS I have now found a way without changing the category_tree.php.
    Looks like this:

    How it works:

     In includes/functions/html_output.php add a new function:
    function tep_show_tree($root_id = 0,$mainUlClass='dropdown-menu',$submenuUlClass='dropdown-menu sub-menu'){     global $languages_id,$cPath_array;     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");     $items = array();     while ($categories = tep_db_fetch_array($categories_query))  {         $items[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'id' => $categories['categories_id']);     }     $citems=count($items);          if($citems<=0) return '';     elseif($citems==1) $children[] = $items; //in case we have one category item without subcategories, rare but possible     else foreach( $items as $item ) $children[$item['parent_id']][] = $item;         $loop = !empty( $children[$root_id] );         $parent = $root_id;         $parent_stack = array();     $html=array();//store html code         $stack=array();//helper array so to know the current level     $pic=''; //products_in_category string         $html[]='<ul class="'.$mainUlClass.'">';         while ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) ){             if ( $option === false ){                 $parent = array_pop( $parent_stack );                 $html[] = '</ul>';                 $html[] = '</li>';                 array_pop( $stack );             }elseif ( !empty( $children[$option['value']['id']] ) ){                 $stack[]=$option['value']['id'];                   $rt=$root_id>0 ? $root_id.'_' : '';                   $cpath_new=count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack);                 $html[]= '<li><a class="trigger right-caret" href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'">';           if (SHOW_COUNTS == 'true') {             $products_in_category = tep_count_products_in_category($option['value']['id']);             if ($products_in_category > 0) {               $pic=' (' . $products_in_category . ')';             }           }           $sm=0;                   if((isset($cPath_array) && in_array($option['value']['id'], $cPath_array))){             $sm=1;             $html[]='<strong>'.stripslashes($option['value']['name']).$pic.'</strong>';           }else{             $html[]=stripslashes($option['value']['name']) . $pic;           }             $html[]='</a>';             $html[] = '<ul class="'.$submenuUlClass.'">';                 $parent_stack[]=$option['value']['parent_id'];                 $parent = $option['value']['id'];           }else{         $rt=$root_id>0 ? $root_id.'_' : '';                 $cpath_new= count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack).'_'.$option['value']['id'];                 $html[]= '<li><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'" >';         if (SHOW_COUNTS == 'true') {           $products_in_category = tep_count_products_in_category($option['value']['id']);           if ($products_in_category > 0) {             $pic=' (' . $products_in_category . ')';           }         }                 if (isset($cPath_array) && in_array($option['value']['id'], $cPath_array)) {           $html[]='<strong>'.stripslashes($option['value']['name']).$pic.'</strong>';         }else{           $html[]=stripslashes($option['value']['name']).$pic;         }         $html[]='</a>';         }        }         $html[]='</ul>';      $data = '<li class="dropdown">' .              '<a class="dropdown-toggle" data-toggle="dropdown">' . HEADER_CATS . '</a>' .                implode($html) .              '</li>';       return $data;   } includes/footer.php add:
    <script type="text/javascript"> $(function(){     $(".dropdown-menu > li > a.trigger").one("click",function(e){         e.preventDefault();         var current=$(this).next();         var grandparent=$(this).parent().parent();         if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))             $(this).toggleClass('right-caret left-caret');         grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret');         grandparent.find(".sub-menu:visible").not(current).hide();         current.toggle();         e.stopPropagation();     });     $(".dropdown-menu > li > a:not(.trigger)").one("click",function(){         var root=$(this).closest('.dropdown');         root.find('.left-caret').toggleClass('right-caret left-caret');         root.find('.sub-menu:visible').hide();     }); })(jQuery); </script> user.css add:
    .dropdown-menu>li /* To prevent selection of text */ {   position:relative;     padding-left: 5px;     -webkit-user-select: none; /* Chrome/Safari */             -moz-user-select: none; /* Firefox */     -ms-user-select: none; /* IE10+ */     /* Rules below not implemented in browsers yet */     -o-user-select: none;     user-select: none;     cursor:pointer; } .dropdown-menu .sub-menu {     left: 100%;     position: absolute;     top: 0;     display:none;     margin-top: -1px;     box-shadow:none; } .right-caret:after,.left-caret:after  {  content:"";     border: 5px solid transparent;     border-top: 5px solid transparent;     display: inline-block;     height: 0;     vertical-align: middle;     width: 0;     margin-left:15px; } .right-caret:after {        border-left: 5px solid #ffaf46; } .left-caret:after {     border-right: 5px solid #ffaf46; } in includes/header.php after:
    <?php echo '<li><a class="store-brand" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_HOME . '</a></li>'; ?> add:
    <?php echo '<li>' . tep_show_tree() . '</li>'; ?> or somewhere else where you like it!
    includes/languages/english.php add:
    define('HEADER_CATS', '<i class="glyphicon glyphicon-cog"></i><span class="hidden-sm"> Categories</span> <span class="caret"></span>'); or any other glyphicon.
     
    I tested it with Mozilla 30. IE 8, Chrome and Opera - seems to work properly in full and collapsed size. 
     
    Hope you enjoy it!
     
    J.J.
  8. Like
    ArtcoInc reacted to mattjt83 in 2334bs - formatting issue   
    @@ArtcoInc
     
    I would suggest using the bootstrap labels instead of the image.
     
    Just wrap the text in the proper <span></span> as found here: http://getbootstrap.com/components/#labels 
     
    Then you can use the contextual classes to display the info and save a tiny bit of bandwidth not loading the image :)
  9. Like
    ArtcoInc reacted to joli1811 in 2334BS - Categories above body?   
    http://lab.maltewassermann.com/viewport-resizer/
     
    nice little bookmarklet tool
     
    Regards
    Joli
  10. Like
    ArtcoInc reacted to Tsimi in 2334BS - Categories above body?   
    Hi Malcolm :)
     
    I have no access to my PC right now.
    I can test it in about 2 hours.
    I have a smart phone and i will test it and report back.
     
    You know that you can simulate the view of a small device with firefox browser by pushing ctrl+shift+m.
  11. Like
    ArtcoInc reacted to burt in 2334BS - Enhanced Contact Us   
    user.css
     

    #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; border-radius: 100px; text-align: center; padding-top: 35px; } #droppable { width: 250px; height: 150px; padding: 0.5em; float: left; margin: 10px; border-radius: 20px; }
     
    /includes/template_bottom.php (after the call to the jquery.js, approx line 45)
     

    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <script src="ext/jquery/touch-punch.min.js"></script>
     
    includes/template_top.php after the endif approx line 42
     

    <link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.22.css" />
     
    contact_us.php at the very end of the file after everything
     

    <script> $(function() { $("#draggable").draggable(); $("#droppable").droppable({ drop: function(event, ui) { console.log(ui.draggable.length); $(".submission").val(ui.draggable.data('text')); $(this).addClass("ui-state-highlight").find("p").html("You may now submit the form!"); } }); }); </script>
     
    same file, just above buttonset div
    note: I don't particularly like the idea for this block of code, but it's what I coded to test the concept, an input field set to display: none; that is required (thereby until it is filled out the form is impossible to submit), and can only be filled out by js trickery (moving the ball into the court)...
     

    <div id="draggable" class="ui-widget-content" data-text="submission"> <p>Drag me...</p> </div> <div id="droppable" class="ui-widget-header"> <p>Drop here...</p> </div> <?php echo tep_draw_input_field('test', NULL, 'required aria-required="true" style="display: none;" class="submission"'); ?> <div class="clearfix"></div>
     
    DONE!
     
    EXTERNAL SCRIPTS
     
    Now grab the external 3rd party script that allows the jqueryui to be swipeable, it's called "touch punch".
    Here is the code: https://raw.githubusercontent.com/furf/jquery-ui-touch-punch/master/jquery.ui.touch-punch.min.js - copy and paste that code into a new file called touch-punch.min.js and save this new file into /ext/jquery/
     
    Visit the contact us page and test it out.
     
    My conclusion:
     
    It is an interesting concept, and could potentially be a good way to stop bots dead...but does need some better "instructions" for the average user...and overall polishing. It's not something I would use on my own sites, I prefer the simple maths question.
  12. Like
    ArtcoInc reacted to De Dokta in Invoice Editor 1.0   
    Hi,
     
    Good question! I never ask for it. :blush: But according to the online manual fpdf - which I used for the pdf forms - is based on milimeters.
     
    J.J.
  13. Like
    ArtcoInc reacted to De Dokta in Invoice Editor 1.0   
    Hi,
     
    As the author of the contrib I will try to answer your questions. Please excuse my limited knowledge of English - I hope I can make me understood anyway
     
    1. I'm a little confused because there is no command line in the sql files to set the DB tables to latin1_swedish_ci, utf8 or whatever. :unsure: The tables should be installed with the same coding as all other tables of your DB. If your other tables are in utf8_unicode_ci you should convert the tables of the Invoice editor to utf8.
    To do this is quite simple: Go to Admin -> Tools -> Database Tables - click the checkboxes of all tables that are not utf8 - select in the pulldown at the bottom of the page 'Convert to utf8' (a new pulldown appears, where you select 'Auto-Detect') - click the Go button. Ready!
     
    2. What is not clear at this instruction? Do you have installed the tool named Order editor? (Order editor is a tool other than Invoice editor!) If yes, you do not need to add these lines of code to your general.php. If no, add them!
     
    3. My mistake! :blush: In invoice_en.sql in some entries accidentally a false Configuration Group is entered. To fix it open your DB with phpmyadmin (or whatever you use to manipulate your DB), search ORDER_EDITOR_PAYMENT_DROPDOWN, ORDER_EDITOR_USE_SPPC, ORDER_EDITOR_CREDIT_CARD, INV_SAVE and SAVE_FOLDER and and change the entries for configuration_group_id from 911 to 912.
     
    4. You must have a very BIG store logo. You're the first whose logo does not fit in the space provided. :P If you don't want to reduce the size of your logo, you can change the position of the address label. Open invoice_editor_pdf.php and invoice_pdf.php and find the following code:
    // Adressfeld mit Absender und Rechnungsanschrift
    $pdf->SetX(0);
    $pdf->SetY(45); /// horizontal position address label
    $pdf->SetFont('Arial','u',7);
    $pdf->SetTextColor(0);
    $pdf->Text(20,40, SHOPBETREIBER . ' • ' . SHOPSTRASSE . ' • ' . SHOPSTADT); ///horizontal position address headline
    $pdf->SetFont('Arial','',10);
    $pdf->SetTextColor(0);
    $pdf->Cell(15);
    $pdf->MultiCell(70, 4, $anrede . tep_address_format($order->billing['format_id'], $order->billing, '', '', "\n"),0,'L');
     
    If you increase the values at the marked positions, the address label will slide down. You'll probably have to try a little bit to find the appropriate values ​​for you. If necessary, execute these changes also in the packingslip_editor_pdf.php and packingslip_pdf.php.
     
    And last your "slightly related". If you have installed a guest checkout (Purchase without account - PWA??), the guest customer should not get at all a backlink to his - non-existent - order history. With PWA it's a simple piece of code added to the checkout_process.php:
     
    if (!$order->customer['is_dummy_account']) {
    $email_order .= EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" ;
    }
     
    J.J.
  14. Like
    ArtcoInc reacted to Tsimi in Bootstrap 3 in 2.3.4 - Responsive from the Get Go   
    Where is the download link to @@wHiTeHaT s better menu?
×