git-svn-id: https://192.168.0.254/svn/Proyectos.FundacionLQDVI_Web/trunk@3 77ab8c26-3d69-2c4d-86f2-786f4ba54905
This commit is contained in:
David Arranz 2011-06-01 15:03:40 +00:00
parent 26d57a69bd
commit 7609520c4d
525 changed files with 29145 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,5 @@
copy.src.files=false
copy.src.target=
index.file=index.php
run.as=LOCAL
url=http://localhost/lqdvi/

View File

@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_5
source.encoding=ISO-8859-1
src.dir=.
tags.asp=false
tags.short=true
web.root=.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>LQDVI</name>
</data>
</configuration>
</project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,473 @@
<?php
/*
Plugin Name: FaceThumb
Plugin URI: http://www.mnt-tech.fr/blog/
Description: The plugin allows your visitors to post thumbnails on your blog.
Version: 0.0.4
Author: MNT-Tech S.A.R.L.
Author URI: http://www.mnt-tech.fr/
*/
$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'facethumb', 'wp-content/plugins/' . $plugin_dir, $plugin_dir . '/languages' );
function calculate_gallery($admin) {
global $wpdb;
$post = $wpdb->prefix . "posts";
$plugin = $wpdb->prefix . "facethumb";
$column = get_option( 'facethumb_column' );
$line = get_option( 'facethumb_line' );
$photo_per_page = $line * $column;
$number_of_photo = $wpdb->get_var( "SELECT COUNT(*) FROM $plugin" );
$number_of_page = ceil( $number_of_photo / $photo_per_page ); //ceil : entier supérieur
if ( isset( $_GET['ppmnt']) AND $_GET['ppmnt'] != NULL AND $_GET['ppmnt'] > 0 AND $_GET['ppmnt'] <= $number_of_page ) {
$number_of_current_page = $_GET['ppmnt'];
$start = ( $photo_per_page * ( $number_of_current_page - 1 ) ) + 1;
}
else {
$number_of_current_page = 1;
$start = 1;
}
$stop = $number_of_current_page * $photo_per_page;
$photo_to_display = $number_of_photo - ($start - 1);
$display = '';
if ( $number_of_photo == 0 ) {
$display .= '<p>'. __('Sorry, no photos have been taken yet!', 'facethumb') .'</p><br/>';
}
elseif ( $photo_to_display < $photo_per_page ) {
$stop_display = 1; // Permet de ne pas afficher des cases vides dans le tableau, s'il n'y a pas assez de photo pour remplir la page
if ( $admin == 1 AND $number_of_photo != 0) {
$cible = str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);
$display .= '<form name="form1" method="post" action="'.$cible.'">';
$display .= '<input type="hidden" name="delete_hidden" value="Y">';
$display .= '<input type="hidden" name="start_hidden" value="'.$start.'">';
}
$display .= '<table>';
for ( $line_count = 1; $line_count <= $line AND $photo_to_display >= $stop_display; $line_count++ ) {
$display .= '<tr>';
for ($compteur_colonne = 1; $compteur_colonne <= $column AND $photo_to_display >= $stop_display; $compteur_colonne++) {
$display .= '<td>';
$id_photo = $number_of_photo - $start;
$current_photo = $wpdb->get_row( "SELECT * FROM $plugin ORDER BY id LIMIT $id_photo, 1" );
while ( $current_photo->url == NULL AND $start <= $stop ) { // Elimine les id des éléments supprimés de la BDD.
$start ++;
$current_photo = $wpdb->get_row( "SELECT * FROM $plugin ORDER BY id LIMIT $id_photo, 1" );
}
if ( (get_option('facethumb_link') == 'gallery' OR get_option('facethumb_link') == 'both') AND $current_photo->link != "none") {
$display .= '<a href="' . htmlspecialchars($current_photo->link) . '">';
}
$display .= '<img src="' . htmlspecialchars($current_photo->url) . '" alt="' . htmlspecialchars($current_photo->name) . '" />';
if ( (get_option('facethumb_link') == 'gallery' OR get_option('facethumb_link') == 'both') AND $current_photo->link != "none") {
$display .= '</a>';
}
$timestamp = $current_photo->time;
$display .= '<br/> '. __('the ', 'facethumb') . date( 'Y-m-d', $timestamp ). __(' at ','facethumb') .date( 'H:i', $timestamp ) . '<br/>'. __('by ', 'facethumb') . htmlspecialchars($current_photo->name);
if ( $admin == 1) {
$display .= '<br/><input type="checkbox" name="delete_'.$current_photo->id.'" />';
}
$display .= '</td>';
$start ++;
$stop_display ++;
}
$display .= '</tr>';
}
$display .= '</table><br/>';
}
else {
if ( $admin == 1 AND $number_of_photo != 0) {
$cible = str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);
$display .= '<form name="form1" method="post" action="'.$cible.'">';
$display .= '<input type="hidden" name="delete_hidden" value="Y">';
$display .= '<input type="hidden" name="start_hidden" value="'.$start.'">';
}
$display .= '<table>';
for ( $line_count = 1; $line_count <= $line; $line_count++ ) {
$display .= '<tr>';
for ($compteur_colonne = 1; $compteur_colonne <= $column; $compteur_colonne++) {
$display .= '<td>';
$id_photo = $number_of_photo - $start;
$current_photo = $wpdb->get_row( "SELECT * FROM $plugin ORDER BY id LIMIT $id_photo, 1" );
while ( $current_photo->url == NULL AND $start <= $stop ) { // Elimine les id des éléments supprimés de la BDD.
$start ++;
$current_photo = $wpdb->get_row( "SELECT * FROM $plugin ORDER BY id LIMIT $id_photo, 1" );
}
if ( (get_option('facethumb_link') == 'gallery' OR get_option('facethumb_link') == 'both') AND $current_photo->link != "none") {
$display .= '<a href="' . htmlspecialchars($current_photo->link) . '">';
}
$display .= '<img src="' . htmlspecialchars($current_photo->url) . '" alt="' . htmlspecialchars($current_photo->name) . '" />';
if ( (get_option('facethumb_link') == 'gallery' OR get_option('facethumb_link') == 'both') AND $current_photo->link != "none") {
$display .= '</a>';
}
$timestamp = $current_photo->time;
$display .= '<br/> '. __('the ', 'facethumb') . date( 'Y-m-d', $timestamp ). __(' at ','facethumb') .date( 'H:i', $timestamp ) . '<br/>'. __('by ', 'facethumb') . htmlspecialchars($current_photo->name);
if ( $admin == 1) {
$display .= '<br/><input type="checkbox" name="delete_'.$current_photo->id.'" />';
}
$display .= '</td>';
$start ++;
}
$display .= '</tr>';
}
$display .= '</table><br/>';
}
// Affichage de la pagination
$id_page = $wpdb->get_var( "SELECT ID FROM $post WHERE post_content='[FaceThumb WordPress MNTT]' AND post_title='FaceThumb Gallery'" );
$start_float = $number_of_current_page - 2;
$stop_float = $number_of_current_page + 2;
if ( $start_float <= 0 ) {
$start_float = 1;
}
if ( $stop_float > $number_of_page ) {
$stop_float = $number_of_page;
}
if ( $admin == 1) {
$url = get_bloginfo( 'url' ) . '/wp-admin/admin.php?page=manage-gallery';
}
else {
$url = get_bloginfo( 'url' ). '/?page_id=' . $id_page;
}
if ( $start_float == 1 AND $stop_float == 1 ) {
$display .= __('Pages', 'facethumb'). ' : 1';
}
elseif ( $start_float > 1 AND $stop_float < $number_of_page ) {
$display .= __('Pages', 'facethumb').' : ';
$display .= '<a href="' . $url . '&amp;ppmnt=1">1</a> ... ';
for ( $i = $start_float; $i <= $number_of_current_page - 1; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= $i . ' ';
for ( $i = $number_of_current_page + 1; $i <= $stop_float; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= '... <a href="' . $url . '&amp;ppmnt=' . $number_of_page . '">' . $number_of_page . '</a>';
}
elseif ( $start_float == 1 AND $stop_float == $number_of_page ) {
$display .= __('Pages', 'facethumb').' : ';
for ( $i = $start_float; $i <= $number_of_current_page - 1; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= $i . ' ';
for ( $i = $number_of_current_page + 1; $i <= $stop_float; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
}
elseif ( $start_float == 1 AND $stop_float != $number_of_page ) {
$display .= __('Pages', 'facethumb').' : ';
for ( $i = $start_float; $i <= $number_of_current_page - 1; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= $i . ' ';
for ( $i = $number_of_current_page + 1; $i <= $stop_float; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= '... <a href="' . $url . '&amp;ppmnt=' . $number_of_page . '">' . $number_of_page . '</a>';
}
elseif ( $start_float != 1 AND $stop_float == $number_of_page ) {
$display .= __('Pages', 'facethumb').' : ';
$display .= '<a href="' . $url . '&amp;ppmnt=1">1</a> ... ';
for ( $i = $start_float; $i <= $number_of_current_page - 1; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
$display .= $i . ' ';
for ( $i = $number_of_current_page + 1; $i <= $stop_float; $i ++) {
$display .= '<a href="' . $url . '&amp;ppmnt=' . $i . '">' . $i . '</a> ';
}
}
// Fin de pagination
if ( $admin == 1 AND $number_of_photo != 0) {
$display .= '<p class="submit">';
$display .= '<input type="submit" name="Submit" value="' . __('Delete Thumbnails', 'facethumb') . '" />';
$display .= '</p>';
$display .= '</form>';
}
return $display;
}
add_action("widgets_init", array('FaceThumb', 'register'));
register_activation_hook( __FILE__, array('FaceThumb', 'plugin_install'));
class FaceThumb {
function plugin_install(){
global $wpdb;
global $plugin_db_version;
$table_name = $wpdb->prefix . "facethumb";
if( $wpdb->get_var("show tables like '$table_name'") != $table_name ) {
$sql1 = "CREATE TABLE " . $table_name . " (
id mediumint(9) NOT NULL AUTO_INCREMENT,
time bigint(11) DEFAULT '0' NOT NULL,
name tinytext NOT NULL,
url VARCHAR(100) NOT NULL,
link VARCHAR(100) NOT NULL,
UNIQUE KEY id (id)
);";
$wpdb->query($sql1);
add_option("plugin_db_version", $plugin_db_version);
}
$post = $wpdb->prefix . "posts";
$date = date( 'Y-m-d H:i:s' );
$first_install = $wpdb->get_var( "SELECT ID FROM $post WHERE post_content='[FaceThumb WordPress MNTT]' AND post_title='FaceThumb Gallery'" );
if ( !($first_install > 0) ) {
$id = $wpdb->get_var( "SELECT ID FROM $post ORDER BY ID DESC LIMIT 0, 1" );
$id ++;
$adress = get_bloginfo('url') . '/?page_id=' . $id;
$wpdb->query( "INSERT INTO $post VALUES ('$id', '1', '$date', '$date', '[FaceThumb WordPress MNTT]', 'FaceThumb Gallery', '','publish', 'closed', 'closed', '', 'facethumb-gallery', '', '', '$date', '$date' , '', '0', '$adress', '0', 'page', '', '0' )");
$time = time();
$base = get_bloginfo('url') . '/wp-content/plugins/facethumb/uploads/mnt-tech.jpg';
$wpdb->query( "INSERT INTO $table_name VALUES ('', '$time', 'MNT-Tech', '$base', 'http://www.mnt-tech.fr/blog/')" );
}
$options = $wpdb->prefix . "options";
$is_set = $wpdb->get_var( "SELECT ID FROM $options WHERE option_name='facethumb_column'" );
if ( !($is_set > 0) ) {
$wpdb->query( "INSERT INTO $options VALUES ('', '0', 'facethumb_column', '3', 'yes')" );
$wpdb->query( "INSERT INTO $options VALUES ('', '0', 'facethumb_line', '5', 'yes')" );
$wpdb->query( "INSERT INTO $options VALUES ('', '0', 'facethumb_widget', 'last', 'yes')" );
}
}
function display_plugin($args) {
global $wpdb;
$table_name = $wpdb->prefix . "facethumb";
$post = $wpdb->prefix . "posts";
$url = get_bloginfo('url') . '/wp-content/plugins/facethumb/flash.php';
$thumb_url = $wpdb->get_var( "SELECT guid FROM $post WHERE post_content='[FaceThumb WordPress MNTT]' AND post_title='FaceThumb Gallery'" );
$facethumb_widget = get_option('facethumb_widget');
if ( $facethumb_widget == 'random' ) {
$number_of_photo = $wpdb->get_var( "SELECT COUNT(*) FROM $table_name" );
$photo_number = rand(0, $number_of_photo-1);
}
else {
$number_of_photo = $wpdb->get_var( "SELECT COUNT(*) FROM $table_name" );
$photo_number = $number_of_photo - 1;
}
$pic_info = $wpdb->get_row( "SELECT * FROM $table_name ORDER BY id LIMIT $photo_number, 1 " );
echo $args['before_widget'];
echo $args['before_title'] . '<a href="http://www.mnt-tech.fr/blog/tag/facethumb/" title="FaceThumb 0.0.4">FaceThumb</a>' . $args['after_title'];
if ( $pic_info->url != NULL ) {
if ( (get_option('facethumb_link') == 'widget' OR get_option('facethumb_link') == 'both') AND $pic_info->link != "none") {
echo '<a href="' . htmlspecialchars($pic_info->link) . '" style="margin: auto;">';
}
echo '<img src="' . $pic_info->url . '" alt="' . htmlspecialchars($pic_info->name) . '" style="margin-left: 10px; margin-top: 10px;" />';
if ( (get_option('facethumb_link') == 'widget' OR get_option('facethumb_link') == 'both') AND $pic_info->link != "none") {
echo '</a>';
}
echo '<script language="Javascript">
<!--
function PopupCenter(page, width, height, options) {
var top=(screen.height-height)/2;
var left=(screen.width-width)/2;
window.open(page,\'Take a Thumbnail\',\'top=\'+top+\',left=\'+left+\',width=\'+width+\',height=\'+height+\',\'+options);
}
// -->
</script>';
echo '<ul style="margin-top: 0px"><li>' . htmlspecialchars($pic_info->name). '</li>
<li><a href="#" onclick="PopupCenter(\'' . $url . '\', 500, 400, \'toolbar=no, menubar=no, location=no, status=no\');" >'.__('Take a Thumbnail', 'facethumb').'</a></li>
<li><a href="'. $thumb_url. '">'.__('Thumb Gallery', 'facethumb').'</a></li>
</ul>';
}
else {
echo '<ul>
<li><a href="#" onclick="PopupCenter(\'' . $url . '\', 500, 400, \'toolbar=no, menubar=no, location=no, status=no\');" >'.__('Take a Thumbnail', 'facethumb').'</a></li>
<li><a href="'. $thumb_url . '">'.__('Thumb Gallery', 'facethumb').'</a></li>
</ul>';
}
echo $args['after_widget'];
}
function register(){
register_sidebar_widget('FaceThumb', array('FaceThumb', 'display_plugin'));
}
}
// Panel Admin
function facethumb_menu() {
add_menu_page('FaceThumb Options', 'FaceThumb', 10, __FILE__, 'facethumb_option');
add_submenu_page(__FILE__,'FaceThumb Options',__('Options', 'facethumb'), 10, __FILE__,'facethumb_option');
add_submenu_page(__FILE__,'Manage Gallery', __('Manage Gallery', 'facethumb'), 10, 'manage-gallery','manage_gallery');
}
add_action('admin_menu', 'facethumb_menu');
function facethumb_option() {
global $wpdb;
$post = $wpdb->prefix . "posts";
$opt_val = get_option('facethumb_column');
$opt_val2 = get_option('facethumb_line');
$opt_val3 = get_option('facethumb_widget');
$opt_val4 = get_option('facethumb_link');
if( $_POST[ 'submit_hidden' ] == 'Y' ) {
function isInt($x) {
return(is_numeric($x) ? intval(0+$x) == $x : false);
}
if ( isInt($_POST['facethumb_column']) AND $_POST['facethumb_column'] > 0 AND isInt($_POST['facethumb_line']) AND $_POST['facethumb_line'] > 0 ) {
$opt_val = $_POST['facethumb_column'];
update_option('facethumb_column', $opt_val);
$opt_val2 = $_POST['facethumb_line'];
update_option('facethumb_line', $opt_val2);
$opt_val3 = $_POST['facethumb_widget'];
update_option('facethumb_widget', $opt_val3);
$opt_val4 = $_POST['facethumb_link'];
update_option('facethumb_link', $opt_val4);
?>
<div class="updated"><p><strong><?php _e('Option saved', 'facethumb'); ?></strong></p></div>
<?php
}
else {
?>
<div class="updated"><p><strong><?php _e('Warning: Number of column and line are integer greater than 0.', 'facethumb'); ?></strong></p></div>
<?php
}
}
echo '<div class="wrap">';
echo "<h2>" . __('FaceThumb Options', 'facethumb') . "</h2>";
?>
<form name="form1" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
<input type="hidden" name="submit_hidden" value="Y">
<h3><?php _e('Gallery properties', 'facethumb'); ?></h3>
<p>
<label for="facethumb_column" /><?php _e('Number of column for the gallery:', 'facethumb'); ?></label>
<input type="text" name="facethumb_column" id="facethumb_column" value="<?php echo $opt_val; ?>" size="10" />
</p>
<p>
<label for="facethumb_line" /><?php _e('Number of line for the gallery:', 'facethumb'); ?></label>
<input type="text" name="facethumb_line" id="facethumb_line" value="<?php echo $opt_val2; ?>" size="10" />
</p>
<h3><?php _e('Other Options', 'facethumb'); ?></h3>
<p>
<label for="facethumb_widget" /><?php _e('Photo to display in widget:', 'facethumb'); ?></label>
<select name="facethumb_widget" id="facethumb_widget">
<option value="last" <?php if($opt_val3 == "last") { echo 'selected="selected"'; } ?>><?php _e('The last one', 'facethumb'); ?></option>
<option value="random" <?php if($opt_val3 == "random") { echo 'selected="selected"'; } ?>><?php _e('A random one', 'facethumb'); ?></option>
</select>
</p>
<p>
<label for="facethumb_link" /><?php _e('Display user\'s link with photos:', 'facethumb'); ?></label>
<select name="facethumb_link" id="facethumb_link">
<option value="gallery" <?php if($opt_val4 == "gallery") { echo 'selected="selected"'; } ?>><?php _e('Gallery', 'facethumb'); ?></option>
<option value="widget" <?php if($opt_val4 == "widget") { echo 'selected="selected"'; } ?>><?php _e('Widget', 'facethumb'); ?></option>
<option value="both" <?php if($opt_val4 == "both") { echo 'selected="selected"'; } ?>><?php _e('Both', 'facethumb'); ?></option>
<option value="none" <?php if($opt_val4 == "none") { echo 'selected="selected"'; } ?>><?php _e('None', 'facethumb'); ?></option>
</select>
</p>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options', 'facethumb'); ?>" />
</p>
</form>
</div>
<?php
}
function manage_gallery() {
global $wpdb;
$plugin = $wpdb->prefix . "facethumb";
if ( $_POST['delete_hidden'] == 'Y' ) {
$startH = $_POST['start_hidden'] - 1; // les limit des BDD commencent à 0 donc on retire 1
$number_of_photo = $wpdb->get_var( "SELECT COUNT(*) FROM $plugin" );
$photo_per_page = get_option( 'facethumb_column' ) * get_option( 'facethumb_line' );
if ( $number_of_photo < $photo_per_page ) {
$stopH = $number_of_photo - 1;
}
else {
$stopH = $startH + $photo_per_page - 1; // les limit des BDD commencent à 0 donc 1 pour $photo_per_page (pour $startH c'est deja fait)
} // Attention les photos de la gallerie sont affichées dans l'ordre décroissant
$idStartH = $wpdb->get_var( "SELECT id FROM $plugin ORDER BY id DESC LIMIT $startH, 1" );
$idStopH = $wpdb->get_var( "SELECT id FROM $plugin ORDER BY id DESC LIMIT $stopH, 1" );
$count = 0;
for ( $i = $idStopH; $i <= $idStartH; $i++ ) {
$dir = '../wp-content/plugins/facethumb/uploads/';
if ( $i == 1 AND $_POST['delete_1'] ) {
if(file_exists($dir.'mnt-tech.jpg')){
if (unlink($dir.'mnt-tech.jpg')) {
$wpdb->query( "DELETE FROM $plugin WHERE id='$i'" );
$count++;
}
}
}
elseif ( $_POST['delete_'. $i] ) {
$thumb_to_delete = $wpdb->get_row( "SELECT * FROM $plugin WHERE id='".$i."'" );
if(file_exists($dir.$thumb_to_delete->time.'.jpg')){
if (unlink($dir.$thumb_to_delete->time.'.jpg')) {
$wpdb->query( "DELETE FROM $plugin WHERE id='$i'" );
$count++;
}
}
else {
$wpdb->query( "DELETE FROM $plugin WHERE id='$i'" );
$count++;
}
}
}
}
echo '<div class="wrap">';
echo "<h2>" . __('Manage Gallery', 'facethumb') . "</h2>";
if ($count > 0) {
echo '<div class="updated"><p><strong>' . $count . __(' thumbnail(s) deleted.', 'facethumb') . '</strong></p></div>';
}
echo calculate_gallery(1);
echo '</div>';
}
// Fin pannel Admin
function public_display_gallery() {
return calculate_gallery(0);
}
function modify_gallery_title($a) {
if ( $a == 'FaceThumb Gallery' ) {
return __('FaceThumb Gallery', 'facethumb');
}
else {
return $a;
}
}
function display_gallery () {
add_filter('the_title', 'modify_gallery_title');
if ( is_page('FaceThumb Gallery') ) {
add_filter('the_content', 'public_display_gallery' );
}
}
add_action( 'loop_start', 'display_gallery' );
if ( isset( $_GET['name']) AND isset( $_GET['link']) AND isset( $_GET['url']) AND isset( $_GET['time'])) {
global $wpdb;
$table_name = $wpdb->prefix . "facethumb";
$link = mysql_real_escape_string(htmlspecialchars($_GET['link']));
$name = mysql_real_escape_string(htmlspecialchars($_GET['name']));
$time = mysql_real_escape_string(htmlspecialchars($_GET['time']));
$url = mysql_real_escape_string(htmlspecialchars($_GET['url']));
$wpdb->query( "INSERT INTO $table_name VALUES ('', '$time', '$name', '$url', '$link')");
}
?>

View File

@ -0,0 +1,38 @@
<?php
require('../../../wp-blog-header.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr-FR">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php _e('Take a snapshot', 'facethumb'); ?></title>
<style type="text/css">
body {
margin: 0px;
}
</style>
</head>
<body>
<?php
$swf = get_bloginfo('url'). '/wp-content/plugins/facethumb/Plugin.swf';
$upload = get_bloginfo('url'). '/wp-content/plugins/facethumb/upload.php';
?>
<object id="top_menu" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="400">
<param name="movie" value="<?php echo $swf; ?>" />
<param name="flashvars" value="upload=<?php echo $upload; ?>" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="<?php echo $swf; ?>" width="500" height="400">
<param name="flashvars" value="upload=<?php echo $upload; ?>" />
<!--<![endif]-->
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</body>
</html>

View File

@ -0,0 +1,137 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: MNT-Tech <contact@mnt-tech.fr>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#: facethumb.php:35
msgid "Sorry, no photos have been taken yet!"
msgstr "Désolé, aucune photo n'a été prise!"
#: facethumb.php:64
#: facethumb.php:102
msgid "by "
msgstr "par "
#: facethumb.php:64
#: facethumb.php:102
msgid "the "
msgstr "le "
#: facethumb.php:64
#: facethumb.php:102
msgid " at "
msgstr " à "
#: facethumb.php:130
#: facethumb.php:133
#: facethumb.php:145
#: facethumb.php:155
#: facethumb.php:166
msgid "Pages"
msgstr "Pages"
#: facethumb.php:180
msgid "Delete Thumbnails"
msgstr "Supprimer les photos"
#: facethumb.php:270
#: facethumb.php:276
msgid "Take a Thumbnail"
msgstr "Prendre une photo"
#: facethumb.php:271
#: facethumb.php:277
msgid "Thumb Gallery"
msgstr "Galerie FaceThumb"
#: facethumb.php:326
msgid "Option saved"
msgstr "Options enregistrées"
#: facethumb.php:331
msgid "Warning: Number of column and line are integer greater than 0."
msgstr "Attention: Les nombres de ligne et de colonne doivent être des entriers supérieur à 0."
#: facethumb.php:338
msgid "FaceThumb Options"
msgstr "Options FaceThumb"
#: facethumb.php:344
msgid "Gallery properties"
msgstr "Propriétés de la galerie"
#: facethumb.php:347
msgid "Number of column for the gallery:"
msgstr "Nombre de colonnes pour la galerie: "
#: facethumb.php:352
msgid "Number of line for the gallery:"
msgstr "Nombre de lignes pour la galerie: "
#: facethumb.php:356
msgid "Other Options"
msgstr "Autres Options"
#: facethumb.php:359
msgid "Photo to display in widget:"
msgstr "Photo à afficher dans le widget: "
#: facethumb.php:361
msgid "The last one"
msgstr "La dernière"
#: facethumb.php:362
msgid "A random one"
msgstr "Une au hasard"
#: facethumb.php:368
msgid "Display user's link with photos:"
msgstr "Afficher les liens avec les photos des visiteurs: "
#: facethumb.php:370
msgid "Gallery"
msgstr "Galerie"
#: facethumb.php:371
msgid "Widget"
msgstr "Widget"
#: facethumb.php:372
msgid "Both"
msgstr "Les deux"
#: facethumb.php:373
msgid "None"
msgstr "Aucun"
#: facethumb.php:379
msgid "Update Options"
msgstr "Mettre à jour les options"
#: facethumb.php:431
msgid "Manage Gallery"
msgstr "Gestion de la galerie"
#: facethumb.php:433
msgid " thumbnail(s) deleted."
msgstr " photo(s) supprimée(s)."
#: facethumb.php:447
msgid "FaceThumb Gallery"
msgstr "Galerie FaceThumb"
#: flash.php:10
msgid "Take a snapshot"
msgstr "Ajoutez votre photo"

View File

@ -0,0 +1,129 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-08-07 15:37+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: facethumb.php:35
msgid "Sorry, no photos have been taken yet!"
msgstr ""
#: facethumb.php:64 facethumb.php:102
msgid "by "
msgstr ""
#: facethumb.php:64 facethumb.php:102
msgid "the "
msgstr ""
#: facethumb.php:64 facethumb.php:102
msgid " at "
msgstr ""
#: facethumb.php:130 facethumb.php:133 facethumb.php:145 facethumb.php:155 facethumb.php:166
msgid "Pages"
msgstr ""
#: facethumb.php:180
msgid "Delete Thumbnails"
msgstr ""
#: facethumb.php:270 facethumb.php:276
msgid "Take a Thumbnail"
msgstr ""
#: facethumb.php:271 facethumb.php:277
msgid "Thumb Gallery"
msgstr ""
#: facethumb.php:326
msgid "Option saved"
msgstr ""
#: facethumb.php:331
msgid "Warning: Number of column and line are integer greater than 0."
msgstr ""
#: facethumb.php:338
msgid "FaceThumb Options"
msgstr ""
#: facethumb.php:344
msgid "Gallery properties"
msgstr ""
#: facethumb.php:347
msgid "Number of column for the gallery:"
msgstr ""
#: facethumb.php:352
msgid "Number of line for the gallery:"
msgstr ""
#: facethumb.php:356
msgid "Other Options"
msgstr ""
#: facethumb.php:359
msgid "Photo to display in widget:"
msgstr ""
#: facethumb.php:361
msgid "The last one"
msgstr ""
#: facethumb.php:362
msgid "A random one"
msgstr ""
#: facethumb.php:368
msgid "Display user's link with photos:"
msgstr ""
#: facethumb.php:370
msgid "Gallery"
msgstr ""
#: facethumb.php:371
msgid "Widget"
msgstr ""
#: facethumb.php:372
msgid "Both"
msgstr ""
#: facethumb.php:373
msgid "None"
msgstr ""
#: facethumb.php:379
msgid "Update Options"
msgstr ""
#: facethumb.php:431
msgid "Manage Gallery"
msgstr ""
#: facethumb.php:433
msgid " thumbnail(s) deleted."
msgstr ""
#: facethumb.php:447
msgid "FaceThumb Gallery"
msgstr ""
#: flash.php:10
msgid "Take a snapshot"
msgstr ""

View File

@ -0,0 +1,75 @@
=== Facethumb ===
Contributors: mnttech
Donate link: http://www.mnt-tech.fr/blog
Tags: thumb, face, webcam, snapme, trombiblog, cam, facethumb, snapshot, widget
Requires at least: 2.7.0
Tested up to: 2.8.4
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.wordpress.mnt-tech.fr
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. Un démo est disponnible à l'adresse suivante: http://www.wordpress.mnt-tech.fr
== 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 `<?php FaceThumb::display_plugins($arg); ?>` to sidebar.php where you want the widget to be.
== 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.
= 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 `<?php FaceThumb::display_plugins($arg); ?>` to sidebar.php file of your theme, where you want the widget to be
== Screenshots ==
1. The plugin is dispalyed 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.0.4 =
* Adding some properties in the admin panel.
* Correcting some bugs.
* Installing I18n tools for the plugin (Languages available: English and French).
* Adding a property that allow you to see a preview before posting your thumbnail.
* Allowing user who do not have URL to share to use the plugin.
* Changing the way that the photo in the widget is displayed.
= 0.0.3 =
* Correcting some bugs of the gallery.
* Creating an administration panel to define gallery proprieties.
* Creating an administration panel to manage gallery (delete some thumb).
* Adding the plugin to the SVN repository.
= 0.0.2 =
* Snap button is now at the bottom (wich is more logic).
* You can only take shots, one by one.
* The windows is closed after you clicked on the OK button.
* The blog is refreshed after the snapshot is sent. (in order to see directly your ugly face).
* Better integration for Microsoft IE.
* Better widget intergration to increase adaptibility of the plugin in differents themes.
* Fix a security problem .
= 0.0.1 =
* First realease of facethumb.
== Arbitrary section ==

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,19 @@
<?php
$time = time();
$sContent = file_get_contents('php://input');
$sName = 'uploads/' . $time . '.jpg';
file_put_contents($sName,$sContent);
$image_test = getimagesize($sName);
if ( $image_test['mime'] == "image/jpeg" ) {
$domaine = 'http://' . $_SERVER['SERVER_NAME'];
$self = $_SERVER["PHP_SELF"];
$base = str_replace( '/wp-content/plugins/facethumb/upload.php', '', $domaine.$self);
$link = $_GET['link'];
$name = $_GET['name'];
$url = str_replace( 'upload.php', $sName, $domaine.$self);
header("Location: ". $base ."/?name=". $name . "&link=" . $link . "&url=" . $url . "&time=" . $time);
}
else {
unlink($sName);
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Some files were not shown because too many files have changed in this diff Show More