Quote Originally Posted by more-solutions
What I want to do is insert randomly into that listing two new images so that I end up with three columns of four "products". Those new images might say something like "click any image to view product information" or "welcome to my shop, please buy something!" (you get the idea).
OK, so there's a complete lack of interest here for this!

I have achieved what I set out to do with products, although with categories its a little harder. In case anyone is interested, what you need to do is:
  1. Create a file defining the image/text/html to use as a dummy, eg ~/includes/languages/english/extra_definitions/product_dummy_items.php:
    Code:
    <?php
    // defined as an image, text or a combination
    define('TEXT_PRODUCT_DUMMY_PRODUCT', zen_image(DIR_WS_TEMPLATE_IMAGES . 'dummyproduct.gif', 'Welcome to my shop!'));    
    ?>
  2. Add some code to ~/includes/modules/product_listing.php to insert the dummy images, ie insert immediately before this line
    Code:
    require($template->get_template_dir('tpl_modules_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_product_listing.php');
    this code
    Code:
    // MSL: Insert blanks into product list as required
      if (defined('TEXT_PRODUCT_DUMMY_PRODUCT')) {
          $rows = count($list_box_contents);
          $cols = count($list_box_contents[0]);
        //$cols = PRODUCT_LISTING_COLUMNS_PER_ROW;
          $lastrowcols = count($list_box_contents[$rows-1]);
          $insertcount = $cols - $lastrowcols;
          $totalcount = $rows * $cols;
          if ($insertcount) {
              // Reorder the items, inserting some blanks to make the rows complete
              $new_list_box_contents = array();
              foreach($list_box_contents as $r=>$row) foreach($row as $i=>$item) {
                  $new_list_box_contents[] = $item;
            // echo "if ($insertcount && (".rand(1,$totalcount)." > ".($totalcount-count($new_list_box_contents)-$insertcount).")) {";
                  if ($insertcount && (mt_rand(1,$totalcount) > ($totalcount-$insertcount-count($new_list_box_contents))*1.2)) {
                      $new_list_box_contents[] = array('align' => 'center',
                                                          'params' => 'class="productListing-data"',
                                                          'text'  => TEXT_PRODUCT_DUMMY_PRODUCT
                                                         );
                      $insertcount--;
                  }
              }
              $r = $i = 0;
              $list_box_contents = array();
              foreach($new_list_box_contents as $item) {
                  $list_box_contents[$r][$i++] = $item;
                  if ($i >= $cols) { $i = 0; $r++; }
              }
          }
        }
      // END: MSL: Insert blanks into product list as required


That should do the trick. If anyone uses or improves on this this let me know.