<?php
/******************************************************************************
*
* Open ShareLive (main site code)
* Copyright (C) 2002-2005 ShareLive
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
******************************************************************************/
require('tmpl_top.php');
// require('errmsg.php');
?>
<h2>Featured Requests and Releases</h2>
<p class="bodytext">
<strong>[<a href="newfeature.php">Create New Feature</a>]</strong>
</p>
<p>
<span class="bodytext">
<strong>Active Features</strong>
</span><br>
<span style="font:normal 11px Tahoma, Helvetica, sans-serif;">
<?
if (!QuickCheck() || !$is_admin) ShowError("You're not allowed here.", "Permission Denied");
$netlist = mysql_query("SELECT * FROM ".$dbprefix."networks");
while ($netlistitem = mysql_fetch_array($netlist)) {
echo "<br><span class=\"viewreltitle\">".$netlistitem['display']."</span><br>";
$getfeatures = mysql_query("SELECT *, ".$dbprefix."shares.*, ".$dbprefix."networks.* FROM ".$dbprefix."featured_releases INNER JOIN ".$dbprefix."shares ON (".$dbprefix."featured_releases.rel_id = ".$dbprefix."shares.rel_id) INNER JOIN ".$dbprefix."networks ON (".$dbprefix."shares.network = ".$dbprefix."networks.nid) WHERE ".$dbprefix."shares.network = ".$netlistitem['nid']." ORDER BY req_state, feature_id DESC");
echo mysql_error();
if ($getfeatures) {
while ($row = mysql_fetch_array($getfeatures)) {
// Set it to display req image if request, rel image if release
if ($row['req_state'] == '1') {
$req_state = '<img src="images/req.gif" align="middle">';
} else {
$req_state = '<img src="images/rel.gif" align="middle">';
}
// Oldest means 120 days ago
$oldest = (time() - 10368000);
// Old means 60 days ago
$old = (time() - 5184000);
// If the release is more than 120 days old, display it in red
if ($row['reqrel_date'] < $oldest) {
$textcolor = 'color:#990000;';
$fontweight = 'font-weight:bold;';
// If it's 60 days old, display it in yellow
} elseif (($row['reqrel_date'] > $oldest) && ($row['reqrel_date'] < $old)) {
$textcolor = 'color:#996600;';
$fontweight = 'font-weight:bold;';
// Otherwise, it must be new, so display it normally
} else {
$textcolor = 'color:#000;';
$fontweight = 'font-weight:normal;';
} ?>
<div style="margin:2px;padding:2px;"><img src="tabs/<?=$row['name']?>/nicon.gif" align="center"> [<a href="editfeature.php?fid=<?=$row['feature_id']?>" style="font-weight:bold;">Edit</a>] [<a href="delfeature.php?fid=<?=$row['feature_id']?>" style="font-weight:bold;">Delete</a>] <?=$req_state?> <a href="view.php?pid=<?=$row['rel_id']?>" style=" <?=$fontweight?><?=$textcolor?>"><?=$row['title']?></a></div>
<?
}
}
}
?> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CCCCCC"><img src="spacer.gif" width="1" height="2"></td>
</tr>
</table><br>
</span>
</p>
<?php include('tmpl_foot.php'); ?>