Vous n'êtes pas identifié.
Annonce
Annonce 1 : Le Codex en français a besoin de vous pour avancer !
Annonce 2 : Avant de poster, n'oubliez pas de faire une petite Recherche et de lire les règles de ce forum.
Annonce 3 : Lisez notre blog, il regorge de bonnes informations.
#1 02-11-2006 19:56:45
- Patrick-Argentine
- Passionné WP

- Lieu: Buenos Aires
- Date d'inscription: 27-10-2006
- Messages: 143
- Site web
Widget pour plugin Falbum
Trouvé sur un forum en anglais après l'avoir cherché des mois, fonctionne parfaitement<?php
/*
Plugin Name: FAlbum Recent Photos widget
Description: Adds a Recent Photo widget to your sidebar.
Author: Daniel Svärd
Version: 0.1
Author URI: http://
*/
function widget_falbum_init() {
if (!function_exists('register_sidebar_widget'))
return;
function widget_falbum($args) {
global $falbum;
extract($args);
$options = get_option('widget_falbum');
$title = $options['title'];
echo $before_widget . $before_title . $title . $after_title;
echo '<ul>';
echo $falbum->show_recent(4,0,'t');
echo '</ul>';
echo $after_widget;
}
function widget_falbum_control() {
$options = get_option('widget_falbum');
if (!is_array($options))
$options = array('title'=>'');
if ($_POST['falbum-submit']) {
$options['title'] = strip_tags(stripslashes($_POST['falbum-title']));
update_option('widget_falbum', $options);
}
$title = htmlspecialchars($options['title'], ENT_QUOTES);
echo '<p style="text-align:right;"><label for="falbum-title">Title: <input style="width: 200px;" id="falbum-title" name="falbum-title" type="text" value="'.$title.'" /></label></p>';
echo '<input type="hidden" id="falbum-submit" name="falbum-submit" value="1" />';
}
register_sidebar_widget('FAlbum widget', 'widget_falbum');
register_widget_control('FAlbum widget', 'widget_falbum_control');
}
add_action('plugins_loaded', 'widget_falbum_init');
?>
Hors ligne
#2 03-04-2008 13:18:42
- mims1664
- Connaisseur WP
- Date d'inscription: 15-02-2008
- Messages: 14
Re: Widget pour plugin Falbum
et ca marche comment ?
Hors ligne
#3 04-04-2008 00:40:58
Re: Widget pour plugin Falbum
Il faut mettre ce code dans un fichier texte, le nommé "falbum.php" (et non falbum.php.txt"), et mettre tout ça dans wp-content/plugins/, puis activer le tout depuis l'admin 
Hors ligne