show_owned_category_list(true); } else { if ((!isset($hide_dropdown) || $hide_dropdown == false) && (isset($show_list) && $show_list) && (!isset($_GET['cat']) || $_GET['cat'] == '') && (!isset($show) || $show == '')) { show_owned_category_list(); } } if (!isset($status)) { echo '<p style="color: red;">ERROR: <code>$status</code> is not set.</p>'; return; } if (isset($_GET['cat']) && $_GET['cat'] != '' || isset($show) && $show != '') { // get fanlistings under that category, and depending on $status $ids = array(); if (isset($_GET['cat']) && $_GET['cat'] == 'all' || isset($show) && $show == 'all') { echo '<p class="show_owned_where_you_are">Showing all ' . $status . ' fanlistings...</p>'; $ids = get_owned($status); } else { if (isset($_GET['cat']) && $_GET['cat'] != 'all' || isset($show) && $show != 'all') { $catid = 0; if (isset($_GET['cat']) && ctype_digit($_GET['cat'])) { $catid = clean($_GET['cat']); } else { if (isset($show)) { $catid = $show; } } if ($ancestors = array_reverse(get_ancestors($catid))) { // get ancestors $text = ''; foreach ($ancestors as $a) { $text .= get_category_name($a) . ' > ';
$db_link = mysql_connect($db_server, $db_user, $db_password) or die(DATABASE_CONNECT_ERROR . mysql_error()); mysql_select_db($db_database) or die(DATABASE_CONNECT_ERROR . mysql_error()); if ($query != '') { // if there IS a query $result = mysql_query($query); if (!$result) { log_error(__FILE__ . ':' . __LINE__, 'Error executing query: <i>' . mysql_error() . '</i>; Query is: <code>' . $query . '</code>'); die(STANDARD_ERROR); } while ($row = mysql_fetch_array($result)) { $collective_total_fans_approved += $row['rowcount']; } } // collective total fans (pending) $collective_total_fans = 0; $ownedarray = get_owned('current'); $query = ''; foreach ($ownedarray as $o) { $info = get_listing_info($o); $table = $info['dbtable']; $dbserver = $info['dbserver']; $dbdatabase = $info['dbdatabase']; $dbuser = $info['dbuser']; $dbpassword = $info['dbpassword']; if ($dbserver != $db_server || $dbdatabase != $db_database || $dbuser != $db_user || $dbpassword != $db_password) { // if not on same database, get counts NOW $db_link = mysql_connect($dbserver, $dbuser, $dbpassword); if ($db_link === false) { continue; } // if it can't be accessed; if not, skip this one
} if ($show_default) { ?> <div class="submenu"> <?php echo $listing ? '<a href="emails.php?action=members&id=' . $listing . '">Email</a>' : ''; ?> </div> <form action="members.php" method="post"> <p class="right"> Manage: <select name="id"> <option value="">All pending members</option> <?php $owned = get_owned('current'); // all current owned foreach ($owned as $id) { $info = get_listing_info($id); echo '<option value="' . $id; if ($id == $listing) { echo '" selected="selected'; } echo '">' . $info['subject'] . ' ' . $info['listingtype'] . ' </option>'; } ?> </select> <input type="submit" value="Manage" /> </p> </form>
if (isset($_GET['dosearch'])) { if ($_GET['search'] == '') { $ids = get_owned($_GET['status'], $start, 'bydate'); $total = count(get_owned($_GET['status'])); } else { // search! $status = ''; if (isset($_GET['status'])) { $status = $_GET['status']; } $ids = search_owned($_GET['search'], $status, $start); $total = count(search_owned($_GET['search'], $status)); } } else { $ids = get_owned('all', $start, 'bydate'); $total = count(get_owned()); } ?> <table> <tr><th> </th> <th>ID</th> <th>Title</th> <th>Subject/URL</th> <th>Category</th> <th>Image</th> <th>Action</th> </tr> <?php $shade = false; foreach ($ids as $id) { $info = get_listing_info($id);
echo $listing == 'collective' ? 'affiliates.php?action=template' : "owned.php?action=edit&id={$listing}&type=templates"; ?> ">Template</a> <a href="emails.php?action=affiliates&id=<?php echo $listing; ?> ">Email</a> </div> <form action="affiliates.php" method="get"> <p class="right"> Manage: <select name="listing"> <option value="collective">Collective affiliates</option> <?php $owned = get_owned(); foreach ($owned as $id) { $own = get_listing_info($id); if ($own['affiliates'] == 1) { echo '<option value="' . $id; if (isset($_REQUEST['listing']) && $_REQUEST['listing'] == $id) { echo '" selected="selected'; } echo '">' . $own['subject'] . ' ' . $own['listingtype'] . ' affiliates </option>'; } } ?> </select> <input type="submit" value="Manage" /> </p></form>