View Single Post
ישן 25-01-11, 17:03   # 9
link
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 36
הודעות: 191

link לא מחובר  

סתם בשביל הספורט, אני אפרסם את שלי:

PHP קוד:
    $banners = array();
    
$hotspot->sql->query("SELECT script,ratio,id FROM bnners");

    while ( 
$r $hotspot->sql->fetch_row() )
    {
        
$banners[] = array($r[0],$r[1],$r[2]);
    }

        
$final_banners = array();

        foreach ( 
$banners as $k => $v )
        {
            
$times $v[1]*($hotspot->sql->num_row()-1);
            for ( 
$i 0$i <= $times;$i++)
            {
                
$final_banners[] = array($v[0],$v[2]);
            }
        }

        
shuffle($final_banners);

        
$chosen rand(1count($final_banners));

echo
$final_banners[$chosen][0]; 
  Reply With Quote