Location: PHPKode > projects > DDL CMS > Upload these files to your webspace/topsites/templates/admin_reviewedits.tpl
<?PHP

$DB->Connect();

$result = $DB->Query("SELECT * FROM topsites_AccountEdits");


?>
<script type="text/javascript">
function checkForm(form)
{
    var checked = 0;

    if( form.Run.value == 'ApproveEdit' || form.Run.value == 'RejectEdit' )
    {
        for( var i = 0; i < form.length; i++ )
        {
            if( form.elements[i].type == 'checkbox' && form.elements[i].checked )
            {
                checked++;
            }
        }

        if( !checked )
        {
            alert('You must select one or more members for this function');
            return false;
        }
    }

    if( form.Run.value == 'RejectEdit' )
    {
        if( !confirm('Are you sure you want to do this?') )
        {
            return false;
        }
    }
}

function selectAll(button)
{
    var form  = document.form;
    var state = (button.value == 'Check All' ? true : false);

    for( var i = 0; i < form.length; i++ )
    {
        if( form.elements[i].type == 'checkbox' )
        {
            form.elements[i].checked = state;
        }
    }

    if( state )
    {
        button.value = 'Uncheck All';
    }
    else
    {
        button.value = 'Check All';
    }
}

function setRun(value)
{
    document.form.Run.value = value;
}
</script>
<?PHP
if( isset($message) )
{
?>
<div id="message">
<?PHP echo $message; ?>
</div>
<br />
<?PHP
}
?>



<?PHP

$total = $DB->NumRows($result);

if( $total > 0 )
{

?>

<form name="form" action="admin.php" method="post" onSubmit="return checkForm(this)">

<table>
<tr>
<td>
<?PHP echo $total; ?> Member Edit<?PHP if( $total > 1 ) echo 's'; ?>
</td>
</tr>

<?PHP

while( $edit = $DB->NextRow($result) )
{
    $account = $DB->Row("SELECT * FROM topsites_Accounts WHERE Username='{$edit['Username']}'");

    foreach($account as $key => $value)
    {
        if( IsEmptyString($value) )
        {
            $account[$key] = '[EMPTY]';
        }
    }


    foreach($edit as $key => $value)
    {
        if( IsEmptyString($value) )
        {
            $edit[$key] = '[EMPTY]';
        }
    }
?>
<tr id="<?PHP echo $edit['Username']; ?>">
<td>
<input type="checkbox" name="Username[]" value="<?PHP echo $edit['Username']; ?>">
<?PHP echo $edit['Username']; ?>
</td>
<td>
<a href="admin.php?Run=RejectEdit&Username[]=<?PHP echo $edit['Username']; ?>">[Reject]</a>
&nbsp;
<a href="admin.php?Run=ApproveEdit&Username[]=<?PHP echo $edit['Username']; ?>">[Approve]</a>
</td>
</tr>


<tr id="<?PHP echo $edit['Username']; ?>">
<td>

<table>

<?PHP
if( $account['Site_URL'] != $edit['Site_URL'] )
{
?>
<tr>
<td>
<b>Site URL:</b>
</td>
<td>
<div>
<a href="<?PHP echo $account['Site_URL']; ?>" target="_blank"><?PHP echo $account['Site_URL']; ?></a>
</div>
<div>
<a href="<?PHP echo $edit['Site_URL']; ?>" target="_blank"><?PHP echo $edit['Site_URL']; ?></a>
</div>
</td>
</tr>
<?PHP
}
?>

<?PHP
if( $account['Title'] != $edit['Title'] )
{
?>
<tr>
<td>
<b>Title:</b>
</td>
<td>
<div>
<?PHP echo $account['Title']; ?>
</div>
<div>
<?PHP echo $edit['Title']; ?>
</div>
</td>
</tr>
<?PHP
}
?>

<?PHP
if( $account['Description'] != $edit['Description'] )
{
?>
<tr>
<td>
<b>Description:</b>
</td>
<td>
<div>
<?PHP echo $account['Description']; ?>
</div>
<div>
<?PHP echo $edit['Description']; ?>
</div>
</td>
</tr>
<?PHP
}
?>

<?PHP
if( $account['Email'] != $edit['Email'] )
{
?>
<tr>
<td>
<b>E-mail:</b>
</td>
<td>
<div>
<a href="mailto:<?PHP echo $account['Email']; ?>"><?PHP echo $account['Email']; ?></a>
</div>
<div>
<a href="mailto:<?PHP echo $edit['Email']; ?>"><?PHP echo $edit['Email']; ?></a>
</div>
</td>
</tr>
<?PHP
}
?>
</table>


</td>
</tr>
<?PHP
}
?>


</table>

<br />

<table>
<tr>
<td>
<input type="button" value="Check All" onClick="selectAll(this)">
&nbsp;&nbsp;
<input type="submit" value="Reject Selected" onClick="setRun('RejectEdit')">
&nbsp;&nbsp;
<input type="submit" value="Approve Selected" onClick="setRun('ApproveEdit')">
</td>
</tr>
</table>

<input type="hidden" name="Run">

</form>

<?PHP
}
else
{
?>
<div>
<b>There are currently no member edits to review</b>
</div>
<br />
<?PHP
}
?>


<br />
<br />
Return current item: DDL CMS