Commit d7629f0b authored by Adrien Dorsaz's avatar Adrien Dorsaz

Merge branch 'master' of adorsaz.ch:leed-market

parents 7e96aee5 daa7d1cc
......@@ -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");
?>
......@@ -14,6 +14,7 @@ Instructions
Version
=======
* v2.1.3 - Corrige le même bug que la version 2.1.1, mais dans une autre situation
* v2.1.2 - les utilisateurs déconnectés ne chargent pas les préférences de l'utilisateur
* v2.1.1 - Utilise la CSS dynamique pour choisir la largeur de l'affichage des articles quand le menu est affiché
* v2.1.0 - ajout d'un controle (suite à une erreur dans la console js)
......
......@@ -4,7 +4,7 @@
@author Cobalt74 <http://www.cobestran.com>
@link http://www.cobestran.com
@licence CC by nc sa http://creativecommons.org/licenses/by-nc-sa/2.0/fr/
@version 2.1.2
@version 2.1.3
@description Le plugin cacheListFeed permet de cacher la liste des feed afin de lire les news en plein écran.
*/
......
......@@ -39,27 +39,12 @@ function cacheListFeed_toggle_div() {
function cacheListFeed_init(cache) {
var divmenubar = document.getElementById('menuBar');
var Elem_article = document.querySelector('#main article');
if(cache) {
// affichage de la menu bar
divmenubar.style.display = "block";
if (Elem_article.style.position!="fixed") { Elem_article.style.width="67%"; }
if (document.getElementById('cacheListFeed_divbut_return'))
document.getElementById('cacheListFeed_divbut_return').parentNode.removeChild(document.getElementById('cacheListFeed_divbut_return'));
} else {
// cacher la menu bar
divmenubar.style.display = "none";
Elem_article.style.width = "100%";
returnButton = document.createElement('div');
returnButton.setAttribute("class", "cacheListFeed_divbut");
returnButton.setAttribute("id", "cacheListFeed_divbut_return");
returnButton.setAttribute("title", "Afficher la liste des Feeds");
returnButton.setAttribute("onclick", "cacheListFeed_toggle_div(this,'menuBar');");
returnButton.innerHTML = "<";
// Insère l'élément sans altérer les événements existants.
Elem_article.insertBefore(returnButton, Elem_article.firstChild);
}
// On initialise l'attribut display du menu avec l'inverse de la valeur
// "cache", pour que l'application de la fonction "toggle" ajuste l'affichage
// bien comme "cache" le demande.
divmenubar.style.display = cache ? "none" : "block" ;
cacheListFeed_toggle_div();
}
$.ajax({
......
This diff is collapsed.
{
"P_EPUB_AT_TIME":"at",
"P_EPUB_BYLEED":"By your Leed rss reader",
"P_EPUB_CHAPTER":"Chapter",
"P_EPUB_DOWNLOAD_FAVORITES":"Download favorites articles:",
"P_EPUB_DOWNLOAD_TITLE":"Download EPUB books",
"P_EPUB_DOWNLOAD_UNREAD":"Download unread articles:",
"P_EPUB_FAVOITE_ARTICLES":"Favorite Leed articles",
"P_EPUB_FULL":"Complete",
"P_EPUB_MANAGE_TITLE":"Epub plugin",
"P_EPUB_NOARTICLES_WARNING":"No available articles to create EPUB",
"P_EPUB_NOIMAGES":"Without images",
"P_EPUB_NOTLOGGED_ERROR_DOWNLOAD":"You have to be connected to download EPUB books.",
"P_EPUB_NOTLOGGED_ERROR_MODIFY_SETTINGS":"You have to be connected to modify epub plugin settings",
"P_EPUB_ON_DATE":"on",
"P_EPUB_SAVE_SETTINGS":"Save",
"P_EPUB_SETTINGS":"Plugin settings",
"P_EPUB_SET_FAVORITE_LINK":"Display favorite article links",
"P_EPUB_SET_HOME_MENU":"Display EPUB links on homescreen",
"P_EPUB_SET_UNREAD_LINK":"Display unread article links",
"P_EPUB_SET_VERSION":"EPUB version of created files:",
"P_EPUB_TEXTONLY":"Text only",
"P_EPUB_UNKNOWN_ACTION_ERROR":"Unknown action for epub plugin:",
"P_EPUB_UNREAD_ARTICLES":"Unread Leed articles",
"P_EPUB_BOOK_DESCRIPTION":"Automatically generated ebook by your Leed rss reader.",
"P_EPUB_BY":"by"
}
{
"P_EPUB_AT_TIME":"à",
"P_EPUB_BYLEED":"Par votre lecteur rss Leed",
"P_EPUB_CHAPTER":"Chapitre",
"P_EPUB_DOWNLOAD_FAVORITES":"Télécharger les articles favoris",
"P_EPUB_DOWNLOAD_TITLE":"Téléchargement des livres EPUB",
"P_EPUB_DOWNLOAD_UNREAD":"Télécharger les articles non lus :",
"P_EPUB_FAVOITE_ARTICLES":"Articles Leed favoris",
"P_EPUB_FULL":"Complet",
"P_EPUB_MANAGE_TITLE":"Plugin Epub",
"P_EPUB_NOARTICLES_WARNING":"Aucun article disponible pour créer un livre EPUB.",
"P_EPUB_NOIMAGES":"Sans images",
"P_EPUB_NOTLOGGED_ERROR_DOWNLOAD":"Vous devez être connecté pour pouvoir télécharger les livres EPUB",
"P_EPUB_NOTLOGGED_ERROR_MODIFY_SETTINGS":"Vous devez être connecté pour modifier ces paramètres",
"P_EPUB_ON_DATE":"le",
"P_EPUB_SAVE_SETTINGS":"Enregistrer",
"P_EPUB_SETTINGS":"Paramètres du plugin",
"P_EPUB_SET_FAVORITE_LINK":"Afficher les liens pour les articles favoris",
"P_EPUB_SET_HOME_MENU":"Afficher les liens EPUB dans la page d'accueil",
"P_EPUB_SET_UNREAD_LINK":"Afficher les liens pour les articles non lus",
"P_EPUB_SET_VERSION":"Version EPUB à utiliser pour créer les fichiers :",
"P_EPUB_TEXTONLY":"Texte seulement",
"P_EPUB_UNKNOWN_ACTION_ERROR":"Action inconnue pour le plugin epub :",
"P_EPUB_UNREAD_ARTICLES":"Articles Leed non lus",
"P_EPUB_BOOK_DESCRIPTION":"Ebook automatiquement généré par votre lecteur de flux RSS Leed.",
"P_EPUB_BY":"par"
}
......@@ -4,26 +4,25 @@
@author Idleman <idleman@idleman.fr>
@link http://blog.idleman.fr
@licence CC by nc sa http://creativecommons.org/licenses/by-nc-sa/2.0/fr/
@version 1.1.3
@version 1.1.4
@description Le plugin FleadItLater ajoute un bouton permettant de marquer un evenement comme "a lire plus tard" qui s'affichera dans un menu de droite.
*/
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;';
//echo '<div onclick="fleadItLater('.$eventId.',\'add\',this);" class="fleaditLaterButton">Lire + Tard</div>';
echo '<button onclick="fleadItLater('.$eventId.',\'add\',this);">'._t('P_FLEADITLATER_READLATER').'</button>&nbsp;';
}
}
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">
<h3 class="left">A lire</h3>
<h3 class="left">'._t('P_FLEADITLATER_TOREAD').'</h3>
<ul class="clear">
<li>
<ul> ';
......@@ -37,7 +36,7 @@ function fleaditlater_plugin_displayEvents(&$myUser){
'.Functions::truncate($data['title'],38).'
</a>
<button class="right" onclick="fleadItLater('.$data['id'].',\'delete\',this)" style="margin-left:5px;margin-top:5px;">
<span title="marquer comme lu" alt="marquer comme lu">Lu</span>
<span title="'._t('P_FLEADITLATER_MARK_AS_READ').'" alt="'._t('P_FLEADITLATER_MARK_AS_READ').'">'._t('P_FLEADITLATER_MARK_AS_READ_SHORT').'</span>
</button>
</li>';
}
......@@ -52,12 +51,12 @@ function fleaditlater_plugin_displayEvents(&$myUser){
function fleaditlater_plugin_action($_,$myUser){
if ($_['action']=='fleadItLater') {
if($myUser==false) exit('Vous devez vous connecter pour cette action.');
if($myUser==false) exit(_t('P_FLEADITLATER_NOT_CONNECTED_ERROR'));
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 +70,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
?>
{
"P_FLEADITLATER_READLATER":"Read later",
"P_FLEADITLATER_TOREAD":"To read",
"P_FLEADITLATER_MARK_AS_READ":"Set as read",
"P_FLEADITLATER_MARK_AS_READ_SHORT":"Read",
"P_FLEADITLATER_NOT_CONNECTED_ERROR":"You can't acess that without login."
}
{
"P_FLEADITLATER_READLATER":"Lire + tard",
"P_FLEADITLATER_TOREAD":"À lire",
"P_FLEADITLATER_MARK_AS_READ":"Marquer comme lu",
"P_FLEADITLATER_MARK_AS_READ_SHORT":"Lu",
"P_FLEADITLATER_NOT_CONNECTED_ERROR":"Vous devez vous connectez pour accéder à cette fonction."
}
<?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",
......
......@@ -4,7 +4,7 @@
@author GAULUPEAU Jonathan <jo.gaulupeau@gmail.com>
@link https://bitbucket.org/jogaulupeau
@licence GPLv3
@version 1.0.1
@version 1.0.2
@description Le plugin intheleed permet de stocker un lien dans son <a target="_blank" href="http://inthepoche.com">poche</a>. Plugin basé sur un sharleed par Idleman.
*/
......@@ -22,13 +22,13 @@ function intheleed_plugin_button(&$event){
$title = $result[1];
echo '
<a title="partager sur poche" target="_blank" href="'.$shareOption.'?action=add&url='.base64_encode($link).'">Poche !</a>
<a title="'._t('P_INTHELEED_SHARE_WITH_POCHE').'" target="_blank" href="'.$shareOption.'?action=add&url='.base64_encode($link).'">'._t('P_INTHELEED_POCHE_EXCLAMATION').'</a>
';
}
function intheleed_plugin_setting_link(&$myUser){
echo '
<li class="pointer" onclick="$(\'#main section\').hide();$(\'#main #pocheBloc\').fadeToggle(200);">poche</li>
<li class="pointer" onclick="$(\'#main section\').hide();$(\'#main #pocheBloc\').fadeToggle(200);">'._t('P_INTHELEED_POCHE').'</li>
';
}
......@@ -38,20 +38,23 @@ function intheleed_plugin_setting_bloc(&$myUser){
echo '
<section id="pocheBloc" style="display:none;">
<form action="action.php?action=intheleed_update" method="POST">
<h2>Plugin poche</h2>
<h2>'._t('P_INTHELEED_PLUGIN_TITLE').'</h2>
<p class="pocheBlock">
<label for="plugin_poche_link">Lien vers votre poche :</label>
<label for="plugin_poche_link">'._t('P_INTHELEED_POCHE_LINK').'</label>
<input style="width:50%;" type="text" placeholder="http://poche.mondomaine.com" value="'.$configurationManager->get('plugin_poche_link').'" id="plugin_poche_link" name="plugin_poche_link" />
<input type="submit" class="button" value="Enregistrer"><br/>
<input type="submit" class="button" value="'._t('P_INTHELEED_SAVE').'"><br/>
</p>
<strong>Nb:</strong> cette option affichera un bouton à côté de chaque article pour vous proposer de le stocker sur poche.
<strong>'._t('P_INTHELEED_NB').'</strong> '._t('P_INTHELEED_NB_INFO').'
</form>
</section>
';
}
function intheleed_plugin_update($_){
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser===false) exit(_t('P_INTHELEED_CONNECTION_ERROR'));
if($_['action']=='intheleed_update'){
$configurationManager = new Configuration();
$configurationManager->put('plugin_poche_link',$_['plugin_poche_link']);
......@@ -66,4 +69,4 @@ Plugin::addHook('setting_post_link', 'intheleed_plugin_setting_link');
Plugin::addHook('setting_post_section', 'intheleed_plugin_setting_bloc');
Plugin::addHook("action_post_case", "intheleed_plugin_update");
?>
\ No newline at end of file
?>
{
"P_INTHELEED_SHARE_WITH_POCHE":"Share with Poche",
"P_INTHELEED_POCHE_EXCLAMATION":"Poche !",
"P_INTHELEED_POCHE":"poche",
"P_INTHELEED_PLUGIN_TITLE":"Poche plugin",
"P_INTHELEED_POCHE_LINK":"Your Poche link :",
"P_INTHELEED_SAVE":"Save",
"P_INTHELEED_NB":"NB:",
"P_INTHELEED_NB_INFO":"This option will display a button beside every news to save it on your Poche service.",
"P_INTHELEED_CONNECTION_ERROR":"You have to be logged for this action."
}
{
"P_INTHELEED_SHARE_WITH_POCHE":"partager sur poche",
"P_INTHELEED_POCHE_EXCLAMATION":"Poche !",
"P_INTHELEED_POCHE":"poche",
"P_INTHELEED_PLUGIN_TITLE":"Plugin poche",
"P_INTHELEED_POCHE_LINK":"Lien vers votre poche :",
"P_INTHELEED_SAVE":"Enregistrer",
"P_INTHELEED_NB":"NB:",
"P_INTHELEED_NB_INFO":"Cette option affichera un bouton à côté de chaque article pour vous proposer de le stocker sur poche.",
"P_INTHELEED_CONNECTION_ERROR":"Vous devez être connecté pour cette action."
}
......@@ -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'].'%\'';
......
{
"P_SHARLEED_SHARE_WITH_SHAARLI":"Share with Shaarli",
"P_SHARLEED_SHAARLI_EXCLAMATION":"Shaarli !",
"P_SHARLEED_SHAARLI":"Shaarli",
"P_SHARLEED_PLUGIN_TITLE":"Shaarli plugin",
"P_SHARLEED_SHAARLI_LINK":"Your Shaarli link :",
"P_SHARLEED_SAVE":"Save",
"P_SHARLEED_NB":"NB:",
"P_SHARLEED_NB_INFO":"This option will display a button beside every news to save it on your Shaarli service.",
"P_SHARLEED_CONNECTION_ERROR":"You have to be logged for this action."
}
{
"P_SHARLEED_SHARE_WITH_SHAARLI":"partager sur Shaarli",
"P_SHARLEED_SHAARLI_EXCLAMATION":"Shaare !",
"P_SHARLEED_SHAARLI":"Shaarli",
"P_SHARLEED_PLUGIN_TITLE":"Plugin Shaarli",
"P_SHARLEED_SHAARLI_LINK":"Lien vers votre Shaarli :",
"P_SHARLEED_SAVE":"Enregistrer",
"P_SHARLEED_NB":"NB:",
"P_SHARLEED_NB_INFO":"Cette option affichera un bouton à côté de chaque news pour vous proposer de la partager/stocker sur le gestionnaire de liens shaarli.",
"P_SHARLEED_CONNECTION_ERROR":"Vous devez être connecté pour cette action."
}
......@@ -4,7 +4,7 @@
@author Idleman <idleman@idleman.fr>
@link http://blog.idleman.fr
@licence WTFPL
@version 3.0.1
@version 3.0.2
@description Le plugin Shaarleed permet de partager un lien d'evenement directement sur son script <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">shaarli</a>
*/
......@@ -15,19 +15,19 @@ 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];
$title = $result[1];
echo '
<a title="partager sur shaarli" target="_blank" href="'.$shareOption.'?post='.rawurlencode($link).'&title='.$title.'&amp;source=bookmarklet">Shaare!</a>
<a title="'._t('P_SHARLEED_SHARE_WITH_SHAARLI').'" target="_blank" href="'.$shareOption.'?post='.rawurlencode($link).'&title='.$title.'&amp;source=bookmarklet">'._t('P_SHARLEED_SHAARLI_EXCLAMATION').'</a>
';
}
function shaarleed_plugin_setting_link(&$myUser){
echo '<li><a class="toggle" href="#shaarli">Shaarli</a></li>';
echo '<li><a class="toggle" href="#shaarli">'._t('P_SHARLEED_SHAARLI_EXCLAMATION').'</a></li>';
}
function shaarleed_plugin_setting_bloc(&$myUser){
......@@ -36,20 +36,23 @@ function shaarleed_plugin_setting_bloc(&$myUser){
echo '
<section id="shaarli" name="shaarli" class="shaarli">
<form action="action.php?action=shaarleed_update" method="POST">
<h2>Plugin Shaarli</h2>
<h2>'._t('P_SHARLEED_PLUGIN_TITLE').'</h2>
<p class="shaarliBlock">
<label for="plugin_shaarli_link">Lien vers votre shaarli :</label>
<label for="plugin_shaarli_link">'._t('P_SHARLEED_SHAARLI_LINK').'</label>
<input style="width:50%;" type="text" placeholder="http://mon.domaine.com/shaarli/" value="'.$configurationManager->get('plugin_shaarli_link').'" id="plugin_shaarli_link" name="plugin_shaarli_link" />
<input type="submit" class="button" value="Enregistrer"><br/>
<input type="submit" class="button" value="'._t('P_SHARLEED_SAVE').'"><br/>
</p>
<strong>Nb:</strong> cette option affichera un bouton à côté de chaque news pour vous proposer de la partager/stocker sur le gestionnaire de liens shaarli.
<strong>'._t('P_SHARLEED_NB').'</strong> '._t('P_SHARLEED_NB_INFO').'
</form>
</section>
';
}
function shaarleed_plugin_update($_){
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser===false) exit(_t('P_SHARLEED_CONNECTION_ERROR'));
if($_['action']=='shaarleed_update'){
$configurationManager = new Configuration();
$configurationManager->put('plugin_shaarli_link',$_['plugin_shaarli_link']);
......@@ -64,4 +67,4 @@ Plugin::addHook('setting_post_link', 'shaarleed_plugin_setting_link');
Plugin::addHook('setting_post_section', 'shaarleed_plugin_setting_bloc');
Plugin::addHook("action_post_case", "shaarleed_plugin_update");
?>
\ No newline at end of file
?>
<?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
?>
{
"P_THEMESWITCHER_SWITCH_THEME":"Switch theme",
"P_THEMESWITCHER_SAVE":"Save",
"P_THEMESWITCHER_NOWRITE_ERROR":"It seems you don't have permission to write the constant.php file. Please, run the command <code>chmod 664 constant.php</code>",
"P_THEMESWITCHER_CONNECTION_ERROR":"You have to be logged to do this action"
}
{
"P_THEMESWITCHER_SWITCH_THEME":"Changer de thème",
"P_THEMESWITCHER_SAVE":"Enregistrer",
"P_THEMESWITCHER_NOWRITE_ERROR":"Vous ne devez pas avoir les droits d'écriture sur le fichier constant.php. Effectuez un <code>chmod 664 constant.php</code>",
"P_THEMESWITCHER_CONNECTION_ERROR":"Vous devez être connecté pour cette action"
}
......@@ -4,12 +4,12 @@
@author Simounet <contact@simounet.net>
@link http://www.simounet.net
@licence CC BY-SA
@version 1.0.0
@version 1.0.1
@description Le plugin ThemeSwitcher permet de changer de thème via la page de gestion.
*/
function themeswitcher_plugin_AddLink_and_Save(){
echo '<li><a class="toggle" href="#themeSwitcher">Changer de thème</a></li>';
echo '<li><a class="toggle" href="#themeSwitcher">'._t('P_THEMESWITCHER_SWITCH_THEME').'</a></li>';
if(isset($_POST['themeSelected'])){
themeswitcher_plugin_change();
}
......@@ -20,27 +20,30 @@ function themeswitcher_plugin_AddForm(){
echo '
<section class="themeSwitcher" id="themeSwitcher" name="themeSwitcher">
<form action="settings.php" method="post">
<h2>Changer de thème :</h2>
<h2>'._t('P_THEMESWITCHER_SWITCH_THEME').'</h2>
<select name="themeSelected" id="themeSelected">';
foreach($themes as $theme){
echo '<option value="'.$theme.'">'.$theme.'</option>';
}
echo '
</select>
<button class="buttonThemeSwitcher" type="submit">Enregistrer</button>
<button class="buttonThemeSwitcher" type="submit">'._t('P_THEMESWITCHER_SAVE').'</button>
</form>
</section>
';
}
function themeswitcher_plugin_change(){
$myUser = (isset($_SESSION['currentUser'])?unserialize($_SESSION['currentUser']):false);
if($myUser===false) exit(_t('P_THEMESWITCHER_CONNECTION_ERROR'));
$fileName = 'constant.php';
$searchfor = 'marigolds';
$file = file_get_contents($fileName);
$result = preg_replace("/'DEFAULT_THEME',(.?)'(.*)'/", "'DEFAULT_THEME','".$_POST['themeSelected']."'", $file);
$put = file_put_contents($fileName, $result);
if(!$put){
echo "Vous ne devez pas avoir les droits d'écriture sur le fichier constant.php. Effectuez un <code>chmod 664 constant.php</code>";
echo _t('P_THEMESWITCHER_NOWRITE_ERROR');
}
}
......
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