Commit 6a703f4f authored by David Loiret's avatar David Loiret Committed by Jean-Baptiste Kempf

Add sponsors carousel

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 244a2a5b
<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/include/include.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/include/sponsors.php");
function getLocaleFromLanguage( $language )
{
......@@ -271,7 +272,7 @@ function start_head( $title,
}
/* Actual start of the body */
function start_body( $body_color, $language, $b_show_donate = true, $nobanner, $alternate_lang, $new_design_class )
function start_body( $body_color, $language, $b_show_donate = true, $nobanner, $alternate_lang, $new_design_class, $show_sponsors_carousel )
{
echo "<body class='$new_design_class'>";
echo "<div id='bodyInner' class='$body_color'>";
......@@ -290,6 +291,21 @@ function start_body( $body_color, $language, $b_show_donate = true, $nobanner, $
<?php
echo 'VideoLAN, '. _('a project and a').' <a href="//www.videolan.org/videolan/" class="noUnderline">'._('non-profit organization').'.</a> ';?>
</div>
<?php if ($show_sponsors_carousel) {
$sponsorsDir = isDeveloper() ? '' : '//images.videolan.org/';
$sponsorsDir .= 'images/partners/';
$sponsors = getSponsors();
shuffle($sponsors);
?>
<div id="sponsors-carousel">
<?php foreach($sponsors as $sponsor) {
echo '<a target="_blank" href="' . $sponsor["link"] .'">' .
'<img src="' . $sponsorsDir . $sponsor["imgSrc"] . '">' .
'</a>';
}
?>
</div>
<?php } ?>
</div>
<?php
}
......@@ -300,20 +316,21 @@ function start_body( $body_color, $language, $b_show_donate = true, $nobanner, $
/* Default configuration options taken from the file */
if(!isset($language) || $language == "" ) { $language = "en"; }
if(!isset($additional_css)) $additional_css = array();
if(!isset($additional_js)) $additional_js = array();
if(!isset($additional_meta)) $additional_meta = array();
if(!isset($alternate_lang)) $alternate_lang = array();
if(!isset($body_onload)) $body_onload = "";
if(!isset($body_onunload)) $body_onunload = "";
if(!isset($body_color)) $body_color = "orange";
if(!isset($nobanner)) $nobanner = false;
if(!isset($show_donate)) $show_donate = true;
if(!isset($new_design)) $new_design = false;
if(!isset($additional_css)) $additional_css = array();
if(!isset($additional_js)) $additional_js = array();
if(!isset($additional_meta)) $additional_meta = array();
if(!isset($alternate_lang)) $alternate_lang = array();
if(!isset($body_onload)) $body_onload = "";
if(!isset($body_onunload)) $body_onunload = "";
if(!isset($body_color)) $body_color = "orange";
if(!isset($nobanner)) $nobanner = false;
if(!isset($show_donate)) $show_donate = true;
if(!isset($new_design)) $new_design = false;
if(!isset($show_sponsors_carousel)) $show_sponsors_carousel = false;
$new_design_class = $new_design ? 'new-design' : '';
/* render the page */
start_head( preg_replace( "/<[^>]*>/", "" , $title ), $body_color, $language,
$additional_css, $additional_js, $additional_meta, $alternate_lang, $body_onload, $body_onunload, $new_design );
start_body( $body_color, $language, $show_donate, $nobanner, $alternate_lang, $new_design_class );
start_body( $body_color, $language, $show_donate, $nobanner, $alternate_lang, $new_design_class, $show_sponsors_carousel );
?>
<?php
$SPONSORS = array(
array(
"imgSrc" => "ab.png",
"link" => "https://www.hpe.com"
),
array(
"imgSrc" => "anevia.jpg",
"link" => "http://www.anevia-group.com"
),
array (
"imgSrc" => "april_logo.png",
"link" => "https://www.april.org/"
),
array (
"imgSrc" => "att.gif",
"link" => "https://www.att.com/"
),
array (
"imgSrc" => "criteo.png",
"link" => "http://www.criteo.com"
),
array (
"imgSrc" => "epitech.jpg",
"link" => "http://www.epitech.eu"
),
array (
"imgSrc" => "free.gif",
"link" => "https://www.free.fr/"
),
array (
"imgSrc" => "gandi.png",
"link" => "https://gandi.net"
),
array (
"imgSrc" => "google-2015.png",
"link" => "https://google.com"
),
array (
"imgSrc" => "hpinvent.gif",
"link" => "http://www.hp.com/"
),
array (
"imgSrc" => "puget.jpg",
"link" => "https://www.pugetsystems.com"
),
array (
"imgSrc" => "videolabs.png",
"link" => "https://videolabs.io"
),
array (
"imgSrc" => "wdlogo.jpg",
"link" => "http://www.wdc.com/"
),
array (
"imgSrc" => "zf.jpg",
"link" => "http://www.zf.com/"
)
);
function getSponsors() {
global $SPONSORS;
return $SPONSORS;
}
?>
......@@ -6,6 +6,7 @@ $body_color = "blue";
$new_design = true;
$additional_js = array("/js/slick-init.js", "/js/slick.min.js");
$additional_css = array("/style/slick.min.css");
$show_sponsors_carousel = true;
require($_SERVER["DOCUMENT_ROOT"] . "/include/language.php");
require($_SERVER["DOCUMENT_ROOT"] . "/include/header.php");
......
......@@ -30,4 +30,13 @@ $(document).ready(function() {
}
}]
});
$('#sponsors-carousel').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 3000,
infinite: true,
arrows: false
});
});
......@@ -107,3 +107,38 @@ $bg-color-hover: rgba(0, 0, 0, 0.4);
#header-carousel .screenshot2.slick-slide {
display: block;
}
#sponsors-carousel {
position: absolute;
display: inline-block;
text-align: center;
right: 15px;
top: 0;
max-width: 150px;
}
#sponsors-carousel a {
display: inline-block;
vertical-align: middle;
}
#sponsors-carousel .slick-slide img {
display: inline-block;
width: auto;
max-height: 36px;
}
@media only screen and (max-width : 480px) {
#sponsors-carousel {
display: none;
}
}
#sponsors-carousel a {
display: none;
background: #fff;
}
#sponsors-carousel a.slick-slide {
display: block;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment