website diff lib/rand-sponsor.php @ rev 951
en: tiny edits
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Wed Mar 14 19:23:45 2012 +0000 (2012-03-14) |
parents | |
children | 6d9dfef749e1 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/lib/rand-sponsor.php Wed Mar 14 19:23:45 2012 +0000 1.3 @@ -0,0 +1,25 @@ 1.4 +<?php 1.5 +// 1.6 +// Display random sponsor. Only main sponsor are featured on main page. 1.7 +// 1.8 + 1.9 +$total = "2"; 1.10 +$folder = "/images/sponsor"; 1.11 +$random = mt_rand(1, $total); 1.12 + 1.13 +switch($random) { 1.14 +case 1: 1.15 + $name = "Allied Data Sys"; 1.16 + $img = "ads.png"; 1.17 + $url = "http://www.ads-lu.com/"; 1.18 + break; 1.19 +case 2: 1.20 + $name = "DuckDuckGo"; 1.21 + $img = "ddg.png"; 1.22 + $url = "https://duckduckgo.com/"; 1.23 + break; 1.24 +} 1.25 + 1.26 +echo "<a href='$url'><img src='$folder/$img' title='$name' alt='[ $name ]' /></a>"; 1.27 + 1.28 +?>