Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default what's new random images - Scrolling sidebox

    Hi everyone,

    I found what is probably an old "what's new scrollbox". There is a bug in it that makes it where it does not scroll. Instead it just changes picture every "n" seconds. I'm not complaining about the scroll because I don't want it to scroll and I like the behavior just like it is. My problem is with the "random" selection of products. It only seems to get about 10 products and then repeats. Here is the code.

    // *** Get Parameters (check if defined, if not then fill with default values)
    $nfcount = @$params->count ? $params->count : "0"; // Count : 0=All / count=limit to <count> latest newsflash (most recent)
    $nfdelay = @$params->delay ? $params->delay : "6000"; // Delay : 1000 = 1 seconds
    $nfheight = @$params->height ? $params->height : "150"; // Height : 200px
    $nfborders = @$params->borders ? $params->borders: "0"; // borders: 1
    $nfpadding = @$params->padding ? $params->padding: "0"; // padding: 2
    $nfbgcolor = @$params->bgcolor? $params->bgcolor: ""; // bgcolor: #F0F0F0


    $random_product_query = "select products_id, products_image, products_tax_class_id, products_price
    from " . TABLE_PRODUCTS . "
    where products_status = '1'
    order by products_date_added desc
    limit " . MAX_RANDOM_SELECT_NEW;

    //var_export($random_product);

    $random_product = $db->Execute($random_product_query);

    $i = 0;
    while (!$random_product->EOF) {
    $whats_new_price = zen_get_products_display_price($random_product->fields['products_id']);
    $random_product->fields['products_name'] = zen_get_products_name($random_product->fields['products_id']);
    $random_product->fields['specials_new_products_price'] = zen_get_products_special_price($random_product->fields['products_id']);
    $title = BOX_HEADING_WHATS_NEW;
    $left_corner = false;
    $right_corner = false;
    $right_arrow = false;
    $title_link = FILENAME_PRODUCTS_NEW;
    $newsflashes[$i] = '<br /><center><a class="wnImage" href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '"><img src="' . DIR_WS_IMAGES . $random_product->fields['products_image']. '" alt="' . $random_product->fields['products_name'] . '" width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" style="border:1px outset #000000" onmouseover="myHint.show(\'TT4\')" onmouseout="myHint.hide()" />' . '</a><br /><a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product->fields['products_id']) . '">' . $random_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</center>';
    $i++;
    $random_product->MoveNext();
    }

    Does anyone know how to fix the number of products that the module is showing? Like I said, it only shows about 10 products then repeats.

    I would appreciate any help.
    thanks

  2. #2
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Re: what's new random images not working well

    Everything is fixed now.... the fix is in the admin section.

    thanks for looking everyone.

 

 

Similar Threads

  1. New Products Scrolling Sidebox
    By tjrayner in forum General Questions
    Replies: 2
    Last Post: 19 Aug 2010, 05:33 PM
  2. Scrolling Whats New Sidebox
    By sn0ut in forum Addon Sideboxes
    Replies: 29
    Last Post: 21 Feb 2010, 09:19 PM
  3. Featured products in What's New scrolling sb!
    By moksha in forum Addon Sideboxes
    Replies: 2
    Last Post: 11 Jun 2008, 10:21 AM
  4. Scrolling What's new Sidebox
    By brimsjewelry in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 19 Sep 2007, 02:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg