0) { return mysql_fetch_assoc($result); } else { return false; } } function getTrackerCategoriesFromParent($categories, $parentcat) { foreach ($categories as $category) { if ($category['parent'] == $parentcat && $category['catid'] != 0) { $retval[$category['catid']] = $category; } } return $retval; } function getTrackerCategoryPath($categories, $cat, $recurse = false) { if ($cat == 0) { return ($recurse) ? 'Newstrackers' : 'Newstrackers'; } else { return getTrackerCategoryPath($categories, $categories[$cat]['parent'], true) . ' > ' . (($recurse) ? ('' . uncheck($categories[$cat]['name']) . '') : uncheck($categories[$cat]['name'])); } } function displayTrackerCategories($subcategories, $parentcat = 0) { if ($parentcat == '') $parentcat = 0; $count = count($subcategories); if ($count > 0) { $index = 0; echo '' . (($parentcat == 0) ? 'C' : 'Subc') . 'ategories:'; echo ''; foreach ($subcategories as $category) { $index++; echo ''; echo ''; } echo '
' . uncheck($category['name']) . '' . (($category['visible'] == 'N') ? ' (hidden)' : '') . '
'; echo uncheck($category['description']); echo '


'; } return $count; } function displayTrackers($cat = 0) { global $DBlink, $isMod, $loggedInUser; if ($cat == '') $cat = 0; if (!isset($_COOKIE['trackersortby'])) $sortby = 'added'; else $sortby = $_COOKIE['trackersortby']; if (!isset($_COOKIE['trackerorder'])) $order = 'DESC'; else $order = $_COOKIE['trackerorder']; $query = 'SELECT * FROM wbtrackers,wbusers WHERE submitter=userid AND cat=' . $cat . ' ORDER BY ' . $sortby . ' ' . $order; $result = @mysql_query($query, $DBlink); $count = 0; if (@mysql_num_rows($result) > 0) { echo ""; echo ''; while ($row = mysql_fetch_assoc($result)) { if ($count > 0 && $count % 2 == 0) echo ''; $postres = @mysql_query('SELECT COUNT(*) AS aantal FROM wbposts WHERE type=2 AND threadid=' . $row['trackerid'], $DBlink); $postrow = mysql_fetch_assoc($postres); echo ''; $count++; } if ($count % 2) echo ''; echo '
'; echo '
Open Tracker in WinBar ' . htmlspecialchars(uncheck($row['trackername'])) . ' - added by ' . htmlspecialchars(uncheck($row['username'])) . ' on ' . makeDate($row['added']); echo ' 
Description: ' . htmlspecialchars(uncheck($row['about'])) . '
Website: ' . htmlspecialchars(uncheck($row['site'])) . ' - Downloads: ' . $row['downloads']; echo '
[ ' . (($postrow) ? $postrow['aantal'] : '?') . ' reaction' . (($postrow['aantal'] == 1) ? '' : 's') . '' . (($isMod || ($loggedInUser['userid'] == $row['userid'])) ? ' | Edit | Delete' : '') . ' ]
'; echo '
 
'; } return $count; } function findTrackers($find, $order) { global $DBlink, $isMod, $loggedInUser; $query = 'SELECT * FROM wbtrackers,wbusers WHERE submitter=userid'; if ($find != '') $query .= ' AND (trackername LIKE "%' . $find . '%" OR about LIKE "%' . $find . '%" OR site LIKE "%' . $find . '%")'; $query .= ' ORDER BY ' . (($order == 'downloads') ? 'downloads' : 'added') . ' DESC'; $result = @mysql_query($query, $DBlink); echo '
Order by: [ ' . (($order == 'downloads') ? 'Date Added | Downloads' : 'Date Added | Downloads') . ' ]'; if ($find != '') echo '     Searched for "' . $find . '".'; echo "
"; echo ''; $count = 0; while ($row = mysql_fetch_assoc($result)) { if ($count > 0 && $count % 2 == 0) echo ''; $postres = @mysql_query('SELECT COUNT(*) AS aantal FROM wbposts WHERE type=2 AND threadid=' . $row['trackerid'], $DBlink); $postrow = mysql_fetch_assoc($postres); echo ''; $count++; } if ($count % 2) echo ''; echo '
'; echo '
Open Tracker in WinBar ' . htmlspecialchars(uncheck($row['trackername'])) . ' - added by ' . htmlspecialchars(uncheck($row['username'])) . ' on ' . makeDate($row['added']); echo ' 
Description: ' . htmlspecialchars(uncheck($row['about'])) . '
Website: ' . htmlspecialchars(uncheck($row['site'])) . ' - Downloads: ' . $row['downloads']; echo '
[ ' . (($postrow) ? $postrow['aantal'] : '?') . ' reaction' . (($postrow['aantal'] == 1) ? '' : 's') . '' . (($isMod || ($loggedInUser['userid'] == $row['userid'])) ? ' | Edit | Delete' : '') . ' ]
'; echo '
 
'; return $count; } function displayTracker($id) { global $DBlink, $loggedInUser, $isMod; $query = 'SELECT * FROM wbtrackers,wbusers WHERE trackerid=' . $id . ' AND submitter=userid LIMIT 0,1'; $result = @mysql_query($query, $DBlink); echo ""; echo '
'; if ($row = mysql_fetch_assoc($result)) { echo '
'; else echo ' '; echo '
Open Tracker in WinBar ' . htmlspecialchars(uncheck($row['trackername'])) . ' - added by ' . htmlspecialchars(uncheck($row['username'])) . ' on ' . makeDate($row['added']) . ' (GMT+1)'; echo ''; if ($isMod || ($loggedInUser['userid'] == $row['userid'])) echo '[ Edit | Delete ]
Description: ' . htmlspecialchars(uncheck($row['about'])) . '
Website: ' . htmlspecialchars(uncheck($row['site'])) . ' - Downloads: ' . $row['downloads'] . '
'; } echo '
'; displayTopic(2, $id); } function displayTrackerForm($id, $cat = 0) { global $DBlink, $loggedInUser, $isMod, $isAdmin; $categories = getTrackerCategories(); if ($isAdmin == false && $cat == 0) $cat = 1; if ($id != 0) { $query = 'SELECT * FROM wbtrackers WHERE trackerid=' . $id; if (!$isMod) $query .= ' AND submitter=' . $loggedInUser['userid']; $query .= ' LIMIT 0,1'; $result = @mysql_query($query, $DBlink); $row = mysql_fetch_assoc($result); if (!$row) echo 'Could not get tracker info!
'; $cat = $row['cat']; } echo ''; echo ''; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
Name: '; echo 'Click on a Help icon to display some hints.
Description:'; echo '
Category:' . $categories[$cat]['name'] . '    '; echo '
Website:'; echo '
Tracker URL:'; echo '
Parse Item:'; echo '
Item ID:'; echo '
Display Format:'; echo '
Link Format:'; echo '
Tracker Icon:'; echo '
Use HTTP/1.1:'; echo '
 
'; } ?>WinBar | Trackers
WinBar    ShockMedia