prefix . "formularios"; $datos = $wpdb->get_row("SELECT receptor,asunto,copia FROM $table_name WHERE id=1 " ); if(empty($_POST['comment_post_ID'])) { echo '
'; echo '
*Campos obligatorios
'; } } function formularios_pimpam_instala(){ global $wpdb; $table_name= $wpdb->prefix . "formularios"; $sql = " CREATE TABLE $table_name( id mediumint( 9 ) NOT NULL AUTO_INCREMENT , receptor text NOT NULL , asunto text NOT NULL , copia text NOT NULL , PRIMARY KEY ( `id` ) ) ;"; $wpdb->query($sql); $sql = "INSERT INTO $table_name (receptor,asunto,copia) VALUES ('ejemplo@pimpamestudio.com','Asunto cualquiera','');"; $wpdb->query($sql); } function formularios_pimpam_desinstala(){ global $wpdb; $table_name = $wpdb->prefix . "formularios"; $sql = "DROP TABLE $table_name"; $wpdb->query($sql); } function formularios_pimpam_panel(){ global $wpdb; $table_name = $wpdb->prefix . "formularios"; if(isset($_POST['formularios_inserta'])){ $formulario=$_POST['formularios_inserta']; $asunto=$_POST['formulario_asunto']; $copia=$_POST['formulario_copia']; }else{ $formulario = $wpdb->get_var("SELECT receptor FROM $table_name WHERE id=1; " ); $asunto = $wpdb->get_var("SELECT asunto FROM $table_name WHERE id=1; " ); $copia = $wpdb->get_var("SELECT copia FROM $table_name WHERE id=1; " ); } if(empty($_POST['comment_post_ID'])) { // El formulario que esta en la pagina de configuracion del plugin echo '

'.__('Datos del Formulario','formularios_pimpamestudio').'


' .'
' .'
' .'' .'
' .'' .'
' .'' .'

' .'
'; } if(isset($_POST['formularios_inserta'])){ $sql = "UPDATE `".$table_name."` SET `receptor` = '{$_POST['formularios_inserta']}' WHERE `id`=1;"; $wpdb->query($sql); $sql = "UPDATE `".$table_name."` SET `asunto` = '{$_POST['formulario_asunto']}' WHERE `id`=1;"; $wpdb->query($sql); $sql = "UPDATE `".$table_name."` SET `copia` = '{$_POST['formulario_copia']}' WHERE `id`=1;"; $wpdb->query($sql); if(empty($_POST['comment_post_ID'])) { echo "

".__('Los cambios se han realizado con éxito.','formularios_pimpamestudio')."

"; } } } function formularios_pimpam_add_menu(){ if (function_exists('add_options_page')) { add_options_page('Formulario', 'Formulario', 10, basename(__FILE__), 'formularios_pimpam_panel'); } } function myscript() { ?>
    query('post_type=slider_home&showposts=-1'); while($slider->have_posts()):$slider->the_post(); if(get('opciones_slider_home_imagen')!=""){ ?>
have_posts()):$slider->the_post(); ?>