Execute($recent_order_query); if ($box_recent_order->RecordCount() > 0 ) { $content=''; $recent_order=''; while (!$box_recent_order->EOF) { $link = zen_href_link(zen_get_info_page($box_recent_order->fields['products_id']), 'products_id=' . $box_recent_order->fields['products_id']); $image = zen_image(DIR_WS_IMAGES . $box_recent_order->fields['products_image'], $box_recent_order->fields['products_name'], 50, 50); $name = zen_trunc_string($box_recent_order->fields['products_name'],30); $price = zen_get_products_display_price($box_recent_order->fields['products_id']); $date_purchased =$box_recent_order->fields['date_purchased']; $recent_order .= '
'.$image.'
'.substr_replace($box_recent_order->fields['customers_name'],str_repeat('*',strlen($box_recent_order->fields['customers_name'])-4),'1',strlen($box_recent_order->fields['customers_name'])-5).'
'. date("M d,Y",strtotime($date_purchased)).'
'; $box_recent_order->MoveNext(); } $total = $box_recent_order->RecordCount(); if ($total > 1) { //if more than one special product exists in the db then scrolling begins $content .= '
' . $recent_order .'
' . $recent_order .'
'; } elseif ($total == 1) { // If only one special product exists in the db then the box will remain static $content .= $recent_order; } echo $content; } ?>