TAE Admin Approval Queue Report

The TAE Admin Approval Queue Report shows a quick count of the number of each ad type awaiting approval.  “Blaster” solos are broken out to help me better manage the SENDSOLO queue.

 The Code to Enhance the TAE Admin Approval Queue Operations

Several areas of the APPROVEADS.PHP file must be modified.  First, the “reporting area” that appears at the top of the Approve Ads screen displays a count of solos in the send queue, that is, those that are approved but have not yet been sent.

WARNING: Before making modifications to any code, be sure you copy it and rename the copy so you can recognize it as the original.  If you make a mistake, simply deleting your changed file and renaming the original will restore it to a known working state.

 

The Reporting area

This is a simple replication of the code that is already there to approve solos, and then making some “where” clause delimiters that separate the “normal” solos from the solo ads that have “promotionmagnet” in the URL.  

The first query appends a condition to the where clause: and not url like ‘%promotionmagnet%’

 The second query appends a condition to the where clause: and  url like ‘%promotionmagnet%’

Other than some minor editing of labels that display on the screen with those counts.

// RJM changed this section to display only “normal” solo ads (ie. NOT Promotion Magnet) that have been approved and are in the send queue
$querysolos = “select * from solos where (sent=0 and added=1 and approved=1) and not url like ‘%promotionmagnet%'”;
$resultsolos = mysql_query ($querysolos)
or die (“Query failed”);
$numrowssolos = @ mysql_num_rows($resultsolos);
if ($numrowssolos == 0) {

echo “<p><center>No solo ads waiting to be sent.</center>”;

}
else {

?>
<p><font color=”red”><center>There are <? echo $numrowssolos; ?> Normal solo ad(s) in the queue to be sent. </font><br><font color=”blue”>These will be sent automatically at the rate of one every hour until all sent.</center></p></font>
<?

}
// RJM end of changed section

// RJM Added this section to separate the Promotional Magnet solos from “normal” solos that have been approved and are in the send queue

$querysolos = “select * from solos where (sent=0 and added=1 and approved=1) and url like ‘%promotionmagnet%'”;
$resultsolos = mysql_query ($querysolos)
or die (“Query failed”);
$numrowssolos = @ mysql_num_rows($resultsolos);
if ($numrowssolos == 0) {

echo “<p><center>No Promotion Magnet solo ads waiting to be sent.</center>”;

}
else {

?>
<p><font color=”red”><center>There are <? echo $numrowssolos; ?> Promotion Magnet solo ad(s) in the queue to be sent. </font><br><font color=”blue”>These will be sent automatically at the rate of one every hour until all sent.</center></p></font>
<?

}
// RJM end of new section

 

 The Approval Area

This is a bit more complex only because the sections of code are much longer.  You must be sure you include all of the code in each section.

 Using the Code Editor in CPANEL, I like to find an If… Else  section by clicking on the left bracket ( { ) immediately following the IF statement.  The CODE EDITOR will show you matched parentheses and brackets by highlighting then in orange.  Now look down through the code until you find the matching right bracket ( } ).  That should take you to the ELSE portion of that statement.  Use the same procedure to find the start and end brackets for the ELSE.  This should be the end of the code you need to replicate.  Simply start from the beginning of that code section to after that last right bracket, copy it to the clipboard, and paste it after the end of the  last section.

The first query appends a condition to the where clause: and not url like ‘%promotionmagnet%’

 The second query appends a condition to the where clause: and  url like ‘%promotionmagnet%’

There is some minor editing of labels that display on the screen with those ads to be removed for approval.

One other important thing: you must identify each code area with a different name to make the “inverse” button check the ads in that section only.  In the second section of code, I highlighted the changed document name.

// RJM changed to show only “normal” solo ads, excluding those from Promotion Magnet
$query3 = “select * from solos where approved=0 and added=1 and not url like ‘%promotionmagnet%’“;
$result3 = mysql_query ($query3)
or die (“Query failed”);
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {
echo “<p><center>No Normal Solo ads awaiting approval.</center>”;
}
else {

echo “<p><center>List of Normal Solo ads awaiting approval.</p>”;
?>
<form action=”approvesolo.php” method=POST name=solo>
<table width=85% border=0 cellpadding=2 cellspacing=2>
<?
while ($line3 = mysql_fetch_array($result3)) {
$id = $line3[“id”];
$userid = $line3[“userid”];
$subject = $line3[“subject”];
$adbody = $line3[“adbody”];
$url = $line3[“url”];

?>
<tr>
<td bgcolor=”<? echo $basecolour; ?>”><input type=”checkbox” name=”id[]” value=”<? echo $id; ?>”></td> <td bgcolor=”<? echo $basecolour; ?>”><font size=2 face=”<? echo $fonttype; ?>” color=”<? echo $fontcolour; ?>”>
<center>Userid: <a href=”memberlogin.php?userid=<? echo $userid; ?>”><? echo $userid; ?></a></center>
<br>
<center>Date Submitted: <? echo date(“Y-m-d G:i”, $line3[“date”]); ?></font></center>
<br>
<center>Subject: <? echo $subject; ?></center>
<br>
<center><? echo $adbody; ?></center>
<br>
<center><a href=”sitecheck.php?url=<? echo $url; ?>” target=”_blank”><? echo $url; ?></a></font></center>
<br>
<center><table border=1 cellpadding=0 cellspacing=0 width=155 height=26><tr valign=middle><td align=”center” nowrap style=”background:white” onMouseDown=”this.style.backgroundColor=’#FFFFFF'” onMouseOver=”this.style.backgroundColor='<? echo $nav_hover; ?>'” onMouseOut=”this.style.backgroundColor=’#FFFFFF'”><a href=”email.php?Member=<? echo $userid; ?>” class=”button” target=”_blank” onmouseover=”window.status=’Email Member’;return true” onMouseOut=”window.status=”;return true”><font color=”#000000″>&nbsp;&nbsp;&nbsp;Email Member&nbsp;&nbsp;&nbsp;</font></a></td></tr></table></center>

<center>
<b>==================================<br>
<center><table border=1 cellpadding=0 cellspacing=0 width=155 height=26><tr valign=middle><td align=”center” nowrap style=”background:white” onMouseDown=”this.style.backgroundColor=’#FFFFFF'” onMouseOver=”this.style.backgroundColor='<? echo $nav_hover; ?>'” onMouseOut=”this.style.backgroundColor=’#FFFFFF'”><a href=”editsolo.php?id=<? echo $id; ?>” class=”button” target=”_blank” onmouseover=”window.status=’Edit Solo’;return true” onMouseOut=”window.status=”;return true”><font color=”#000000″>&nbsp;&nbsp;&nbsp;Edit Solo&nbsp;&nbsp;&nbsp;</font></a></td></tr></table></center>

</td>
<tr>
<td>&nbsp;</td>
</tr>

</tr> <?
}
echo ‘</table><input type=”button” onClick=”return Inverse(document.solo);” value=”Inverse”><input type=”submit” name=”submit” value=”Approve”><input type=”submit” name=”submit” value=”Delete”></form></center>’;

}

