Hello all,
A lot of admins have been asking for this mod. This update is only valid for the SDR 1 series with the add/delete terms addon; it will be standard in the SDR 2. What we want to do is update the terms page from this:

To this:

First, we want to make a edit terms file called admin2/edit_terms.php and here are the contents of that file:
<?
$includes[title]="Edit Terms of Service";
if($action == "edit") {
$Db1->query("UPDATE terms SET
title='".addslashes($title)."',
terms='".addslashes($terms)."',
dsub='".time()."'
WHERE id='$id'");
$Db1->sql_close();
header("Location: admin.php?view=admin&ac=terms&".$url_variables."");
}
$sql=$Db1->query("SELECT * FROM terms WHERE id='$id'");
$faq=$Db1->fetch_array($sql);
$includes[content]="
<div align=\"Center\">
<form action=\"admin.php?view=admin&ac=edit_terms&action=edit&id=$id&".$url_variables."\" method=\"post\">
<table>
<tr>
<td>Terms Section Title</td>
<td><input type=\"text\" name=\"title\" value=\"".htmlentities(stripslashes($faq[title]))."\" size=\"35\"></td>
</tr>
<tr>
<td>Terms section text:</td>
<td>
<textarea name=\"terms\" cols=25 rows=5>".htmlentities(stripslashes($faq[terms]))."</textarea><br />
<br>
</td>
</tr>
<td colspan=2 align=\"center\"><input type=\"submit\" value=\"Save\"></td>
</tr>
</table>
</form>
</div>
";
?>
**************************************************************************************************************
Now, we want to modify the admin2/terms.php file so it appears as below. Best best is to simply cut out the old code and just paste in this whole file.

<?
$includes[title]="Manage Terms Of Service";
//**S**//
if($action == "add") {
$sql=$Db1->query("INSERT INTO terms SET title='".addslashes($title)."' , imglink=' ".$settings[base_url]."/images/icons/termsicon.png' , dsub='".time()."', terms='".addslashes($terms)."'");
}
$sql=$Db1->query("SELECT * FROM terms ORDER BY title");
for($x=0; $title=$Db1->fetch_array($sql); $x++) {
$titlelist.="<option value=\"$title[id]\">".htmlentities(stripslashes($title[title]))."";
$sql2=$Db1->query("SELECT * FROM terms WHERE title='$title[id]'");
$sql2=$Db1->query("SELECT * FROM terms");
$faqs="";
while($faq=$Db1->fetch_array($sql2)) {
$faqs.="<option value=\"$faq[id]\">".htmlentities(stripslashes($faq[title]))."";
}
$thelist.="
<tr class=\"tableHL1\">
<td><b><big>$title[title]</big></b></td>
<td align=\"right\" width=75>
<small>
<a href=\"admin.php?view=admin&ac=edit_terms&id=$title[id]&".$url_variables."\">Edit</a> :
<a href=\"admin.php?view=admin&ac=delete_terms&id=$title[id]&".$url_variables."\" onclick=\"return confirm('Are you sure you want to delete this?')\">Delete</a>
</small>
</td>
</tr>
</tr>
";
}
$includes[content]="
<form name=\"faqform\">
<center>
<table width=\"100%\">
$thelist
</table>
</form>
<form method=\"post\" action=\"admin.php?view=admin&ac=terms&action=add&".$url_variables."\">
<table>
<tr>
<td>Terms Section Title</td>
<td><input type=\"text\" name=\"title\"></td>
</tr>
<tr>
<td colspan=2>Terms Sectin Text:<br><textarea name=\"terms\" cols=25 rows=5></textarea></td>
</tr>
<tr>
<td align=\"center\" colspan=2><input type=\"submit\" value=\"Add Term\"></td>
</tr>
</table>
</center>
</form>
";
//**E**//
?>
****************************************************************************************
This is what the edit terms page will look like:
