21 require_once
'OPiQuotations/log.inc';
26 ini_set(
'display_errors',
'stdout');
27 ini_set(
'display_startup_errors', 1);
28 ini_set(
'html_errors', 1);
32 assert_options(ASSERT_ACTIVE,
true);
33 assert_options(ASSERT_WARNING,
true);
34 assert_options(ASSERT_BAIL,
true);
39 ini_set(
'display_errors',
'stderr');
40 ini_set(
'display_startup_errors', 0);
41 ini_set(
'html_errors', 0);
45 assert_options(ASSERT_ACTIVE,
false);
46 assert_options(ASSERT_WARNING,
false);
47 assert_options(ASSERT_BAIL,
false);
49 set_error_handler(
'\OPiQuotations\error_handler');
54 mb_internal_encoding(
'UTF-8');
55 mb_regex_encoding(
'UTF-8');
56 mb_http_output(
'UTF-8');
57 mb_detect_order(
'UTF-8');
60 require_once
'OPiQuotations/OPiQuotations.inc';
66 if (isset($_GET[
'id'])) {
68 $id = (int)$_GET[
'id'];
81 header(
'Location: http://'.$_SERVER[
'HTTP_HOST'].$_SERVER[
'PHP_SELF']);
89 $title =
'une OPiCitations n°'.$quot->id().
' — Dictionnaire de citations';
91 $desc =
'une OPiCitation n°'.$quot->id().
' : 92 '.htmlspecialchars(
$quot->to_text());
99 $keywords = [
'citation',
'citations',
'maxime',
'maximes',
'proverbe',
'proverbes',
'littérature',
'français'];
102 foreach ([
$quot->subject(), (
$quot->is_maxim()
104 :
$quot->author()),
$quot->work()] as $keyword) {
105 if ($keyword !== null) {
107 $a = explode(
' ', $keyword);
116 foreach ($a as $keyword) {
117 $keywords[] = htmlspecialchars($keyword);
131 $url_site =
'http://'.$_SERVER[
'HTTP_HOST'].dirname($_SERVER[
'PHP_SELF']).
'/';
138 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
140 <meta name=
"viewport" content=
"width=device-width, initial-scale=1">
142 <meta name=
"author" content=
"Olivier Pirson">
143 <meta name=
"description" content=
"<?php echo $desc; ?>">
144 <meta name=
"keywords" content=
"<?php echo implode(',', $keywords); ?>">
145 <meta name=
"keywords" lang=
"en" content=
"quotation,quotations,maxim,maxims,proverb,proverbs,literature,French">
147 <title><?php echo
$title; ?></title>
149 <link rel=
"stylesheet" type=
"text/css" href=
"/OPiCitations/public/css/one-OPiQuotation.min.css">
151 <script src=
"/OPiCitations/public/js/one-OPiQuotation.automatic-min.js" async=
"async"></script>
153 <link rel=
"icon" type=
"image/x-icon" href=
"/OPiCitations/public/img/one-OPiQuotation-32x32.ico">
155 <link rel=
"canonical" href=
"<?php echo $url; ?>">
157 <meta
property=
"og:image" content=
"<?php echo $url_site; ?>public/img/one-OPiQuotation<?php 159 if ($quot->is_maxim()) { 164 <meta
property=
"og:description" content=
"<?php echo $desc_open_graph; ?>">
165 <meta
property=
"og:title" content=
"<?php echo $title; ?>">
166 <meta
property=
"og:type" content=
"website">
167 <meta
property=
"og:url" content=
"<?php echo $url; ?>">
169 <meta name=
"msapplication-TileColor" content=
"#fdfdd0">
170 <meta name=
"msapplication-square150x150logo" content=
"/OPiCitations/public/img/one-OPiQuotation-64x64-t.png">
177 echo
$quot->to_html(null,
true,
'_blank',
178 'h1',
'une-OPiCitation.php',
183 <?php
if (!isset($_GET[
'no-link-OPiQuotations'])): ?>
185 <a href=
"<?php echo $url_site; ?>" target=
"_blank">D’autres citations sur <span>O<span
class=
"surname">Pi</span>Citations</span></a>
if(!isset($_GET['no-link-OPiQuotations'])) endif
Class to get OPiQuotation and informations from the databse.
html_text_cut($html_text, $max_length, $hellip='…', $reduce=true)
If length of $html_text <= $max_length characters then return $html_text, else return $html_text cutt...