Skip to content

Instantly share code, notes, and snippets.

@pasterp
Created March 21, 2017 00:04
Show Gist options
  • Save pasterp/a38cc6c4aee4fc4a519fe3a592cb341e to your computer and use it in GitHub Desktop.
Save pasterp/a38cc6c4aee4fc4a519fe3a592cb341e to your computer and use it in GitHub Desktop.
<?php
// ICI (1/3)
include_once("../../../twig/lib/Twig/Autoloader.php");
Twig_Autoloader::register();
// ICI (2/3)
$loader = new Twig_Loader_Filesystem("../../../templates"); // Dossier contenant les templates
$twig = new Twig_Environment($loader, array(
"cache" => false
));
//Cette fonction pourrait être dans un include
function checkOnline($domain) {
$curlInit = curl_init($domain);
curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10);
curl_setopt($curlInit,CURLOPT_HEADER,true);
curl_setopt($curlInit,CURLOPT_NOBODY,true);
curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true);
//get answer
$response = curl_exec($curlInit);
curl_close($curlInit);
if ($response) return true;
return false;
}
/*
AIDE POUR GENERER LA PAGE
PATH HELPER : Permet de compléter le début des liens de la page. Il faut le compléter en fonction de l'emplacement de l'index.php dans lequel il se trouve. (Plus ou moins loin dans des dossiers) Dans les pages de projet, il faut remonter deux dossiers avant de pouvoir récupérer le dossier img/. Il faut donc mettre "../../" et ainsi de suite pour les autres index.php. L'index.php de l'accueil aura donc "../"
ARRAY_DESCRIPTION : C'est ici que l'on écrit la description du projet sous la forme de plusieurs paragraphes.
*/
//Check pour l'url
$url = checkOnline("http://tim.cgmatane.qc.ca/prod/efc/2016/eq4/WP") ? "http://tim.cgmatane.qc.ca/prod/efc/2016/eq4/WP" : "#OFFLINE";
echo $twig->render("projet/base_projet.html", array(
// ICI (3/3)
"path_helper" => "../../../",
"lang" => "en",
"title" => "TIM Matane",
"first_image" => "tim_matane/tim.png",
"projet_suiv" => array("coachella", "Coachella"),
"array_descriptions" => array(
"The revision of the site of Techniques of Multimedia Integration (TIM) of the Cégep of Matane is a collective project professionnal realized by five students of DEC TIM, of whom myself on a duration of 10 weeks begun in October, 2016. The site TIM Matane is a platform of division and distribution of the multimedia contents of the pupils of Techniques of Multimedia Integration of the Cégep of Matane. Most our site is that it is a site dedicated to the students realized by students!",
"In this project I occupied the role of artistic director and UI (Use Interface) - UX (Use experience) Designer. I took care of the realization of the Web and mobile model on Illustrator. I designed an intuitive and interactive interface for the site in association with the developer. I also inserted the contents into the site via Wordpress (the realized projects - the pupils of DEC TIM - the companies where the students realized their internships) and I have write all the textual contents of the site. I also realized user tests to experiment our site on several users and know their felt, their experiences with regard to our product and be able to rectify the site if need following their comments. Besides, I participated in the realizations of the files of proposal of the site to the customer until the final presentation of the site of Techniques of Multimedia Integration of the Cégep of Matane."),
"type_project_description" => "Website - Mobile site // Artistic Director - UI Designer - UX Designer",
"tools_project" => "Photoshop // Illustrator // Lightroom // Wordpress",
"description_images" => array("tim_matane/tim_ordi1.png",
"tim_matane/tim_ordi2.png",
"tim_matane/tim_ordi3.png",
"tim_matane/tim_ordi4.png",
"tim_matane/tim_ordi5.png",
"tim_matane/tim_ordi6.png",
"tim_matane/tim_ordi7.png",
"tim_matane/tim_ordi8.png",
"tim_matane/tim_ordi9.png",
"tim_matane/tim_ordi10.png",
"tim_matane/tim_ordi11.png",
"tim_matane/tim_ordi12.png",
"tim_matane/tim_ordi13.png",
"tim_matane/tim_ordi14.png",
"tim_matane/tim_ordi15.png",
"tim_matane/tim_ordi16.png",
"tim_matane/tim_ordi17.png",
"tim_matane/tim_ordi18.png",
"tim_matane/tim_mobile1.png",
"tim_matane/tim_mobile2.png",
"tim_matane/tim_mobile3.png",
"tim_matane/tim_mobile4.png",
"tim_matane/tim_mobile5.png",
"tim_matane/tim_mobile6.png"),
"website_redirection" => $url
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment