├── .gitignore ├── .travis.yml ├── README.md ├── calendar ├── calendar.php └── style.css ├── contact ├── contact.css ├── contact.js └── contact.php ├── highlight ├── highlight.css ├── highlight.min.js ├── highlight.php └── start_highlight.js ├── hscroll ├── hscroll.css ├── hscroll.js └── hscroll.php ├── latex ├── auto-render.min.js ├── fonts │ ├── KaTeX_AMS-Regular.eot │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.eot │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Caligraphic-Regular.eot │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_Caligraphic-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.eot │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.eot │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Main-Bold.eot │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-Bold.woff │ ├── KaTeX_Main-Bold.woff2 │ ├── KaTeX_Main-Italic.eot │ ├── KaTeX_Main-Italic.ttf │ ├── KaTeX_Main-Italic.woff │ ├── KaTeX_Main-Italic.woff2 │ ├── KaTeX_Main-Regular.eot │ ├── KaTeX_Main-Regular.ttf │ ├── KaTeX_Main-Regular.woff │ ├── KaTeX_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.eot │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── KaTeX_Math-Italic.eot │ ├── KaTeX_Math-Italic.ttf │ ├── KaTeX_Math-Italic.woff │ ├── KaTeX_Math-Italic.woff2 │ ├── KaTeX_Math-Regular.eot │ ├── KaTeX_Math-Regular.ttf │ ├── KaTeX_Math-Regular.woff │ ├── KaTeX_Math-Regular.woff2 │ ├── KaTeX_SansSerif-Bold.eot │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── KaTeX_SansSerif-Bold.woff2 │ ├── KaTeX_SansSerif-Italic.eot │ ├── KaTeX_SansSerif-Italic.ttf │ ├── KaTeX_SansSerif-Italic.woff │ ├── KaTeX_SansSerif-Italic.woff2 │ ├── KaTeX_SansSerif-Regular.eot │ ├── KaTeX_SansSerif-Regular.ttf │ ├── KaTeX_SansSerif-Regular.woff │ ├── KaTeX_SansSerif-Regular.woff2 │ ├── KaTeX_Script-Regular.eot │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Size1-Regular.eot │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.eot │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.eot │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.eot │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.eot │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Typewriter-Regular.woff │ └── KaTeX_Typewriter-Regular.woff2 ├── katex-config.js ├── katex.min.css ├── katex.min.js └── latex.php ├── lazyload ├── echo.js ├── lazyload.css ├── lazyload.js └── lazyload.php ├── readmore ├── readmore.php └── style.css ├── relatedposts ├── relatedposts.php └── style.css ├── showrss ├── getrss.php ├── phpcs.phar └── showrss.php ├── sidelinks └── sidelinks.php ├── smileys ├── smileys.js └── smileys.php └── use_firefox ├── use_firefox.css ├── use_firefox.js ├── use_firefox.min.css ├── use_firefox.min.js └── use_firefox.php /.gitignore: -------------------------------------------------------------------------------- 1 | *.ini 2 | *.html 3 | cache/ 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 5.5 4 | - 5.6 5 | - 7.0 6 | - nightly 7 | 8 | install: 9 | - curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar 10 | 11 | script: 12 | - php phpcs.phar --standard=PSR2 -np --tab-width=4 --encoding=utf-8 . 13 | 14 | matrix: 15 | fast_finish: true 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Addons for [BlogoText](https://github.com/BlogoText/blogotext) 2 | 3 | ## How to use ? 4 | 5 | * [Download the zip](https://github.com/BlogoText/blogotext-addons/archive/master.zip) 6 | * Unzip into the addons folder of your BlogoText 7 | * Go to your admin / addons (http://example.com/admin/addons.php) 8 | 9 | 10 | ## Create your addon 11 | 12 | - Take a look to [this repository](https://github.com/BlogoText/blogotext-addons-example), you will find an example, some documentations ... 13 | - Fork this repo and create a branch for each of your addon (1 addon = 1 branch). 14 | - The master branch is for working and approved addons 15 | - The dev branch is when you need some review or help by the community. 16 | 17 | ## Update an addon 18 | 19 | - get your [addon/branch updated](https://github.com/BlogoText/blogotext/wiki/Contributing) 20 | - push to master or dev, depending on the addon status 21 | 22 | ## Update of your addon from the community 23 | 24 | Keep in mind that the community or maintainers can modify, delete (...) your addon when they are on this repo. So we can improve, debug, update your addon when needed. 25 | -------------------------------------------------------------------------------- /calendar/calendar.php: -------------------------------------------------------------------------------- 1 | 'calendar', 21 | 'name' => array( 22 | 'en' => 'Calendar', 23 | 'fr' => 'Calendrier', 24 | ), 25 | 'desc' => array( 26 | 'en' => 'Display a navigable HTML calendar.', 27 | 'fr' => 'Affiche un calendrier navigable.', 28 | ), 29 | 'version' => '1.0.0', 30 | 'compliancy' => '3.7', 31 | 'css' => 'style.css', 32 | ); 33 | 34 | function a_calendar() 35 | { 36 | // Get the post ID 37 | $date = date('Ym'); 38 | $postId = (string)filter_input(INPUT_GET, 'd'); 39 | if (preg_match('#^\d{4}(/\d{2}){5}#', $postId)) { 40 | $postId = (int)substr(str_replace('/', '', $postId), 0, 14); 41 | $date = substr(get_entry($GLOBALS['db_handle'], 'articles', 'bt_date', $postId, 'return'), 0, 8); 42 | $date = ($date <= date('Ymd')) ? $date : date('Ym'); 43 | } elseif (preg_match('#^\d{4}/\d{2}(/\d{2})?#', $postId)) { 44 | $date = str_replace('/', '', $postId); 45 | $date = (preg_match('#^\d{6}\d{2}#', $date)) ? substr($date, 0, 8) : substr($date, 0, 6); 46 | } elseif (preg_match('#^\d{14}#', $postId)) { 47 | $date = substr($postId, 0, 8); 48 | } 49 | // quick fix for #12 (http 500 when url modified) 50 | if (!is_int($date)) { 51 | $date = date('Ym'); 52 | } 53 | $year = substr($date, 0, 4); 54 | $thisMonth = substr($date, 4, 2); 55 | $thisDay = (strlen(substr($date, 6, 2)) == 2) ? substr($date, 6, 2) : ''; 56 | 57 | $mode = (string)filter_input(INPUT_GET, 'mode'); 58 | $qstring = ($mode != '') ? 'mode='.htmlspecialchars($mode).'&' : ''; 59 | 60 | $firstDay = mktime(0, 0, 0, $thisMonth, 1, $year); 61 | $daysInThisMonth = date('t', $firstDay); 62 | $dayOffset = date('w', $firstDay - 1); 63 | 64 | // We check if there is one or more posts/links/comments in the current month 65 | $datesList = array(); 66 | switch ($mode) { 67 | case 'comments': 68 | $where = 'commentaires'; 69 | break; 70 | case 'links': 71 | $where = 'links'; 72 | break; 73 | case 'blog': 74 | default: 75 | $where = 'articles'; 76 | break; 77 | } 78 | 79 | // We look for previous and next post dates 80 | list($previousPost, $nextPost) = a_calendar_prev_next_posts_($year, $thisMonth, $where); 81 | $previousMonth = '?'.$qstring.'d='.substr($previousPost, 0, 4).'/'.substr($previousPost, 4, 2); 82 | $nextMonth = '?'.$qstring.'d='.substr($nextPost, 0, 4).'/'.substr($nextPost, 4, 2); 83 | 84 | // List of days containing at least one post for this month 85 | $datesList = a_calendar_table_list_date_($year.$thisMonth, $where); 86 | 87 | // Calendar header 88 | $html = '
'; 103 | } 104 | } 105 | for ($day = 1; $day <= $daysInThisMonth; $day++) { 106 | $class = $day == ($thisDay) ? ' class="active"' : ''; 107 | $link = $day; 108 | if (in_array($day, $datesList)) { 109 | $link = ''.$day.''; 110 | } 111 | $html .= ' | '.$link.' | '; 112 | $dayOffset++; 113 | if ($dayOffset == 7) { 114 | $dayOffset = 0; 115 | $html .= '
'; 124 | } 125 | $html .= ' |
" . $channel_title . "");
20 | echo("
");
21 | echo($channel_desc . "
" . $item_title . "");
34 | echo ("
");
35 | echo ($item_desc . "
and )
32 | var htmlTagRegex =/(<[^>]*>)/g
33 |
34 | function convert_smileys()
35 | {
36 | "use strict";
37 |
38 | // loop in classes
39 | classes_to_replace.forEach(function (class_) {
40 | var tochange = document.getElementsByClassName(class_);
41 | var codecnt = 0;
42 |
43 | var classcnt = 0;
44 | var div = "";
45 | for (classcnt = 0; classcnt < tochange.length; classcnt++) {
46 | div = tochange[classcnt]
47 |
48 | // check if in or
49 | var tagArray = div.innerHTML.split(htmlTagRegex);
50 | var divtxt = "";
51 | var tagcnt = 0;
52 | var t = "";
53 | for (tagcnt = 0; tagcnt < tagArray.length; tagcnt++) {
54 | t = tagArray[tagcnt];
55 | if (t.toLowerCase() == "" || t == "") {
56 | codecnt++;
57 | } else if (t.toLowerCase() == "
" || t == "
") {
58 | codecnt--;
59 | }
60 |
61 | if (codecnt == 0) {
62 | var i;
63 | var newtxt = "";
64 | for (i = 0; i < strtostr.length; i++) {
65 | t = t.replace(strtostr[i][0],strtostr[i][1]);
66 | }
67 | }
68 | divtxt += t;
69 | }
70 | div.innerHTML = divtxt;
71 | }
72 | });
73 | }
74 |
75 | window.addEventListener('load', convert_smileys, false);
76 |
--------------------------------------------------------------------------------
/smileys/smileys.php:
--------------------------------------------------------------------------------
1 | 'smileys',
22 | 'name' => array(
23 | 'en' => 'Smileys',
24 | 'fr' => 'Émoticônes',
25 | ),
26 | 'desc' => array(
27 | 'en' => 'Convert smileys strings into emoticons. i.e. : ";)" -> "😉".',
28 | 'fr' => 'Convertit des smileys en émojis. ex : ";)" -> "😉".',
29 | ),
30 | 'url' => 'http://yeuxdelibad.net',
31 | 'version' => '1.0.0',
32 | 'compliancy' => '3.7',
33 | 'js' => 'smileys.js',
34 | );
35 |
--------------------------------------------------------------------------------
/use_firefox/use_firefox.css:
--------------------------------------------------------------------------------
1 | /* The Modal (background) */
2 | /* https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_modal_bottom */
3 | .use_ffx_modal {
4 | display: none; /* Hidden by default */
5 | position: fixed; /* Stay in place */
6 | z-index: 1; /* Sit on top */
7 | left: 0;
8 | top: 0;
9 | width: 100%; /* Full width */
10 | height: 100%; /* Full height */
11 | overflow: auto; /* Enable scroll if needed */
12 | -webkit-animation-name: fadeIn; /* Fade in the background */
13 | -webkit-animation-duration: 0.4s;
14 | animation-name: fadeIn;
15 | animation-duration: 0.4s
16 | }
17 |
18 | /* Modal Content */
19 | .use_ffx_modal-content {
20 | position: fixed;
21 | bottom: 0;
22 | background-color: #fefefe;
23 | width: 100%;
24 | -webkit-animation-name: slideIn;
25 | -webkit-animation-duration: 0.4s;
26 | animation-name: slideIn;
27 | animation-duration: 0.4s
28 | }
29 |
30 | /* The Close Button */
31 | .use_ffx_close {
32 | color: white;
33 | float: right;
34 | font-size: 28px;
35 | font-weight: bold;
36 | }
37 |
38 | .use_ffx_close:hover,
39 | .use_ffx_close:focus {
40 | color: #000;
41 | text-decoration: none;
42 | cursor: pointer;
43 | }
44 |
45 | .use_ffx_modal-header {
46 | padding: 2px 16px;
47 | background-color: orange;
48 | color: white;
49 | }
50 |
51 | .use_ffx_modal-body {padding: 2px 12px;}
52 | .use_ffx_modal-header h2 {font-size:18px;}
53 | .use_ffx_modal-body {color:darkblue;}
54 |
55 | /* Add Animation */
56 | @-webkit-keyframes slideIn {
57 | from {bottom: -300px; opacity: 0}
58 | to {bottom: 0; opacity: 1}
59 | }
60 |
61 | @keyframes slideIn {
62 | from {bottom: -300px; opacity: 0}
63 | to {bottom: 0; opacity: 1}
64 | }
65 |
66 | @-webkit-keyframes fadeIn {
67 | from {opacity: 0}
68 | to {opacity: 1}
69 | }
70 |
71 | @keyframes fadeIn {
72 | from {opacity: 0}
73 | to {opacity: 1}
74 | }
75 |
--------------------------------------------------------------------------------
/use_firefox/use_firefox.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var modal = document.getElementById('use_ffx_modal');
4 |
5 | // Get the element that closes the modal
6 | var span = document.getElementById("use_ffx_close");
7 |
8 | // When the user clicks on (x), close the modal
9 | span.onclick = function () {
10 | modal.style.display = "none";
11 | }
12 |
13 | // When the user clicks anywhere outside of the modal, close it
14 | window.onclick = function (event) {
15 | if (event.target == modal) {
16 | modal.style.display = "none";
17 | }
18 | }
19 |
20 | if ((navigator.userAgent.toLowerCase().indexOf('chrome') > -1) ||
21 | (navigator.userAgent.toLowerCase().indexOf('opera') > -1) ||
22 | (navigator.userAgent.toLowerCase().indexOf('vivaldi') > -1) ||
23 | (navigator.userAgent.toLowerCase().indexOf('safari') > -1) ||
24 | (navigator.userAgent.toLowerCase().indexOf('msie') > -1) ||
25 | (navigator.userAgent.toLowerCase().indexOf('samsung') > -1) ||
26 | (navigator.userAgent.toLowerCase().indexOf('nokia') > -1) ||
27 | (navigator.userAgent.toLowerCase().indexOf('chromium') > -1)) {
28 | modal.style.display = "block";
29 | }
30 |
--------------------------------------------------------------------------------
/use_firefox/use_firefox.min.css:
--------------------------------------------------------------------------------
1 | .use_ffx_modal{display:none;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;-webkit-animation-name:fadeIn;-webkit-animation-duration:.4s;animation-name:fadeIn;animation-duration:.4s}.use_ffx_modal-content{position:fixed;bottom:0;background-color:#fefefe;width:100%;-webkit-animation-name:slideIn;-webkit-animation-duration:.4s;animation-name:slideIn;animation-duration:.4s}.use_ffx_close{color:white;float:right;font-size:28px;font-weight:bold}.use_ffx_close:hover,.use_ffx_close:focus{color:#000;text-decoration:none;cursor:pointer}.use_ffx_modal-header{padding:2px 16px;background-color:orange;color:white}.use_ffx_modal-body{padding:2px 12px}.use_ffx_modal-header h2{font-size:18px}.use_ffx_modal-body{color:darkblue}@-webkit-keyframes slideIn{from{bottom:-300px;opacity:0}to{bottom:0;opacity:1}}@keyframes slideIn{from{bottom:-300px;opacity:0}to{bottom:0;opacity:1}}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}
2 |
--------------------------------------------------------------------------------
/use_firefox/use_firefox.min.js:
--------------------------------------------------------------------------------
1 | "use strict";var modal=document.getElementById("use_ffx_modal"),span=document.getElementById("use_ffx_close");span.onclick=function(){modal.style.display="none"},window.onclick=function(e){e.target==modal&&(modal.style.display="none")},(navigator.userAgent.toLowerCase().indexOf("chrome")>-1||navigator.userAgent.toLowerCase().indexOf("opera")>-1||navigator.userAgent.toLowerCase().indexOf("vivaldi")>-1||navigator.userAgent.toLowerCase().indexOf("safari")>-1||navigator.userAgent.toLowerCase().indexOf("msie")>-1||navigator.userAgent.toLowerCase().indexOf("samsung")>-1||navigator.userAgent.toLowerCase().indexOf("nokia")>-1||navigator.userAgent.toLowerCase().indexOf("chromium")>-1)&&(modal.style.display="block");
2 |
--------------------------------------------------------------------------------
/use_firefox/use_firefox.php:
--------------------------------------------------------------------------------
1 | 'use_firefox',
15 | 'name' => array(
16 | 'en' => 'Use Firefox',
17 | 'fr' => 'Utilisez Firefox',
18 | ),
19 | 'desc' => array(
20 | 'en' => 'Display an modal if firefox is not used.',
21 | 'fr' => 'Affiche un avertissement si Firefox n\'est pas utilisé.',
22 | ),
23 | 'settings' => array(
24 | 'message' => array(
25 | 'type' => 'text',
26 | 'label' => array(
27 | 'en' => 'Message',
28 | 'fr' => 'Message'
29 | ),
30 | 'desc' => array(
31 | 'en' => 'Message to display',
32 | 'fr' => 'Message à afficher',
33 | ),
34 | 'value' => '⚠ Your browser doesn\'t respect your privacy, you might want to try Firefox.',
35 | ),
36 | 'dlmessage' => array(
37 | 'type' => 'text',
38 | 'label' => array(
39 | 'en' => 'Download message',
40 | 'fr' => 'Message téléchargement'
41 | ),
42 | 'desc' => array(
43 | 'en' => 'Message to display for download link',
44 | 'fr' => 'Message à afficher pour le lien de téléchargement',
45 | ),
46 | 'value' => '⬇️ Click to download Firefox now and thank me later 😉',
47 | ),
48 |
49 | ),
50 |
51 |
52 | 'version' => '1.0.0',
53 | 'compliancy' => '3.7',
54 | 'css' => 'use_firefox.min.css',
55 | 'js' => 'use_firefox.min.js',
56 | );
57 |
58 | function a_use_firefox()
59 | {
60 | $msg = addon_get_setting('use_firefox', 'message');
61 | $dlmsg = addon_get_setting('use_firefox', 'dlmessage');
62 | $html = 'lala';
63 |
64 | $html = '
65 | ';
75 | return $html;
76 | }
77 |
--------------------------------------------------------------------------------
74 |