Skip to content

Commit

Permalink
Adding message preview support
Browse files Browse the repository at this point in the history
You can now preview the site right in your messages as an embed!
  • Loading branch information
taedium8vitae committed Nov 30, 2022
1 parent 13e2640 commit aa37432
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 75 deletions.
91 changes: 44 additions & 47 deletions dev/index.php
Original file line number Diff line number Diff line change
@@ -1,49 +1,5 @@
<!doctype html>
<!--
.........................................................
.........................................................
....................*****************....................
...............******...............******...............
...........****...........................****...........
.........****.................................***........
......***.......................................***......
.....**...........***...............***...........**.....
...**...........*******...........*******..........***...
..**............*******...........*******............**..
.**.............*******...........*******.............**.
.**...............***...............***...............**.
**.....................................................**
**.......*.....................................*.......**
**......**.....................................**......**
.**...****.....................................****...**.
.**......**...................................**......**.
..**.......***.............................***.......**..
...***.......****.......................****.......***...
.....**.........******.............******.........**.....
......***............***************............***......
........****.................................****........
...........****...........................****...........
...............******...............******...............
....................*****************....................
.........................................................
-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Work+Sans:800,700,500,400">
<link href="/styles.css" rel="stylesheet" type="text/css">
<title>Cinéclub du Collège St-Michel Fribourg</title>
<meta name="description" content="Découvrez le prochain film à venir au Cinéclub du collège St-Michel Fribourg." />
</head>

<?php include('dbConnect.php'); ?>

<body>
<?php include('header.php'); ?>
<main>
<div class="nextMovie">
<div class="poster">
<?php
<?php include('dbConnect.php'); ?>
<?php
// Vérifier si le prochain film a été ajouté à la base de données
$nextMovieAnnounced = false;
foreach ($movies as $movie) {
Expand All @@ -59,9 +15,50 @@
break;
}
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Work+Sans:800,700,500,400">
<link href="/styles.css" rel="stylesheet" type="text/css">
<title>Cinéclub du Collège St-Michel Fribourg</title>
<meta name="description" content="Découvrez le prochain film à venir au Cinéclub du collège St-Michel Fribourg." />
<meta name="og:title" content="<?php
if ($nextMovieAnnounced == true) {
echo $movie['title'];
}else{
echo "CSM Cinéclub";
}
?>" />
<meta name="og:description" content="
<?php
if ($nextMovieAnnounced == true) {
echo $movie['text'];
}else{
echo "Le prochain film n'a pas encore été annoncé, revenez bientôt !";
}
?>
" />
<?php
if ($nextMovieAnnounced == true) {
echo '<meta name="og:image" content="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/' . $movie['linkToImage'] . '" />';
}
?>
</head>

