--- /dev/null
+[submodule "inc/3rdparty/site_config"]
+ path = inc/3rdparty/site_config
+ url = git://github.com/inthepoche/site_config.git
--- /dev/null
+<?php
+/*
+* Class for Flattr querying
+*/
+class FlattrItem {
+
+ public $status;
+ public $urltoflattr;
+ public $flattrItemURL;
+ public $numflattrs;
+
+ public function checkItem($urltoflattr) {
+ $this->cacheflattrfile($urltoflattr);
+ $flattrResponse = file_get_contents(CACHE . "/flattr/".base64_encode($urltoflattr).".cache");
+ if($flattrResponse != FALSE) {
+ $result = json_decode($flattrResponse);
+ if (isset($result->message)){
+ if ($result->message == "flattrable") {
+ $this->status = FLATTRABLE;
+ }
+ }
+ elseif ($result->link) {
+ $this->status = FLATTRED;
+ $this->flattrItemURL = $result->link;
+ $this->numflattrs = $result->flattrs;
+ }
+ else {
+ $this->status = NOT_FLATTRABLE;
+ }
+ }
+ else {
+ $this->status = "FLATTR_ERR_CONNECTION";
+ }
+ }
+
+ private function cacheflattrfile($urltoflattr) {
+ if (!is_dir(CACHE . '/flattr')) {
+ mkdir(CACHE . '/flattr', 0777);
+ }
+
+ // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache
+ if ((!file_exists(CACHE . "/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime(CACHE . "/flattr/".base64_encode($urltoflattr).".cache") > 86400)) {
+ $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr);
+ $flattrCacheFile = fopen(CACHE . "/flattr/".base64_encode($urltoflattr).".cache", 'w+');
+ fwrite($flattrCacheFile, $askForFlattr);
+ fclose($flattrCacheFile);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+Subproject commit fe9f0d3f60d44a8701f3ecab0c4077a4ed39bfe8
+++ /dev/null
-Full-Text RSS Site Patterns
----------------------------
-
-Site patterns allow you to specify what should be extracted from specific sites.
-
-Please see http://help.fivefilters.org/customer/portal/articles/223153-site-patterns for more information.
\ No newline at end of file
+++ /dev/null
-title: //title
-body: //h2 | //span[@class='masque'] | //article[@class='corps_article_right']
-prune: no
-tidy: no
-
-test_url: http://www.bfmtv.com/societe/cigarette-electronique-dangers-588622.html
\ No newline at end of file
+++ /dev/null
-title: //title
-body: //div[@class='post-content']
-
-prune: no
-tidy: no
-
-test_url: http://www.inthepoche.com/?post/poche-hosting
\ No newline at end of file
+++ /dev/null
-title: //title
-body: //h2 | //p | //ul
-prune: no
-tidy: no
-
-test_url: http://www.tldp.org/HOWTO/Plug-and-Play-HOWTO-7.html
\ No newline at end of file
+++ /dev/null
-<?php
-// this is here to prevent directory listing over the web
-?>
\ No newline at end of file
+++ /dev/null
-title: //h1[@id='firstHeading']
-body: //div[@id = 'bodyContent']
-strip_id_or_class: editsection
-#strip_id_or_class: toc
-strip_id_or_class: vertical-navbox
-strip: //table[@id='toc']
-strip: //div[@id='catlinks']
-strip: //div[@id='jump-to-nav']
-strip: //div[@class='thumbcaption']//div[@class='magnify']
-strip: //table[@class='navbox']
-strip: //table[contains(@class, 'infobox')]
-strip: //div[@class='dablink']
-strip: //div[@id='contentSub']
-strip: //table[contains(@class, 'metadata')]
-strip: //*[contains(@class, 'noprint')]
-strip: //span[@title='pronunciation:']
-prune: no
-tidy: no
-test_url: http://en.wikipedia.org/wiki/Christopher_Lloyd
\ No newline at end of file
+++ /dev/null
-<?php
-// this is here to prevent directory listing over the web
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-return 1;
\ No newline at end of file
}
if (!$import) {
- Tools::redirect();
+ Tools::redirect('?view=home');
}
break;
case 'delete':
$tidy->cleanRepair();
$content = $tidy->value;
- // flattr checking
+ # flattr checking
$flattr = new FlattrItem();
- $flattr->checkitem($entry['url']);
+ $flattr->checkItem($entry['url']);
$tpl_vars = array(
'entry' => $entry,
Tools::logm('error in view call : entry is null');
}
break;
- default : // home, favorites and archive views
+ default: # home, favorites and archive views
$entries = $this->store->getEntriesByView($view, $this->user->getId());
$tpl_vars = array(
'entries' => '',
'page_links' => '',
+ 'nb_results' => '',
);
if (count($entries) > 0) {
$this->pagination->set_total(count($entries));
$datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit());
$tpl_vars['entries'] = $datas;
$tpl_vars['page_links'] = $page_links;
+ $tpl_vars['nb_results'] = count($entries);
}
Tools::logm('display ' . $view . ' view');
break;
}
return $version;
}
-}
-
-/* class for Flattr querying. Should be put in a separate file
-* Or maybe just create an array instead of a complete class... My mistake. :-°
-*/
-class FlattrItem{
- public $status;
- public $urltoflattr;
- public $flattrItemURL;
- public $numflattrs;
-
- public function checkitem($urltoflattr){
- $this->cacheflattrfile($urltoflattr);
- $flattrResponse = file_get_contents("cache/flattr/".base64_encode($urltoflattr).".cache");
- if($flattrResponse != FALSE){
- $result = json_decode($flattrResponse);
- if (isset($result->message)){
- if ($result->message == "flattrable"){
- $this->status = "flattrable";
- }
- }
- elseif ($result->link) {
- $this->status = "flattred";
- $this->flattrItemURL = $result->link;
- $this->numflattrs = $result->flattrs;
- }
- else{
- $this->status = "not flattrable";
- }
- }
- else
- {
- $this->status = "FLATTR_ERR_CONNECTION";
- }
- }
-
- private function cacheflattrfile($urltoflattr){
- if (!is_dir('cache/flattr')){
- mkdir('./cache/flattr', 0777);
- }
- // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache
- if ((!file_exists("cache/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime("cache/flattr/".base64_encode($urltoflattr).".cache") > 86400))
- {
- $askForFlattr = Tools::getFile("https://api.flattr.com/rest/v2/things/lookup/?url=".$urltoflattr);
- $flattrCacheFile = fopen("cache/flattr/".base64_encode($urltoflattr).".cache", 'w+');
- fwrite($flattrCacheFile, $askForFlattr);
- fclose($flattrCacheFile);
- }
- }
-}
+}
\ No newline at end of file
* poche, a read it later open source system
*
* @category poche
- * @author Nicolas Lœuillet <nicolas@loeuillet.org>
+ * @author Nicolas Lœuillet <support@inthepoche.com>
* @copyright 2013
* @license http://www.wtfpl.net/ see COPYING file
*/
# /!\ Be careful if you change the lines below /!\
if (!file_exists(__DIR__ . '/../../vendor/autoload.php')) {
- die('Twig does not seem installed. Have a look at <a href="http://inthepoche.com/?pages/Documentation">the documentation.</a>');
+ die('Twig does not seem installed. Have a look at <a href="inthepoche.com/doc">the documentation.</a>');
}
-// if (file_exists(__DIR__ . '/../../inc/poche/myconfig.inc.php')) {
- // require_once __DIR__ . '/../../inc/poche/myconfig.inc.php';
-// }
require_once __DIR__ . '/../../inc/poche/User.class.php';
require_once __DIR__ . '/../../inc/poche/Url.class.php';
require_once __DIR__ . '/../../inc/3rdparty/class.messages.php';
require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedItem.php';
require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedWriter.php';
require_once __DIR__ . '/../../inc/3rdparty/feedwriter/DummySingleItemFeed.php';
+require_once __DIR__ . '/../../inc/3rdparty/FlattrItem.class.php';
if (DOWNLOAD_PICTURES) {
require_once __DIR__ . '/../../inc/poche/pochePictures.php';
* poche, a read it later open source system
*
* @category poche
- * @author Nicolas Lœuillet <nicolas@loeuillet.org>
+ * @author Nicolas Lœuillet <support@inthepoche.com>
* @copyright 2013
* @license http://www.wtfpl.net/ see COPYING file
*/
define ('DOWNLOAD_PICTURES', FALSE);
define ('SHARE_TWITTER', TRUE);
define ('SHARE_MAIL', TRUE);
-define ('SHARE_SHAARLI', TRUE);
+define ('SHARE_SHAARLI', FALSE);
define ('SHAARLI_URL', 'http://myshaarliurl.com');
define ('FLATTR', TRUE);
+define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url=');
+define ('NOT_FLATTRABLE', '0');
+define ('FLATTRABLE', '1');
+define ('FLATTRED', '2');
define ('ABS_PATH', 'assets/');
define ('TPL', __DIR__ . '/../../tpl');
define ('LOCALE', __DIR__ . '/../../locale');
elseif (isset($_GET['export'])) {
$poche->export();
}
+elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) {
+ $plain_url = new Url(base64_encode($_GET['plainurl']));
+ $poche->action('add', $plain_url);
+}
# vars to send to templates
$tpl_vars = array(
<?php
-/*
-FULL-TEXT-RSS V2 COMPATIBILITY TEST
-
-1) Upload ftr_compatibility_test.php to the web-accessible root of your website.
-For example, if your website is www.example.com, upload it so that you can get
-to it at www.example.com/ftr_compatibility_test.php
-
-2) Open your web browser and go to the page you just uploaded.
-
-Note: This compatibility test has been borrowed (and slightly adapted) from the one supplied by
-SimplePie.org. We have kept most of their checks intact as we use SimplePie in our application.
-http://github.com/simplepie/simplepie/tree/master/compatibility_test/
-*/
-
$app_name = 'poche 1.0';
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.2.0', '>='));
<li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
<li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
<li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
- </ul>
\ No newline at end of file
+ </ul>
\ No newline at end of file
<header class="w600p center mbm">
- <h1><a href="./" title="{% trans "back to home" %}" ><img src="./tpl/img/logo.png" alt="logo poche" /></a></h1>
+ <h1>
+ {% if view == 'home' %}{% block logo %}<img src="./tpl/img/logo.png" alt="logo poche" />{% endblock %}
+ {% else %}<a href="./" title="{% trans "back to home" %}" >{{ block('logo') }}</a>
+ {% endif %}
+ </h1>
</header>
\ No newline at end of file
{% block title %}{% trans "config" %}{% endblock %}
{% block menu %}
- <ul id="links">
- <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
- <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
- <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
- <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
- <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
- </ul>
+{% include '_menu.twig' %}
{% endblock %}
{% block content %}
<h2>{% trans "Poching a link" %}</h2>
- <p>You can poche a link by several methods: (<a href="http://www.inthepoche.com/?pages/Documentation" title="{% trans "read the documentation" %}">?</a>)</p>
+ <p>You can poche a link by several methods: (<a href="http://inthepoche.com/doc" title="{% trans "read the documentation" %}">?</a>)</p>
<ul>
<li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
<li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
<li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
+ <li>
+ <form method="get" action="index.php">
+ <label class="addurl" for="plainurl">{% trans "by filling this field" %}:</label>
+ <input autofocus required placeholder="Ex:mywebsite.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
+ <input type="submit" value="{% trans "poche it!" %}" />
+ </form>
+ </li>
<li>bookmarklet: drag & drop this link to your bookmarks bar <a id="bookmarklet" ondragend="this.click();" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li>
</ul>
<h2>{% trans "Updating poche" %}</h2>
<ul>
<li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li>
- <li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://inthepoche.com/?pages/T%C3%A9l%C3%A9charger-poche">{% trans "a more recent stable version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
- {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://inthepoche.com/?pages/T%C3%A9l%C3%A9charger-poche">{% trans "a more recent development version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>{% endif %}
+ <li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://inthepoche.com/">{% trans "a more recent stable version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
+ {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://inthepoche.com/">{% trans "a more recent development version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>{% endif %}
</ul>
<h2>{% trans "Change your password" %}</h2>
<h2>{% trans "Import" %}</h2>
<p>{% trans "Please execute the import script locally, it can take a very long time." %}</p>
- <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p>
+ <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/doc">inthepoche.com</a></p>
<ul>
<li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "{{ constant('IMPORT_POCKET_FILE')}}" file on your server)</li>
<li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "{{constant('IMPORT_READABILITY_FILE')}}" file on your server)</li>
#main #content .entrie {
border-bottom: 1px dashed #222;
}
+/* First entry */
+#main #content .results + .entrie {
+ clear: both;
+}
#main .entrie .tools {
list-style-type: none;
}
-/* Pagination */
-.pagination {
- clear: both;
+.results {
+ overflow: hidden;
padding-bottom: 20px;
padding-top: 10px;
+}
+
+.nb-results {
+ float: left;
+ font-size: 0.9em;
+ line-height: 24px;
+ vertical-align: middle;
+}
+
+/* Pagination */
+.pagination {
+ float: right;
text-align: right;
}
.pagination a {
margin: 2px;
}
.pagination .disabled {
- border: 1px solid #eee;
- color: #ddd;
- margin: 2px;
- padding: 4px 8px;
- font-size: 11px;
- font-weight: bold;
+ display: none;
}
#bookmarklet {
.reading-time {
font-size: 0.8em;
}
+
+#inputform {
+ display: none;
+ text-align:center;
+ max-width:300px;
+ margin-left:auto;
+ margin-right:auto;
+ margin-top:5px;
+ padding-bottom: 5px;
+ background-color: rgba(0, 0, 0, 0.9);
+ opacity:0.8;
+ color:white;
+ border-radius: 3px;
+}
{% block title %}{% trans "plop" %}{% endblock %}
{% block content %}
{{ msg|raw }}
- <p>Don't forget <a href="http://inthepoche.com/?pages/Documentation">the documentation</a>.</p>
+ <p>Don't forget <a href="http://inthepoche.com/doc">the documentation</a>.</p>
{% endblock %}
\ No newline at end of file
{% include '_menu.twig' %}
{% endblock %}
{% block precontent %}
+ {% if entries|length > 1 %}
<ul id="sort">
<li><a href="./?sort=ia&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
<li><a href="./?sort=ta&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
</ul>
+ {% endif %}
{% endblock %}
{% block content %}
- {{ page_links | raw }}
{% if entries is empty %}
<div class="messages warning"><p>{% trans "No link available here!" %}</p></div>
{% else %}
+ {% block pager %}
+ {% if nb_results > 1 %}
+ <div class="results">
+ <div class="nb-results">{{ nb_results }} {% trans "results" %}</div>
+ {{ page_links | raw }}
+ </div>
+ {% endif %}
+ {% endblock %}
{% for entry in entries %}
<div id="entry-{{ entry.id|e }}" class="entrie">
<h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
</div>
{% endfor %}
{% endif %}
- {{ page_links | raw }}
+ {{ block('pager') }}
{% endblock %}
\ No newline at end of file
<fieldset class="w500p center">
<h2 class="mbs txtcenter">{% trans "install your poche" %}</h2>
<p>
- {% trans "poche is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://inthepoche.com/?pages/Documentation'>read the documentation on poche website</a>." %}
+ {% trans "poche is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://inthepoche.com/doc'>read the documentation on poche website</a>." %}
</p>
<p class="row">
<label class="col w150p" for="login">{% trans "Login" %}</label>
--- /dev/null
+function showinput(){
+$('#inputform').fadeIn('fast');}
\ No newline at end of file
{% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
{% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
{% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
- {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %}
+ {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
</ul>
</div>
<header class="mbm">
{% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
{% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
{% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
- {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %}
+ {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
</ul>
<p>{% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com?subject=Wrong%20display%20in%20poche&body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p>
</div>