├── Controller ├── AboutController.php ├── AbstractController.php ├── BadgeController.php ├── ControllerInterface.php ├── DashboardController.php ├── OpmlController.php ├── OptionStatisticController.php ├── RiverController.php └── SubscriptionController.php ├── Lang ├── AbstractLang.php ├── EnLang.php ├── FrLang.php └── LangInterface.php ├── README.md ├── abonnements.php ├── about.php ├── add.php ├── api.php ├── badges.php ├── bash ├── do_build_all_rss.sh └── update_table_liens.sh ├── bootstrap.php ├── config.php.sample ├── css ├── Dotsies.ttf ├── dotsies.css ├── foundation-overload.css ├── foundation.css ├── foundation.min.css ├── img │ ├── icon_chat.png │ ├── icon_config.png │ ├── icon_filtres.png │ ├── icon_gear.png │ ├── icon_messagerie.png │ ├── icon_people.png │ ├── icon_pwd.png │ ├── icon_report.png │ ├── icon_shaarli.png │ ├── lock_lock.png │ ├── lock_open.png │ ├── logo-shaarli.png │ └── logo-shaarlo.png ├── markdown.css ├── normalize.css ├── style-light.css ├── style.css └── transparent.png ├── dashboard.php ├── decouvrir.php ├── discussion.php ├── favicon-16x16.png ├── favicon.ico ├── favicon.png ├── fct ├── Favicon │ ├── .gitignore │ ├── DataAccess.php │ ├── Favicon.php │ ├── autoloader.php │ └── resources │ │ ├── cache │ │ └── .gitkeep │ │ └── tests │ │ ├── cache │ │ └── .gitkeep │ │ └── default.ico ├── Markdown │ ├── Parsedown.php │ └── markdown.php ├── PasswordHashing │ └── password_hashing_PBKDF2.php ├── Webshots │ ├── test.png │ ├── testWebshot.php │ ├── webshots.php │ └── webshots_old.php ├── fct_cache.php ├── fct_capture.php ├── fct_crypt.php ├── fct_file.php ├── fct_http.php ├── fct_indexation.php ├── fct_mail.php ├── fct_markdown.php ├── fct_mysql.php ├── fct_rss.php ├── fct_session.php ├── fct_sort.php ├── fct_time.php ├── fct_url.php ├── fct_valid.php ├── fct_xsl.php ├── phpmailer │ ├── class.phpmailer.php │ ├── class.smtp.php │ └── language │ │ ├── phpmailer.lang-br.php │ │ ├── phpmailer.lang-de.php │ │ ├── phpmailer.lang-en.php │ │ └── phpmailer.lang-it.php ├── test.jpg └── webshots.php ├── img ├── apple-icon-114x114.png ├── apple-icon-120x120.png ├── apple-icon-144x144.png ├── apple-icon-152x152.png ├── apple-icon-180x180.png ├── apple-icon-57x57.png ├── apple-icon-60x60.png ├── apple-icon-72x72.png ├── apple-icon-76x76.png ├── apple-icon-precomposed.png ├── effet_sebsauvage.png ├── index.html ├── lock_lock.png ├── lock_open.png ├── lock_outline.png ├── logo.png ├── logout_icon.png ├── mail.gif ├── merci.gif ├── rss_icon.png ├── spinner.gif └── top │ ├── top_1.gif │ ├── top_10.gif │ ├── top_11.gif │ ├── top_12.gif │ ├── top_13.gif │ ├── top_14.gif │ ├── top_15.gif │ ├── top_16.gif │ ├── top_17.gif │ ├── top_18.gif │ ├── top_19.gif │ ├── top_2.gif │ ├── top_20.gif │ ├── top_21.gif │ ├── top_22.gif │ ├── top_23.gif │ ├── top_24.gif │ ├── top_25.gif │ ├── top_26.gif │ ├── top_27.gif │ ├── top_28.gif │ ├── top_29.gif │ ├── top_3.gif │ ├── top_30.gif │ ├── top_31.gif │ ├── top_32.gif │ ├── top_33.gif │ ├── top_34.gif │ ├── top_35.gif │ ├── top_36.gif │ ├── top_37.gif │ ├── top_38.gif │ ├── top_39.gif │ ├── top_4.gif │ ├── top_40.gif │ ├── top_41.gif │ ├── top_42.gif │ ├── top_43.gif │ ├── top_44.gif │ ├── top_45.gif │ ├── top_46.gif │ ├── top_47.gif │ ├── top_48.gif │ ├── top_49.gif │ ├── top_5.gif │ ├── top_50.gif │ ├── top_51.gif │ ├── top_52.gif │ ├── top_53.gif │ ├── top_54.gif │ ├── top_55.gif │ ├── top_56.gif │ ├── top_57.gif │ ├── top_58.gif │ ├── top_59.gif │ ├── top_6.gif │ ├── top_60.gif │ ├── top_61.gif │ ├── top_62.gif │ ├── top_63.gif │ ├── top_64.gif │ ├── top_65.gif │ ├── top_66.gif │ ├── top_67.gif │ ├── top_68.gif │ ├── top_69.gif │ ├── top_7.gif │ ├── top_8.gif │ └── top_9.gif ├── index.php ├── js ├── foundation.min.js ├── foundation │ ├── foundation.abide.js │ ├── foundation.accordion.js │ ├── foundation.alert.js │ ├── foundation.clearing.js │ ├── foundation.dropdown.js │ ├── foundation.equalizer.js │ ├── foundation.interchange.js │ ├── foundation.joyride.js │ ├── foundation.js │ ├── foundation.magellan.js │ ├── foundation.offcanvas.js │ ├── foundation.orbit.js │ ├── foundation.reveal.js │ ├── foundation.slider.js │ ├── foundation.tab.js │ ├── foundation.tooltip.js │ └── foundation.topbar.js ├── jquery-modernizr-foundation.min.js └── vendor │ ├── elevator.min.js │ ├── fastclick.js │ ├── jquery.cookie.js │ ├── jquery.js │ ├── modernizr.js │ └── placeholder.js ├── mod ├── delete_duplicate_url │ └── delete_duplicate_url.php ├── login_secure │ ├── autorestrict.php │ ├── login_form.php │ └── login_secure.php ├── mod.php ├── my_respawn │ └── my_respawn.php ├── my_shaarli │ └── my_shaarli.php ├── proposition │ └── proposition.php ├── reload_info │ └── reload_info.php ├── tags_info │ └── tags_info.php └── test_mod │ └── test_mod.php ├── opml.php ├── options_stat.php ├── robots.txt ├── sessions └── .htaccess ├── shaarlimy.sql ├── synchro_favicon.php ├── synchro_shaarli.php ├── update_table_liens.php └── valide.php /Controller/ControllerInterface.php: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | Abonnements 24 | 25 | '; 26 | foreach ($infoAboutAllDecoded["stat"] as $rssLabel => $rss) { 27 | if ('1' == $rss['is_dead']) { 28 | continue; 29 | } 30 | $rssUrl = htmlspecialchars($rss['link']).'?do=rss'; 31 | if ('le hollandais volant' == $rss['title']) { 32 | $rssUrl = htmlspecialchars($rss['link']); 33 | } 34 | $rssLabel = htmlspecialchars($rss['title']); 35 | 36 | // Export de ses shaarlis si connecté 37 | if (!empty($abonnements)) { 38 | if (in_array($rss['id'], $abonnements)) { 39 | $subscription .= sprintf( 40 | '', 41 | $rssLabel, 42 | $rssLabel, 43 | $rssUrl, 44 | $rssUrl 45 | ); 46 | } 47 | } else { 48 | $subscription .= sprintf( 49 | '', 50 | $rssLabel, 51 | $rssLabel, 52 | $rssUrl, 53 | $rssUrl 54 | ); 55 | } 56 | } 57 | $subscription .= ''; 58 | 59 | $opmlFileTmp = $CACHE_DIRECTORY_PATH.'/'.rand(0, 10000).'_opml.xml'; 60 | file_put_contents($opmlFileTmp, $subscription); 61 | 62 | header("Content-disposition: attachment; filename=subscriptions.xml"); 63 | header("Content-Type: application/xml"); 64 | header("Content-Transfer-Encoding: xml\n"); // Surtout ne pas enlever le \n 65 | header("Content-Length: ".(filesize($opmlFileTmp) + 10)); 66 | header("Pragma: no-cache"); 67 | header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public"); 68 | header("Expires: 0"); 69 | readfile($opmlFileTmp); 70 | 71 | unlink($opmlFileTmp); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Controller/OptionStatisticController.php: -------------------------------------------------------------------------------- 1 | 5) { 35 | $optionsStat[] = array('nom' => $option, 'actifs' => $nbActifs, 'desactifs' => $nbDesactifs, 'ratio' => $ratio) ; 36 | } 37 | } 38 | 39 | $params = array(); 40 | $this->render( 41 | array( 42 | 'optionsStat' => $optionsStat 43 | ) 44 | ); 45 | } 46 | 47 | /** 48 | * {@inheritdoc} 49 | */ 50 | public function render($params=array()) 51 | { 52 | ?> 53 | 54 | 55 | renderHead(); 57 | ?> 58 | 59 | renderMenu(); 61 | ?> 62 | 63 |
64 |
65 |

Statistiques des options

66 |
67 |
68 |
69 | Option 70 |
71 | 78 |
79 | % d'utilisation de l'option 80 |
81 |
82 |
83 | 86 |
87 |
88 | 89 |
90 | 98 |
99 | 30) { 101 | ?> % % 106 | 107 |
108 |
109 |
110 | 113 |
114 |
115 |
116 | renderScript(); 118 | ?> 119 | 120 | 121 | messages; 19 | if (isset($messages[$code])) { 20 | return $messages[$code]; 21 | } 22 | 23 | return ''; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Lang/EnLang.php: -------------------------------------------------------------------------------- 1 | 'Password', 10 | ); 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /Lang/FrLang.php: -------------------------------------------------------------------------------- 1 | 'Mot de passe', 9 | ); 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /Lang/LangInterface.php: -------------------------------------------------------------------------------- 1 | run(); 10 | -------------------------------------------------------------------------------- /about.php: -------------------------------------------------------------------------------- 1 | run(); 10 | -------------------------------------------------------------------------------- /add.php: -------------------------------------------------------------------------------- 1 | 1) { 267 | foreach ($abonnements as $k => $abo) { 268 | if ($abo === $_POST['id']) { 269 | unset($abonnements[$k]); 270 | } 271 | } 272 | majAbonnements($abonnements); 273 | } else { 274 | header('HTTP/1.1 202 Accepted', true, 202); 275 | return; 276 | } 277 | }elseif(isset($_POST['do']) && $_POST['do'] == 'add') { 278 | $abonnements[] = $_POST['id']; 279 | majAbonnements($abonnements); 280 | } 281 | 282 | shaarliMyDisconnect($mysqli); 283 | header('HTTP/1.1 200 OK', true, 200); 284 | return; 285 | } 286 | }else{ 287 | header('HTTP/1.1 401 Unauthorized', true, 401); 288 | return; 289 | } 290 | 291 | 292 | header('HTTP/1.1 401 Bad Request', true, 400); 293 | return; 294 | -------------------------------------------------------------------------------- /badges.php: -------------------------------------------------------------------------------- 1 | run(); 10 | -------------------------------------------------------------------------------- /bash/do_build_all_rss.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SHAARLO_HOST='https://www.shaarlo.fr' 4 | LOCKFILE=/root/cron/build.pid 5 | 6 | if [ -f /root/cron/build.pid ] 7 | then 8 | if [ -d /proc/$(cat ${LOCKFILE}) ] 9 | then 10 | echo 'process deja en cours'; 11 | exit; 12 | else 13 | echo "suppression ancien process"; 14 | rm /root/cron/build.pid 15 | fi 16 | fi 17 | 18 | echo $$ > /root/cron/build.pid 19 | echo "lancement nouveau process"; 20 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=1" > /dev/null 21 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=2" > /dev/null 22 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=3" > /dev/null 23 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=4" > /dev/null 24 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=5" > /dev/null 25 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=6" > /dev/null 26 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=7" > /dev/null 27 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=8" > /dev/null 28 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=9" > /dev/null 29 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=10" > /dev/null 30 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=11" > /dev/null 31 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=12" > /dev/null 32 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=13" > /dev/null 33 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=14" > /dev/null 34 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=15" > /dev/null 35 | wget --timeout=47 "$SHAARLO_HOST/api.php?do=buildAllRss&nbthreads=16&thread=16" > /dev/null 36 | rm api* 37 | 38 | 39 | -------------------------------------------------------------------------------- /bash/update_table_liens.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SHAARLO_HOST='https://www.shaarlo.fr' 3 | 4 | wget "$SHAARLO_HOST/update_table_liens.php" > /dev/null 5 | 6 | rm update_table_liens.php.* 7 | 8 | 9 | -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | .columns { 96 | transform: translateY(-50%); 97 | -webkit-transform: translateY(-50%); 98 | -o-transform:translateY(-50%); 99 | -ms-transform:translateY(-50%); 100 | } 101 | 102 | .panel { 103 | background: white; 104 | } 105 | 106 | .reveal-modal { 107 | height:70%; 108 | overflow: auto; 109 | } 110 | 111 | 112 | textarea{ 113 | box-shadow:none; 114 | border-radius: 5px; 115 | } 116 | 117 | .reveal-modal .close-reveal-modal { 118 | z-index:2; 119 | } 120 | 121 | .panel { 122 | box-shadow:0 1px 2px rgba(0,0,0,.1); 123 | box-sizing: border-box; 124 | } 125 | 126 | .top-bar-fixed{ 127 | width:100%; 128 | position:fixed; 129 | z-index:2; 130 | } 131 | 132 | 133 | /* Conflit avec Markdown */ 134 | code { 135 | background: none; 136 | border: none; 137 | } 138 | -------------------------------------------------------------------------------- /css/img/icon_chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_chat.png -------------------------------------------------------------------------------- /css/img/icon_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_config.png -------------------------------------------------------------------------------- /css/img/icon_filtres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_filtres.png -------------------------------------------------------------------------------- /css/img/icon_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_gear.png -------------------------------------------------------------------------------- /css/img/icon_messagerie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_messagerie.png -------------------------------------------------------------------------------- /css/img/icon_people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_people.png -------------------------------------------------------------------------------- /css/img/icon_pwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_pwd.png -------------------------------------------------------------------------------- /css/img/icon_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_report.png -------------------------------------------------------------------------------- /css/img/icon_shaarli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/icon_shaarli.png -------------------------------------------------------------------------------- /css/img/lock_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/lock_lock.png -------------------------------------------------------------------------------- /css/img/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/lock_open.png -------------------------------------------------------------------------------- /css/img/logo-shaarli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/logo-shaarli.png -------------------------------------------------------------------------------- /css/img/logo-shaarlo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/img/logo-shaarlo.png -------------------------------------------------------------------------------- /css/markdown.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Credit to Simon Laroche 3 | * whom created the CSS which this file is based on. 4 | * License: Unlicense 5 | */ 6 | 7 | .markdown p{ 8 | margin:0.75em 0; 9 | } 10 | 11 | .markdown img{ 12 | max-width:100%; 13 | } 14 | 15 | .markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6{ 16 | font-weight:normal; 17 | font-style:normal; 18 | line-height:1em; 19 | margin:0.75em 0; 20 | } 21 | .markdown h4, .markdown h5, .markdown h6{ font-weight: bold; } 22 | .markdown h1{ font-size:2.1em; } 23 | .markdown h2{ font-size:1.6em; } 24 | .markdown h3{ font-size:1.1em; } 25 | .markdown h4{ font-size:0.8em; } 26 | .markdown h5{ font-size:0.6em; } 27 | .markdown h6{ font-size:0.5em; } 28 | 29 | .markdown blockquote{ 30 | color:#666666; 31 | padding-left: 3em; 32 | border-left: 0.5em #EEE solid; 33 | margin:0.75em 0; 34 | } 35 | .markdown hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; } 36 | .markdown pre, .markdown code, .markdown kbd, .markdown samp { 37 | font-family: monospace, 'courier new'; 38 | font-size: 0.98em; 39 | } 40 | .markdown pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } 41 | 42 | .markdown b, .markdown strong { font-weight: bold; } 43 | 44 | .markdown dfn, .markdown em { font-style: italic; } 45 | 46 | .markdown ins { background: #ff9; color: #000; text-decoration: none; } 47 | 48 | .markdown mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } 49 | 50 | .markdown sub, .markdown sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 51 | .markdown sup { top: -0.5em; } 52 | .markdown sub { bottom: -0.25em; } 53 | 54 | .markdown ul, .markdown ol { margin: 1em 0; padding: 0 0 0 2em; } 55 | .markdown li p:last-child { margin:0 } 56 | .markdown dd { margin: 0 0 0 2em; } 57 | 58 | .markdown img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } 59 | 60 | .markdown table { border-collapse: collapse; border-spacing: 0; } 61 | .markdown td { vertical-align: top; } 62 | 63 | @media only screen and (min-width: 480px) { 64 | .markdown {font-size:0.9em;} 65 | } 66 | 67 | @media only screen and (min-width: 768px) { 68 | .markdown {font-size:1em;} 69 | } 70 | 71 | #linklist .markdown li { 72 | padding: 0; 73 | border: none; 74 | background: none; 75 | } 76 | 77 | #linklist .markdown ul li { 78 | list-style: circle; 79 | } 80 | 81 | #linklist .markdown ol li { 82 | list-style: decimal; 83 | } 84 | 85 | .markdown table { 86 | padding: 0; 87 | } 88 | .markdown table tr { 89 | border-top: 1px solid #cccccc; 90 | background-color: white; 91 | margin: 0; 92 | padding: 0; 93 | } 94 | .markdown table tr:nth-child(2n) { 95 | background-color: #f8f8f8; 96 | } 97 | .markdown table tr th { 98 | font-weight: bold; 99 | border: 1px solid #cccccc; 100 | text-align: left; 101 | margin: 0; 102 | padding: 6px 13px; 103 | } 104 | .markdown table tr td { 105 | border: 1px solid #cccccc; 106 | text-align: left; 107 | margin: 0; 108 | padding: 6px 13px; 109 | } 110 | .markdown table tr th :first-child, .markdown table tr td :first-child { 111 | margin-top: 0; 112 | } 113 | .markdown table tr th :last-child, table tr td :last-child { 114 | margin-bottom: 0; 115 | } 116 | 117 | .markdown pre { 118 | background-color: #eee; 119 | padding: 4px 9px; 120 | -webkit-border-radius: 5px; 121 | -moz-border-radius: 5px; 122 | border-radius: 5px; 123 | overflow: auto; 124 | box-shadow: 0 -1px 0 #e5e5e5,0 0 1px rgba(0,0,0,0.12),0 1px 2px rgba(0,0,0,0.24); 125 | } 126 | 127 | .markdown pre code { 128 | color: black; 129 | font-family: 'Consolas', 'Monaco', 'Andale Mono', monospace; 130 | direction: ltr; 131 | text-align: left; 132 | white-space: pre; 133 | word-spacing: normal; 134 | word-break: normal; 135 | line-height: 1.7; 136 | font-size: 11.5px; 137 | -moz-tab-size: 4; 138 | -o-tab-size: 4; 139 | tab-size: 4; 140 | -webkit-hyphens: none; 141 | -moz-hyphens: none; 142 | -ms-hyphens: none; 143 | hyphens: none; 144 | } 145 | 146 | .markdown :not(pre) code { 147 | background-color: #eee; 148 | padding: 1px 3px; 149 | border-radius: 1px; 150 | box-shadow: 0 -1px 0 #e5e5e5,0 0 1px rgba(0,0,0,0.12),0 1px 1px rgba(0,0,0,0.24); 151 | } 152 | 153 | .md_help { 154 | color: white; 155 | } 156 | 157 | /* 158 | Remove header links style 159 | */ 160 | #pageheader .md_help a { 161 | color: lightgray; 162 | font-weight: bold; 163 | text-decoration: underline; 164 | 165 | background: none; 166 | box-shadow: none; 167 | padding: 0; 168 | margin: 0; 169 | } 170 | 171 | #pageheader .md_help a:hover { 172 | color: white; 173 | } 174 | -------------------------------------------------------------------------------- /css/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/css/transparent.png -------------------------------------------------------------------------------- /dashboard.php: -------------------------------------------------------------------------------- 1 | run(); 9 | -------------------------------------------------------------------------------- /discussion.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | Shaarlo : My 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 |
40 |
41 | 49 |

