diff options
Diffstat (limited to 'doc/Example-patch---add-new-via-field-for-links.html')
-rw-r--r-- | doc/Example-patch---add-new-via-field-for-links.html | 141 |
1 files changed, 92 insertions, 49 deletions
diff --git a/doc/Example-patch---add-new-via-field-for-links.html b/doc/Example-patch---add-new-via-field-for-links.html index 7df9d253..44352d3e 100644 --- a/doc/Example-patch---add-new-via-field-for-links.html +++ b/doc/Example-patch---add-new-via-field-for-links.html | |||
@@ -4,7 +4,7 @@ | |||
4 | <meta charset="utf-8"> | 4 | <meta charset="utf-8"> |
5 | <meta name="generator" content="pandoc"> | 5 | <meta name="generator" content="pandoc"> |
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> |
7 | <title></title> | 7 | <title>Shaarli - Example patch add new via field for links</title> |
8 | <style type="text/css">code{white-space: pre;}</style> | 8 | <style type="text/css">code{white-space: pre;}</style> |
9 | <!--[if lt IE 9]> | 9 | <!--[if lt IE 9]> |
10 | <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | 10 | <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
@@ -12,12 +12,55 @@ | |||
12 | <link rel="stylesheet" href="github-markdown.css"> | 12 | <link rel="stylesheet" href="github-markdown.css"> |
13 | </head> | 13 | </head> |
14 | <body> | 14 | <body> |
15 | <div id="local-sidebar"> | ||
16 | <ul> | ||
17 | <li><a href="Home.html">Home</a></li> | ||
18 | <li>Installation | ||
19 | <ul> | ||
20 | <li><a href="Server-requirements.html">Server requirements</a></li> | ||
21 | <li><a href="Server-configuration.html">Server configuration</a></li> | ||
22 | <li><a href="Shaarli-configuration.html">Shaarli configuration</a></li> | ||
23 | </ul></li> | ||
24 | <li><a href="Usage.html">Usage</a> | ||
25 | <ul> | ||
26 | <li><a href="Sharing-button.html">Sharing button</a> (bookmarklet)</li> | ||
27 | <li><a href="Firefox-share.html">Firefox share</a></li> | ||
28 | <li><a href="RSS-feeds.html">RSS feeds</a></li> | ||
29 | </ul></li> | ||
30 | <li>How To | ||
31 | <ul> | ||
32 | <li><a href="Backup,-restore,-import-and-export.html">Backup, restore, import and export</a></li> | ||
33 | <li><a href="Copy-an-existing-installation-over-SSH-and-serve-it-locally.html">Copy an existing installation over SSH and serve it locally</a></li> | ||
34 | <li><a href="Download-CSS-styles-from-an-OPML-list.html">Download CSS styles from an OPML list</a></li> | ||
35 | </ul></li> | ||
36 | <li><a href="Troubleshooting.html">Troubleshooting</a></li> | ||
37 | <li><a href="Development.html">Development</a> | ||
38 | <ul> | ||
39 | <li><a href="GnuPG-signature.html">GnuPG signature</a></li> | ||
40 | <li><a href="Coding-guidelines.html">Coding guidelines</a></li> | ||
41 | <li><a href="Directory-structure.html">Directory structure</a></li> | ||
42 | <li><a href="3rd-party-libraries.html">3rd party libraries</a></li> | ||
43 | <li><a href="Plugin-System.html">Plugin System</a></li> | ||
44 | <li><a href="Security.html">Security</a></li> | ||
45 | <li><a href="Static-analysis.html">Static analysis</a></li> | ||
46 | <li><a href="Theming.html">Theming</a></li> | ||
47 | <li><a href="Unit-tests.html">Unit tests</a></li> | ||
48 | </ul></li> | ||
49 | <li>About | ||
50 | <ul> | ||
51 | <li><a href="FAQ.html">FAQ</a></li> | ||
52 | <li><a href="Community-&-Related-software.html">Community & Related software</a></li> | ||
53 | <li><a href="TODO.html">TODO</a></li> | ||
54 | </ul></li> | ||
55 | </ul> | ||
56 | </div> | ||
57 | <h1 id="example-patch-add-new-via-field-for-links">Example patch add new via field for links</h1> | ||
15 | <p>Example patch to add a new field ("via") for links, an input field to set the "via" property from the "edit link" dialog, and display the "via" field in the link list display. <strong>Untested, use at your own risk</strong></p> | 58 | <p>Example patch to add a new field ("via") for links, an input field to set the "via" property from the "edit link" dialog, and display the "via" field in the link list display. <strong>Untested, use at your own risk</strong></p> |
16 | <p>Thanks to @Knah-Tsaeb in <a href="https://github.com/sebsauvage/Shaarli/pull/158">https://github.com/sebsauvage/Shaarli/pull/158</a></p> | 59 | <p>Thanks to @Knah-Tsaeb in <a href="https://github.com/sebsauvage/Shaarli/pull/158" class="uri">https://github.com/sebsauvage/Shaarli/pull/158</a></p> |
17 | <pre><code>From e0f363c18e8fe67990ed2bb1a08652e24e70bbcb Mon Sep 17 00:00:00 2001 | 60 | <pre><code>From e0f363c18e8fe67990ed2bb1a08652e24e70bbcb Mon Sep 17 00:00:00 2001 |
18 | From: Knah Tsaeb <knah-tsaeb@knah-tsaeb.org> | 61 | From: Knah Tsaeb <knah-tsaeb@knah-tsaeb.org> |
19 | Date: Fri, 11 Oct 2013 15:18:37 +0200 | 62 | Date: Fri, 11 Oct 2013 15:18:37 +0200 |
20 | Subject: [PATCH] Add a "via"/origin property for links, add new input in "edit link" dialog | 63 | Subject: [PATCH] Add a "via"/origin property for links, add new input in "edit link" dialog[](.html) |
21 | Thanks to: | 64 | Thanks to: |
22 | * https://github.com/Knah-Tsaeb/Shaarli/commit/040eb18ec8cdabd5ea855e108f81f97fbf0478c4 | 65 | * https://github.com/Knah-Tsaeb/Shaarli/commit/040eb18ec8cdabd5ea855e108f81f97fbf0478c4 |
23 | * https://github.com/Knah-Tsaeb/Shaarli/commit/4123658eae44d7564d1128ce52ddd5689efee813 | 66 | * https://github.com/Knah-Tsaeb/Shaarli/commit/4123658eae44d7564d1128ce52ddd5689efee813 |
@@ -33,27 +76,27 @@ diff --git a/index.php b/index.php | |||
33 | index 6fae2f8..53f798e 100644 | 76 | index 6fae2f8..53f798e 100644 |
34 | --- a/index.php | 77 | --- a/index.php |
35 | +++ b/index.php | 78 | +++ b/index.php |
36 | @@ -436,6 +436,12 @@ if (isset($_POST['login'])) | 79 | @@ -436,6 +436,12 @@ if (isset($_POST['login']))[](.html) |
37 | // ------------------------------------------------------------------------------------------ | 80 | // ------------------------------------------------------------------------------------------ |
38 | // Misc utility functions: | 81 | // Misc utility functions: |
39 | 82 | ||
40 | +// Try to get just domain for @via | 83 | +// Try to get just domain for @via |
41 | +function getJustDomain($url){ | 84 | +function getJustDomain($url){ |
42 | + $parts = parse_url($url); | 85 | + $parts = parse_url($url); |
43 | + return trim($parts['host']); | 86 | + return trim($parts['host']);[](.html) |
44 | + } | 87 | + } |
45 | + | 88 | + |
46 | // Returns the server URL (including port and http/https), without path. | 89 | // Returns the server URL (including port and http/https), without path. |
47 | // e.g. "http://myserver.com:8080" | 90 | // e.g. "http://myserver.com:8080" |
48 | // You can append $_SERVER['SCRIPT_NAME'] to get the current script URL. | 91 | // You can append $_SERVER['SCRIPT_NAME'] to get the current script URL.[](.html) |
49 | @@ -799,7 +805,8 @@ class linkdb implements Iterator, Countable, ArrayAccess | 92 | @@ -799,7 +805,8 @@ class linkdb implements Iterator, Countable, ArrayAccess |
50 | $found= (strpos(strtolower($l['title']),$s)!==false) | 93 | $found= (strpos(strtolower($l['title']),$s)!==false)[](.html) |
51 | || (strpos(strtolower($l['description']),$s)!==false) | 94 | || (strpos(strtolower($l['description']),$s)!==false)[](.html) |
52 | || (strpos(strtolower($l['url']),$s)!==false) | 95 | || (strpos(strtolower($l['url']),$s)!==false)[](.html) |
53 | - || (strpos(strtolower($l['tags']),$s)!==false); | 96 | - || (strpos(strtolower($l['tags']),$s)!==false);[](.html) |
54 | + || (strpos(strtolower($l['tags']),$s)!==false) | 97 | + || (strpos(strtolower($l['tags']),$s)!==false)[](.html) |
55 | + || (!empty($l['via']) && (strpos(strtolower($l['via']),$s)!==false)); | 98 | + || (!empty($l['via']) && (strpos(strtolower($l['via']),$s)!==false));[](.html) |
56 | if ($found) $filtered[$l['linkdate']] = $l; | 99 | if ($found) $filtered[$l['linkdate'[ = $l;](-=-$l;.html) |
57 | } | 100 | } |
58 | krsort($filtered); | 101 | krsort($filtered); |
59 | @@ -814,7 +821,7 @@ class linkdb implements Iterator, Countable, ArrayAccess | 102 | @@ -814,7 +821,7 @@ class linkdb implements Iterator, Countable, ArrayAccess |
@@ -63,74 +106,74 @@ index 6fae2f8..53f798e 100644 | |||
63 | - foreach($this->links as $l) | 106 | - foreach($this->links as $l) |
64 | + foreach($this-> links as $l) | 107 | + foreach($this-> links as $l) |
65 | { | 108 | { |
66 | $linktags = explode(' ',($casesensitive?$l['tags']:strtolower($l['tags']))); | 109 | $linktags = explode(' ',($casesensitive?$l['tags']:strtolower($l['tags'])));[](.html) |
67 | if (count(array_intersect($linktags,$searchtags)) == count($searchtags)) | 110 | if (count(array_intersect($linktags,$searchtags)) == count($searchtags)) |
68 | @@ -905,7 +912,7 @@ function showRSS() | 111 | @@ -905,7 +912,7 @@ function showRSS() |
69 | else $linksToDisplay = $LINKSDB; | 112 | else $linksToDisplay = $LINKSDB; |
70 | $nblinksToDisplay = 50; // Number of links to display. | 113 | $nblinksToDisplay = 50; // Number of links to display. |
71 | if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links. | 114 | if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.[](.html) |
72 | - { | 115 | - { |
73 | + { | 116 | + { |
74 | $nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ; | 117 | $nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ;[](.html) |
75 | } | 118 | } |
76 | 119 | ||
77 | @@ -944,7 +951,12 @@ function showRSS() | 120 | @@ -944,7 +951,12 @@ function showRSS() |
78 | // If user wants permalinks first, put the final link in description | 121 | // If user wants permalinks first, put the final link in description |
79 | if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)'; | 122 | if ($usepermalinks===true) $descriptionlink = '(<a href="'.$absurl.'">Link</a>)'; |
80 | if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink; | 123 | if (strlen($link['description'])>0) $descriptionlink = '<br>'.$descriptionlink;[](.html) |
81 | - echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.']]></description>'."\n</item>\n"; | 124 | - echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$descriptionlink.'[></description>'."\n</item>\n";](></description>'."\n</item>\n";.html) |
82 | + if(!empty($link['via'])){ | 125 | + if(!empty($link['via'])){[](.html) |
83 | + $via = '<br>Origine => <a href="'.htmlspecialchars($link['via']).'">'.htmlspecialchars(getJustDomain($link['via'])).'</a>'; | 126 | + $via = '<br>Origine => <a href="'.htmlspecialchars($link['via']).'">'.htmlspecialchars(getJustDomain($link['via'])).'</a>';[](.html) |
84 | + } else { | 127 | + } else { |
85 | + $via = ''; | 128 | + $via = ''; |
86 | + } | 129 | + } |
87 | + echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$via.$descriptionlink.']]></description>'."\n</item>\n"; | 130 | + echo '<description><![CDATA['.nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))).$via.$descriptionlink.'[></description>'."\n</item>\n";](></description>'."\n</item>\n";.html) |
88 | $i++; | 131 | $i++; |
89 | } | 132 | } |
90 | echo '</channel></rss><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->'; | 133 | echo '</channel></rss><!-- Cached version of '.htmlspecialchars(pageUrl()).' -->'; |
91 | @@ -980,7 +992,7 @@ function showATOM() | 134 | @@ -980,7 +992,7 @@ function showATOM() |
92 | else $linksToDisplay = $LINKSDB; | 135 | else $linksToDisplay = $LINKSDB; |
93 | $nblinksToDisplay = 50; // Number of links to display. | 136 | $nblinksToDisplay = 50; // Number of links to display. |
94 | if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links. | 137 | if (!empty($_GET['nb'])) // In URL, you can specificy the number of links. Example: nb=200 or nb=all for all links.[](.html) |
95 | - { | 138 | - { |
96 | + { | 139 | + { |
97 | $nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ; | 140 | $nblinksToDisplay = $_GET['nb']=='all' ? count($linksToDisplay) : max($_GET['nb']+0,1) ;[](.html) |
98 | } | 141 | } |
99 | 142 | ||
100 | @@ -1006,11 +1018,16 @@ function showATOM() | 143 | @@ -1006,11 +1018,16 @@ function showATOM() |
101 | 144 | ||
102 | // Add permalink in description | 145 | // Add permalink in description |
103 | $descriptionlink = htmlspecialchars('(<a href="'.$guid.'">Permalink</a>)'); | 146 | $descriptionlink = htmlspecialchars('(<a href="'.$guid.'">Permalink</a>)'); |
104 | + if(isset($link['via']) && !empty($link['via'])){ | 147 | + if(isset($link['via']) && !empty($link['via'])){[](.html) |
105 | + $via = htmlspecialchars('</br> Origine => <a href="'.$link['via'].'">'.getJustDomain($link['via']).'</a>'); | 148 | + $via = htmlspecialchars('</br> Origine => <a href="'.$link['via'].'">'.getJustDomain($link['via']).'</a>');[](.html) |
106 | + } else { | 149 | + } else { |
107 | + $via = ''; | 150 | + $via = ''; |
108 | + } | 151 | + } |
109 | // If user wants permalinks first, put the final link in description | 152 | // If user wants permalinks first, put the final link in description |
110 | if ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)'); | 153 | if ($usepermalinks===true) $descriptionlink = htmlspecialchars('(<a href="'.$absurl.'">Link</a>)'); |
111 | if (strlen($link['description'])>0) $descriptionlink = '&lt;br&gt;'.$descriptionlink; | 154 | if (strlen($link['description'])>0) $descriptionlink = '&lt;br&gt;'.$descriptionlink;[](.html) |
112 | 155 | ||
113 | - $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink."</content>\n"; | 156 | - $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink."</content>\n";[](.html) |
114 | + $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink.$via."</content>\n"; | 157 | + $entries.='<content type="html">'.htmlspecialchars(nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))))).$descriptionlink.$via."</content>\n";[](.html) |
115 | if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification) | 158 | if ($link['tags']!='') // Adding tags to each ATOM entry (as mentioned in ATOM specification)[](.html) |
116 | { | 159 | { |
117 | foreach(explode(' ',$link['tags']) as $tag) | 160 | foreach(explode(' ',$link['tags']) as $tag)[](.html) |
118 | @@ -1478,7 +1495,7 @@ function renderPage() | 161 | @@ -1478,7 +1495,7 @@ function renderPage() |
119 | if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?')) | 162 | if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?')) |
120 | $url = 'http://'.$url; | 163 | $url = 'http://'.$url; |
121 | $link = array('title'=>trim($_POST['lf_title']),'url'=>$url,'description'=>trim($_POST['lf_description']),'private'=>(isset($_POST['lf_private']) ? 1 : 0), | 164 | $link = array('title'=>trim($_POST['lf_title']),'url'=>$url,'description'=>trim($_POST['lf_description']),'private'=>(isset($_POST['lf_private']) ? 1 : 0),[](.html) |
122 | - 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags)); | 165 | - 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags)); |
123 | + 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags), 'via'=>trim($_POST['lf_via'])); | 166 | + 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags), 'via'=>trim($_POST['lf_via']));[](.html) |
124 | if ($link['title']=='') $link['title']=$link['url']; // If title is empty, use the URL as title. | 167 | if ($link['title']=='') $link['title']=$link['url']; // If title is empty, use the URL as title.[](.html) |
125 | $LINKSDB[$linkdate] = $link; | 168 | $LINKSDB[$linkdate] = $link;[](.html) |
126 | $LINKSDB->savedb(); // Save to disk. | 169 | $LINKSDB->savedb(); // Save to disk. |
127 | @@ -1556,7 +1573,8 @@ function renderPage() | 170 | @@ -1556,7 +1573,8 @@ function renderPage() |
128 | $title = (empty($_GET['title']) ? '' : $_GET['title'] ); // Get title if it was provided in URL (by the bookmarklet). | 171 | $title = (empty($_GET['title']) ? '' : $_GET['title'] ); // Get title if it was provided in URL (by the bookmarklet).[](.html) |
129 | $description = (empty($_GET['description']) ? '' : $_GET['description']); // Get description if it was provided in URL (by the bookmarklet). [Bronco added that] | 172 | $description = (empty($_GET['description']) ? '' : $_GET['description']); // Get description if it was provided in URL (by the bookmarklet). [Bronco added that][](.html) |
130 | $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); // Get tags if it was provided in URL | 173 | $tags = (empty($_GET['tags']) ? '' : $_GET['tags'] ); // Get tags if it was provided in URL[](.html) |
131 | - $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL | 174 | - $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL [](.html) |
132 | + $via = (empty($_GET['via']) ? '' : $_GET['via'] ); | 175 | + $via = (empty($_GET['via']) ? '' : $_GET['via'] );[](.html) |
133 | + $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL | 176 | + $private = (!empty($_GET['private']) && $_GET['private'] === "1" ? 1 : 0); // Get private if it was provided in URL[](.html) |
134 | if (($url!='') && parse_url($url,PHP_URL_SCHEME)=='') $url = 'http://'.$url; | 177 | if (($url!='') && parse_url($url,PHP_URL_SCHEME)=='') $url = 'http://'.$url; |
135 | // If this is an HTTP link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) | 178 | // If this is an HTTP link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) |
136 | if (empty($title) && parse_url($url,PHP_URL_SCHEME)=='http') | 179 | if (empty($title) && parse_url($url,PHP_URL_SCHEME)=='http') |
@@ -141,10 +184,10 @@ index 6fae2f8..53f798e 100644 | |||
141 | - | 184 | - |
142 | + | 185 | + |
143 | // If found, extract encoding. | 186 | // If found, extract encoding. |
144 | if (!empty($meta[0])) | 187 | if (!empty($meta[0]))[](.html) |
145 | { | 188 | { |
146 | @@ -1577,7 +1595,7 @@ function renderPage() | 189 | @@ -1577,7 +1595,7 @@ function renderPage() |
147 | $html_charset = (!empty($enc[1])) ? strtolower($enc[1]) : 'utf-8'; | 190 | $html_charset = (!empty($enc[1])) ? strtolower($enc[1]) : 'utf-8';[](.html) |
148 | } | 191 | } |
149 | else { $html_charset = 'utf-8'; } | 192 | else { $html_charset = 'utf-8'; } |
150 | - | 193 | - |
@@ -162,13 +205,13 @@ index 6fae2f8..53f798e 100644 | |||
162 | 205 | ||
163 | $PAGE = new pageBuilder; | 206 | $PAGE = new pageBuilder; |
164 | @@ -1842,6 +1860,9 @@ function buildLinkList($PAGE,$LINKSDB) | 207 | @@ -1842,6 +1860,9 @@ function buildLinkList($PAGE,$LINKSDB) |
165 | $taglist = explode(' ',$link['tags']); | 208 | $taglist = explode(' ',$link['tags']);[](.html) |
166 | uasort($taglist, 'strcasecmp'); | 209 | uasort($taglist, 'strcasecmp'); |
167 | $link['taglist']=$taglist; | 210 | $link['taglist']=$taglist;[](.html) |
168 | + if(!empty($link['via'])){ | 211 | + if(!empty($link['via'])){[](.html) |
169 | + $link['via']=htmlspecialchars($link['via']); | 212 | + $link['via']=htmlspecialchars($link['via']);[](.html) |
170 | + } | 213 | + } |
171 | $linkDisp[$keys[$i]] = $link; | 214 | $linkDisp[$keys[$i[ = $link;](-=-$link;.html) |
172 | $i++; | 215 | $i++; |
173 | } | 216 | } |
174 | diff --git a/tpl/editlink.html b/tpl/editlink.html | 217 | diff --git a/tpl/editlink.html b/tpl/editlink.html |
@@ -180,7 +223,7 @@ index 4a2c30c..14d4f9c 100644 | |||
180 | <i>Description</i><br><textarea name="lf_description" rows="4" cols="25" style="width:100%">{$link.description|htmlspecialchars}</textarea><br> | 223 | <i>Description</i><br><textarea name="lf_description" rows="4" cols="25" style="width:100%">{$link.description|htmlspecialchars}</textarea><br> |
181 | <i>Tags</i><br><input type="text" id="lf_tags" name="lf_tags" value="{$link.tags|htmlspecialchars}" style="width:100%"><br> | 224 | <i>Tags</i><br><input type="text" id="lf_tags" name="lf_tags" value="{$link.tags|htmlspecialchars}" style="width:100%"><br> |
182 | + <i>Origine</i><br><input type="text" name="lf_via" value="{$link.via|htmlspecialchars}" style="width:100%"><br> | 225 | + <i>Origine</i><br><input type="text" name="lf_via" value="{$link.via|htmlspecialchars}" style="width:100%"><br> |
183 | {if condition="($link_is_new && $GLOBALS['privateLinkByDefault']==true) || $link.private == true"} | 226 | {if condition="($link_is_new && $GLOBALS['privateLinkByDefault']==true) || $link.private == true"}[](.html) |
184 | <input type="checkbox" checked="checked" name="lf_private" id="lf_private"> | 227 | <input type="checkbox" checked="checked" name="lf_private" id="lf_private"> |
185 | &nbsp;<label for="lf_private"><i>Private</i></label><br> | 228 | &nbsp;<label for="lf_private"><i>Private</i></label><br> |
186 | diff --git a/tpl/linklist.html b/tpl/linklist.html | 229 | diff --git a/tpl/linklist.html b/tpl/linklist.html |
@@ -192,7 +235,7 @@ index ddc38cb..0a8475f 100644 | |||
192 | <br> | 235 | <br> |
193 | {if="$value.description"}<div class="linkdescription"{if condition="$search_type=='permalink'"} style="max-height:none !important;"{/if}>{$value.description}</div>{/if} | 236 | {if="$value.description"}<div class="linkdescription"{if condition="$search_type=='permalink'"} style="max-height:none !important;"{/if}>{$value.description}</div>{/if} |
194 | + {if condition="isset($value.via) && !empty($value.via)"}<div><a href="{$value.via}">Origine => {$value.via|getJustDomain}</a></div>{/if} | 237 | + {if condition="isset($value.via) && !empty($value.via)"}<div><a href="{$value.via}">Origine => {$value.via|getJustDomain}</a></div>{/if} |
195 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} | 238 | {if="!$GLOBALS['config'['HIDE_TIMESTAMPS'] || isLoggedIn()"}]('HIDE_TIMESTAMPS']-||-isLoggedIn()"}.html) |
196 | <span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{$value.localdate|htmlspecialchars} - permalink</a> - </span> | 239 | <span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{$value.localdate|htmlspecialchars} - permalink</a> - </span> |
197 | {else} | 240 | {else} |
198 | -- | 241 | -- |