├── 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 |
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 .'[^>]*>(.*\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 |
215 | ', $nbJour);
216 |
217 |
--------------------------------------------------------------------------------
/mod/login_secure/login_form.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Shaarlo
6 |
7 |
8 |
28 |
29 |
30 |
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 |
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 |
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 |
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 |
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 |