Index: WP-FaceThumb.php =================================================================== --- WP-FaceThumb.php (.../trunk) (revision 543649) +++ WP-FaceThumb.php (.../tags/0.2) (revision 544576) @@ -3,8 +3,8 @@ /* Plugin Name: WP-FaceThumb Plugin URI: http://wordpress.org/extend/plugins/wp-facethumb/ - Description: This plugin allows your visitors to take pictures of themselves with their webcam and post it to your blog. - Version: 0.1 + Description: WP-FaceThumb allows your visitors to take a picture with their webcam and post it on a widget to your blog. + Version: 0.2 Author: MNT-TECH Author URI: http://www.mnt-tech.fr/ */ @@ -12,7 +12,7 @@ class WP_FaceThumb { private $wp_facethumb_settings = array(); - private $wp_facethumb_version = '0.1'; + private $wp_facethumb_version = '0.2'; function __construct() { @@ -104,13 +104,25 @@ if ($thumb_mime == "image/jpeg") { global $wpdb; $table = $wpdb->prefix . "facethumb"; - $wpdb->query("INSERT INTO $table VALUES ('', '$time', '$pseudo', '$thumb_url', '$link', '1')"); + + /* Check if the moderate function is activate or not in the settings */ + if ( $this->wp_facethumb_settings['moderate'] == 'yes' ) { + $moderate = '0'; + } else { + $moderate = '1'; + } + + $wpdb->query("INSERT INTO $table VALUES ('', '$time', '$pseudo', '$thumb_url', '$link', '$moderate')"); } else { unlink($thumb_location); } } } + + /** + * This function handle the plugin installation : table creation, settings creation, set the db version... + */ function facethumb_install() { /* load the settings registred if the plugin was previously installed */ @@ -124,7 +136,8 @@ 'link' => 'both', 'ajax' => 'no', 'moderate' => 'no', - 'thumbs_per_page' => '10' + 'thumbs_per_page' => '10', + 'support_us' => 'no' ), $wp_facethumb_settings); /* Store or update the settings */ @@ -180,10 +193,7 @@ $wp_facethumb_settings = (array) get_option('wp_facethumb_settings'); $wp_facethumb_settings['gallery_id'] = $gallery_id; update_option('wp_facethumb_settings', $wp_facethumb_settings); - - - /* Add the first thumb, time() will be used for the name and arrival time of the thumb */ $time = time(); Index: readme.txt =================================================================== --- readme.txt (.../trunk) (revision 543649) +++ readme.txt (.../tags/0.2) (revision 544576) @@ -6,42 +6,36 @@ Tested up to: 3.2.1 Stable tag: trunk -The plugin allows your visitor to post thumbnail on your blog - == Description == -This plugin allows your visitor to take a snapshot whith a webcam and the thumb is display on your sidebar. The visitor indicate his pseudo and can let an URL which will be link to the thumb. You can see a demo at http://www.mnt-tech.fr/wp-facethumb +[WP-FaceThumb](http://www.mnt-tech.fr/wp-facethumb/) allows your visitors to take a picture with their webcam and post it on a widget to your blog. -French translation : -Ce plugin permet à vos visiteurs de prendre une photo avec leur webcam et cette photo sera affichée dans votre sidebar. Le visiteur indique son pseudo et peut également laisser une URL qui sera lié à la photo. Une démo est disponnible à l'adresse suivante: http://www.mnt-tech.fr/wp-facethumb - == Installation == -1. Simply download the archive of the latest release of facethumb -2. Go to the admin panel of your blog -3. Go to 'Add new' in the Plugins menu -4. Go to 'Upload' an click 'browse' to select the archive you've just downloaded -5. Click on the 'install now' button and here it is, facethumb is installed -6. To see it in action on your blog you just have to activate the widget in the widget menu which is in 'Appearance' -7. Just drag and drop facethumb in your sidebar and that's it. If you don't want to use the widgetized sidebar add `` to sidebar.php where you want the widget to be. +There is a complete step by step guide with screenshots to install WP-FaceThumb. == Frequently Asked Questions == -= Can I delete some strange thumb people posted on my blog? = -Yes, but that will be possible only if you have FaceThumb 0.0.3 or better. += Can I delete some strange photos people posted on my blog? = +Yes, you have to go in the "manage gallery" tab in the WP-FaceThumb settings and you can delete or simply hide the photos. = How do I add the widget in my sidebar? = -You can use 2 differents ways. Either go to 'Appearance' > 'Widget' in the admin panel and drag and drop FaceThumb from Available Widget to Sidebar 1 or add `` to sidebar.php file of your theme, where you want the widget to be +Login to your blog dashboard, go to 'Appearance' -> 'Widget' and drag and drop WP-FaceThumb from Available Widget to the sidebar you want the plugin appears. += Can i change or delete the page WP-FaceThumb Gallery ? = +Yes, here is a complete guide about this setting and how to customize it += I can see the photos in manage gallery but not in the public gallery, WTF ? = +Don't worry, just check if the photos are set to yes in the visible column and make sure that the moderate function is set to no if you want the photos are automatically shown == Screenshots == -1. The plugin is dispalyed in the sidebar. You can click on 'Take a thumbnail' or 'Thumb gallery' to use the plugin. +1. The plugin is displayed in the sidebar. You can click on 'Take a thumbnail' or 'Thumb gallery' to use the plugin. 2. You just have to click on allow to let the site use your webcam 3. Just fill the form and click the snap button == Changelog == -= 0.1 = += 0.2 = +* Bug Fix: Activate moderate function when the photo is taken +* Security Fix -* First realease of WP-FaceThumb. - -== Arbitrary section == \ No newline at end of file += 0.1 = +* First release of WP-FaceThumb \ No newline at end of file Index: classes/WP_FaceThumb_Admin.php =================================================================== --- classes/WP_FaceThumb_Admin.php (.../trunk) (revision 543649) +++ classes/WP_FaceThumb_Admin.php (.../tags/0.2) (revision 544576) @@ -28,8 +28,9 @@ add_settings_field('widget_thumb', __('Photo to display in widget
Select if you want to show the last thumb or a random one', 'WP-Facethumb'), array(&$this, 'generate_fields'), 'wp_facethumb_settings', 'wp-facethumb-options', array('label_for' => 'widget_thumb')); add_settings_field('ajax', __('Load the widget using ajax
Select if you are using a cache plugin like WP Super Cache or W3 Total Cache. If you don\'t know what is cache you should select no', 'WP-Facethumb'), array(&$this, 'generate_fields'), 'wp_facethumb_settings', 'wp-facethumb-options', array('label_for' => 'ajax')); add_settings_field('thumbs_per_page', __('Number of thumbs per page in admin panel
This setting applies to the Manage Gallery tab', 'WP-Facethumb'), array(&$this, 'generate_fields'), 'wp_facethumb_settings', 'wp-facethumb-options', array('label_for' => 'thumbs_per_page')); + add_settings_field('support_us', __('Support us
By selecting yes this will create a link on the widget to help us to be more famous', 'WP-Facethumb'), array(&$this, 'generate_fields'), 'wp_facethumb_settings', 'wp-facethumb-options', array('label_for' => 'support_us')); add_settings_field('gallery_id', __('Gallery ID
Don\'touch this unless you know exactly what you\'re doing!', 'WP-Facethumb'), array(&$this, 'generate_fields'), 'wp_facethumb_settings', 'wp-facethumb-options', array('label_for' => 'gallery_id')); - } + } /* Generate the different fields */ @@ -105,6 +106,16 @@ } ?>/>
'; + foreach ($link as $value) { + ?>