I was wondering if there are any free scripts that can display the number of times a banner is displayed and remove it after a certain number. Like if it has an admin panel and u can add like Impressions - Code 1000 - <a href""><img src="http:"></a> idk something like that would be really nice ;D
Hi, There is no any free script for that, but we can make it. Whether you have database in the server ?
Presuming you log the stats in a MySQL database, you could do something like: <?php $results = mysql_query( "SELECT impressions FROM table WHERE whatever" ); $results_query = mysql_num_rows( $results ); $results_array = mysql_fetch_array( $results ); if( $results_query < 1000 ) { echo "Impressions - Code"; echo "".$results_array["impressions"]." - <a href=\"http://www.Xtrm2Matt.com"\><img src=\"http://www.Xtrm2Matt.com/someimage.jpg\"></img></a>"; } else { // It has over 1000 impressions, so let's do nothing } ?> PHP: Now, the above would output one result only. You could change it to do a "while" loop: <?php $results = mysql_query( "SELECT impressions FROM table" ); while( $row = mysql_fetch_array( $results ) ) { if( $row["impressions"] < 1000 ) { echo "Impressions - Code"; echo "".$row["impressions"]." - <a href=\"http://www.Xtrm2Matt.com"\><img src=\"http://www.Xtrm2Matt.com/someimage.jpg\"></img></a>"; } else { // It has over 1000 impressions, so let's do nothing } } ?> PHP: This would select ALL results in the table, and output everything providing it has less than 1000 impressions. Hope that helps you (I only use MSSQL in PHP, so the mysql_query, mysql_num_rows and mysql_fetch_array are based on how MSSQL works. If they are wrong for MySQL, then it shouldn't be hard to fix)