Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Un lien qui permet de réactiver le flux directement dans les notifica…
…tions de désactivation Fix seenthis/seenthis_squelettes#200
- Loading branch information
Showing
3 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
if (!defined('_ECRIRE_INC_VERSION')) { | ||
return; | ||
} | ||
|
||
function action_seenthis_reactiver_flux_dist() { | ||
$securiser_action = charger_fonction('securiser_action', 'inc'); | ||
$arg = $securiser_action(); | ||
|
||
$id_auteur = intval($arg); | ||
|
||
// reactiver le flux (s'il commence bien par une étoile) | ||
$s = sql_query("SELECT login,rss FROM spip_auteurs WHERE id_auteur = $id_auteur"); | ||
if ($t = sql_fetch($s) and substr($t['rss'], 0, 1) == '*') { | ||
spip_log("reactivation du flux RSS de ". $t['login'] . " (". $id_auteur .") : ". ltrim($t['rss'], '*'), 'flux'); | ||
// mettre à jour le champ en_ligne à la date courante | ||
sql_updateq('spip_auteurs', array('en_ligne' => date('Y-m-d H:i:s')), 'id_auteur =' . $id_auteur); | ||
// retirer * au début de l'url du flux pour le réactiver | ||
sql_updateq('spip_auteurs', array('rss' => ltrim($t['rss'], '*')), 'id_auteur =' . $id_auteur); | ||
} | ||
|
||
// redirect | ||
$GLOBALS['redirect'] = $GLOBALS['meta']['adresse_site']; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters