  <?php
    require_once "cmsAdmin/lib/viewer_functions.php";

    // get favorite record nums
    $tableOrTag        = mysql_escape('listings');  // update this with your table or tag name
    $currentUserNum    = mysql_escape( @$CURRENT_USER['num'] );
    $favoriteNumsQuery = "SELECT recordNum FROM {$TABLE_PREFIX}_website_favorites WHERE tableOrTag = '$tableOrTag' AND createdByUserNum = '$currentUserNum'";

    // load matching records
    list($favoriteRecords, $favoriteMetaData) = getRecords(array(
      'tableName'     => 'listings', // update this with your table or tag name
      'perPage'       => '10',
      'where'         => " num IN ($favoriteNumsQuery) ",
      'loadCreatedBy' => false,
      'allowSearch'   => false,
    ));
  ?>
<html>
<head>
<title>View Favorite Listings</title>
</head>
<body>
  <h2>Favorites</h2>
  <?php foreach ($favoriteRecords as $record): ?>
    <?php
      $tableOrTag = 'news';          // Update with your section's table name
      $recordNum  = $record['num'];  // Update this with current record number
    ?>

    <div class="<?php wsf_cssClassFor($tableOrTag, $recordNum, 'remove'); ?>"
         style="<?php wsf_displayStyleFor($tableOrTag, $recordNum, 'remove'); ?>">
      <a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a> -
      <a href="#" onclick="<?php wsf_onClickFor($tableOrTag, $recordNum, 'removeAndReload'); ?>">Remove</a>
    </div>
  <?php endforeach; ?>

  <?php if (!$favoriteRecords): ?>
     You don't have any favorites yet.
  <?php endif; ?>
</body>
</html>