Afficher la discussion autour d'une url

50 | Cette page permet de retrouver tous les shaarlinks en rapport avec une URL 51 |
52 | 53 | 54 | 55 |
56 | 57 |
58 |
59 |

'; 73 | } 74 | $date = new DateTime($item['pubdateiso']); 75 | ?>, le format('d/m/Y'); ?> à format('H:i'); ?>
76 |

'; 79 | } 80 | } 81 | }else{ 82 | echo 'pas de resultat - fonction expérimentale'; 83 | } 84 | ?> 85 |
86 | 87 |
88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/favicon-16x16.png -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/favicon.ico -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/favicon.png -------------------------------------------------------------------------------- /fct/Favicon/.gitignore: -------------------------------------------------------------------------------- 1 | resources/cache/* 2 | resources/tests/cache/* 3 | !.gitkeep 4 | index.php 5 | 6 | ### Composer ### 7 | composer.phar 8 | vendor/ -------------------------------------------------------------------------------- /fct/Favicon/DataAccess.php: -------------------------------------------------------------------------------- 1 | set_context(); 13 | return @file_get_contents($url); 14 | } 15 | 16 | public function retrieveHeader($url) { 17 | $this->set_context(); 18 | return @get_headers($url, TRUE); 19 | } 20 | 21 | public function saveCache($file, $data) { 22 | file_put_contents($file, $data); 23 | } 24 | 25 | public function readCache($file) { 26 | return file_get_contents($file); 27 | } 28 | 29 | private function set_context() { 30 | stream_context_set_default( 31 | array( 32 | 'http' => array( 33 | 'method' => 'GET', 34 | 'timeout' => 10, 35 | 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Favicon; +https://github.com/ArthurHoaro/favicon) Gecko/20100101 Firefox/32.0\r\n", 36 | ) 37 | ) 38 | ); 39 | } 40 | } -------------------------------------------------------------------------------- /fct/Favicon/Favicon.php: -------------------------------------------------------------------------------- 1 | url = $args['url']; 16 | } 17 | 18 | $this->cacheDir = __DIR__ . '/../../resources/cache'; 19 | $this->dataAccess = new DataAccess(); 20 | } 21 | 22 | public function cache($args = array()) { 23 | if (isset($args['dir'])) { 24 | $this->cacheDir = $args['dir']; 25 | } 26 | 27 | if (!empty($args['timeout'])) { 28 | $this->cacheTimeout = $args['timeout']; 29 | } else { 30 | $this->cacheTimeout = 0; 31 | } 32 | } 33 | 34 | public static function baseUrl($url, $path = false) 35 | { 36 | $return = ''; 37 | 38 | if (!$url = parse_url($url)) { 39 | return FALSE; 40 | } 41 | 42 | // Scheme 43 | $scheme = isset($url['scheme']) ? strtolower($url['scheme']) : null; 44 | if ($scheme != 'http' && $scheme != 'https') { 45 | 46 | return FALSE; 47 | } 48 | $return .= "{$scheme}://"; 49 | 50 | // Username and password 51 | if (isset($url['user'])) { 52 | $return .= $url['user']; 53 | if (isset($url['pass'])) { 54 | $return .= ":{$url['pass']}"; 55 | } 56 | $return .= '@'; 57 | } 58 | 59 | // Hostname 60 | if( !isset($url['host']) ) { 61 | return FALSE; 62 | } 63 | 64 | $return .= $url['host']; 65 | 66 | // Port 67 | if (isset($url['port'])) { 68 | $return .= ":{$url['port']}"; 69 | } 70 | 71 | // Path 72 | if( $path && isset($url['path']) ) { 73 | $return .= $url['path']; 74 | } 75 | $return .= '/'; 76 | 77 | return $return; 78 | } 79 | 80 | public function info($url) 81 | { 82 | if(empty($url) || $url === false) { 83 | return false; 84 | } 85 | 86 | $max_loop = 5; 87 | 88 | // Discover real status by following redirects. 89 | $loop = TRUE; 90 | while ($loop && $max_loop-- > 0) { 91 | $headers = $this->dataAccess->retrieveHeader($url); 92 | $exploded = explode(' ', $headers[0]); 93 | 94 | if( !isset($exploded[1]) ) { 95 | return false; 96 | } 97 | list(,$status) = $exploded; 98 | var_dump($status); 99 | var_dump($headers); 100 | switch ($status) { 101 | case '301': 102 | case '302': 103 | $url = $headers['Location']; 104 | break; 105 | default: 106 | $loop = FALSE; 107 | break; 108 | } 109 | } 110 | 111 | return array('status' => $status, 'url' => $url); 112 | } 113 | 114 | public function endRedirect($url) { 115 | $out = $this->info($url); 116 | return !empty($out['url']) ? $out['url'] : false; 117 | } 118 | 119 | /** 120 | * Find remote (or cached) favicon 121 | * @return favicon URL, false if nothing was found 122 | **/ 123 | public function get($url = '') 124 | { 125 | // URLs passed to this method take precedence. 126 | if (!empty($url)) { 127 | $this->url = $url; 128 | } 129 | 130 | // Get the base URL without the path for clearer concatenations. 131 | $original = rtrim($this->baseUrl($this->url, true), '/'); 132 | $url = rtrim($this->endRedirect($this->baseUrl($this->url, false)), '/'); 133 | 134 | if(($favicon = $this->checkCache($url)) || ($favicon = $this->getFavicon($url))) { 135 | $base = true; 136 | } 137 | elseif(($favicon = $this->checkCache($original)) || ($favicon = $this->getFavicon($original, false))) { 138 | $base = false; 139 | } 140 | else 141 | return false; 142 | 143 | // Save cache if necessary 144 | $cache = $this->cacheDir . '/' . md5($base ? $url : $original); 145 | if ($this->cacheTimeout && !file_exists($cache) || (is_writable($cache) && time() - filemtime($cache) > $this->cacheTimeout)) { 146 | $this->dataAccess->saveCache($cache, $favicon); 147 | } 148 | 149 | if (!file_exists($cache)) { 150 | $this->dataAccess->saveCache($cache, ''); 151 | } 152 | 153 | return $favicon; 154 | } 155 | 156 | private function getFavicon($url, $checkDefault = true) { 157 | $favicon = false; 158 | 159 | if(empty($url)) { 160 | return false; 161 | } 162 | 163 | // Try /favicon.ico first. 164 | if( $checkDefault ) { 165 | $info = $this->info("{$url}/favicon.ico"); 166 | if ($info['status'] == '200') { 167 | $favicon = $info['url']; 168 | } 169 | } 170 | 171 | // See if it's specified in a link tag in domain url. 172 | if (!$favicon) { 173 | $favicon = $this->getInPage($url); 174 | } 175 | 176 | // Make sure the favicon is an absolute URL. 177 | if( $favicon && filter_var($favicon, FILTER_VALIDATE_URL) === false ) { 178 | $favicon = $url . '/' . $favicon; 179 | } 180 | 181 | // Sometimes people lie, so check the status. 182 | // And sometimes, it's not even an image. Sneaky bastards! 183 | // If cacheDir isn't writable, that's not our problem 184 | if ($favicon && is_writable($this->cacheDir) && !$this->checkImageMType($favicon)) { 185 | $favicon = false; 186 | } 187 | 188 | return $favicon; 189 | } 190 | 191 | private function getInPage($url) { 192 | $html = $this->dataAccess->retrieveUrl("{$url}/"); 193 | preg_match('!.*!ims', $html, $match); 194 | 195 | if(empty($match) || count($match) == 0) { 196 | return false; 197 | } 198 | 199 | $head = $match[0]; 200 | 201 | $dom = new \DOMDocument(); 202 | // Use error supression, because the HTML might be too malformed. 203 | if (@$dom->loadHTML($head)) { 204 | $links = $dom->getElementsByTagName('link'); 205 | foreach ($links as $link) { 206 | if ($link->hasAttribute('rel') && strtolower($link->getAttribute('rel')) == 'shortcut icon') { 207 | return $link->getAttribute('href'); 208 | } elseif ($link->hasAttribute('rel') && strtolower($link->getAttribute('rel')) == 'icon') { 209 | return $link->getAttribute('href'); 210 | } elseif ($link->hasAttribute('href') && strpos($link->getAttribute('href'), 'favicon') !== FALSE) { 211 | return $link->getAttribute('href'); 212 | } 213 | } 214 | } 215 | return false; 216 | } 217 | 218 | private function checkCache($url) { 219 | if ($this->cacheTimeout) { 220 | $cache = $this->cacheDir . '/' . md5($url); 221 | if (file_exists($cache) && is_readable($cache) && (time() - filemtime($cache) < $this->cacheTimeout)) { 222 | return $this->dataAccess->readCache($cache); 223 | } 224 | } 225 | return false; 226 | } 227 | 228 | private function checkImageMType($url) { 229 | $tmpFile = $this->cacheDir . '/tmp.ico'; 230 | 231 | $fileContent = $this->dataAccess->retrieveUrl($url); 232 | $this->dataAccess->saveCache($tmpFile, $fileContent); 233 | 234 | $finfo = finfo_open(FILEINFO_MIME_TYPE); 235 | $isImage = strpos(finfo_file($finfo, $tmpFile), 'image') !== false; 236 | finfo_close($finfo); 237 | 238 | unlink($tmpFile); 239 | 240 | return $isImage; 241 | } 242 | 243 | /** 244 | * @return mixed 245 | */ 246 | public function getCacheDir() 247 | { 248 | return $this->cacheDir; 249 | } 250 | 251 | /** 252 | * @param mixed $cacheDir 253 | */ 254 | public function setCacheDir($cacheDir) 255 | { 256 | $this->cacheDir = $cacheDir; 257 | } 258 | 259 | /** 260 | * @return mixed 261 | */ 262 | public function getCacheTimeout() 263 | { 264 | return $this->cacheTimeout; 265 | } 266 | 267 | /** 268 | * @param mixed $cacheTimeout 269 | */ 270 | public function setCacheTimeout($cacheTimeout) 271 | { 272 | $this->cacheTimeout = $cacheTimeout; 273 | } 274 | 275 | /** 276 | * @return string 277 | */ 278 | public function getUrl() 279 | { 280 | return $this->url; 281 | } 282 | 283 | /** 284 | * @param string $url 285 | */ 286 | public function setUrl($url) 287 | { 288 | $this->url = $url; 289 | } 290 | 291 | /** 292 | * @param DataAccess $dataAccess 293 | */ 294 | public function setDataAccess($dataAccess) 295 | { 296 | $this->dataAccess = $dataAccess; 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /fct/Favicon/autoloader.php: -------------------------------------------------------------------------------- 1 | path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'src'; 24 | } 25 | 26 | /** 27 | * Autoloader 28 | * 29 | * @param string $class The name of the class to attempt to load. 30 | */ 31 | public function autoload($class) 32 | { 33 | // Only load the class if it starts with "SimplePie" 34 | if (strpos($class, 'Favicon') !== 0) 35 | { 36 | return; 37 | } 38 | 39 | include $class . '.php'; 40 | } 41 | } -------------------------------------------------------------------------------- /fct/Favicon/resources/cache/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/fct/Favicon/resources/cache/.gitkeep -------------------------------------------------------------------------------- /fct/Favicon/resources/tests/cache/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/fct/Favicon/resources/tests/cache/.gitkeep -------------------------------------------------------------------------------- /fct/Favicon/resources/tests/default.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/fct/Favicon/resources/tests/default.ico -------------------------------------------------------------------------------- /fct/Markdown/markdown.php: -------------------------------------------------------------------------------- 1 | [^ ]+!m', '$1', $description); 155 | } 156 | 157 | /** 158 | * Remove
tag to let markdown handle it. 159 | * 160 | * @param string $description input description text. 161 | * 162 | * @return string $description without
tags. 163 | */ 164 | function reverse_nl2br($description) 165 | { 166 | return preg_replace('!
!im', '', $description); 167 | } 168 | 169 | /** 170 | * Remove HTML spaces ' ' auto generated by Shaarli core system. 171 | * 172 | * @param string $description input description text. 173 | * 174 | * @return string $description without HTML links. 175 | */ 176 | function reverse_space2nbsp($description) 177 | { 178 | return preg_replace('/(^| ) /m', '$1 ', $description); 179 | } 180 | 181 | /** 182 | * Remove dangerous HTML tags (tags, iframe, etc.). 183 | * Doesn't affect content (already escaped by Parsedown). 184 | * 185 | * @param string $description input description text. 186 | * 187 | * @return string given string escaped. 188 | */ 189 | function sanitize_html($description) 190 | { 191 | $escapeTags = array( 192 | 'script', 193 | 'style', 194 | 'link', 195 | 'iframe', 196 | 'frameset', 197 | 'frame', 198 | ); 199 | foreach ($escapeTags as $tag) { 200 | $description = preg_replace_callback( 201 | '#<\s*'. $tag .'[^>]*>(.*]*>)?#is', 202 | function ($match) { return escape($match[0]); }, 203 | $description); 204 | } 205 | $description = preg_replace( 206 | '#(<[^>]+)on[a-z]*="[^"]*"#is', 207 | '$1', 208 | $description); 209 | return $description; 210 | } 211 | 212 | /** 213 | * Render shaare contents through Markdown parser. 214 | * 1. Remove HTML generated by Shaarli core. 215 | * 2. Reverse the escape function. 216 | * 3. Generate markdown descriptions. 217 | * 4. Sanitize sensible HTML tags for security. 218 | * 5. Wrap description in 'markdown' CSS class. 219 | * 220 | * @param string $description input description text. 221 | * 222 | * @return string HTML processed $description. 223 | */ 224 | function process_markdown($description) 225 | { 226 | $parsedown = new Parsedown(); 227 | 228 | $processedDescription = $description; 229 | //$processedDescription = reverse_text2clickable($processedDescription); 230 | $processedDescription = reverse_nl2br($processedDescription); 231 | $processedDescription = reverse_space2nbsp($processedDescription); 232 | //$processedDescription = unescape($processedDescription); 233 | $processedDescription = $parsedown 234 | ->setMarkupEscaped(false) 235 | ->setBreaksEnabled(true) 236 | ->text($processedDescription); 237 | $processedDescription = sanitize_html($processedDescription); 238 | 239 | if(!empty($processedDescription)){ 240 | $processedDescription = '
'. $processedDescription . '
'; 241 | } 242 | 243 | return $processedDescription; 244 | } 245 | -------------------------------------------------------------------------------- /fct/PasswordHashing/password_hashing_PBKDF2.php: -------------------------------------------------------------------------------- 1 | An error has occuredThe following error(s) occured:
  • Could not find the internal image you specified.


Query String : t=1421342350 -------------------------------------------------------------------------------- /fct/Webshots/testWebshot.php: -------------------------------------------------------------------------------- 1 | bool(true) 2 | -------------------------------------------------------------------------------- /fct/Webshots/webshots.php: -------------------------------------------------------------------------------- 1 | api_url = 'http://ns3010509.ip-46-105-120.eu:85/shot.php'; 13 | $this->profile_secret_code = ''; // user profile secret code 14 | $this->profile_secret_key = ''; // user profile secret key 15 | } 16 | 17 | function post_to_url($url, $data=array()) 18 | { 19 | 20 | $fields = http_build_query($data); 21 | /*foreach($data as $key => $value) { 22 | $fields .= $key . '=' . $value . '&'; 23 | } 24 | $fields = rtrim($fields, '&');*/ 25 | $c = curl_init(); 26 | curl_setopt($c, CURLOPT_URL, $url); 27 | //curl_setopt($c, CURLOPT_GET, count($data)); 28 | //curl_setopt($c, CURLOPT_POSTFIELDS, $fields); 29 | curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 30 | $result = curl_exec($c); 31 | curl_close($c); 32 | return $result; 33 | } 34 | 35 | function url_to_image($webpage_url, $img_path) 36 | { 37 | // $webpage_url = 'http://www.yahoo.com/'; // webpage url for which image is to be created 38 | // $img_path = '#full absolute path for png image file to be created#'; // e.g.: linux: /var/www/images/img.png OR windows: d:\www\images\ (path where you want to store image) 39 | $url = $this->api_url."/?url=".urlencode($webpage_url); // api url with random unique time based value as parameter to prevent cached response 40 | $params = array(); 41 | // 42 | $img = $this->post_to_url($url, $params); 43 | // print_r($img); exit; 44 | if(strpos($img, '"er":"error: #') === false) { 45 | @ file_put_contents($img_path, $img); 46 | // your code to further use image as per your req. will be here 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | } 53 | ?> 54 | -------------------------------------------------------------------------------- /fct/Webshots/webshots_old.php: -------------------------------------------------------------------------------- 1 | api_url = 'http://www.plsein.tk/api/webshots'; 13 | $this->api_url = 'screen.microweber.com/shot.php'; 14 | 15 | //$this->profile_secret_code = 'sinedchryser@gmail.com'; // user profile secret code 16 | //$this->profile_secret_key = '30c8b4e7dc8508f80ca41ec2b17bec9d93c9bff29dcd8110e2d381092f331957'; // user profile secret key 17 | $this->profile_secret_code = ''; // user profile secret code 18 | $this->profile_secret_key = ''; // user profile secret key 19 | } 20 | 21 | function post_to_url($url) 22 | { 23 | //echo $url; 24 | $fields = http_build_query(); 25 | /*foreach($data as $key => $value) { 26 | $fields .= $key . '=' . $value . '&'; 27 | } 28 | $fields = rtrim($fields, '&');*/ 29 | $c = curl_init($url); 30 | 31 | $options = array( 32 | CURLOPT_URL => $url, 33 | CURLOPT_RETURNTRANSFER => true, 34 | CURLOPT_HEADER => false, 35 | CURLOPT_AUTOREFERER => false, 36 | CURLOPT_FOLLOWLOCATION => true, 37 | CURLOPT_MAXREDIRS => 5, 38 | CURLOPT_CONNECTTIMEOUT => 15, 39 | CURLOPT_TIMEOUT => 30, 40 | CURLOPT_SSL_VERIFYPEER => false, 41 | CURLOPT_SSL_VERIFYHOST => false, 42 | CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, 43 | CURLOPT_ENCODING => 'gzip', 44 | //CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_0, 45 | //CURLOPT_SSL_CIPHER_LIST => 'RC4-SHA', 46 | CURLOPT_HTTPHEADER => array( 47 | 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0', 48 | 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 49 | 'Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 50 | 'Accept-Encoding: gzip, deflate', 51 | 'DNT: 1', 52 | 'Connection: keep-alive', 53 | ), 54 | ); 55 | curl_setopt_array($c, $options); 56 | 57 | $result = curl_exec($c); 58 | //print_r(curl_error($c)); 59 | curl_close($c); 60 | return $result; 61 | } 62 | 63 | function url_to_image($webpage_url, $img_path) 64 | { 65 | $img = $this->post_to_url(sprintf('%s?url=%s', $this->api_url, urlencode($webpage_url))); 66 | 67 | if($img !== false) { 68 | @ file_put_contents($img_path, $img); 69 | // your code to further use image as per your req. will be here 70 | return true; 71 | } 72 | return false; 73 | } 74 | 75 | } 76 | ?> 77 | -------------------------------------------------------------------------------- /fct/fct_cache.php: -------------------------------------------------------------------------------- 1 | $expireTime){ 15 | return true; 16 | } 17 | return false; 18 | } 19 | 20 | /* 21 | * Return the content of the cached file 22 | * @cacheFile : 'cache/rss/test.xml' 23 | * @return string 24 | */ 25 | function getCachedContent($cacheFile){ 26 | return @file_get_contents($cacheFile); 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /fct/fct_capture.php: -------------------------------------------------------------------------------- 1 | url_to_image($url, $imgCapturePath)) { 58 | $imgCapturePath = ''; 59 | } else { 60 | if (filesize($imgCapturePath) == 0) { 61 | return ''; 62 | } 63 | // On redimensionne l'image 64 | $largeur = $width; 65 | $hauteur = $height; 66 | 67 | switch($formatImgCapture) { 68 | case 'png': 69 | $image = imagecreatefrompng($imgCapturePath); 70 | break; 71 | case 'jpeg': 72 | case 'jpg': 73 | default: 74 | $image = imagecreatefromjpeg($imgCapturePath); 75 | break; 76 | } 77 | $taille = getimagesize($imgCapturePath); 78 | $sortie = imagecreatetruecolor($largeur,$hauteur); 79 | $coef = min($taille[0]/$largeur,$taille[1]/$hauteur); 80 | 81 | $deltax = $taille[0]-($coef * $largeur); 82 | $deltay = $taille[1]-($coef * $hauteur); 83 | 84 | //imagecopyresampled($sortie,$image,0,0,$deltax/2,$deltay/2,$largeur,$hauteur,$taille[0]-$deltax,$taille[1]-$deltay); 85 | imagecopyresampled($sortie,$image,0,0,0,0,$largeur,$hauteur,$taille[0]-$deltax,$taille[1]-$deltay); 86 | 87 | // Jpeg progressif 88 | imageinterlace($sortie, 1); 89 | 90 | imagejpeg($sortie, $imgMiniCapturePath, 100); 91 | } 92 | } 93 | 94 | if(!is_file($imgMiniCapturePath) 95 | || filesize($imgMiniCapturePath) == 1367 96 | || filesize($imgMiniCapturePath) == 1850 97 | 98 | || filesize($imgMiniCapturePath) == 838) { 99 | $imgMiniCapturePath = ''; 100 | } 101 | 102 | // Suppression image $imgCapturePath pour faire de la place 103 | // unlink($imgCapturePath); 104 | 105 | return $imgMiniCapturePath; 106 | } 107 | 108 | -------------------------------------------------------------------------------- /fct/fct_crypt.php: -------------------------------------------------------------------------------- 1 | 0) { 44 | $csv .= sprintf('"%s";"%s";"%s";"%s";"%s";"%s";"%s";"%s"' . "\n", $file, $date->format('Ymd'), $date->format('YmdHis'), $count, $article['link'], str_replace('"', '\"', $article['description']), str_replace('"', '\"', $article['category']), str_replace('"', '\"', $article['title'])); 45 | } 46 | } 47 | } 48 | return $csv; 49 | } -------------------------------------------------------------------------------- /fct/fct_mail.php: -------------------------------------------------------------------------------- 1 | IsSMTP(); 11 | $mail2->CharSet = 'UTF-8'; 12 | $mail2->IsHTML(true); 13 | $mail2->SMTPAuth = true; 14 | $mail2->Host='smtp.shaarli.fr'; 15 | $mail2->Port='587'; 16 | //$mail2->Host='ssl0.ovh.net'; 17 | //$mail2->Port='465'; 18 | 19 | $mail2->Username = $ADMIN_EMAIL; 20 | $mail2->Password = $ADMIN_PASSWORD; 21 | $mail2->From=$ADMIN_EMAIL; 22 | $mail2->FromName = 'Shaarli.fr' ; 23 | $mail2->AddAddress($to); 24 | $mail2->AddReplyTo($ADMIN_EMAIL); 25 | //$mail2->SMTPDebug = 2; 26 | $ip = getClientIp(); 27 | $mail2->Subject = utf8_decode(sprintf('Récupération du profil %s', $profilId)); 28 | $message = "Voici le nouveau mot de passe de votre compte : " . $key; 29 | $message .= "

Demande de l'adresse IP : $ip.

"; 30 | $message .= "

Note : Modifiez le dès que possible (votre prestataire de messagerie pourrait se connecter à votre compte !).

"; 31 | 32 | $enveloppe = ' 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | %s 41 | 42 | '; 43 | 44 | $mail2->Body = utf8_decode(sprintf($enveloppe, $message)); 45 | if(!$mail2->Send()){ 46 | //print($mail2->ErrorInfo); 47 | return false; 48 | } 49 | $mail2->SmtpClose(); 50 | unset($mail2); 51 | 52 | return true; 53 | } 54 | 55 | function getClientIp() { 56 | $ipaddress = ''; 57 | if (getenv('HTTP_CLIENT_IP')) 58 | $ipaddress = getenv('HTTP_CLIENT_IP'); 59 | else if(getenv('HTTP_X_FORWARDED_FOR')) 60 | $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); 61 | else if(getenv('HTTP_X_FORWARDED')) 62 | $ipaddress = getenv('HTTP_X_FORWARDED'); 63 | else if(getenv('HTTP_FORWARDED_FOR')) 64 | $ipaddress = getenv('HTTP_FORWARDED_FOR'); 65 | else if(getenv('HTTP_FORWARDED')) 66 | $ipaddress = getenv('HTTP_FORWARDED'); 67 | else if(getenv('REMOTE_ADDR')) 68 | $ipaddress = getenv('REMOTE_ADDR'); 69 | else 70 | $ipaddress = 'UNKNOWN'; 71 | return $ipaddress; 72 | } 73 | 74 | /** 75 | * Retourne une adresse email obfusquée 76 | * 77 | * @param string $email : machin@truc.com 78 | * 79 | * @return string $emailObfusque : m*****@truc.com 80 | */ 81 | function obfusqueEmail($email) { 82 | if (!isValidEmail($email)) { 83 | return ''; 84 | } 85 | $emailExploded = explode('@', $email); 86 | $premiereLettre = substr($emailExploded[0], 0, 1); 87 | 88 | return sprintf('%s******@%s', $premiereLettre, $emailExploded[1]); 89 | } 90 | 91 | /** 92 | * Indique si une adresse mail contient un @ 93 | * 94 | * @param string $email : machin@truc.com 95 | * 96 | * @return bool 97 | */ 98 | function isValidEmail($email) { 99 | if (strpos($email, ' ') !== false) { 100 | return false; 101 | } 102 | 103 | return 1 === substr_count($email, '@'); 104 | } 105 | 106 | 107 | -------------------------------------------------------------------------------- /fct/fct_markdown.php: -------------------------------------------------------------------------------- 1 | ', str_replace("\n", '', $markdown)); 7 | $tableauDeRetour = array(); 8 | 9 | $parametreCourant = null; 10 | 11 | foreach ($toutesLesLignes as $ligne) { 12 | if(isTitreMarkdown($ligne)) { 13 | $clefCourante = nettoieTitreMarkdown($ligne); 14 | if ( ! in_array($clefCourante, $clefsAutorises)) { 15 | $parametreCourant = null; 16 | } else { 17 | $parametreCourant = $clefCourante; 18 | $tableauDeRetour[$parametreCourant] = array(); 19 | } 20 | } 21 | if($parametreCourant !== null && isParamMarkdown($ligne)) { 22 | $tableauDeRetour[$parametreCourant][] = getParam(nettoieTitreMarkdown($ligne)); 23 | } 24 | } 25 | return $tableauDeRetour; 26 | } 27 | 28 | 29 | function isTitreMarkdown($string) { 30 | return (strpos($string, '# ') === 0); 31 | } 32 | 33 | function nettoieTitreMarkdown($string) { 34 | $string = preg_replace('##', '', $string); 35 | $string = preg_replace('##', '', $string); 36 | 37 | return substr($string, 2); 38 | } 39 | 40 | function getParam($string) { 41 | $exploded = explode(' : ', $string); 42 | if(!is_array($exploded) || count($exploded) !== 2) { 43 | return null; 44 | } 45 | 46 | return array('key' => $exploded[0], 'value' => $exploded[1]); 47 | } 48 | 49 | 50 | 51 | function isParamMarkdown($string) { 52 | return (strpos($string, '* ') === 0); 53 | } 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /fct/fct_sort.php: -------------------------------------------------------------------------------- 1 | 'année', 16 | 30 * 24 * 60 * 60 => 'mois', 17 | 24 * 60 * 60 => 'jour', 18 | 60 * 60 => 'heure', 19 | 60 => 'minute', 20 | 1 => 'seconde' 21 | ); 22 | 23 | foreach ($a as $secs => $str) 24 | { 25 | $d = $etime / $secs; 26 | if ($d >= 1) 27 | { 28 | $r = round($d); 29 | if($str === 'mois'){ 30 | return ', il y a ' . $r . ' ' . $str; 31 | }else{ 32 | return ', il y a ' . $r . ' ' . $str . ($r > 1 ? 's' : ''); 33 | } 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /fct/fct_url.php: -------------------------------------------------------------------------------- 1 | '); 42 | } 43 | // alias vers redirige 44 | function redirection($url) { 45 | return redirige($url); 46 | } 47 | // alias vers redirige 48 | function redirect($url) { 49 | return redirige($url); 50 | } 51 | // alias vers redirige 52 | function redir($url) { 53 | return redirige($url); 54 | } 55 | 56 | 57 | // ----------------------------------------- 58 | // Ajoute/Modifie un parametre à un URL. 59 | // ----------------------------------------- 60 | function ajouterParametreGET($url, $paramNom, $paramValeur){ 61 | $urlFinal = ""; 62 | if($paramNom==""){ 63 | $urlFinal = $url; 64 | }else{ 65 | $t_url = explode("?",$url); 66 | if(count($t_url)==1){ 67 | // pas de queryString 68 | $urlFinal .= $url; 69 | if(substr($url,strlen($url)-1,strlen($url))!="/"){ 70 | $t_url2 = explode("/",$url); 71 | if(preg_match("/./",$t_url2[count($t_url2)-1])==false){ 72 | $urlFinal .= "/"; 73 | } 74 | } 75 | $urlFinal .= "?".$paramNom."=".$paramValeur; 76 | } elseif(count($t_url)==2){ 77 | // il y a une queryString 78 | $paramAAjouterPresentDansQueryString = "non"; 79 | $t_queryString = explode("&",$t_url[1]); 80 | foreach($t_queryString as $cle => $coupleNomValeur){ 81 | $t_param = explode("=",$coupleNomValeur); 82 | if($t_param[0]==$paramNom){ 83 | $paramAAjouterPresentDansQueryString = "oui"; 84 | } 85 | } 86 | if($paramAAjouterPresentDansQueryString=="non"){ 87 | // le parametre à ajouter n'existe pas encore dans la queryString 88 | if(!is_null($paramValeur)) { 89 | $urlFinal = $url."&".$paramNom."=".$paramValeur; 90 | } else { 91 | $urlFinal = $url; 92 | } 93 | } elseif($paramAAjouterPresentDansQueryString=="oui"){ 94 | // le parametre à ajouter existe déjà dans la queryString 95 | // donc on va reconstruire l'URL 96 | $urlFinal = $t_url[0]."?"; 97 | foreach($t_queryString as $cle => $coupleNomValeur){ 98 | $t_coupleNomValeur = explode("=",$coupleNomValeur); 99 | if($t_coupleNomValeur[0]==$paramNom){ 100 | if(!is_null($paramValeur)) { 101 | if($cle > 0){ 102 | $urlFinal .= "&"; 103 | } 104 | $urlFinal .= $paramNom."=".$paramValeur; 105 | } 106 | }else{ 107 | if($cle > 0){ 108 | $urlFinal .= "&"; 109 | } 110 | $urlFinal .= $t_coupleNomValeur[0]."=".$t_coupleNomValeur[1]; 111 | } 112 | } 113 | } 114 | } 115 | } 116 | return $urlFinal; 117 | } 118 | 119 | // Ajoute un tableau de paramètres 120 | function ajouterParametresGET($url, $nomsvaleurs){ 121 | foreach($nomsvaleurs as $nom => $valeur) { 122 | $url = ajouterParametreGET($url, $nom, $valeur); 123 | } 124 | 125 | return $url; 126 | } 127 | 128 | /** 129 | * Affiche de manière protégée les éventuelles balises html 130 | */ 131 | function eh($string) { 132 | echo htmlentities($string); 133 | } 134 | 135 | 136 | /** 137 | * Affiche de manière protégée une url 138 | * 139 | * @param string $url : http://toto?coucou=toi&moi 140 | * 141 | * @return string : http://toto%3Fcoucou=toi%26moi 142 | */ 143 | function ehu($string) { 144 | $string = str_replace('?', '%3F', $string); 145 | $string = str_replace('&', '%26', $string); 146 | echo htmlentities($string); 147 | } 148 | 149 | function supprimeDernierPointInterrogation($url) { 150 | if (preg_match('#\?$#', $url)) { 151 | return substr($url, 0, strlen($url) - 1); 152 | } 153 | 154 | return $url; 155 | } 156 | 157 | function corrigeUrlMy($url) { 158 | $url = str_replace('my.shaarli.fr/', 'shaarli.fr/my/', $url); 159 | return $url; 160 | } 161 | 162 | function getUrlSimplifiee($url) { 163 | $urlSimplifiee = str_replace('https://', '', $url); 164 | $urlSimplifiee = str_replace('http://', '', $urlSimplifiee); 165 | $urlSimplifiee = str_replace('my.shaarli.fr/', 'shaarli.fr/my/', $urlSimplifiee); 166 | 167 | return $urlSimplifiee; 168 | } 169 | 170 | -------------------------------------------------------------------------------- /fct/fct_valid.php: -------------------------------------------------------------------------------- 1 | $v) { 21 | unset($process[$key][$k]); 22 | if (is_array($v)) { 23 | $process[$key][stripslashes($k)] = $v; 24 | $process[] = &$process[$key][stripslashes($k)]; 25 | } else { 26 | $process[$key][stripslashes($k)] = stripslashes($v); 27 | } 28 | } 29 | } 30 | unset($process); 31 | } 32 | } 33 | 34 | /** 35 | * Check installation 36 | * @return boolean 37 | */ 38 | function checkInstall(){ 39 | global $DATA_DIR, $CACHE_DIR_NAME, $ARCHIVE_DIR_NAME, $ARCHIVE_FILE_NAME, $SHAARLIS_FILE_NAME; 40 | if(!is_dir($DATA_DIR) 41 | || !is_dir(sprintf('%s/%s', $DATA_DIR, $ARCHIVE_DIR_NAME)) 42 | || !is_dir(sprintf('%s/%s', $DATA_DIR, $CACHE_DIR_NAME)) 43 | ){ 44 | return false; 45 | } 46 | 47 | $rssListFile = sprintf('%s/%s', $DATA_DIR, $SHAARLIS_FILE_NAME); 48 | if(!is_file($rssListFile)){ 49 | return false; 50 | } 51 | 52 | if(is_file($rssListFile)){ 53 | $rssList = json_decode(file_get_contents($rssListFile), true); 54 | if(empty($rssList)){ 55 | return false; 56 | } 57 | } 58 | 59 | return true; 60 | } 61 | -------------------------------------------------------------------------------- /fct/fct_xsl.php: -------------------------------------------------------------------------------- 1 | $v){ 14 | // if(strlen($k) >= 5 && substr_compare($k,'PATH_',0,5)==0){ 15 | // tplAssign('TPL'.strtoupper(substr($k,5)),$v.'/tpl'); 16 | // } 17 | // } 18 | // Le document XML 19 | $xmlDoc=new DomDocument(); 20 | $rc=$xmlDoc->loadXML($xml); 21 | if($rc==false){ 22 | 23 | var_export($xml); 24 | throw new Exception('Loading XML principal document via loadXML()',500); 25 | } 26 | // Création du processor 27 | $xsl=file_get_contents 28 | ($tpl 29 | ,true 30 | ); 31 | $xslDoc=new DomDocument; 32 | $rc=$xslDoc->loadXML($xsl); 33 | if($rc==false){ 34 | throw new Exception('Loading '.pathFile($FROG['TPL']['file'][$tpl]['f'],$_tpl_subdir).' XSL document via loadXML()',500); 35 | } 36 | 37 | // L'analyseur XSLT 38 | $xslt=new XSLTProcessor(); 39 | 40 | // Autoriser les appels aux fonctions PHP dans une feuille XSL 41 | $xslt->registerPHPFunctions(); 42 | $xslt->importStyleSheet($xslDoc); 43 | 44 | $xslt->setParameter 45 | ('' // Namespace 46 | ,$pParams // Tableau de paramètres 47 | ); 48 | $domHtmlText = $xslt->transformToXML($xmlDoc); 49 | //Correction d'un bug apparent qui supprime le caractère / dans la balise fermante /> meta 50 | // $domHtmlText = $domTranObj->saveXML(); 51 | 52 | //Correction d'un bug apparent qui importe des xmlns="" dans les premieres balises des templates 53 | $domHtmlText =str_replace("xmlns=\"\"", "",$domHtmlText); 54 | return $domHtmlText; 55 | } 56 | -------------------------------------------------------------------------------- /fct/phpmailer/language/phpmailer.lang-br.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/fct/phpmailer/language/phpmailer.lang-br.php -------------------------------------------------------------------------------- /fct/phpmailer/language/phpmailer.lang-de.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fct/phpmailer/language/phpmailer.lang-en.php: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /fct/phpmailer/language/phpmailer.lang-it.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $PHPMAILER_LANG = array(); 10 | 11 | $PHPMAILER_LANG["provide_address"] = 'Deve essere fornito almeno un'. 12 | ' indirizzo ricevente'; 13 | $PHPMAILER_LANG["mailer_not_supported"] = 'Mailer non supportato'; 14 | $PHPMAILER_LANG["execute"] = "Impossibile eseguire l'operazione: "; 15 | $PHPMAILER_LANG["instantiate"] = 'Impossibile istanziare la funzione mail'; 16 | $PHPMAILER_LANG["authenticate"] = 'SMTP Error: Impossibile autenticarsi.'; 17 | $PHPMAILER_LANG["from_failed"] = 'I seguenti indirizzi mittenti hanno'. 18 | ' generato errore: '; 19 | $PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: I seguenti indirizzi'. 20 | 'destinatari hanno generato errore: '; 21 | $PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data non accettati dal'. 22 | 'server.'; 23 | $PHPMAILER_LANG["connect_host"] = 'SMTP Error: Impossibile connettersi'. 24 | ' all\'host SMTP.'; 25 | $PHPMAILER_LANG["file_access"] = 'Impossibile accedere al file: '; 26 | $PHPMAILER_LANG["file_open"] = 'File Error: Impossibile aprire il file: '; 27 | $PHPMAILER_LANG["encoding"] = 'Encoding set dei caratteri sconosciuto: '; 28 | ?> 29 | -------------------------------------------------------------------------------- /fct/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/fct/test.jpg -------------------------------------------------------------------------------- /fct/webshots.php: -------------------------------------------------------------------------------- 1 | api_url = 'http://vps154208.ovh.net/screen/shot.php'; 13 | $this->profile_secret_code = ''; // user profile secret code 14 | $this->profile_secret_key = ''; // user profile secret key 15 | } 16 | 17 | function post_to_url($url, $data=array()) 18 | { 19 | 20 | $fields = http_build_query($data); 21 | /*foreach($data as $key => $value) { 22 | $fields .= $key . '=' . $value . '&'; 23 | } 24 | $fields = rtrim($fields, '&');*/ 25 | $c = curl_init(); 26 | curl_setopt($c, CURLOPT_URL, $url); 27 | //curl_setopt($c, CURLOPT_GET, count($data)); 28 | //curl_setopt($c, CURLOPT_POSTFIELDS, $fields); 29 | curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); 30 | $result = curl_exec($c); 31 | curl_close($c); 32 | return $result; 33 | } 34 | 35 | function url_to_image($webpage_url, $img_path) 36 | { 37 | // $webpage_url = 'http://www.yahoo.com/'; // webpage url for which image is to be created 38 | // $img_path = '#full absolute path for png image file to be created#'; // e.g.: linux: /var/www/images/img.png OR windows: d:\www\images\ (path where you want to store image) 39 | $url = $this->api_url."/?url=".urlencode($webpage_url); // api url with random unique time based value as parameter to prevent cached response 40 | $params = array(); 41 | // 42 | $img = $this->post_to_url($url, $params); 43 | // print_r($img); exit; 44 | if(strpos($img, '"er":"error: #') === false) { 45 | @ file_put_contents($img_path, $img); 46 | // your code to further use image as per your req. will be here 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | } 53 | ?> 54 | -------------------------------------------------------------------------------- /img/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-114x114.png -------------------------------------------------------------------------------- /img/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-120x120.png -------------------------------------------------------------------------------- /img/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-144x144.png -------------------------------------------------------------------------------- /img/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-152x152.png -------------------------------------------------------------------------------- /img/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-180x180.png -------------------------------------------------------------------------------- /img/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-57x57.png -------------------------------------------------------------------------------- /img/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-60x60.png -------------------------------------------------------------------------------- /img/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-72x72.png -------------------------------------------------------------------------------- /img/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-76x76.png -------------------------------------------------------------------------------- /img/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/apple-icon-precomposed.png -------------------------------------------------------------------------------- /img/effet_sebsauvage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/effet_sebsauvage.png -------------------------------------------------------------------------------- /img/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/lock_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/lock_lock.png -------------------------------------------------------------------------------- /img/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/lock_open.png -------------------------------------------------------------------------------- /img/lock_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/lock_outline.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/logo.png -------------------------------------------------------------------------------- /img/logout_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/logout_icon.png -------------------------------------------------------------------------------- /img/mail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/mail.gif -------------------------------------------------------------------------------- /img/merci.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/merci.gif -------------------------------------------------------------------------------- /img/rss_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/rss_icon.png -------------------------------------------------------------------------------- /img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/spinner.gif -------------------------------------------------------------------------------- /img/top/top_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_1.gif -------------------------------------------------------------------------------- /img/top/top_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_10.gif -------------------------------------------------------------------------------- /img/top/top_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_11.gif -------------------------------------------------------------------------------- /img/top/top_12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_12.gif -------------------------------------------------------------------------------- /img/top/top_13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_13.gif -------------------------------------------------------------------------------- /img/top/top_14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_14.gif -------------------------------------------------------------------------------- /img/top/top_15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_15.gif -------------------------------------------------------------------------------- /img/top/top_16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_16.gif -------------------------------------------------------------------------------- /img/top/top_17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_17.gif -------------------------------------------------------------------------------- /img/top/top_18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_18.gif -------------------------------------------------------------------------------- /img/top/top_19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_19.gif -------------------------------------------------------------------------------- /img/top/top_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_2.gif -------------------------------------------------------------------------------- /img/top/top_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_20.gif -------------------------------------------------------------------------------- /img/top/top_21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_21.gif -------------------------------------------------------------------------------- /img/top/top_22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_22.gif -------------------------------------------------------------------------------- /img/top/top_23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_23.gif -------------------------------------------------------------------------------- /img/top/top_24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_24.gif -------------------------------------------------------------------------------- /img/top/top_25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_25.gif -------------------------------------------------------------------------------- /img/top/top_26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_26.gif -------------------------------------------------------------------------------- /img/top/top_27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_27.gif -------------------------------------------------------------------------------- /img/top/top_28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_28.gif -------------------------------------------------------------------------------- /img/top/top_29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_29.gif -------------------------------------------------------------------------------- /img/top/top_3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_3.gif -------------------------------------------------------------------------------- /img/top/top_30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_30.gif -------------------------------------------------------------------------------- /img/top/top_31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_31.gif -------------------------------------------------------------------------------- /img/top/top_32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_32.gif -------------------------------------------------------------------------------- /img/top/top_33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_33.gif -------------------------------------------------------------------------------- /img/top/top_34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_34.gif -------------------------------------------------------------------------------- /img/top/top_35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_35.gif -------------------------------------------------------------------------------- /img/top/top_36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_36.gif -------------------------------------------------------------------------------- /img/top/top_37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_37.gif -------------------------------------------------------------------------------- /img/top/top_38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_38.gif -------------------------------------------------------------------------------- /img/top/top_39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_39.gif -------------------------------------------------------------------------------- /img/top/top_4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_4.gif -------------------------------------------------------------------------------- /img/top/top_40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_40.gif -------------------------------------------------------------------------------- /img/top/top_41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_41.gif -------------------------------------------------------------------------------- /img/top/top_42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_42.gif -------------------------------------------------------------------------------- /img/top/top_43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_43.gif -------------------------------------------------------------------------------- /img/top/top_44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_44.gif -------------------------------------------------------------------------------- /img/top/top_45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_45.gif -------------------------------------------------------------------------------- /img/top/top_46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_46.gif -------------------------------------------------------------------------------- /img/top/top_47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_47.gif -------------------------------------------------------------------------------- /img/top/top_48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_48.gif -------------------------------------------------------------------------------- /img/top/top_49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_49.gif -------------------------------------------------------------------------------- /img/top/top_5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_5.gif -------------------------------------------------------------------------------- /img/top/top_50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_50.gif -------------------------------------------------------------------------------- /img/top/top_51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_51.gif -------------------------------------------------------------------------------- /img/top/top_52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_52.gif -------------------------------------------------------------------------------- /img/top/top_53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_53.gif -------------------------------------------------------------------------------- /img/top/top_54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_54.gif -------------------------------------------------------------------------------- /img/top/top_55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_55.gif -------------------------------------------------------------------------------- /img/top/top_56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_56.gif -------------------------------------------------------------------------------- /img/top/top_57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_57.gif -------------------------------------------------------------------------------- /img/top/top_58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_58.gif -------------------------------------------------------------------------------- /img/top/top_59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_59.gif -------------------------------------------------------------------------------- /img/top/top_6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_6.gif -------------------------------------------------------------------------------- /img/top/top_60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_60.gif -------------------------------------------------------------------------------- /img/top/top_61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_61.gif -------------------------------------------------------------------------------- /img/top/top_62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_62.gif -------------------------------------------------------------------------------- /img/top/top_63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_63.gif -------------------------------------------------------------------------------- /img/top/top_64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_64.gif -------------------------------------------------------------------------------- /img/top/top_65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_65.gif -------------------------------------------------------------------------------- /img/top/top_66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_66.gif -------------------------------------------------------------------------------- /img/top/top_67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_67.gif -------------------------------------------------------------------------------- /img/top/top_68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_68.gif -------------------------------------------------------------------------------- /img/top/top_69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_69.gif -------------------------------------------------------------------------------- /img/top/top_7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_7.gif -------------------------------------------------------------------------------- /img/top/top_8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_8.gif -------------------------------------------------------------------------------- /img/top/top_9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DMeloni/shaarlo/06f8e3091f20e784f0c656300fe1a879a37d32f5/img/top/top_9.gif -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | run(); 9 | -------------------------------------------------------------------------------- /js/foundation/foundation.accordion.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.accordion = { 5 | name : 'accordion', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | content_class : 'content', 11 | active_class : 'active', 12 | multi_expand : false, 13 | toggleable : true, 14 | callback : function () {} 15 | }, 16 | 17 | init : function (scope, method, options) { 18 | this.bindings(method, options); 19 | }, 20 | 21 | events : function () { 22 | var self = this; 23 | var S = this.S; 24 | S(this.scope) 25 | .off('.fndtn.accordion') 26 | .on('click.fndtn.accordion', '[' + this.attr_name() + '] > .accordion-navigation > a', function (e) { 27 | var accordion = S(this).closest('[' + self.attr_name() + ']'), 28 | groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()), 29 | settings = accordion.data(self.attr_name(true) + '-init') || self.settings, 30 | target = S('#' + this.href.split('#')[1]), 31 | aunts = $('> .accordion-navigation', accordion), 32 | siblings = aunts.children('.' + settings.content_class), 33 | active_content = siblings.filter('.' + settings.active_class); 34 | 35 | e.preventDefault(); 36 | 37 | if (accordion.attr(self.attr_name())) { 38 | siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class); 39 | aunts = aunts.add('[' + groupSelector + '] .accordion-navigation'); 40 | } 41 | 42 | if (settings.toggleable && target.is(active_content)) { 43 | target.parent('.accordion-navigation').toggleClass(settings.active_class, false); 44 | target.toggleClass(settings.active_class, false); 45 | settings.callback(target); 46 | target.triggerHandler('toggled', [accordion]); 47 | accordion.triggerHandler('toggled', [target]); 48 | return; 49 | } 50 | 51 | if (!settings.multi_expand) { 52 | siblings.removeClass(settings.active_class); 53 | aunts.removeClass(settings.active_class); 54 | } 55 | 56 | target.addClass(settings.active_class).parent().addClass(settings.active_class); 57 | settings.callback(target); 58 | target.triggerHandler('toggled', [accordion]); 59 | accordion.triggerHandler('toggled', [target]); 60 | }); 61 | }, 62 | 63 | off : function () {}, 64 | 65 | reflow : function () {} 66 | }; 67 | }(jQuery, window, window.document)); 68 | -------------------------------------------------------------------------------- /js/foundation/foundation.alert.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.alert = { 5 | name : 'alert', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | callback : function () {} 11 | }, 12 | 13 | init : function (scope, method, options) { 14 | this.bindings(method, options); 15 | }, 16 | 17 | events : function () { 18 | var self = this, 19 | S = this.S; 20 | 21 | $(this.scope).off('.alert').on('click.fndtn.alert', '[' + this.attr_name() + '] .close', function (e) { 22 | var alertBox = S(this).closest('[' + self.attr_name() + ']'), 23 | settings = alertBox.data(self.attr_name(true) + '-init') || self.settings; 24 | 25 | e.preventDefault(); 26 | if (Modernizr.csstransitions) { 27 | alertBox.addClass('alert-close'); 28 | alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) { 29 | S(this).trigger('close').trigger('close.fndtn.alert').remove(); 30 | settings.callback(); 31 | }); 32 | } else { 33 | alertBox.fadeOut(300, function () { 34 | S(this).trigger('close').trigger('close.fndtn.alert').remove(); 35 | settings.callback(); 36 | }); 37 | } 38 | }); 39 | }, 40 | 41 | reflow : function () {} 42 | }; 43 | }(jQuery, window, window.document)); 44 | -------------------------------------------------------------------------------- /js/foundation/foundation.equalizer.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.equalizer = { 5 | name : 'equalizer', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | use_tallest : true, 11 | before_height_change : $.noop, 12 | after_height_change : $.noop, 13 | equalize_on_stack : false 14 | }, 15 | 16 | init : function (scope, method, options) { 17 | Foundation.inherit(this, 'image_loaded'); 18 | this.bindings(method, options); 19 | this.reflow(); 20 | }, 21 | 22 | events : function () { 23 | this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function (e) { 24 | this.reflow(); 25 | }.bind(this)); 26 | }, 27 | 28 | equalize : function (equalizer) { 29 | var isStacked = false, 30 | vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'), 31 | settings = equalizer.data(this.attr_name(true) + '-init'); 32 | 33 | if (vals.length === 0) { 34 | return; 35 | } 36 | var firstTopOffset = vals.first().offset().top; 37 | settings.before_height_change(); 38 | equalizer.trigger('before-height-change').trigger('before-height-change.fndth.equalizer'); 39 | vals.height('inherit'); 40 | vals.each(function () { 41 | var el = $(this); 42 | if (el.offset().top !== firstTopOffset) { 43 | isStacked = true; 44 | } 45 | }); 46 | 47 | if (settings.equalize_on_stack === false) { 48 | if (isStacked) { 49 | return; 50 | } 51 | }; 52 | 53 | var heights = vals.map(function () { return $(this).outerHeight(false) }).get(); 54 | 55 | if (settings.use_tallest) { 56 | var max = Math.max.apply(null, heights); 57 | vals.css('height', max); 58 | } else { 59 | var min = Math.min.apply(null, heights); 60 | vals.css('height', min); 61 | } 62 | settings.after_height_change(); 63 | equalizer.trigger('after-height-change').trigger('after-height-change.fndtn.equalizer'); 64 | }, 65 | 66 | reflow : function () { 67 | var self = this; 68 | 69 | this.S('[' + this.attr_name() + ']', this.scope).each(function () { 70 | var $eq_target = $(this); 71 | self.image_loaded(self.S('img', this), function () { 72 | self.equalize($eq_target) 73 | }); 74 | }); 75 | } 76 | }; 77 | })(jQuery, window, window.document); 78 | -------------------------------------------------------------------------------- /js/foundation/foundation.magellan.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs['magellan-expedition'] = { 5 | name : 'magellan-expedition', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | active_class : 'active', 11 | threshold : 0, // pixels from the top of the expedition for it to become fixes 12 | destination_threshold : 20, // pixels from the top of destination for it to be considered active 13 | throttle_delay : 30, // calculation throttling to increase framerate 14 | fixed_top : 0, // top distance in pixels assigend to the fixed element on scroll 15 | offset_by_height : true, // whether to offset the destination by the expedition height. Usually you want this to be true, unless your expedition is on the side. 16 | duration : 700, // animation duration time 17 | easing : 'swing' // animation easing 18 | }, 19 | 20 | init : function (scope, method, options) { 21 | Foundation.inherit(this, 'throttle'); 22 | this.bindings(method, options); 23 | }, 24 | 25 | events : function () { 26 | var self = this, 27 | S = self.S, 28 | settings = self.settings; 29 | 30 | // initialize expedition offset 31 | self.set_expedition_position(); 32 | 33 | S(self.scope) 34 | .off('.magellan') 35 | .on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) { 36 | e.preventDefault(); 37 | var expedition = $(this).closest('[' + self.attr_name() + ']'), 38 | settings = expedition.data('magellan-expedition-init'), 39 | hash = this.hash.split('#').join(''), 40 | target = $('a[name="' + hash + '"]'); 41 | 42 | if (target.length === 0) { 43 | target = $('#' + hash); 44 | 45 | } 46 | 47 | // Account for expedition height if fixed position 48 | var scroll_top = target.offset().top - settings.destination_threshold + 1; 49 | if (settings.offset_by_height) { 50 | scroll_top = scroll_top - expedition.outerHeight(); 51 | } 52 | 53 | $('html, body').stop().animate({ 54 | 'scrollTop' : scroll_top 55 | }, settings.duration, settings.easing, function () { 56 | if (history.pushState) { 57 | history.pushState(null, null, '#' + hash); 58 | } else { 59 | location.hash = '#' + hash; 60 | } 61 | }); 62 | }) 63 | .on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay)); 64 | 65 | $(window) 66 | .on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay)); 67 | }, 68 | 69 | check_for_arrivals : function () { 70 | var self = this; 71 | self.update_arrivals(); 72 | self.update_expedition_positions(); 73 | }, 74 | 75 | set_expedition_position : function () { 76 | var self = this; 77 | $('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) { 78 | var expedition = $(this), 79 | settings = expedition.data('magellan-expedition-init'), 80 | styles = expedition.attr('styles'), // save styles 81 | top_offset, fixed_top; 82 | 83 | expedition.attr('style', ''); 84 | top_offset = expedition.offset().top + settings.threshold; 85 | 86 | //set fixed-top by attribute 87 | fixed_top = parseInt(expedition.data('magellan-fixed-top')); 88 | if (!isNaN(fixed_top)) { 89 | self.settings.fixed_top = fixed_top; 90 | } 91 | 92 | expedition.data(self.data_attr('magellan-top-offset'), top_offset); 93 | expedition.attr('style', styles); 94 | }); 95 | }, 96 | 97 | update_expedition_positions : function () { 98 | var self = this, 99 | window_top_offset = $(window).scrollTop(); 100 | 101 | $('[' + this.attr_name() + '=fixed]', self.scope).each(function () { 102 | var expedition = $(this), 103 | settings = expedition.data('magellan-expedition-init'), 104 | styles = expedition.attr('style'), // save styles 105 | top_offset = expedition.data('magellan-top-offset'); 106 | 107 | //scroll to the top distance 108 | if (window_top_offset + self.settings.fixed_top >= top_offset) { 109 | // Placeholder allows height calculations to be consistent even when 110 | // appearing to switch between fixed/non-fixed placement 111 | var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']'); 112 | if (placeholder.length === 0) { 113 | placeholder = expedition.clone(); 114 | placeholder.removeAttr(self.attr_name()); 115 | placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), ''); 116 | expedition.before(placeholder); 117 | } 118 | expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed'); 119 | } else { 120 | expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove(); 121 | expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed'); 122 | } 123 | }); 124 | }, 125 | 126 | update_arrivals : function () { 127 | var self = this, 128 | window_top_offset = $(window).scrollTop(); 129 | 130 | $('[' + this.attr_name() + ']', self.scope).each(function () { 131 | var expedition = $(this), 132 | settings = expedition.data(self.attr_name(true) + '-init'), 133 | offsets = self.offsets(expedition, window_top_offset), 134 | arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'), 135 | active_item = false; 136 | offsets.each(function (idx, item) { 137 | if (item.viewport_offset >= item.top_offset) { 138 | var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'); 139 | arrivals.not(item.arrival).removeClass(settings.active_class); 140 | item.arrival.addClass(settings.active_class); 141 | active_item = true; 142 | return true; 143 | } 144 | }); 145 | 146 | if (!active_item) { 147 | arrivals.removeClass(settings.active_class); 148 | } 149 | }); 150 | }, 151 | 152 | offsets : function (expedition, window_offset) { 153 | var self = this, 154 | settings = expedition.data(self.attr_name(true) + '-init'), 155 | viewport_offset = window_offset; 156 | 157 | return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) { 158 | var name = $(this).data(self.data_attr('magellan-arrival')), 159 | dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']'); 160 | if (dest.length > 0) { 161 | var top_offset = dest.offset().top - settings.destination_threshold; 162 | if (settings.offset_by_height) { 163 | top_offset = top_offset - expedition.outerHeight(); 164 | } 165 | top_offset = Math.floor(top_offset); 166 | return { 167 | destination : dest, 168 | arrival : $(this), 169 | top_offset : top_offset, 170 | viewport_offset : viewport_offset 171 | } 172 | } 173 | }).sort(function (a, b) { 174 | if (a.top_offset < b.top_offset) { 175 | return -1; 176 | } 177 | if (a.top_offset > b.top_offset) { 178 | return 1; 179 | } 180 | return 0; 181 | }); 182 | }, 183 | 184 | data_attr : function (str) { 185 | if (this.namespace.length > 0) { 186 | return this.namespace + '-' + str; 187 | } 188 | 189 | return str; 190 | }, 191 | 192 | off : function () { 193 | this.S(this.scope).off('.magellan'); 194 | this.S(window).off('.magellan'); 195 | }, 196 | 197 | reflow : function () { 198 | var self = this; 199 | // remove placeholder expeditions used for height calculation purposes 200 | $('[' + self.add_namespace('data-magellan-expedition-clone') + ']', self.scope).remove(); 201 | } 202 | }; 203 | }(jQuery, window, window.document)); 204 | -------------------------------------------------------------------------------- /js/foundation/foundation.offcanvas.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.offcanvas = { 5 | name : 'offcanvas', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | open_method : 'move', 11 | close_on_click : false 12 | }, 13 | 14 | init : function (scope, method, options) { 15 | this.bindings(method, options); 16 | }, 17 | 18 | events : function () { 19 | var self = this, 20 | S = self.S, 21 | move_class = '', 22 | right_postfix = '', 23 | left_postfix = ''; 24 | 25 | if (this.settings.open_method === 'move') { 26 | move_class = 'move-'; 27 | right_postfix = 'right'; 28 | left_postfix = 'left'; 29 | } else if (this.settings.open_method === 'overlap_single') { 30 | move_class = 'offcanvas-overlap-'; 31 | right_postfix = 'right'; 32 | left_postfix = 'left'; 33 | } else if (this.settings.open_method === 'overlap') { 34 | move_class = 'offcanvas-overlap'; 35 | } 36 | 37 | S(this.scope).off('.offcanvas') 38 | .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) { 39 | self.click_toggle_class(e, move_class + right_postfix); 40 | if (self.settings.open_method !== 'overlap') { 41 | S('.left-submenu').removeClass(move_class + right_postfix); 42 | } 43 | $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 44 | }) 45 | .on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) { 46 | var settings = self.get_settings(e); 47 | var parent = S(this).parent(); 48 | 49 | if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) { 50 | self.hide.call(self, move_class + right_postfix, self.get_wrapper(e)); 51 | parent.parent().removeClass(move_class + right_postfix); 52 | } else if (S(this).parent().hasClass('has-submenu')) { 53 | e.preventDefault(); 54 | S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix); 55 | } else if (parent.hasClass('back')) { 56 | e.preventDefault(); 57 | parent.parent().removeClass(move_class + right_postfix); 58 | } 59 | $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 60 | }) 61 | .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) { 62 | self.click_toggle_class(e, move_class + left_postfix); 63 | if (self.settings.open_method !== 'overlap') { 64 | S('.right-submenu').removeClass(move_class + left_postfix); 65 | } 66 | $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 67 | }) 68 | .on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) { 69 | var settings = self.get_settings(e); 70 | var parent = S(this).parent(); 71 | 72 | if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) { 73 | self.hide.call(self, move_class + left_postfix, self.get_wrapper(e)); 74 | parent.parent().removeClass(move_class + left_postfix); 75 | } else if (S(this).parent().hasClass('has-submenu')) { 76 | e.preventDefault(); 77 | S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix); 78 | } else if (parent.hasClass('back')) { 79 | e.preventDefault(); 80 | parent.parent().removeClass(move_class + left_postfix); 81 | } 82 | $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 83 | }) 84 | .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 85 | self.click_remove_class(e, move_class + left_postfix); 86 | S('.right-submenu').removeClass(move_class + left_postfix); 87 | if (right_postfix) { 88 | self.click_remove_class(e, move_class + right_postfix); 89 | S('.left-submenu').removeClass(move_class + left_postfix); 90 | } 91 | $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 92 | }) 93 | .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 94 | self.click_remove_class(e, move_class + left_postfix); 95 | $('.left-off-canvas-toggle').attr('aria-expanded', 'false'); 96 | if (right_postfix) { 97 | self.click_remove_class(e, move_class + right_postfix); 98 | $('.right-off-canvas-toggle').attr('aria-expanded', 'false'); 99 | } 100 | }); 101 | }, 102 | 103 | toggle : function (class_name, $off_canvas) { 104 | $off_canvas = $off_canvas || this.get_wrapper(); 105 | if ($off_canvas.is('.' + class_name)) { 106 | this.hide(class_name, $off_canvas); 107 | } else { 108 | this.show(class_name, $off_canvas); 109 | } 110 | }, 111 | 112 | show : function (class_name, $off_canvas) { 113 | $off_canvas = $off_canvas || this.get_wrapper(); 114 | $off_canvas.trigger('open').trigger('open.fndtn.offcanvas'); 115 | $off_canvas.addClass(class_name); 116 | }, 117 | 118 | hide : function (class_name, $off_canvas) { 119 | $off_canvas = $off_canvas || this.get_wrapper(); 120 | $off_canvas.trigger('close').trigger('close.fndtn.offcanvas'); 121 | $off_canvas.removeClass(class_name); 122 | }, 123 | 124 | click_toggle_class : function (e, class_name) { 125 | e.preventDefault(); 126 | var $off_canvas = this.get_wrapper(e); 127 | this.toggle(class_name, $off_canvas); 128 | }, 129 | 130 | click_remove_class : function (e, class_name) { 131 | e.preventDefault(); 132 | var $off_canvas = this.get_wrapper(e); 133 | this.hide(class_name, $off_canvas); 134 | }, 135 | 136 | get_settings : function (e) { 137 | var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']'); 138 | return offcanvas.data(this.attr_name(true) + '-init') || this.settings; 139 | }, 140 | 141 | get_wrapper : function (e) { 142 | var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap'); 143 | 144 | if ($off_canvas.length === 0) { 145 | $off_canvas = this.S('.off-canvas-wrap'); 146 | } 147 | return $off_canvas; 148 | }, 149 | 150 | reflow : function () {} 151 | }; 152 | }(jQuery, window, window.document)); 153 | -------------------------------------------------------------------------------- /js/foundation/foundation.tab.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.tab = { 5 | name : 'tab', 6 | 7 | version : '5.5.1', 8 | 9 | settings : { 10 | active_class : 'active', 11 | callback : function () {}, 12 | deep_linking : false, 13 | scroll_to_content : true, 14 | is_hover : false 15 | }, 16 | 17 | default_tab_hashes : [], 18 | 19 | init : function (scope, method, options) { 20 | var self = this, 21 | S = this.S; 22 | 23 | this.bindings(method, options); 24 | 25 | // store the initial href, which is used to allow correct behaviour of the 26 | // browser back button when deep linking is turned on. 27 | self.entry_location = window.location.href; 28 | 29 | this.handle_location_hash_change(); 30 | 31 | // Store the default active tabs which will be referenced when the 32 | // location hash is absent, as in the case of navigating the tabs and 33 | // returning to the first viewing via the browser Back button. 34 | S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () { 35 | self.default_tab_hashes.push(this.hash); 36 | }); 37 | }, 38 | 39 | events : function () { 40 | var self = this, 41 | S = this.S; 42 | 43 | var usual_tab_behavior = function (e) { 44 | var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init'); 45 | if (!settings.is_hover || Modernizr.touch) { 46 | e.preventDefault(); 47 | e.stopPropagation(); 48 | self.toggle_active_tab(S(this).parent()); 49 | } 50 | }; 51 | 52 | S(this.scope) 53 | .off('.tab') 54 | // Click event: tab title 55 | .on('focus.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior ) 56 | .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior ) 57 | // Hover event: tab title 58 | .on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) { 59 | var settings = S(this).closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init'); 60 | if (settings.is_hover) { 61 | self.toggle_active_tab(S(this).parent()); 62 | } 63 | }); 64 | 65 | // Location hash change event 66 | S(window).on('hashchange.fndtn.tab', function (e) { 67 | e.preventDefault(); 68 | self.handle_location_hash_change(); 69 | }); 70 | }, 71 | 72 | handle_location_hash_change : function () { 73 | 74 | var self = this, 75 | S = this.S; 76 | 77 | S('[' + this.attr_name() + ']', this.scope).each(function () { 78 | var settings = S(this).data(self.attr_name(true) + '-init'); 79 | if (settings.deep_linking) { 80 | // Match the location hash to a label 81 | var hash; 82 | if (settings.scroll_to_content) { 83 | hash = self.scope.location.hash; 84 | } else { 85 | // prefix the hash to prevent anchor scrolling 86 | hash = self.scope.location.hash.replace('fndtn-', ''); 87 | } 88 | if (hash != '') { 89 | // Check whether the location hash references a tab content div or 90 | // another element on the page (inside or outside the tab content div) 91 | var hash_element = S(hash); 92 | if (hash_element.hasClass('content') && hash_element.parent().hasClass('tabs-content')) { 93 | // Tab content div 94 | self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent()); 95 | } else { 96 | // Not the tab content div. If inside the tab content, find the 97 | // containing tab and toggle it as active. 98 | var hash_tab_container_id = hash_element.closest('.content').attr('id'); 99 | if (hash_tab_container_id != undefined) { 100 | self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash); 101 | } 102 | } 103 | } else { 104 | // Reference the default tab hashes which were initialized in the init function 105 | for (var ind = 0; ind < self.default_tab_hashes.length; ind++) { 106 | self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent()); 107 | } 108 | } 109 | } 110 | }); 111 | }, 112 | 113 | toggle_active_tab : function (tab, location_hash) { 114 | var self = this, 115 | S = self.S, 116 | tabs = tab.closest('[' + this.attr_name() + ']'), 117 | tab_link = tab.find('a'), 118 | anchor = tab.children('a').first(), 119 | target_hash = '#' + anchor.attr('href').split('#')[1], 120 | target = S(target_hash), 121 | siblings = tab.siblings(), 122 | settings = tabs.data(this.attr_name(true) + '-init'), 123 | interpret_keyup_action = function (e) { 124 | // Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js 125 | 126 | // define current, previous and next (possible) tabs 127 | 128 | var $original = $(this); 129 | var $prev = $(this).parents('li').prev().children('[role="tab"]'); 130 | var $next = $(this).parents('li').next().children('[role="tab"]'); 131 | var $target; 132 | 133 | // find the direction (prev or next) 134 | 135 | switch (e.keyCode) { 136 | case 37: 137 | $target = $prev; 138 | break; 139 | case 39: 140 | $target = $next; 141 | break; 142 | default: 143 | $target = false 144 | break; 145 | } 146 | 147 | if ($target.length) { 148 | $original.attr({ 149 | 'tabindex' : '-1', 150 | 'aria-selected' : null 151 | }); 152 | $target.attr({ 153 | 'tabindex' : '0', 154 | 'aria-selected' : true 155 | }).focus(); 156 | } 157 | 158 | // Hide panels 159 | 160 | $('[role="tabpanel"]') 161 | .attr('aria-hidden', 'true'); 162 | 163 | // Show panel which corresponds to target 164 | 165 | $('#' + $(document.activeElement).attr('href').substring(1)) 166 | .attr('aria-hidden', null); 167 | 168 | }, 169 | go_to_hash = function(hash) { 170 | // This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it 171 | // the user would get continually redirected to the default hash. 172 | var is_entry_location = window.location.href === self.entry_location, 173 | default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : is_entry_location ? window.location.hash :'fndtn-' + self.default_tab_hashes[0].replace('#', '') 174 | 175 | if (!(is_entry_location && hash === default_hash)) { 176 | window.location.hash = hash; 177 | } 178 | }; 179 | 180 | // allow usage of data-tab-content attribute instead of href 181 | if (S(this).data(this.data_attr('tab-content'))) { 182 | target_hash = '#' + S(this).data(this.data_attr('tab-content')).split('#')[1]; 183 | target = S(target_hash); 184 | } 185 | 186 | if (settings.deep_linking) { 187 | 188 | if (settings.scroll_to_content) { 189 | 190 | // retain current hash to scroll to content 191 | go_to_hash(location_hash || target_hash); 192 | 193 | if (location_hash == undefined || location_hash == target_hash) { 194 | tab.parent()[0].scrollIntoView(); 195 | } else { 196 | S(target_hash)[0].scrollIntoView(); 197 | } 198 | } else { 199 | // prefix the hashes so that the browser doesn't scroll down 200 | if (location_hash != undefined) { 201 | go_to_hash('fndtn-' + location_hash.replace('#', '')); 202 | } else { 203 | go_to_hash('fndtn-' + target_hash.replace('#', '')); 204 | } 205 | } 206 | } 207 | 208 | // WARNING: The activation and deactivation of the tab content must 209 | // occur after the deep linking in order to properly refresh the browser 210 | // window (notably in Chrome). 211 | // Clean up multiple attr instances to done once 212 | tab.addClass(settings.active_class).triggerHandler('opened'); 213 | tab_link.attr({'aria-selected' : 'true', tabindex : 0}); 214 | siblings.removeClass(settings.active_class) 215 | siblings.find('a').attr({'aria-selected' : 'false', tabindex : -1}); 216 | target.siblings().removeClass(settings.active_class).attr({'aria-hidden' : 'true', tabindex : -1}); 217 | target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex'); 218 | settings.callback(tab); 219 | target.triggerHandler('toggled', [tab]); 220 | tabs.triggerHandler('toggled', [target]); 221 | 222 | tab_link.off('keydown').on('keydown', interpret_keyup_action ); 223 | }, 224 | 225 | data_attr : function (str) { 226 | if (this.namespace.length > 0) { 227 | return this.namespace + '-' + str; 228 | } 229 | 230 | return str; 231 | }, 232 | 233 | off : function () {}, 234 | 235 | reflow : function () {} 236 | }; 237 | }(jQuery, window, window.document)); 238 | -------------------------------------------------------------------------------- /js/vendor/elevator.min.js: -------------------------------------------------------------------------------- 1 | var Elevator=function(){"use strict";function n(n,o){for(var e in o)e in n||(n[e]=o[e]);return n}function o(n,o,e,t){return n/=t/2,1>n?e/2*n*n+o:(n--,-e/2*(n*(n-2)-1)+o)}function e(n,o){for(var e in o){var t=void 0===n[e]&&"function"!=typeof e;t&&(n[e]=o[e])}return n}function t(n){v||(v=n);var e=n-v,i=o(e,w,-w,s);window.scrollTo(0,i),s>e?f=requestAnimationFrame(t):r()}function i(){T||(T=!0,w=document.documentElement.scrollTop||m.scrollTop,p||(s=1.5*w),requestAnimationFrame(t),c&&c.play())}function u(){v=null,w=null,T=!1}function r(){u(),c&&(c.pause(),c.currentTime=0),A&&A.play()}function l(){T&&(cancelAnimationFrame(f),u(),c&&(c.pause(),c.currentTime=0),window.scrollTo(0,0))}function d(n){n.addEventListener("click",i,!1)}function a(n){m=document.body;var o={duration:void 0,mainAudio:!1,preloadAudio:!0,loopAudio:!0,endAudio:!1};n=e(n,o),n.element&&d(n.element),n.duration&&(p=!0,s=n.duration),n.mainAudio&&(c=new Audio(n.mainAudio),c.setAttribute("preload",n.preloadAudio),c.setAttribute("loop",n.loopAudio)),n.endAudio&&(A=new Audio(n.endAudio),A.setAttribute("preload","true")),window.addEventListener("blur",l,!1)}var c,A,m=null,f=null,s=null,p=!1,v=null,w=null,T=!1;return n(a,{elevate:i})}(); -------------------------------------------------------------------------------- /js/vendor/fastclick.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";/** 2 | * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. 3 | * 4 | * @codingstandard ftlabs-jsv2 5 | * @copyright The Financial Times Limited [All Rights Reserved] 6 | * @license MIT License (see LICENSE.txt) 7 | */ 8 | function a(b,d){function e(a,b){return function(){return a.apply(b,arguments)}}var f;if(d=d||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=d.touchBoundary||10,this.layer=b,this.tapDelay=d.tapDelay||200,this.tapTimeout=d.tapTimeout||700,!a.notNeeded(b)){for(var g=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],h=this,i=0,j=g.length;j>i;i++)h[g[i]]=e(h[g[i]],h);c&&(b.addEventListener("mouseover",this.onMouse,!0),b.addEventListener("mousedown",this.onMouse,!0),b.addEventListener("mouseup",this.onMouse,!0)),b.addEventListener("click",this.onClick,!0),b.addEventListener("touchstart",this.onTouchStart,!1),b.addEventListener("touchmove",this.onTouchMove,!1),b.addEventListener("touchend",this.onTouchEnd,!1),b.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(b.removeEventListener=function(a,c,d){var e=Node.prototype.removeEventListener;"click"===a?e.call(b,a,c.hijacked||c,d):e.call(b,a,c,d)},b.addEventListener=function(a,c,d){var e=Node.prototype.addEventListener;"click"===a?e.call(b,a,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(b,a,c,d)}),"function"==typeof b.onclick&&(f=b.onclick,b.addEventListener("click",function(a){f(a)},!1),b.onclick=null)}}var b=navigator.userAgent.indexOf("Windows Phone")>=0,c=navigator.userAgent.indexOf("Android")>0&&!b,d=/iP(ad|hone|od)/.test(navigator.userAgent)&&!b,e=d&&/OS 4_\d(_\d)?/.test(navigator.userAgent),f=d&&/OS [6-7]_\d/.test(navigator.userAgent),g=navigator.userAgent.indexOf("BB10")>0;a.prototype.needsClick=function(a){switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(d&&"file"===a.type||a.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(a.className)},a.prototype.needsFocus=function(a){switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!c;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},a.prototype.sendClick=function(a,b){var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},a.prototype.determineEventType=function(a){return c&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},a.prototype.focus=function(a){var b;d&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type&&"month"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},a.prototype.updateScrollParent=function(a){var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},a.prototype.getTargetElementFromEventTarget=function(a){return a.nodeType===Node.TEXT_NODE?a.parentNode:a},a.prototype.onTouchStart=function(a){var b,c,f;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],d){if(f=window.getSelection(),f.rangeCount&&!f.isCollapsed)return!0;if(!e){if(c.identifier&&c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTimec||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},a.prototype.onTouchMove=function(a){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},a.prototype.findControl=function(a){return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},a.prototype.onTouchEnd=function(a){var b,g,h,i,j,k=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,g=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,f&&(j=a.changedTouches[0],k=document.elementFromPoint(j.pageX-window.pageXOffset,j.pageY-window.pageYOffset)||k,k.fastClickScrollParent=this.targetElement.fastClickScrollParent),h=k.tagName.toLowerCase(),"label"===h){if(b=this.findControl(k)){if(this.focus(k),c)return!1;k=b}}else if(this.needsFocus(k))return a.timeStamp-g>100||d&&window.top!==window&&"input"===h?(this.targetElement=null,!1):(this.focus(k),this.sendClick(k,a),d&&"select"===h||(this.targetElement=null,a.preventDefault()),!1);return d&&!e&&(i=k.fastClickScrollParent,i&&i.fastClickLastScrollTop!==i.scrollTop)?!0:(this.needsClick(k)||(a.preventDefault(),this.sendClick(k,a)),!1)},a.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},a.prototype.onMouse=function(a){return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0},a.prototype.onClick=function(a){var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},a.prototype.destroy=function(){var a=this.layer;c&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},a.notNeeded=function(a){var b,d,e,f;if("undefined"==typeof window.ontouchstart)return!0;if(d=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!c)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(d>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(g&&(e=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),e[1]>=10&&e[2]>=3&&(b=document.querySelector("meta[name=viewport]")))){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===a.style.msTouchAction||"manipulation"===a.style.touchAction?!0:(f=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],f>=27&&(b=document.querySelector("meta[name=viewport]"),b&&(-1!==b.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===a.style.touchAction||"manipulation"===a.style.touchAction?!0:!1)},a.attach=function(b,c){return new a(b,c)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?(module.exports=a.attach,module.exports.FastClick=a):window.FastClick=a}(); 9 | -------------------------------------------------------------------------------- /js/vendor/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); 9 | -------------------------------------------------------------------------------- /js/vendor/placeholder.js: -------------------------------------------------------------------------------- 1 | /*! http://mths.be/placeholder v2.0.9 by @mathias */ 2 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(b){var c={},d=/^jQuery\d+$/;return a.each(b.attributes,function(a,b){b.specified&&!d.test(b.name)&&(c[b.name]=b.value)}),c}function c(b,c){var d=this,f=a(d);if(d.value==f.attr("placeholder")&&f.hasClass("placeholder"))if(f.data("placeholder-password")){if(f=f.hide().nextAll('input[type="password"]:first').show().attr("id",f.removeAttr("id").data("placeholder-id")),b===!0)return f[0].value=c;f.focus()}else d.value="",f.removeClass("placeholder"),d==e()&&d.select()}function d(){var d,e=this,f=a(e),g=this.id;if(""===e.value){if("password"===e.type){if(!f.data("placeholder-textinput")){try{d=f.clone().attr({type:"text"})}catch(h){d=a("").attr(a.extend(b(this),{type:"text"}))}d.removeAttr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",c),f.data({"placeholder-textinput":d,"placeholder-id":g}).before(d)}f=f.removeAttr("id").hide().prevAll('input[type="text"]:first').attr("id",g).show()}f.addClass("placeholder"),f[0].value=f.attr("placeholder")}else f.removeClass("placeholder")}function e(){try{return document.activeElement}catch(a){}}var f,g,h="[object OperaMini]"==Object.prototype.toString.call(window.operamini),i="placeholder"in document.createElement("input")&&!h,j="placeholder"in document.createElement("textarea")&&!h,k=a.valHooks,l=a.propHooks;i&&j?(g=a.fn.placeholder=function(){return this},g.input=g.textarea=!0):(g=a.fn.placeholder=function(){var a=this;return a.filter((i?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":c,"blur.placeholder":d}).data("placeholder-enabled",!0).trigger("blur.placeholder"),a},g.input=i,g.textarea=j,f={get:function(b){var c=a(b),d=c.data("placeholder-password");return d?d[0].value:c.data("placeholder-enabled")&&c.hasClass("placeholder")?"":b.value},set:function(b,f){var g=a(b),h=g.data("placeholder-password");return h?h[0].value=f:g.data("placeholder-enabled")?(""===f?(b.value=f,b!=e()&&d.call(b)):g.hasClass("placeholder")?c.call(b,!0,f)||(b.value=f):b.value=f,g):b.value=f}},i||(k.input=f,l.value=f),j||(k.textarea=f,l.value=f),a(function(){a(document).delegate("form","submit.placeholder",function(){var b=a(".placeholder",this).each(c);setTimeout(function(){b.each(d)},10)})}),a(window).bind("beforeunload.placeholder",function(){a(".placeholder").each(function(){this.value=""})}))}); 3 | -------------------------------------------------------------------------------- /mod/delete_duplicate_url/delete_duplicate_url.php: -------------------------------------------------------------------------------- 1 | $rssUrl){ 50 | $content = getRss($rssUrl); 51 | $xmlContent = getSimpleXMLElement($content); 52 | if($xmlContent === false){ 53 | $disabledRssList[$rssKey] = $rssUrl; 54 | unset($flippedRssList[$rssUrl]); 55 | continue; 56 | } 57 | 58 | $shaarliTitle = $xmlContent->xpath(XPATH_RSS_TITLE); 59 | $shaarliDescription = $xmlContent->xpath(XPATH_RSS_DESCRIPTION); 60 | 61 | if(!isset($shaarliTitle) || !isset($shaarliDescription)){ 62 | $deletedRssList[$rssKey] = $rssUrl; 63 | unset($flippedRssList[$rssUrl]); 64 | }else{ 65 | $uniqId = md5((string)$shaarliTitle[0].(string)$shaarliDescription[0]); 66 | if(!array_key_exists($uniqId, $shaarliLinks)){ 67 | $shaarliLinks[$uniqId] = $rssUrl; 68 | }else{ 69 | if(substr($rssUrl, 0, 8) == 'https://'){ 70 | $deletedRssList[$flippedRssList[$shaarliLinks[$uniqId]]] = $shaarliLinks[$uniqId]; 71 | unset($flippedRssList[$shaarliLinks[$uniqId]]); 72 | $shaarliLinks[$uniqId] = $rssUrl; 73 | }else{ 74 | $deletedRssList[$rssKey] = $rssUrl; 75 | unset($flippedRssList[$rssUrl]); 76 | } 77 | } 78 | } 79 | } 80 | 81 | $rssList = array_flip($flippedRssList); 82 | file_put_contents($rssListFile, json_encode($rssList)); 83 | file_put_contents($disabledRssListFile, json_encode($disabledRssList)); 84 | file_put_contents($deletedRssListFile, json_encode($deletedRssList)); 85 | } 86 | 87 | // var_export($rssList); 88 | if(!empty($rssList)){ 89 | /* 90 | * View on admin.php 91 | */ 92 | $MOD['admin.php_top'] .= '
93 |

94 | Suppression des Shaarlis en double 95 |

96 |
97 |   98 | Supprimer les Shaarlis en double ? 99 |
100 |
'; 101 | } 102 | -------------------------------------------------------------------------------- /mod/login_secure/autorestrict.php: -------------------------------------------------------------------------------- 1 | '); 61 | include 'login_form.php';exit(); 62 | } 63 | else{ # On affiche un formulaire invitant à rentrer le mdp puis on exit le script 64 | include 'login_form.php';exit(); 65 | } 66 | } 67 | // --------------------------------------------------------------------------------- 68 | 69 | 70 | // ------------------------------------------------------------------ 71 | 72 | // ------------------------------------------------------------------ 73 | // gestion de post pour demande de connexion 74 | // si un utilisateur tente de se loguer, on gère ici 75 | // ------------------------------------------------------------------ 76 | if (isset($_POST['login']) && isset($_POST['pass'])){ 77 | log_user($_POST['login'],$_POST['pass']); 78 | if (isset($_POST['cookie'])){setcookie($auto_restrict['cookie_name'],sha1($_SERVER['HTTP_USER_AGENT']),time()+$auto_restrict['cookie_expiration_delay']*1440);} 79 | } 80 | 81 | // ------------------------------------------------------------------ 82 | // si pas de demande de connexion on verifie les vars de session 83 | // et la duree d'inactivité de la session 84 | // si probleme,on include un form de login. 85 | // ------------------------------------------------------------------ 86 | if (!is_ok()){session_destroy();include 'login_form.php';exit();} 87 | // ------------------------------------------------------------------ 88 | // demande de deco via la variable get 'deconnexion' 89 | // ------------------------------------------------------------------ 90 | if (isset($_GET['deconnexion'])){log_user('dis','connect');} 91 | // ------------------------------------------------------------------ 92 | 93 | 94 | 95 | 96 | 97 | // ------------------------------------------------------------------ 98 | // fonctions de cryptage 99 | // récupérées sur http://www.info-3000.com/phpmysql/cryptagedecryptage.php 100 | // ------------------------------------------------------------------ 101 | function GenerationCle($Texte,$CleDEncryptage) 102 | { 103 | $CleDEncryptage = md5($CleDEncryptage); 104 | $Compteur=0; 105 | $VariableTemp = ""; 106 | for ($Ctr=0;$Ctr 207 |

208 | Info sur la session en cours 209 |

210 |
211 |   212 | 213 | Durée d\'inactivité avant déconnexion:%s  214 |
215 | ', $nbJour); 216 | 217 | -------------------------------------------------------------------------------- /mod/login_secure/login_form.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Shaarlo 6 | 7 | 8 | 28 | 29 |
30 |
31 | 32 |

Identifiez-vous

Créez votre mot de passe

40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 | 48 |
49 | 50 |
51 | 52 |
53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /mod/login_secure/login_secure.php: -------------------------------------------------------------------------------- 1 | $_POST['respawn_url']); 41 | $myRespawnJson = json_encode($myRespawn); 42 | file_put_contents($myRespawnFile, $myRespawnJson); 43 | } 44 | } 45 | 46 | if(is_array($myRespawn)){ 47 | $myRespawnUrl = reset($myRespawn); 48 | } 49 | 50 | /* 51 | * Show html for user 52 | */ 53 | $MOD['admin.php_top'] .= sprintf('
54 |

55 | Mon respawn 56 |

57 |
58 |
59 | 60 | 61 | 62 |
63 |
64 |
', $myRespawnUrl); 65 | 66 | -------------------------------------------------------------------------------- /mod/my_shaarli/my_shaarli.php: -------------------------------------------------------------------------------- 1 | $_POST['shaarli_url']); 41 | $myShaarliJson = json_encode($myShaarli); 42 | file_put_contents($myShaarliFile, $myShaarliJson); 43 | } 44 | } 45 | 46 | if(is_array($myShaarli)){ 47 | $myShaarliUrl = reset($myShaarli); 48 | } 49 | 50 | /* 51 | * Show html for user 52 | */ 53 | $MOD['admin.php_top'] .= sprintf('
54 |

55 | Mon shaarli 56 |

57 |
58 |
59 | 60 | 61 | 62 |
63 |
64 |
', $myShaarliUrl); 65 | 66 | -------------------------------------------------------------------------------- /mod/proposition/proposition.php: -------------------------------------------------------------------------------- 1 | $limit){ 86 | break 3; 87 | } 88 | $newsUrl = explode('?', $newsUrl); 89 | if(isset($newsUrl[1]) && strlen($newsUrl[1]) === 6){ 90 | 91 | if('index.php' === substr($newsUrl[0], -9)){ 92 | $newsUrl[0] = substr($newsUrl[0], 0, strlen($newsUrl[0]) - 9); 93 | } 94 | 95 | if('/' !== $newsUrl[0][strlen($newsUrl[0])-1]) { 96 | $newsUrl[0] .= '/'; 97 | } 98 | $potentialRssUrl = $newsUrl[0] . '?do=rss'; 99 | 100 | if(substr($potentialRssUrl, 8) === 'https://'){ 101 | if(!in_array($potentialRssUrl, $potentialShaarlis) 102 | && !in_array($potentialRssUrl, $rssList) 103 | && !in_array($potentialRssUrl, $deletedRssList) 104 | && !in_array($potentialRssUrl, $disabledRssList) 105 | && !in_array($potentialRssUrl, $noHttpsRssList) 106 | ){ 107 | $newRssFlux = is_valid_rss($potentialRssUrl); 108 | if($newRssFlux !== false){ 109 | $potentialShaarlis[$newRssFlux] = $potentialRssUrl; 110 | }else{ 111 | $noHttpsRssList[] = $potentialRssUrl; 112 | file_put_contents($noHttpsRssListFile, json_encode($noHttpsRssList)); 113 | } 114 | } 115 | }else{ 116 | $potentialRssUrls = str_replace('http://', 'https://', $potentialRssUrl); 117 | if(!in_array($potentialRssUrls, $potentialShaarlis) 118 | && !in_array($potentialRssUrls, $rssList) 119 | && !in_array($potentialRssUrls, $deletedRssList) 120 | && !in_array($potentialRssUrls, $disabledRssList) 121 | && !in_array($potentialRssUrls, $noHttpsRssList) 122 | ){ 123 | $newRssFlux = is_valid_rss($potentialRssUrls); 124 | if($newRssFlux !== false){ 125 | $potentialShaarlis[$newRssFlux] = $potentialRssUrls; 126 | }else{ 127 | $noHttpsRssList[] = $potentialRssUrls; 128 | file_put_contents($noHttpsRssListFile, json_encode($noHttpsRssList)); 129 | 130 | if(!in_array($potentialRssUrl, $potentialShaarlis) 131 | && !in_array($potentialRssUrl, $rssList) 132 | && !in_array($potentialRssUrl, $deletedRssList) 133 | && !in_array($potentialRssUrl, $disabledRssList)){ 134 | $newRssFlux = is_valid_rss($potentialRssUrl); 135 | if($newRssFlux !== false){ 136 | $potentialShaarlis[$newRssFlux] = $potentialRssUrl; 137 | } 138 | } 139 | } 140 | } 141 | } 142 | } 143 | } 144 | } 145 | } 146 | } 147 | file_put_contents($potentialShaarlisListFile, json_encode($potentialShaarlis)); 148 | } 149 | } 150 | 151 | if(!empty($potentialShaarlis)){ 152 | $MOD['admin.php_top'] .= '
153 |

154 | Proposition de flux 155 |

156 |
157 |
158 | '; 159 | foreach($potentialShaarlis as $rssKey => $rssUrl){ 160 | $MOD['admin.php_top'] .= ' 161 | 164 | 165 | 166 | 167 | 173 | '; 174 | } 175 | $MOD['admin.php_top'] .= '
162 | 163 |
168 | 169 |
170 | '.$rssUrl.' 171 | 172 |
176 | 177 | 178 |
179 |
180 |
'; 181 | }else{ 182 | /* 183 | * View on admin.php 184 | */ 185 | $MOD['admin.php_top'] .= '
186 |

187 | Proposition de flux 188 |

189 |
190 |   191 | Pas de nouveaux flux trouvés :-( 192 |
193 |
'; 194 | } 195 | -------------------------------------------------------------------------------- /mod/reload_info/reload_info.php: -------------------------------------------------------------------------------- 1 | 35 |

36 | Info sur le dernier rafraîchissement 37 |

38 |
39 | Dernière mise à jour le : %s 40 |
41 | Forcer un rafraîchissement 42 |
43 | ', $mtimeLastReload); 44 | -------------------------------------------------------------------------------- /mod/tags_info/tags_info.php: -------------------------------------------------------------------------------- 1 | 0){ 60 | arsort($categories); 61 | $i = 0; 62 | $tags = ''; 63 | $stopWords = array('
', '[en]', '[fr]'); 64 | foreach($categories as $value => $frequency){ 65 | if(strlen($value) > 3 && !in_array($value, $stopWords)){ 66 | $tags .= '' . $value . ' : ' . $frequency . "
"; 67 | } 68 | 69 | if($i > 50){ 70 | break; 71 | } 72 | $i++; 73 | } 74 | if(!isset($MOD[$currentPhpFile . '_top'])){ 75 | $MOD[$currentPhpFile . '_top'] = ''; 76 | } 77 | 78 | $MOD[$currentPhpFile . '_top'] .= sprintf('
79 |

80 | Top Tags 81 |

82 |
%s
83 |
', $tags); 84 | } 85 | -------------------------------------------------------------------------------- /mod/test_mod/test_mod.php: -------------------------------------------------------------------------------- 1 | 39 |

40 | Module de test 41 |

42 |
43 |   44 | Vous pouvez créer, modifier et activer plusieurs types de module (session sécurisée, recherche de doublon, tags principaux...) %s 45 |
46 | ', $text); 47 | 48 | -------------------------------------------------------------------------------- /opml.php: -------------------------------------------------------------------------------- 1 | run(); 10 | -------------------------------------------------------------------------------- /options_stat.php: -------------------------------------------------------------------------------- 1 | run(); 9 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / -------------------------------------------------------------------------------- /sessions/.htaccess: -------------------------------------------------------------------------------- 1 | Allow from none 2 | Deny from all 3 | -------------------------------------------------------------------------------- /synchro_favicon.php: -------------------------------------------------------------------------------- 1 | strictErrorChecking = FALSE; 24 | $content = getRss($url); 25 | 26 | @$doc->loadHTML($content); 27 | //var_dump($doc); 28 | $xml = @simplexml_import_dom($doc); 29 | $arr = $xml->xpath('//link[@rel="shortcut icon"]'); 30 | 31 | 32 | /** 33 | * Permet de trier des tableaux qui ont des attributs sizes 34 | * 35 | * sizes : "64x64" est convertie en "64" par un simple (int) 36 | * et on regarde le plus grand des deux 37 | */ 38 | function usortByIconSize($a, $b) 39 | { 40 | if ((int)$a['sizes'] == (int)$b['sizes']) { 41 | return 0; 42 | } 43 | 44 | return ((int)$a['sizes'] < (int)$b['sizes']) ? -1 : 1; 45 | } 46 | 47 | // Si shortcut icon non trouvé, on essai via rel icon 48 | if (!isset($arr[0]['href'])) { 49 | 50 | // 51 | $arr = $xml->xpath('//link[@rel="icon"]'); 52 | 53 | // On trouve au moins une image d'icone \o/ 54 | if (is_array($arr)) { 55 | // On commence à trier en fonction des sizes 56 | usort($arr, "usortByIconSize"); 57 | 58 | // Puis on prend le dernier 59 | $arr = array(end($arr)); 60 | } 61 | } 62 | 63 | // Si toujours rien, on sort en 404 64 | if (!isset($arr[0]['href'])) { 65 | header('HTTP/1.1 404 Not found', true, 404); 66 | return; 67 | } 68 | 69 | if (0 === strpos($arr[0]['href'], 'http://') || 0 === strpos($arr[0]['href'], 'https://')) { // Url absolue. 70 | $faviconUrl = $arr[0]['href']; 71 | } else { 72 | $faviconUrl = sprintf('%s/%s', $url, $arr[0]['href']); 73 | } 74 | 75 | $favicon = getRssByCurl($faviconUrl); 76 | if ($favicon) { 77 | $faviconPath = sprintf('img/favicon/%s.ico', getIdOkRss()); 78 | $putContents = file_put_contents($faviconPath, $favicon); 79 | if (false !== $putContents) { 80 | header('HTTP/1.1 200 OK', true, 200); 81 | return; 82 | } 83 | } 84 | 85 | header('HTTP/1.1 500 Internal Server Error', true, 500); 86 | return; 87 | -------------------------------------------------------------------------------- /synchro_shaarli.php: -------------------------------------------------------------------------------- 1 | "; 64 | 65 | $content = file_get_contents($fluxFile); 66 | 67 | //Fri, 13 Mar 2015 16:09:22 +0400 68 | if (strpos($content, date('D, d M Y')) === false && !isset($_GET['full'])) { 69 | echo "Rien de neuf" . "
"; 70 | continue; 71 | } 72 | 73 | $content = str_replace('é', 'é', $content); 74 | 75 | // FIX : parser error : PCDATA invalid Char value 31. 76 | $content = preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $content); 77 | 78 | $xmlContent = getSimpleXMLElement($content); 79 | if($xmlContent === false){ 80 | if (!is_null(get('force'))) { 81 | echo "flux foireux : " . $fluxFile; 82 | } 83 | continue; 84 | } 85 | 86 | $list = $xmlContent->xpath(XPATH_RSS_TITLE); 87 | 88 | if(!isset($list[0])) { 89 | continue; 90 | } 91 | 92 | $titre = (string)$list[0]; 93 | 94 | $shaarlistes[] = creerRss($fluxName, $titre, $url, $urlRssSimplifiee, 1); 95 | 96 | if (!isset($_GET['full'])) { 97 | $rssListArrayed = convertXmlToTableauAndStop($xmlContent, XPATH_RSS_ITEM); 98 | } else { 99 | $rssListArrayed = convertXmlToTableau($xmlContent, XPATH_RSS_ITEM); 100 | } 101 | 102 | foreach($rssListArrayed as $rssItem) { 103 | 104 | $link = $rssItem['link']; 105 | 106 | $link = str_replace('my.shaarli.fr/', 'www.shaarli.fr/my/', $link); 107 | 108 | $rssTimestamp = strtotime($rssItem['pubDate']); 109 | $articleDateJour = date('Ymd', $rssTimestamp); 110 | if($articleDateJour !== date('Ymd') 111 | && !isset($_GET['full'])) { 112 | break; 113 | } 114 | 115 | echo "Ajout de : " . $link . "
"; 116 | $guid = $rssItem['guid']; 117 | if (preg_match('#^https://deleurme.net/#', $link)) { 118 | $link = str_replace('https://deleurme.net', 'http://deleurme.net', $link); 119 | echo "Modification en : " . $link . "
"; 120 | } 121 | if (preg_match('#^https://www.mypersonnaldata.eu/#', $link)) { 122 | $link = str_replace('https://www.mypersonnaldata.eu/', 'http://www.mypersonnaldata.eu/', $link); 123 | echo "Modification en : " . $link . "
"; 124 | } 125 | if (preg_match('#^http://mypersonnaldata.eu/shaarli#', $link)) { 126 | $link = str_replace('http://mypersonnaldata.eu/shaarli', 'http://www.mypersonnaldata.eu/shaarli', $link); 127 | echo "Modification en : " . $link . "
"; 128 | } 129 | 130 | // Remplacement des http://domaine:80/machin en http://domaine/machin 131 | if (strpos($link, ':80') > 0 ) { 132 | $link = str_replace(':80', '', $link); 133 | echo "Modification en : " . $link . "
"; 134 | } 135 | // Remplacement des http://domaine:80/machin en http://domaine/machin 136 | if (strpos($guid, ':80') > 0 ) { 137 | $guid = str_replace(':80', '', $guid); 138 | echo "Modification en : " . $guid . "
"; 139 | } 140 | 141 | if (strpos('#^http://mypersonnaldata.eu/shaarli#', $link)) { 142 | $link = str_replace('http://mypersonnaldata.eu/shaarli', 'http://www.mypersonnaldata.eu/shaarli', $link); 143 | echo "Modification en : " . $link . "
"; 144 | } 145 | 146 | 147 | if (preg_match('#^http://deleurme.net/liens/index.php5/?\?[_a-zA-Z0-9\-]{6}$#', $link)) { 148 | $link = str_replace('index.php5/', '', $link); 149 | $link = str_replace('index.php5', '', $link); 150 | echo "Modification en : " . $link . "
"; 151 | } 152 | 153 | if (preg_match('#^http://lehollandaisvolant.net/\?mode=links&id=[0-9]{14}$#', $guid)) { 154 | $guid = str_replace('mode=links&', '', $guid); 155 | } 156 | if (preg_match('#^http://lehollandaisvolant.net/\?mode=links&id=[0-9]{14}$#', $link)) { 157 | $link = str_replace('mode=links&', '', $link); 158 | } 159 | 160 | 161 | 162 | $title = $rssItem['title']; 163 | $description = $rssItem['description']; 164 | $id = md5(simplifieUrl($guid)); 165 | $category = ''; 166 | if (isset($rssItem['category'])) { 167 | $category = $rssItem['category']; 168 | } 169 | 170 | $linkSansHttp = str_replace('http://', '', $link); 171 | $linkSansHttps = str_replace('https://', '', $linkSansHttp); 172 | $urlSimplifie = $linkSansHttps; 173 | 174 | $idCommun = md5($urlSimplifie); 175 | // Si c'est un lien qui pointe vers un shaarli, il est surement déjà en base 176 | // Donc on le récupère directement 177 | $nbBouclesMax = 5; 178 | $nbBoucles = 0; 179 | $lienSource = $link; 180 | $idRssOrigin = null; 181 | 182 | while ( preg_match('#\?[_a-zA-Z0-9\-]{6}$#', $lienSource) 183 | || preg_match('#\?id=[0-9]{14}$#', $lienSource) 184 | ) { 185 | $retourGetId = getIdCommunFromShaarliLink($mysqli, $lienSource); 186 | if($idRssOrigin === null) { 187 | $idRssOrigin = getIdRssOriginFromShaarliLink($mysqli, $lienSource); 188 | } 189 | $nbBoucles++; 190 | if(!is_null($retourGetId) && $nbBoucles < $nbBouclesMax) { 191 | $idCommun = $retourGetId['id_commun']; 192 | $lienSource = $retourGetId['article_url']; 193 | }else{ 194 | break; 195 | } 196 | } 197 | 198 | // Creation miniature 199 | if (!isset($_GET['skip-mini'])) { 200 | captureUrl($link, $idCommun, 200, 200, true); 201 | captureUrl($link, $idCommun, 256, 256, true); 202 | captureUrl($link, $idCommun, 450, 450, true); 203 | } 204 | $articleDate = date('YmdHis', $rssTimestamp); 205 | $articles[] = creerArticle($id, $idCommun, $link, $urlSimplifie, $title, $description, false, $articleDate, $guid, $fluxName, $idRssOrigin, $category); 206 | 207 | $categories = explode(',', $category); 208 | foreach ($categories as $categoriesPart) { 209 | if (empty($categoriesPart)) { 210 | continue; 211 | } 212 | $tags[] = creerTag($id, $categoriesPart); 213 | } 214 | 215 | if (count($tags) > $maxArticlesParInsert) { 216 | insertEntites($mysqli, 'tags', $tags); 217 | $tags = array(); 218 | } 219 | 220 | if (count($articles) > $maxArticlesParInsert) { 221 | insertArticles($mysqli, $articles); 222 | $articles = array(); 223 | } 224 | } 225 | } 226 | //else{ 227 | // echo ' - pas de flux'; 228 | //} 229 | 230 | insertEntites($mysqli, 'tags', $tags); 231 | $tags = array(); 232 | var_dump($articles); 233 | insertArticles($mysqli, $articles); 234 | $articles = array(); 235 | 236 | //echo '
'; 237 | } 238 | 239 | insertEntites($mysqli, 'rss', $shaarlistes); 240 | 241 | shaarliMyDisconnect($mysqli); 242 | @unlink($pidFile); 243 | 244 | $afin = microtime(true) - $adebut; 245 | 246 | 247 | file_put_contents('temps_script.txt', sprintf('%s : %s', date('d/m/Y H:i:s'), $afin)); 248 | 249 | 250 | -------------------------------------------------------------------------------- /valide.php: -------------------------------------------------------------------------------- 1 |