//RJM added this section to show Promotion Magnet Solo Ads only
$query3 = “select * from solos where approved=0 and added=1 and url like ‘%promotionmagnet%'”;
$result3 = mysql_query ($query3)
or die (“Query failed”);
$numrows3 = @ mysql_num_rows($result3);
if ($numrows3 == 0) {

echo “<p><center>No Promotion Magnet Solo ads awaiting approval.</center>”;
}
else {
echo “<p><center>List of Promotion Magnet Solo ads awaiting approval.</p>”;
?>
<form action=”approvesolo.php” method=POST name=pmsolo>
<table width=85% border=0 cellpadding=2 cellspacing=2>
<?
while ($line3 = mysql_fetch_array($result3)) {
$id = $line3[“id”];
$userid = $line3[“userid”];
$subject = $line3[“subject”];
$adbody = $line3[“adbody”];
$url = $line3[“url”];

?>
<tr>
<td bgcolor=”<? echo $basecolour; ?>”><input type=”checkbox” name=”id[]” value=”<? echo $id; ?>”></td> <td bgcolor=”<? echo $basecolour; ?>”><font size=2 face=”<? echo $fonttype; ?>” color=”<? echo $fontcolour; ?>”>
<center>Userid: <a href=”memberlogin.php?userid=<? echo $userid; ?>”><? echo $userid; ?></a></center>
<br>
<center>Date Submitted: <? echo date(“Y-m-d G:i”, $line3[“date”]); ?></font></center>
<br>
<center>Subject: <? echo $subject; ?></center>
<br>
<center><? echo $adbody; ?></center>
<br>
<center><a href=”sitecheck.php?url=<? echo $url; ?>” target=”_blank”><? echo $url; ?></a></font></center>
<br>
<center><table border=1 cellpadding=0 cellspacing=0 width=155 height=26><tr valign=middle><td align=”center” nowrap style=”background:white” onMouseDown=”this.style.backgroundColor=’#FFFFFF'” onMouseOver=”this.style.backgroundColor='<? echo $nav_hover; ?>'” onMouseOut=”this.style.backgroundColor=’#FFFFFF'”><a href=”email.php?Member=<? echo $userid; ?>” class=”button” target=”_blank” onmouseover=”window.status=’Email Member’;return true” onMouseOut=”window.status=”;return true”><font color=”#000000″>&nbsp;&nbsp;&nbsp;Email Member&nbsp;&nbsp;&nbsp;</font></a></td></tr></table></center>

<center>
<b>==================================<br>
<center><table border=1 cellpadding=0 cellspacing=0 width=155 height=26><tr valign=middle><td align=”center” nowrap style=”background:white” onMouseDown=”this.style.backgroundColor=’#FFFFFF'” onMouseOver=”this.style.backgroundColor='<? echo $nav_hover; ?>'” onMouseOut=”this.style.backgroundColor=’#FFFFFF'”><a href=”editsolo.php?id=<? echo $id; ?>” class=”button” target=”_blank” onmouseover=”window.status=’Edit Solo’;return true” onMouseOut=”window.status=”;return true”><font color=”#000000″>&nbsp;&nbsp;&nbsp;Edit Solo&nbsp;&nbsp;&nbsp;</font></a></td></tr></table></center>

</td>
<tr>
<td>&nbsp;</td>
</tr>

</tr> <?
}
echo ‘</table><input type=”button” onClick=”return Inverse(document.pmsolo);” value=”Inverse”><input type=”submit” name=”submit” value=”Approve”><input type=”submit” name=”submit” value=”Delete”></form></center>’;

}

 

Don’t forget to save the file, and TEST, TEST, TEST.

These few minor changes to the script help me better manage the monster influx of blaster adds, and allow me to give priority to ads submitted by local members, in addition to tons of time that it took to manually review that queue 10-15 times per day to be sure MY subscribers were getting the best service.

 

Rich Moyer

aka the ExcelVBA Wizard

WebcastSource.com