Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

heranke

Pioneers
  • Posts

    13
  • Joined

  • Last visited

Everything posted by heranke

  1. Dear Jack, thanks you for such a useful contribution. After setting up I got some trouble with the file permissions of 2 files: admin/sitemonitor_configure_0.txt and admin/includes/functions/sitemonitor_functions.php. Setting them to 0644 and all works like a charm. So far so good. If I am returning to SiteMonitor (adminside) say a few minutes later and select one of he both menupoints, its giving me a permission error. Checking with ftp shows, permissions of both above mentioned files had been set to 0200 which is real disturbing. As soon as I reset them manually back to 0644 all turns good again. I got no idea why and where the permissions are being set. Could you please give a hint? Kind Regards, heranke
  2. Dear Jack, Finally I broke down the trouble with the closing divs to one single problem: The last row beeing drawn has to be closed and how to do that depends from beeing at the end of the row or not. Changes made: Moved the count out of the foreach element for performance. Moved one closing div after the foreach to close the <div id="tagcloud"> opened in front of the foreach element. New variables: $htsTagsArrayCount (bearing the total number of elements of $htsTagsArray) $htsTagsArrayElement (actual element beeing processed) This version takes account for your code structure. catalog/includes/headertags_seo_tagcloud_footer.php <?php /* $Id$ header_tags_tag_cloud Originally Created by: Jack_mcs osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Portions Copyright 2011 oscommerce-solution.com Released under the GNU General Public License */ include_once(DIR_WS_FUNCTIONS . 'header_tags.php'); // $maximum is the highest counter for a search term $hts_tags_query = tep_db_query("select keyword, counter from " . TABLE_HEADERTAGS_KEYWORDS . " where keyword is not null and keyword != '' and found = 1 and language_id = " . (int)$languages_id . " ORDER BY counter DESC LIMIT 20"); if (tep_db_num_rows($hts_tags_query)) { $maximum = 0; while ($hts_tags = tep_db_fetch_array($hts_tags_query)) { if ($hts_tags['counter'] > $maximum) { $maximum = $hts_tags['counter']; } $htsTagsArray[] = array('keyword' => $hts_tags['keyword'], 'counter' => $hts_tags['counter']); } shuffle($htsTagsArray); $htsTagsArrayCount = count($htsTagsArray); $colCtr = ''; $htsTagsArrayElement = ''; $content = '<div id="tagcloud">'; foreach ($htsTagsArray as $kword) { // clean start a row if ($colCtr == 0) {$content .= '<div style="text-align:center;">';} // determine the popularity of this term as a percentage $percent = floor(($kword['counter'] / $maximum) * 100); // determine the size for this term based on the percentage if ($percent < 20) { $class = 'smallest'; } elseif ($percent >= 20 and $percent < 40) { $class = 'small'; } elseif ($percent >= 40 and $percent < 60) { $class = 'medium'; } elseif ($percent >= 60 and $percent < 80) { $class = 'large'; } else { $class = 'largest'; } if (! tep_not_null(($hstLink = GetHTSTagCloudLink($kword['keyword'], $languages_id)))) { continue; } $content .= '<span class="' . $class . '"><a style="color:#000;" href="' . $hstLink . '">' . ucwords(stripslashes($kword['keyword'])) . '</a> </span>'; $colCtr++; // closing at the end of a row if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div>'; } // closing a row if we are inmid $htsTagsArrayElement++; if ($htsTagsArrayElement==$htsTagsArrayCount) { if ( $colCtr <> 0) { $content .= '</div>'; } } // debug bof, e=element, max=total elements of array, c=column #echo $htsTagsArrayElement . 'e' . $htsTagsArrayCount . 'max' . $colCtr . 'c' . ' / '; // debug eof } $content .= '</div>'; echo '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading"><span>' . BOX_HEADING_HEADERTAGS_TAGCLOUD . '</span></div>' . ' <div class="ui-widget-content ui-corner-bottom infoBoxContents" style="padding-top:10px; text-align:center; color:#fff;">' . $content . '</div>' . '</div>'; } ?> Fontsizing keywords by weighted factors. I love it. After a day studying only one module of your work I got a slightly impression how much efforts you are putting in to bring this all to us. Thank you so much. I consider it done so i posted the whole page. Hope its not to annoying. Kind Regards heranke
  3. Hello again, added a debug display and figured it out. catalog/includes/headertags_seo_tagcloud_footer.php is now closing right. Using tools showing the structure is fine. It would be interesting to know if someone else is experiencing the same problem with the tagcloud. Here it is: catalog/includes/headertags_seo_tagcloud_footer.php $colCtr = ''; $htsTagsArrayCtr = ''; $content = '<div id="tagcloud">'; foreach ($htsTagsArray as $kword) { // clean start a row if ($colCtr == 0) {$content .= '<div style="text-align:center;">';} // determine the popularity of this term as a percentage $percent = floor(($kword['counter'] / $maximum) * 100); // determine the size for this term based on the percentage if ($percent < 20) { $class = 'smallest'; } elseif ($percent >= 20 and $percent < 40) { $class = 'small'; } elseif ($percent >= 40 and $percent < 60) { $class = 'medium'; } elseif ($percent >= 60 and $percent < 80) { $class = 'large'; } else { $class = 'largest'; } if (! tep_not_null(($hstLink = GetHTSTagCloudLink($kword['keyword'], $languages_id)))) { continue; } $content .= '<span class="' . $class . '"><a style="color:#000;" href="' . $hstLink . '">' . ucwords(stripslashes($kword['keyword'])) . '</a> </span>'; $colCtr++; // clean close a row if max per row is reached if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div>'; } // closing div $htsTagsArrayCtr++; $htsTagsArrayMax = count($htsTagsArray); // debug, e=element, max=total elements of array, c=column #echo $htsTagsArrayCtr . 'e' . $htsTagsArrayMax . 'max' . $colCtr . 'c' . ' / '; // solution 1: compact #if ($htsTagsArrayCtr==$htsTagsArrayMax && $colCtr == 0) {$content .= '</div>';} #elseif ($htsTagsArrayCtr==$htsTagsArrayMax) {$content .= '</div>' . '</div>';} // solution 2: structured if ($htsTagsArrayCtr==$htsTagsArrayMax) { // if last element of array is reached if ($colCtr == 0) { // and we hit max element per row $content .= '</div>';} // last row alrdy closed (row 62), close id="tagcloud" (row 31) else { // else we are inmid the row $content .= '</div>' . '</div>'; // close last row and close id="tagcloud" (row 31) } } } Last comments and debug can be deleted without problems. There are 2 solutions where I consider the second as more clear. Best Regards heranke
  4. Hey Jack, thank you for your reply. After rethinking post 7204, it turns out, if last keyword hits exactly the max elements per row (HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) it would send you a row with <div style="text-align:center;"></div> which is empty. Tested and confirmed. So recycle post 7204. Next step: Simply adding 2 closing divs, as suggested, may be the solution, but it fall short and could end up in having a row like described above. One don't need 2 closing divs in any case. Depending from last element of array and if it is hitting the max per row. Solution: Clean start and close the div's within foreach element and catch the 2 cases where 1 or 2 closing divs are needed. in catalog/includes/headertags_seo_tagcloud_footer.php FIND $colCtr = ''; $content = '<div id="tagcloud"><div style="text-align:center;">'; foreach ($htsTagsArray as $kword) { // determine the popularity of this term as a percentage $percent = floor(($kword['counter'] / $maximum) * 100); // determine the size for this term based on the percentage if ($percent < 20) { $class = 'smallest'; } elseif ($percent >= 20 and $percent < 40) { $class = 'small'; } elseif ($percent >= 40 and $percent < 60) { $class = 'medium'; } elseif ($percent >= 60 and $percent < 80) { $class = 'large'; } else { $class = 'largest'; } if (! tep_not_null(($hstLink = GetHTSTagCloudLink($kword['keyword'], $languages_id)))) { continue; } $content .= '<span class="' . $class . '"><a style="color:#000;" href="' . $hstLink . '">' . ucwords(stripslashes($kword['keyword'])) . '</a> </span>'; $colCtr++; if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div><div style="text-align:center;">'; } } REPLACE WITH $colCtr = ''; $htsTagsArrayCtr = ''; $content = '<div id="tagcloud">'; foreach ($htsTagsArray as $kword) { // clean start a row if ($colCtr == 0) {$content .= '<div style="text-align:center;">';} // determine the popularity of this term as a percentage $percent = floor(($kword['counter'] / $maximum) * 100); // determine the size for this term based on the percentage if ($percent < 20) { $class = 'smallest'; } elseif ($percent >= 20 and $percent < 40) { $class = 'small'; } elseif ($percent >= 40 and $percent < 60) { $class = 'medium'; } elseif ($percent >= 60 and $percent < 80) { $class = 'large'; } else { $class = 'largest'; } if (! tep_not_null(($hstLink = GetHTSTagCloudLink($kword['keyword'], $languages_id)))) { continue; } $content .= '<span class="' . $class . '"><a style="color:#000;" href="' . $hstLink . '">' . ucwords(stripslashes($kword['keyword'])) . '</a> </span>'; $colCtr++; if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div>'; } // closing div $htsTagsArrayCtr++; $htsTagsArrayMax = count($htsTagsArray); if ($htsTagsArrayCtr==$htsTagsArrayMax) { //if last element of array is reached if ($colCtr == 0) { // last element of array = max element per row $content .= '</div>';} // we need one closing div for id="tagcloud" (row 31), last row already closed (row 62) else { //last element of array is < max element per row (since row 60 not met) $content .= '</div>' . '</div>'; // we need two closing div: close last row and close id="tagcloud" (row 31) } } } Comments can be removed without trouble. Checked for 7,8,9,15,16,17 keywords with 8 as maximum per row. Working as intended. Please recheck and proof if $htsTagsArrayCtr, $htsTagsArrayMax can be used without causing trouble. Not lucky with last if clause ($colCtr == 0), should be something like ($htsTagsArrayCtr==HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT). Have to figure out. Kind Regards heranke
  5. First and foremost: Thank you for this hot work! Just updated from 3.2.9 to 3.3.0 and recognized after turning "Display Tag Cloud" to true, you have added the header for the tag cloud. Cuuuute. Thanks again. After some examination of source code of entire page (since it disturbs my structure in footer.php) it looks like there are 2 closing div's missing. 1. closing div if last element of last row is reached (of $content) 2. closing div for id="tagcloud" (of $content) Solution: Add the 2 missing div if last element of array is reached within foreach element in catalog/includes/headertags_seo_tagcloud_footer.php FIND: if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div><div style="text-align:center;">'; } } REPLACE WITH if ($colCtr >= HEADER_TAGS_TAG_CLOUD_COLUMN_COUNT) { $colCtr = 0; $content .= '</div><div style="text-align:center;">'; } // closing div if last element of last row is reached (of $content) // closing div for id="tagcloud" (of $content) $htsTagsArrayCounter+=1; $htsTagsArrayMax = count($htsTagsArray); if ($htsTagsArrayCounter==$htsTagsArrayMax) { $content .= '</div>' . '</div>'; } } The counter should be resetted in front of mentioned foreach element like: $htsTagsArrayCounter=0; I don't know for sure if this is necessary but think its sound to prevent any trouble and to ensure a correct startvalue. Advise is appreciated. Hope it will help. Kind Regards heranke
  6. Ok, found $order->info['tax'] is showing the amount of taxes. And the following code works so far: if ($order->info['tax']==0){ echo ' <tr>' . ' <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . ' <tr>' . "\n" . ' <td>' . TEXT_ORDER_TAX_HINT . '</td>' . "\n" . ' </tr>' . "\n" . ' </table></td>' . ' </tr>'; } Any ideas to achieve this by the 1st preferred way? Regards heranke
  7. Thanx Chris for your reply. At first sight this solution should do the job. I will have a try and report back. Since all means should be on board with osc stock functions there should be a simpler solution. I imagine there are to ways: 1. direct way: Looking for the country the customer is sitting. if(country!=EU){show info} 2. indirect way: Looking for the calculated taxes. Assuming it has positive value in case of EU, and zero value otherwise. if(taxes==0){show info}. The first way should be preferred. What I am wondering is, if i add some products to the cart and do the checkout until checkout_confirmation.php it shows the calculated taxes correctly. checkout_confirmation.php shows <?php if (MODULE_ORDER_TOTAL_INSTALLED) { echo $order_total_modules->output(); } ?> Since total values are encapsuled within output() I cant reach the variable for the tax. Is there a way to break it down again? I am not that familiar with the totalling modules yet. I guess this is beeing calculated in ot_tax.php? Is there a guide for the totalling mechanism? For the archive: Implementing this for sure and be on the bright side.
  8. Zone for EU is implemented. No trouble with tax calcs. Which variable do I have to use for check against zone? This is the point I need help. [information] If the customers is within EU taxes are positiv and shown. I looked at ot_tax.php, ot_total.php, order.php, order_total.php even checkout_process.php assuming it should be there. And I tried different variables with no success for now.
  9. Dear Community, [Description] Since changes in law from 08/2012 there is the need to show information about tax and duty-regulations IF (AND ONLY IF) the customers is sitting outside the EU and want to ship it there. (See http://www.haendlerbund.de/hinweisblaetter/finish/1-hinweisblaetter/99-button-loesung.pdf) Showing an information box on checkout_confirmation.php isnt a problem but: Since it shoud only show up if the customers shipping adress is Non-EU I need an if(customer is NON-EU)-clause. Alternatively an if(total_tax>0)-clause should work either. [Question] I am searching a variable to make the show-up-information-box depend from shipping adress or total-tax that can be used within checkout_confirmation.php. Any ideas? Regards heranke Here is what I got (~/catalog/checkout_confirmation.php). Yes, there are XXX. <?php if (XXX){ echo ' <tr>' . ' <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . ' <tr>' . "\n" . ' <td>' . TEXT_ORDER_TAX_HINT . '</td>' . "\n" . ' </tr>' . "\n" . ' </table></td>' . ' </tr>'; } ?>
  10. Dear kymation, dear community, In the following file: catalog/admin/banner_manager.php Found a small misspelling in line 140: if (function_exists('imagecreate') && tep_not_null($banner_extensio)) { Assume it should be: if (function_exists('imagecreate') && tep_not_null($banner_extension)) { All credits to the author. Like the feature. Kind Regards heranke
  11. Since I like to use the product pictures as links instead of popup the images i added a switch to V2.04 (added from surfalot on 4 Aug 2009): LOOK FOR (Line 7): $show_original_prices = true; // show original prices of the products ADD STRAIGHT AFTER: $show_images_as_links = true; // show images as links instead of popup the image REPLACE (Lines 83-89): <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php WITH THIS: <?php #show images as link ... if ($show_images_as_links) { echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . ' ' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>';} else { #... instead of popup the image ?><script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php } AND REPLACE (Lines 126-132) FOR THE SECOND PICTURE: <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php WITH THIS: if ($show_images_as_links) { echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . ' ' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?> </noscript> <?php } All credits to the author for this nice contrib. And also credits to the community for this interesting discussion. Sincerely, heranke.com
×
×
  • Create New...