Advanced TAE Admin Topics – Cleaning up Banners

I’ve been taking a serious look at the admin tools with the most popular TAE scripts, and calling out some deficiencies, and specific tools and behaviors I want.

Deleting Ads from the Database is a Bad Practice

First, I don’t like that when the admin finds a bad banner or ad anywhere except Approve Ads, the record is DELETED from the database, and there is no audit trail. My opinion, the member purchased, traded commissions or traded points to obtain these ads, so the admin should be “sending them back to the member”. It’s actually quite easy to implement with a little change to the SQL query. Rather than:

$sql = “delete from banners where id='”.$line[‘id’].”‘”;

change this to a statement that simply changes the “status” (in some databases this is “approved”) and “added” which means it is submitted for approval.

$sql = “update banners set status=0, added=0 where id='”.$line[‘id’].”‘”;

This way, the goal is accomplished of getting bad ads out of the rotation, but still allowing the member to make changes and resubmit rather than purchasing or trading commissions or points for more ads.

I Don’t Need to See Ad Records That Have Not Been Submitted and/or Approved.

I only want to see ads in rotation. They have been submitted for approval. I can only vouch for ads that I approve for the minute I approve them. For any number of reasons, these ads may no longer be viable – programs go out of business, graphics change, sites close down, etc. I want a way to look at SUBMITTED and APPROVED ads, and quickly take them out of rotation. A simple SQL change narrows it down. This is the default, that shows you EVERYTHING:

$sql = “select * from banners”;

A minor change makes it look for only submitted and approved ads

$sql = “select * from banners where status=1 and added=1“;

Deleting Records (removing from rotation) One At a Time

The way the ViewAll functions are written so that a “delete” button shows beside each ad. It only allows you to delete one record at a time, after which the database refreshes and re-draws the screen. This could be thousand of ads – GRAPHIC ADS that take a long time to populate. We already see in the approval screens the “checkbox” and inverse functionality. It was not that hard to apply the same technique to the ViewAll functions.


I’m not sure WHY the default sort order, by record ID, makes any sense at all. I want them grouped by userid. Again, a minor change in the SQL

$sql = “select * from banners where status=1 and added=1 order by userid“;

I want to see all ads submitted by User xxx

Again, a few lines of code, and I create an input box for the userid. This must be an exact match, but I generally see the need to look at a particular user my scanning the list.

$sql = “select * from banners where status=1 and added=1 and userid='”.$userid.'””;

Put this all together, and it just makes life a whole lot easier. Check out the demo videos:




Rich Moyer