Jump to content

wizaard

Members
  • Content count

    23
  • Joined

  • Last visited

About wizaard

  • Birthday 08/22/1988

Profile Information

  1. wizaard

    Dynamic SiteMap

    When I've read my posted hint (Fixed cPath in class category_tree.php (Dynamic Site Map v 2.00)) I found out that it would be nice to give you better explanation what it does. So... the original version of Dynamic SiteMap v 2.00 outputs links of categories using "index.php?cPath=ID" mask but it's not very suitable and compatible with breadcrumbs and/or category list box. BUT when you use my fix, you'll get the right and well-working links like this: "index.php?cPath=(Parent ID 1)_(Parent ID 2)..._(Parent ID X)_(Current category ID)" which is the correct one.
  2. wizaard

    Dynamic SiteMap

    Fixed cPath in class category_tree.php (Dynamic Site Map v 2.00) If you want to have category links to be suitable and compatible with breadcrumb and other contribs (like some categories box enhancments and similar), which means to have complete links including the parent categories, you just need to make these few minor changes included below. AUTHORS: wizaard (if) and funous (the others) ;) HOW TO? CHANGES TO catalog/includes/classes/category_tree.php REPLACE: function buildBranch($parent_id, $level = 0) { WITH: function buildBranch($parent_id, $level = 0, $p_category_link = false) { ADD BELOW FOREACH FUNCTION (around line 23): if ($parent_id == '0') { $category_link = $category_id; } else { $category_link = $p_category_link . '_' . $category_id; } REPLACE: $result .= $this->buildBranch($category_id, $level+1);} WITH: $result .= $this->buildBranch($category_id, $level+1, $category_link);} THE END, ENJOY
  3. wizaard

    Graphical Borders on RSS News

    And (as it's ussual about me) I need to add something to the previous hind. When I read the post again I found out that I forgot to mention exactly what the hint actually does. So... If you've applied the graphical borders as the downloadable guide says, you must have discovered that if you have no featured products, the box (table) in the middle doesn't disappear. When you apply my code (catalog/includes/module/featured.php) it will behave correctly and will even have the link in the heading (I have translated the title and alt of the image into English but if you want you can connect it to the lang files).
  4. wizaard

    Graphical Borders on RSS News

    And the last hint I "created" today is about "featured products" addon (contrib) - I tested it on the featured products version 1.5.8 but I think it should work in almost all versions... It's simple - you can download a step by step guide how to add the graphical borders 2.1 to featured products (and to other contribs). I did it as the guide says but found out that the featured products table in the middle doesn't dissapear if the graphical borders are applied after the guide. I looked into the PHP file after installing the borders (includes/modules/featured.php) and changed the original one to work properly. It's absolutely simple and easy (notice that I'm not a PHP programmer). The file should look like this (just copy and overwrite the whole code if you want): <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Featured Products V1.1 Displays a list of featured products, selected from admin For use as an Infobox instead of the "New Products" Infobox */ ?> <!-- featured_products //--> <?php if(FEATURED_PRODUCTS_DISPLAY == 'true') { $featured_products_category_id = $new_products_category_id; $cat_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $featured_products_category_id . "' limit 1"); $cat_name_fetch = tep_db_fetch_array($cat_name_query); $cat_name = $cat_name_fetch['categories_name']; $info_box_contents = array(); if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) { // by wizaard $gh_heading = TABLE_HEADING_FEATURED_PRODUCTS . " <a href=\"featured_products.php\"><img src=\"images/infobox/arrow_right.gif\" border=\"0\" title=\"Show all...\" alt=\"Show all...\"></a>"; // end by wizaard $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); list($usec, $sec) = explode(' ', microtime()); srand( (float) $sec + ((float) $usec * 100000) ); $mtm= rand(); $featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } else { // by wizaard $gh_heading = TABLE_HEADING_FEATURED_PRODUCTS . " " . $cat_name; // end by wizaard $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name)); $subcategories_array = array(); tep_get_subcategories($subcategories_array, $featured_products_category_id); $featured_products_category_id_list = tep_array_values_to_string($subcategories_array); if ($featured_products_category_id_list == '') { $featured_products_category_id_list .= $featured_products_category_id; } else { $featured_products_category_id_list .= ',' . $featured_products_category_id; } $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_FEATURED . " f on p.products_id = f.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS); } $row = 0; $col = 0; $num = 0; while ($featured_products = tep_db_fetch_array($featured_products_query)) { $num ++; if ($num == 1) { //new contentBoxHeading($info_box_contents); } $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']); if($featured_products['specstat']) { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>'); } else { $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id']))); } $col ++; if ($col > 2) { $col = 0; $row ++; } } if($num) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php echo mws_header($gh_heading); ?> <td> <?php new noborderBox($info_box_contents); ?> </td> <?php echo mws_footer(''); ?> </tr> </table> <?php } } else // If it's disabled, then include the original New Products box { // include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); // disable for dont show if desactive the feature module } ?> <!-- featured_products_eof //--> And it works, and it's easy and much smarter than the original version (I can't write PHP scripts but this was absolutely easy - the whole idea is just about to find the exact part of the code that calls for showing the box). Enjoy.
  5. Thanks for info but I checked these thousand times before and everything was correct. But SHAME ON ME because I discovered the whole problem and the worst thing is that it was my fault, everything works now. I didn't create the imagecache folder by myself but let it to be created by the script, what my server didn't want to accept (actually there was some problem with ownership of the folder in fact), I remembered that something similar had happened to me some time ago, so I deleted the imagecache folder and created a new one and what happened? Everything has worked since I did it. So SHAME ON ME again and sorry for the stupid posts and problems. :blush:
  6. wizaard

    Graphical Borders on RSS News

    You're welcome. Anyway I forgot to mention how to fix an error you've certainly found out - the "new products" box has different borders on the top and on the bottom... how is that possible? A/ BORDERS AS THE BOXES (with darker shadow inside): echo mws_header_main($titulo); replace with echo mws_header($titulo); B/ BORDERS AS THE MAIN PAGES (with no shadow inside) <?php echo mws_footer(''); ?> replace with <?php echo mws_footer_main(''); ?> USEFUL ADVICE: Notice that if you use the... echo mws_header_main(''); <?php echo mws_footer_main(''); ?> ...you get the borders for MAIN pages (with no shadow inside in your case, actually it was developed to distinguish the boxes that need headign as the Windows windows ;) and the boxes used for info pages and so on with no heading in the header stripe). Then, naturally, if you use the... echo mws_header(''); <?php echo mws_footer(''); ?> ...you get the borders with heading stripe (bkg of title).
  7. wizaard

    Graphical Borders on RSS News

    ******************************************************************************** ***************** * * 6) OPEN file: * * catalog/includes/modules/new_products.php * * NOTE: THE NEXT MODIFICATION 6.1, 6.2 AND 6.3 * IS FOR DISPLAY THE "NEW PRODUCTS IN MONTH..." MODULE * WITH A GRAPHIC ROUNDED BORDERS. * * IF YOU WANT TO DISPLAY THE PRODUCTS OF THIS MODULE * IN INDIVIDUAL BOXES THEN DONT DO STEPS 6.1, 6.2 AND 6.3 * AND USE FOR THIS FILE THE CONTRIBUTION: * Individual boxes for products in central modules * http://www.oscommerce.com/community/contributions,4491 * ******************************************************************************** ***************** * * * 6.1. Open File and Find: * <!-- new_products //--> * * ADD AFTER: * <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <?php $titulo = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')); echo mws_header_main($titulo); ?> <td> * * INCLUDE FIX: fix to display the month in the title of module. Fix by OSdave * (http://oscommerce.qadram.com/modules.php?name=Forums&file=profile&mode=viewprofile&u=5673) * * * 6.2. FIND: * <!-- new_products_eof //--> * * ADD BEFORE: * </td> <?php echo mws_footer(''); ?> </tr> </table> * * 6.3. FIND: * new contentBoxHeading($info_box_contents); * * REPLACE With: * // new contentBoxHeading($info_box_contents); * * ***************************************************************************** * * 7) FOR DONT DISPLAY THE DEFAULT BORDERS OF MODULE "NEW PRODUCTS ON MONTH...": * * ***************************************************************************** * * 7.1. OPEN file: * catalog/includes/classes/boxes.php * * and ADD at botton of file before ?>: * // Graphical Borders class noborderBox extends tableBox { function noborderBox($contents) { $this->table_cellpadding = '0'; $this->table_cellspacing = '3'; $this->table_data_parameters = 'class="noborderBox"'; $this->tableBox($contents, true); } } // Graphical Borders - end modification
  8. No, of course not, I was answering the original task - to add the lightbox support for images in reviews. The thing you want to do is a little bit more complicated and I'm not able to help you with that. Anyway the hint I sent about implementation of the lightbox into reviews is (in my point of view) quite useful for some people. Now back to my answer - of course I went through the install process step by step again but in fact I haven't almost changed any files, most of them I directly uploaded because I made no changes in them before. I was talking with the hosting support technician and he said it might be a problem of safe mode, so they try to turn it off and then we'll see. But it would be really bad and I would be very sad if it doesn't work :(.
  9. And I do have a question too... I installed this contrib (with the thumbnails and so on by matrix france), everything seems to be OK (the CSS "popup" is great, uploading of images works) BUT the thumbs aren't shown (image doesn't exist, which is true) - the folder is there, it's chmod 777 but nothing's ever inside. No images, no files. How is that possible? Just look at it - http://eshop.e78.cz/product_info.php?products_id=50 . Is anyone able to help? :'(
  10. ADDITION TO MY PREVIOUS MESSAGE: In the product_reviews_info.php file, the replacing code is not the same as in the other two files because this PHP uses another name of picture function (it uses $review['products_image'] instead of $product_info['products_image'] ), so it's necessary to change the replacing code: <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $review['products_image']) . '" rel="lightbox[roadtrip]">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $review['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript>
  11. Simple... :) Edit these files: product_reviews.php, product_reviews_info.php and product_reviews_write.php as it's mentioned below... 1) add this to the HEAD (under "link rel stylesheet"): <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="js/lightbox.js"></script> 2) Replace: Find: <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $review['products_image'], addslashes($review['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $review['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> Replace with: <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" rel="lightbox[roadtrip]">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_WIDTH), (MOPICS_RESTRICT_PARENT=='false'?'':SMALL_IMAGE_HEIGHT), 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> AND IT'S DONE... upload the files and enjoy ;)
  12. wizaard

    Ajax advanced and box search v1.0

    I found out the problem - wrong database collation was set. Before it was cp1250_czech_cs, now it's cp1250_general_ci. Thx.
  13. wizaard

    [Contribution] Additional Images Module

    Yes, that's it, exactly ;). But besides that I have even the problem with writing permitions to the folderi even though they're 777.
  14. wizaard

    [Contribution] Additional Images Module

    First I have to thank the author of this amazing contrib - it's really great. I installed the contrib today and (unfortunately and probably by my mistake) I'm having difficulties. I'll try to explain what's the problem and I hope someone will be able to help me. 1/ I have the same problem as David427. I mean that the main picture for each product isn't shown, it's shown just as text with no image and after clicking the text and launching the popup the image's shown. In the admin section, the adress of the picture is shown like this: /var/www/web5/e78.cz/tmp/phpgYzz9r but when browsing the catalog as a normal visitor, the picture is not shown (of course because it doesn't exist) but the adress is correct (I mean: http://eshop.e78.cz/images/products/Vapor betony.jpg) Now I found out that this happens only when I use the "generate now" function, but when I add the file manually, everything's fine. The other two images are always OK (even when I use "generate now" but the main image is never created and the adress /var/www/web5/e78.cz/tmp/phpgYzz9r doesn't exist of course). 2/ When the contrib tries to create a directory, it always makes an error that it couldn't be created even though the images directory is chmod 777. These two problems really bother me. I even checked the config files but found no mistake.
  15. I installed the "Ajax advanced and box search v1.0" (Original contribution by Assembler, Modified and addapted by Joop) contribution (from contribution site) but I have difficulties with this contrib. Everything works fine but this contrib would need some little improvements - they're 2 exactly: 1) The contrib is case-sensitive, what's wrong and should work as non-case-sensitive search. 2) The contrib doesn't support other languages' special characters (in my case central Europe - Czech Republic - ěščř etc.) and thus works bad when using MSIE. I haven't changed the code of course, so if anyone is able to help me with fixing these disadvantages I would be glad. Thanx
×