website rev 945
Add lib/rand-sponsor.php and display featured sponsor on main page and sponsor page
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Mar 13 19:14:50 2012 +0100 (2012-03-13) |
parents | 437b853154e1 |
children | e2a0a816a8c6 |
files | en/sponsor/index.php images/sponsor/ddg.png index.php lib/get-feeds.php lib/rand-sponsor.php slitaz.css |
line diff
1.1 --- a/en/sponsor/index.php Tue Mar 13 16:38:01 2012 +0100 1.2 +++ b/en/sponsor/index.php Tue Mar 13 19:14:50 2012 +0100 1.3 @@ -34,6 +34,15 @@ 1.4 <!-- Content --> 1.5 <div id="content"> 1.6 1.7 +<!-- Featured sponsor --> 1.8 +<div id="sponsor"> 1.9 + <p><strong>Featured sponsor</strong></p> 1.10 + <?php include("../../lib/rand-sponsor.php"); ?> 1.11 + <p><?php echo "<a href='$url'>$name</a>" ?></p> 1.12 +</div> 1.13 + 1.14 +<div style="margin-right: 220px;"> 1.15 + 1.16 <h2>Sponsoring SliTaz</h2> 1.17 <p> 1.18 Firstly, a huge thanks to our <a href="#cur">current sponsors</a> and all 1.19 @@ -43,6 +52,8 @@ 1.20 use in production environments. 1.21 </p> 1.22 1.23 +</div> 1.24 + 1.25 <h3>Monetary support a developer</h3> 1.26 <p> 1.27 Do you use SliTaz in your project and want to see the distribution getting 1.28 @@ -95,7 +106,7 @@ 1.29 <table> 1.30 <tbody> 1.31 <tr> 1.32 - <td style="width: 120px;"> 1.33 + <td style="width: 120px; height: 120px;"> 1.34 <a href="http://www.ads-lu.com/"><img 1.35 src="/images/sponsor/ads.png" 1.36 style="float: left;" /></a>
2.1 Binary file images/sponsor/ddg.png has changed
3.1 --- a/index.php Tue Mar 13 16:38:01 2012 +0100 3.2 +++ b/index.php Tue Mar 13 19:14:50 2012 +0100 3.3 @@ -71,8 +71,15 @@ 3.4 </p> 3.5 </div> 3.6 3.7 +<!-- Featured sponsor --> 3.8 +<div id="sponsor"> 3.9 + <p><strong>Featured sponsor</strong></p> 3.10 + <?php include("lib/rand-sponsor.php"); ?> 3.11 + <p><a href="/en/sponsor/">Become a sponsor</a></p> 3.12 +</div> 3.13 + 3.14 <!-- We just keep the last 4 web site news --> 3.15 -<div class="news"> 3.16 +<div class="news" style="margin-right: 220px;"> 3.17 3.18 <h2>Latest News</h2> 3.19 3.20 @@ -136,7 +143,7 @@ 3.21 height: 200, 3.22 theme: { 3.23 shell: { 3.24 - background: '#eaeaea', 3.25 + background: '#efefef', 3.26 color: '#000000' 3.27 }, 3.28 tweets: {
4.1 --- a/lib/get-feeds.php Tue Mar 13 16:38:01 2012 +0100 4.2 +++ b/lib/get-feeds.php Tue Mar 13 19:14:50 2012 +0100 4.3 @@ -19,7 +19,7 @@ 4.4 echo "</p>\n<div>\n<ul>\n"; 4.5 foreach($x->channel->item as $entry) { 4.6 $count = $count + 1; 4.7 - echo " <li><a href='$entry->link' title='$entry->title'>" . 4.8 + echo " <li><a href='$entry->guid' title='$entry->title'>" . 4.9 $entry->title . "</a></li>\n"; 4.10 if ($count == $entries) { 4.11 break;
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/lib/rand-sponsor.php Tue Mar 13 19:14:50 2012 +0100 5.3 @@ -0,0 +1,25 @@ 5.4 +<?php 5.5 +// 5.6 +// Display random sponsor. Only main sponsor are featured on main page. 5.7 +// 5.8 + 5.9 +$total = "2"; 5.10 +$folder = "/images/sponsor"; 5.11 +$random = mt_rand(1, $total); 5.12 + 5.13 +switch($random) { 5.14 +case 1: 5.15 + $name = "Allied Data Sys"; 5.16 + $img = "ads.png"; 5.17 + $url = "http://www.ads-lu.com/"; 5.18 + break; 5.19 +case 2: 5.20 + $name = "DuckDuckGo"; 5.21 + $img = "ddg.png"; 5.22 + $url = "https://duckduckgo.com/"; 5.23 + break; 5.24 +} 5.25 + 5.26 +echo "<a href='$url'><img src='$folder/$img' title='$name' alt='[ $name ]' /></a>"; 5.27 + 5.28 +?>
6.1 --- a/slitaz.css Tue Mar 13 16:38:01 2012 +0100 6.2 +++ b/slitaz.css Tue Mar 13 19:14:50 2012 +0100 6.3 @@ -166,6 +166,16 @@ 6.4 #twitter { margin: 20px 0; } 6.5 #gallery { text-align: center; } 6.6 6.7 +#sponsor { 6.8 + font-size: 90%; 6.9 + background-color: #efefef; 6.10 + border: 1px solid #ddd; 6.11 + width: 200px; 6.12 + height: 140px; 6.13 + float: right; 6.14 + text-align: center; 6.15 +} 6.16 + 6.17 /* Classes */ 6.18 6.19 .right_box { width: 48%; float: right; } 6.20 @@ -190,7 +200,7 @@ 6.21 6.22 .activity { 6.23 margin: 0 0 20px; 6.24 - background: #eaeaea; 6.25 + background: #efefef; 6.26 padding: 5px 2px 0; 6.27 border: 1px solid #ddd; 6.28 } 6.29 @@ -228,23 +238,12 @@ 6.30 /* Round corner */ 6.31 6.32 #block_nav, pre, .box, .searchbox, .button a, #twitter, .activity, 6.33 -.activity div { 6.34 +.activity div, #sponsor { 6.35 -moz-border-radius: 4px; 6.36 -webkit-border-radius: 4px; 6.37 border-radius: 4px; 6.38 } 6.39 6.40 -/* Transition */ 6.41 - 6.42 -.box { 6.43 - -webkit-transition-property: background-color; 6.44 - -webkit-transition-duration: 2s; 6.45 - -moz-transition-property: background-color; 6.46 - -moz-transition-duration: 2s; 6.47 - transition-property: background-color; 6.48 - transition-duration: 2s; 6.49 -} 6.50 - 6.51 /* Form */ 6.52 6.53 input[type=submit] {