Piwigo). In other words, it's a WordPress Sidebar Widget with some available public pictures in your Piwigo gallery as a prereq. Version: 1.00 Author: VDigital Author URI: http://www.vdigital.org/sharing/ */ if (defined('PHPWG_ROOT_PATH')) return; /* Avoid Automatic install under Piwigo */ /* Copyright 2009 VDigital (email : vpiwigo[at]gmail[dot]com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ if (!defined('PPW_NAME')) define('PPW_NAME','Public Piwigo WordPress '); if (!defined('PPW_PFX')) define('PPW_PFX','Public_Piwigo_WordPress_'); load_plugin_textdomain('pwg', 'wp-content/plugins/Public_Piwigo_WordPress_Widget', 'Public_Piwigo_WordPress_Widget' ); class Public_Piwigo_WordPress_Widget extends WP_Widget { function Public_Piwigo_WordPress_Widget(){ $widget_ops = array('classname' => PPW_PFX . 'Widget', 'description' => __( "Adds a thumbnail and its link (to the picture) inside your blog sidebar.",'pwg') ); $control_ops = array('width' => 300, 'height' => 300); $this->WP_Widget(PPW_PFX . 'Widget', PPW_NAME . 'Widget', $widget_ops, $control_ops); } // Code generator function widget($args, $gallery){ include 'Public_WP_Piwigo_code.php'; } function update($new_gallery, $old_gallery){ $gallery = $old_gallery; $gallery['title'] = strip_tags(stripslashes($new_gallery['title'])); $gallery['thumbnail'] = (strip_tags(stripslashes($new_gallery['thumbnail'])) == 'true') ? 'true':'false'; $gallery['piwigo'] = strip_tags(stripslashes($new_gallery['piwigo'])); $gallery['external'] = strip_tags(stripslashes($new_gallery['external'])); $gallery['number'] = intval(strip_tags(stripslashes($new_gallery['number']))); $gallery['category'] = intval(strip_tags(stripslashes($new_gallery['category']))); $gallery['from'] = intval(strip_tags(stripslashes($new_gallery['from']))); $gallery['divclass'] = strip_tags(stripslashes($new_gallery['divclass'])); $gallery['class'] = strip_tags(stripslashes($new_gallery['class'])); $gallery['most_visited'] = (strip_tags(stripslashes($new_gallery['most_visited'])) == 'true') ? 'true':'false'; $gallery['best_rated'] = (strip_tags(stripslashes($new_gallery['best_rated'])) == 'true') ? 'true':'false'; $gallery['most_commented'] = (strip_tags(stripslashes($new_gallery['most_commented'])) == 'true') ? 'true':'false'; $gallery['random'] = (strip_tags(stripslashes($new_gallery['random'])) == 'true') ? 'true':'false'; $gallery['recent_pics'] = (strip_tags(stripslashes($new_gallery['recent_pics'])) == 'true') ? 'true':'false'; $gallery['calendar'] = (strip_tags(stripslashes($new_gallery['calendar'])) == 'true') ? 'true':'false'; $gallery['tags'] = (strip_tags(stripslashes($new_gallery['tags'])) == 'true') ? 'true':'false'; $gallery['comments'] = (strip_tags(stripslashes($new_gallery['comments'])) == 'true') ? 'true':'false'; $gallery['mbcategories'] = (strip_tags(stripslashes($new_gallery['mbcategories'])) == 'true') ? 'true':'false'; return $gallery; } function form($gallery){ // Options include 'Public_WP_Piwigo_options.php'; } } // Register function Public_Piwigo_WordPress_Widget_Init() { register_widget(PPW_PFX . 'Widget'); } add_action('widgets_init', PPW_PFX . 'Widget_Init'); ?>