Location: PHPKode > projects > Open ShareLive > F3-OSL-pre_alpha-2005_05_30/subscriptions.php
<?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.
*
******************************************************************************/

	include("tmpl_top.php");
	if (!QuickCheck()) {
		require_once("errmsg.php");
		ShowError("You must be logged in to add a release.", "Please Log In");
	}

?>
<br><img src="images/email.gif" width="16" height="16" border="0" align="absmiddle"> <span class="smallprint">Email notification is off : Click to turn on</span><br>
<img src="images/email_no.gif" width="16" height="16" border="0" align="absmiddle"> <span class="smallprint">Email notification is on : Click to turn off</span><br>
<h2>Requests</h2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
	$sql = "SELECT str_full, ".$dbprefix."requests.request_id, ".$dbprefix."requests.email_notify FROM ".$dbprefix."shares INNER JOIN ".$dbprefix."requests ON (".$dbprefix."requests.request_id = ".$dbprefix."shares.rel_id) WHERE ".$dbprefix."requests.user_id = $userid AND ".$dbprefix."shares.req_state = 1";
	$qres = mysql_query($sql);
	echo mysql_error();
	if ($qres && mysql_num_rows($qres)) {
		echo '<tr><td width="5%" nowrap class="newstitle" align="center"><b>Action<br><br></b></td>';
		echo '<td><img src="spacer.gif" width="10" height="2"></td>';
		echo '<td width="95%" class="newstitle"><b>Request Name<br><br></b></td></tr>';
		while($row = mysql_fetch_array($qres)) {
			echo '<tr><td width="5%" nowrap class="smallprint" align="center">';
			if (!$row[email_notify]) {
				echo '<a href="update_req_email.php?pid=' . $row[request_id] . '" title="Notify me when this item is released"><img src="images/email.gif" width="16" height="16" border="0" align="absmiddle"></a>';
			} else {
				echo '<a href="update_req_email.php?pid=' . $row[request_id] . '" title="Don\'t Notify me when this item is released"><img src="images/email_no.gif" width="16" height="16" border="0" align="absmiddle"></a>';
			}
			echo '</td>';
			echo '<td><img src="spacer.gif" width="10" height="2"></td>';
			echo '<td width="95%" class="smallprint"><a href="view.php?pid=' . $row[request_id] . '">' . $row[str_full] . '</a></td></tr>';
		}
	} else {
		echo 'No requests';
	}
?>
</table>
<br><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>

<h2>Discussion Subscriptions</h2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
	$sql = "SELECT str_full, ".$dbprefix."comments_notify.rel_id FROM ".$dbprefix."shares INNER JOIN ".$dbprefix."comments_notify ON (".$dbprefix."comments_notify.rel_id = ".$dbprefix."shares.rel_id) WHERE user_id = $userid";
	$qres = mysql_query($sql);
	echo mysql_error();
	if ($qres && mysql_num_rows($qres)) {
		echo '<tr><td width="5%" nowrap class="newstitle" align="center"><b>Action<br><br></b></td>';
		echo '<td><img src="spacer.gif" width="10" height="2"></td>';
		echo '<td width="95%" class="newstitle"><b>Discussion Name<br><br></b></td></tr>';
		while($row = mysql_fetch_array($qres)) {
			//echo '<tr><td width="5%" nowrap class="smallprint" align="center">[<a href="discuss_notify.php?pid=' . $row[rel_id] . '">Unsubscribe</a>]</td>';
         echo '<tr><td width="5%" nowrap class="smallprint" align="center"><a href="discuss_notify.php?pid=' . $row[rel_id] . '"><img src="images/email_no.gif" width="16" height="16" border="0" align="absmiddle"></a></td>';
			echo '<td><img src="spacer.gif" width="10" height="2"></td>';
			echo '<td width="95%" class="smallprint"><a href="view.php?pid=' . $row[rel_id] . '">' . $row[str_full] . '</a></td></tr>';
		}
	} else {
		echo 'No subscriptions';
	}
?>
</table>
<br>

<?php include("tmpl_foot.php"); ?>
Return current item: Open ShareLive