Commit 009f4862 authored by Adrien Dorsaz's avatar Adrien Dorsaz

Merge branch 'master' of github.com:ldleman/Leed-market into modularize_cacheListFeed

parents 8de6a0a7 ce0808b6
......@@ -4,7 +4,7 @@
@author qwerty <qwerty@legtux.org>
@link http://etudiant-libre.fr.nf
@licence Tea Licence
@version 1.0.1
@version 1.0.2
@description Vide le cache
*/
......@@ -47,7 +47,7 @@ function clear_folder($folder, $skip_files=array()){
function delcache_plugin_setting_link(&$feed){
echo '<a class="pointer" href="action.php?action=delcache" alt="Vider le cache de Leed" title="Vider le cache">Vider le cache</a>';
echo '<li><a class="toggle" href="action.php?action=delcache" alt="Vider le cache de Leed" title="Vider le cache">Vider le cache</a></li>';
}
function delcache_plugin_action(&$_){
......
{
"READING_TIME":"Reading time:"
}
{
"READING_TIME":"temps estimé de lecture :"
}
<?php
/*
@name Reading Time
@author Qwerty <qwerty@legtux.org>
@link http://etudiant-libre.fr.nf
@licence Tea Licence
@version 1.0.0
@description Estime le temps de lecture d'un article
*/
function readingtime(&$event) {
$readingtime =null;
$word = str_word_count(strip_tags($event->getContent()));
$minutes_estimate = floor($word / 200);
$seconds_estimate = floor($word / (200 / 60));
$hours = intval($seconds_estimate / 3600);
$minutes=intval(($seconds_estimate % 3600) / 60);
$secondes=intval((($seconds_estimate % 3600) % 60));
if($hours>=1) { $readingtime .= $hours.'h ';}
if($minutes>=1) { $readingtime .= $minutes.'min ';}
if($minutes<1 && $hours == 0) { $readingtime .= $secondes.'s ';}
echo _t('READING_TIME').' '.$readingtime;
}
Plugin::addHook("event_pre_top_options", "readingtime");
?>
......@@ -160,7 +160,7 @@ function epub_plugin_download(&$_){
if($myUser===false) exit(_t('P_EPUB_NOTLOGGED_ERROR_DOWNLOAD'));
$requete = 'SELECT title,creator,content,pubdate
FROM '.MYSQL_PREFIX.'event
FROM `'.MYSQL_PREFIX.'event`
WHERE ';
$epubfile_title = "Title to be defined";
......
......@@ -10,7 +10,7 @@
function fleaditlater_plugin_AddButton(&$event){
$eventId = $event->getId();
$count = mysql_query('SELECT COUNT(id) FROM '.MYSQL_PREFIX.'plugin_feaditlater WHERE event='.$eventId);
$count = mysql_query('SELECT COUNT(id) FROM `'.MYSQL_PREFIX.'plugin_feaditlater` WHERE event='.$eventId);
$count = mysql_fetch_row($count);
if(!$count[0]){
echo '<a class="pointer fleaditLaterButton" onclick="fleadItLater('.$eventId.',\'add\',this);">Lire + Tard</a>&nbsp;';
......@@ -19,7 +19,7 @@ function fleaditlater_plugin_AddButton(&$event){
}
function fleaditlater_plugin_displayEvents(&$myUser){
$query = mysql_query('SELECT le.id,le.title,le.link FROM '.MYSQL_PREFIX.'event le INNER JOIN '.MYSQL_PREFIX.'plugin_feaditlater fil ON (le.id=fil.event)');
$query = mysql_query('SELECT le.id,le.title,le.link FROM `'.MYSQL_PREFIX.'event` le INNER JOIN `'.MYSQL_PREFIX.'plugin_feaditlater` fil ON (le.id=fil.event)');
if($query!=null){
echo '<aside class="fleaditLaterMenu">
......@@ -55,9 +55,9 @@ function fleaditlater_plugin_action($_,$myUser){
if($myUser==false) exit('Vous devez vous connecter pour cette action.');
if (isset($_['id'])){
if(isset($_['state']) && $_['state']=='add'){
$return = mysql_query('INSERT INTO '.MYSQL_PREFIX.'plugin_feaditlater (event)VALUES(\''.$_['id'].'\')');
$return = mysql_query('INSERT INTO `'.MYSQL_PREFIX.'plugin_feaditlater` (event)VALUES(\''.$_['id'].'\')');
}else{
$return = mysql_query('DELETE FROM '.MYSQL_PREFIX.'plugin_feaditlater WHERE event=\''.$_['id'].'\'');
$return = mysql_query('DELETE FROM `'.MYSQL_PREFIX.'plugin_feaditlater` WHERE event=\''.$_['id'].'\'');
}
if(!$return) echo mysql_error();
}
......@@ -71,4 +71,4 @@ Plugin::addHook("event_post_top_options", "fleaditlater_plugin_AddButton");
Plugin::addHook("menu_post_folder_menu", "fleaditlater_plugin_displayEvents");
//Ajout des actions fleadit
Plugin::addHook("action_post_case", "fleaditlater_plugin_action");
?>
\ No newline at end of file
?>
<?php
mysql_query('DROP TABLE '.MYSQL_PREFIX.'plugin_feaditlater');
mysql_query('DROP TABLE `'.MYSQL_PREFIX.'plugin_feaditlater`');
?>
\ No newline at end of file
......@@ -19,6 +19,7 @@ Instructions
Version
=======
* v2.6.0 - Gestion de la séparation des fichiers de langues (install / plugins / templates)
* v2.5.0 - compatibilité v1.7 - MAJ changement de langue
* v2.4.1 - Correction notice php
* v2.4.0 - Ajout de la fonction de traduction avec google.
......
This diff is collapsed.
......@@ -5,11 +5,14 @@
"P_I18N_BTN_LOAD_FILE":"Load file",
"P_I18N_BTN_UPD_FILE":"Edit translation",
"P_I18N_COPY_TO":"to",
"P_I18N_CREA_FIC_LNG":"Creating a language file",
"P_I18N_KEY_CODE_NB_KEY":"Leed ($1 Tags)",
"P_I18N_KEY_FILE_NB_KEY":"Language file ($1 Tags)",
"P_I18N_KEY_INFILE_NOTFND_TITLE":"Key missing / obsolete",
"P_I18N_KEY_INFILE_TITLE":"Keys present",
"P_I18N_MANAGE_LNG_TITLE":"Management language files Leed",
"P_I18N_MANAGE_PLUGIN_LNG":"File management plugins languages",
"P_I18N_MANAGE_TEMPLATE_LNG":"File management templates languages",
"P_I18N_MESSAGES":"Message(s)",
"P_I18N_MSG_ALERT":"The 'double quote' character is not authorized in the translations.",
"P_I18N_MSG_CHG_LNG_LEED":"Language change successful, refresh the page to confirm the inclusion",
......
......@@ -5,11 +5,14 @@
"P_I18N_BTN_LOAD_FILE":"Cargar el archivo",
"P_I18N_BTN_UPD_FILE":"Modificar la traducción",
"P_I18N_COPY_TO":"hacia",
"P_I18N_CREA_FIC_LNG":"Creación de un archivo de idioma",
"P_I18N_KEY_CODE_NB_KEY":"Leed ($1 Tags)",
"P_I18N_KEY_FILE_NB_KEY":"Archivo de idioma ($1 Tags)",
"P_I18N_KEY_INFILE_NOTFND_TITLE":"Llaves ausentes / obsoletas",
"P_I18N_KEY_INFILE_TITLE":"Llaves presentes",
"P_I18N_MANAGE_LNG_TITLE":"Administración de los archivos de idioma de Leed",
"P_I18N_MANAGE_PLUGIN_LNG":"Archivos de idioma plugins Gestión",
"P_I18N_MANAGE_TEMPLATE_LNG":"Archivos de idioma temas Gestión",
"P_I18N_MESSAGES":"Mensaje(s)",
"P_I18N_MSG_ALERT":"No se puede utilizar el carácter 'double quote' en las traducciones",
"P_I18N_MSG_CHG_LNG_LEED":"Cambio de idioma exitoso, recarga la página para tomarlo en cuenta",
......
......@@ -5,11 +5,14 @@
"P_I18N_BTN_LOAD_FILE":"Charger fichier",
"P_I18N_BTN_UPD_FILE":"Modifier la traduction",
"P_I18N_COPY_TO":"vers",
"P_I18N_CREA_FIC_LNG":"Création d'un fichier de langue",
"P_I18N_KEY_CODE_NB_KEY":"Leed ($1 Tags)",
"P_I18N_KEY_FILE_NB_KEY":"Fichier Langue ($1 Tags)",
"P_I18N_KEY_INFILE_NOTFND_TITLE":"Clés absentes / obsolètes",
"P_I18N_KEY_INFILE_TITLE":"Clés présentes",
"P_I18N_MANAGE_LNG_TITLE":"Gestion des fichiers de langue de Leed",
"P_I18N_MANAGE_PLUGIN_LNG":"Gestion des fichiers de langues des plugins",
"P_I18N_MANAGE_TEMPLATE_LNG":"Gestion des fichiers de langues des thèmes",
"P_I18N_MESSAGES":"Message(s)",
"P_I18N_MSG_ALERT":"Le caractère 'double quote' n'est pas autorisé dans les traductions.",
"P_I18N_MSG_CHG_LNG_LEED":"Changement de langue réussi, rafraîchir la page pour confirmer la prise en compte",
......
......@@ -26,11 +26,11 @@ function leedStats_plugin_setting_bloc(&$myUser){
//Nombre global d'article lus / non lus / total / favoris
$requete = 'SELECT
(SELECT count(1) FROM '.MYSQL_PREFIX.'feed)as nbFeed,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event WHERE unread = 1)as nbUnread,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event WHERE unread = 0)as nbRead,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event) as nbTotal,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event WHERE favorite = 1)as nbFavorite
(SELECT count(1) FROM `'.MYSQL_PREFIX.'feed`) as nbFeed,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` WHERE unread = 1) as nbUnread,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` WHERE unread = 0) as nbRead,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event`) as nbTotal,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` WHERE favorite = 1) as nbFavorite
';
$query = mysql_query($requete);
if($query!=null){
......@@ -62,11 +62,11 @@ function leedStats_plugin_setting_bloc(&$myUser){
';
//Nombre global d'article lus / non lus / total / favoris
$requete = 'SELECT name, count(1) as nbTotal,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event le2 WHERE le2.unread=1 and le1.feed = le2.feed) as nbUnread,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event le2 WHERE le2.unread=0 and le1.feed = le2.feed) as nbRead,
(SELECT count(1) FROM '.MYSQL_PREFIX.'event le2 WHERE le2.favorite=1 and le1.feed = le2.feed) as nbFavorite
FROM '.MYSQL_PREFIX.'feed lf1
INNER JOIN '.MYSQL_PREFIX.'event le1 on le1.feed = lf1.id
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` le2 WHERE le2.unread=1 and le1.feed = le2.feed) as nbUnread,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` le2 WHERE le2.unread=0 and le1.feed = le2.feed) as nbRead,
(SELECT count(1) FROM `'.MYSQL_PREFIX.'event` le2 WHERE le2.favorite=1 and le1.feed = le2.feed) as nbFavorite
FROM `'.MYSQL_PREFIX.'feed` lf1
INNER JOIN `'.MYSQL_PREFIX.'event` le1 on le1.feed = lf1.id
GROUP BY name
ORDER BY name
';
......
......@@ -10,7 +10,7 @@
*/
function openanon_plugin_button(&$event){
$requete = 'SELECT link FROM '.MYSQL_PREFIX.'event WHERE id = '.$event->getId();
$requete = 'SELECT link FROM `'.MYSQL_PREFIX.'event` WHERE id = '.$event->getId();
$query = mysql_query($requete);
$result = mysql_fetch_row($query);
$link = $result[0];
......
......@@ -67,7 +67,7 @@ function search_plugin_AddForm(){
// foction de recherche des articles avec affichage du résultat.
function search_plugin_recherche(){
$requete = 'SELECT id,title,guid,content,description,link,pubdate,unread, favorite
FROM '.MYSQL_PREFIX.'event
FROM `'.MYSQL_PREFIX.'event`
WHERE title like \'%'.$_GET['plugin_search'].'%\'';
if (isset($_GET['search_option']) && $_GET['search_option']=="1"){
$requete = $requete.' OR content like \'%'.$_GET['plugin_search'].'%\'';
......
......@@ -15,7 +15,7 @@ function shaarleed_plugin_button(&$event){
$configurationManager->getAll();
$shareOption = $configurationManager->get('plugin_shaarli_link');
$requete = 'SELECT link, title FROM '.MYSQL_PREFIX.'event WHERE id = '.$event->getId();
$requete = 'SELECT link, title FROM `'.MYSQL_PREFIX.'event` WHERE id = '.$event->getId();
$query = mysql_query($requete);
$result = mysql_fetch_row($query);
$link = $result[0];
......
<?php
/*
Le code contenu dans cette page ne sera éxecuté qu'à la désactivation du plugin
Vous pouvez donc l'utiliser pour supprimer des tables MySQL, des dossiers, ou executer une action
qui ne doit se lancer qu'à la désinstallation ex :
Le code contenu dans cette page ne sera exécuté qu'à la désactivation du plugin
Vous pouvez donc l'utiliser pour supprimer des tables MySQL, des dossiers, ou exécuter une action
qui ne doit se lancer qu'à la désinstallation ex :
mysql_query('DROP TABLE '.MYSQL_PREFIX.'plugin_squelette');
mysql_query('DROP TABLE `'.MYSQL_PREFIX.'plugin_squelette`');
*/
?>
\ No newline at end of file
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment