Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/06/2007, 13:14
Avatar de xiscomax
xiscomax
 
Fecha de Ingreso: febrero-2006
Mensajes: 379
Antigüedad: 18 años, 2 meses
Puntos: 5
Re: Como añadirle Style a este codigo de Formulario?

Código PHP:
<?php
/*
Plugin Name: WP-ContactForm
Description: WP Contact Form es un formulario para que los usuarios se puedan poner fácilmente en contacto con usted. Se puede insertar en un post o en una web. Esta versión es de uso SOLO para Wordpress 2.0 --- Esta versión ha sido traducida por <a href="http://quintadimension.net/blog/">Quintadimension.net</a> si tiene alguna consulta o sugerencia consulte su web. --- Programado
Version: 1.4.3
*/

load_plugin_textdomain('wpcf',$path 'wp-content/plugins/wp-contact-form');

// Attachments max size in KB!
$attachment_max_size 1024;

/* Declare strings that change depending on input. This also resets them so errors clear on resubmission. */
$wpcf_strings = array(
    
'name' => '<div class="contactright"><input  class="textfield" type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" /> (requerido)</div>',
    
'email' => '<div class="contactright"><input  class="textfield" type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" /> (requerido)</div>',
    
'msg' => '<br/><textarea  class="textfield" name="wpcf_msg" id="wpcf_msg" cols="35" rows="8" >' $_POST['wpcf_msg'] . '</textarea>',
    
'error' => '');

/*
This shows the quicktag on the write pages
Based off Buttonsnap Template
http://redalt.com/downloads
*/
if(get_option('wpcf_show_quicktag') == true) {
    include(
'buttonsnap.php');

    
add_action('init''wpcf_button_init');
    
add_action('marker_css''wpcf_marker_css');

    function 
wpcf_button_init() {
        
$wpcf_button_url buttonsnap_dirname(__FILE__) . '/wpcf_button.png';

        
buttonsnap_textbutton($wpcf_button_url__('Insert Contact Form''wpcf'), '<!--contact form-->');
        
buttonsnap_register_marker('contact form''wpcf_marker');
    }

    function 
wpcf_marker_css() {
        
$wpcf_marker_url buttonsnap_dirname(__FILE__) . '/wpcf_marker.gif';
        echo 
"
            .wpcf_marker {
                    display: block;
                    height: 15px;
                    width: 155px
                    margin-top: 5px;
                    background-image: url({$wpcf_marker_url});
                    background-repeat: no-repeat;
                    background-position: center;
            }
        "
;
    }
}

function 
wpcf_is_malicious($input) {
    
$is_malicious false;
    
$bad_inputs = array("\r""\n""mime-version""content-type""cc:""to:");
    foreach(
$bad_inputs as $bad_input) {
        if(
strpos(strtolower($input), strtolower($bad_input)) !== false) {
            
$is_malicious true; break;
        }
    }
    return 
$is_malicious;
}

/* This function checks for errors on input and changes $wpcf_strings if there are any errors. Shortcircuits if there has not been a submission */
function wpcf_check_input()
{
    if(!(isset(
$_POST['wpcf_stage']))) {return false;} // Shortcircuit.

    
$_POST['wpcf_your_name'] = stripslashes(trim($_POST['wpcf_your_name']));
    
$_POST['wpcf_email'] = stripslashes(trim($_POST['wpcf_email']));
    
$_POST['wpcf_website'] = stripslashes(trim($_POST['wpcf_website']));
    
$_POST['wpcf_msg'] = stripslashes(trim($_POST['wpcf_msg']));

    global 
$wpcf_strings;
    
$ok true;

    if(empty(
$_POST['wpcf_your_name']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['name'] = '<div class="contactright"><input type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" class="contacterror" /> (' __('requerido''wpcf') . ')</div>';
    }

    if(!
is_email($_POST['wpcf_email']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['email'] = '<div class="contactright"><input type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" class="contacterror" /> (' __('requerido''wpcf') . ')</div>';
    }

    if(empty(
$_POST['wpcf_msg']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['msg'] = '<div class="contactright"><textarea name="wpcf_msg" id="wpcf_message" cols="35" rows="8" class="contacterror">' $_POST['wpcf_msg'] . '</textarea></div>';
    }

    if(
wpcf_is_malicious($_POST['wpcf_your_name']) || wpcf_is_malicious($_POST['wpcf_email'])) {
        
$ok false$reason 'malicious';
    }

    if(
$ok == true)
    {
        return 
true;
    }
    else {
        if(
$reason == 'malicious') {
            
$wpcf_strings['error'] = "<div style='font-weight: bold;'>You can not use any of the following in the Name or Email fields: a linebreak, or the phrases 'mime-version', 'content-type', 'cc:' or 'to:'.</div>";
        } elseif(
$reason == 'empty') {
            
$wpcf_strings['error'] = '<div style="font-weight: bold;">' stripslashes(get_option('wpcf_error_msg')) . '</div>';
        }
        return 
false;
    }
}