<body>
<?php include('header.php'); ?>
<main>
<div class="nextMovie">
<div class="poster">
<?php
if ($nextMovieAnnounced == true) {
// Afficher le prochain film
?>
<img src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/<?php echo $movie['linkToImage'] ?>" alt="<?php echo $movie['title'] ?>">
<img src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images/<?php echo $movie['linkToImage'] ?>" alt="<?php echo $movie['title'] ?>">
<h2 class="movieTitle"><?php echo $movie['title'] ?></h2>
<h2 class="movieDate"><?php echo date('d M Y',strtotime($movie['date'])); ?></h2>
<?php
Expand Down
29 changes: 1 addition & 28 deletions live/index.php
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
<!doctypehtml><!--
.........................................................
.........................................................
....................*****************....................
...............******...............******...............
...........****...........................****...........
.........****.................................***........
......***.......................................***......
.....**...........***...............***...........**.....
...**...........*******...........*******..........***...
..**............*******...........*******............**..
.**.............*******...........*******.............**.
.**...............***...............***...............**.
**.....................................................**
**.......*.....................................*.......**
**......**.....................................**......**
.**...****.....................................****...**.
.**......**...................................**......**.
..**.......***.............................***.......**..
...***.......****.......................****.......***...
.....**.........******.............******.........**.....
......***............***************............***......
........****.................................****........
...........****...........................****...........
...............******...............******...............
....................*****************....................
.........................................................
--><head><meta charset="utf-8"><meta content="width=device-width,initial-scale=1"name="viewport"><link href="https://fonts.googleapis.com/css?family=Work+Sans:800,700,500,400"rel="stylesheet"><link href="/styles.css"rel="stylesheet"type="text/css"><title>Cinéclub du Collège St-Michel Fribourg</title><meta content="Découvrez le prochain film à venir au Cinéclub du collège St-Michel Fribourg."name="description"></head><?php include('dbConnect.php'); ?><body><?php include('header.php'); ?><main><div class="nextMovie"><div class="poster"><?php $nextMovieAnnounced=false;foreach($movies as $movie){if($movie['date']>date('Y-m-d')){$nextMovieAnnounced=true;break;}}if($nextMovieAnnounced==true){foreach($movies as $movie){if($movie['date']>date('Y-m-d')){break;}} ?><img alt="<?php echo $movie['title'] ?>"src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/<?php echo $movie['linkToImage'] ?>"><h2 class="movieTitle"><?php echo $movie['title'] ?></h2><h2 class="movieDate"><?php echo date('d M Y',strtotime($movie['date'])); ?></h2><?php }else{ ?><img alt="Le prochain film n'a pas encore été annoncé"src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/noMovie.png"><h2 class="movieTitle">Aucun film à l'affiche</h2><?php } ?></div><div class="paragraph-container"><p class="synopsis"><?php if($nextMovieAnnounced==true){echo $movie['text'];}else{echo "Le prochain film n'a pas encore été annoncé, revenez plus tard ! :)";} ?></p></div></div></main><?php include('footer.php'); ?></body>
<?php include('dbConnect.php'); ?><?php $nextMovieAnnounced=false;foreach($movies as $movie){if($movie['date']>date('Y-m-d')){$nextMovieAnnounced=true;break;}}if($nextMovieAnnounced==true){foreach($movies as $movie){if($movie['date']>date('Y-m-d')){break;}}} ?><!doctypehtml><html><head><meta charset="utf-8"><meta content="width=device-width,initial-scale=1"name="viewport"><link href="https://fonts.googleapis.com/css?family=Work+Sans:800,700,500,400"rel="stylesheet"><link href="/styles.css"rel="stylesheet"type="text/css"><title>Cinéclub du Collège St-Michel Fribourg</title><meta content="Découvrez le prochain film à venir au Cinéclub du collège St-Michel Fribourg."name="description"><meta content="<?php if($nextMovieAnnounced==true){echo $movie['title'];}else{echo "CSM Cinéclub";} ?>"name="og:title"><meta content="<?php if($nextMovieAnnounced==true){echo $movie['text'];}else{echo "Le prochain film n'a pas encore été annoncé, revenez bientôt !";} ?>"name="og:description"><?php if($nextMovieAnnounced==true){echo '<meta name="og:image" content="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/'.$movie['linkToImage'].'" />';} ?></head><body><?php include('header.php'); ?><main><div class="nextMovie"><div class="poster"><?php if($nextMovieAnnounced==true){ ?><img alt="<?php echo $movie['title'] ?>"src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images/<?php echo $movie['linkToImage'] ?>"><h2 class="movieTitle"><?php echo $movie['title'] ?></h2><h2 class="movieDate"><?php echo date('d M Y',strtotime($movie['date'])); ?></h2><?php }else{ ?><img alt="Le prochain film n'a pas encore été annoncé"src="https://raw.githubusercontent.com/taedium8vitae/cineclub_ws/main/images-mini/noMovie.png"><h2 class="movieTitle">Aucun film à l'affiche</h2><?php } ?></div><div class="paragraph-container"><p class="synopsis"><?php if($nextMovieAnnounced==true){echo $movie['text'];}else{echo "Le prochain film n'a pas encore été annoncé, revenez plus tard ! :)";} ?></p></div></div></main><?php include('footer.php'); ?></body></html>

0 comments on commit aa37432

Please sign in to comment.