View Single Post
Old 04-29-2004, 06:29 AM   #12
RaGe
Green Mole
 
Join Date: Apr 2004
Posts: 12
So basicly this is the example content for adbanners.php?

Quote:
Originally posted by alivin70
[b]Hi, let me help you with some code (very simplified):

PHP Code:
function banners($query_string){
    
// 1-select your banner using $query_string
    // You shoud have something like this, dependimg on your AdServer
    
$query_ini ='SELECT DISTINCT B.bid,  B.url, B.text
            FROM '
.$prefix.'_banner_imp3 AS B
            WHERE B.keyword LIKE \'%'
.trim($query_string).'%\'';
    
$bresult = @mysql_query($query_ini);
    
// Count banner
    
$numrows = @mysql_num_rows($bresult);
   
    
// 2-format your results in a string          
    //  variable using html  
    
if ($numrows 0) {
          
$html '<b>Sonsored links</b> <br>'
          
while (list($bid,$url$text)=mysql_fetch_row($bresult){
                  
$html .="<a href=$url>$text</a><br>";     
                  
// do other things
          
}
    }         
   
    
// 3- return this variable
    
return $html;

So, you have to implement the function banners() accordingly with your AdServer (NOT present in Phpdig, try PhpAdsNew or others).
RaGe is offline   Reply With Quote