1
PHP / Re:[AYUDA] Email en formulario de contacto y newlester
« en: 25 de Mayo de 2013, 11:34:22 am »
Ya conseguí ambas cosas, podeis cerrrar tema, gracias
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
//Setting trigger, content and dimensions of contact box overlay
$(".contactustrigger").colorbox({width:"470px", height:"630px", transition: 'none', speed:'50', inline:true, href:"#contactus"}).fadeIn(100);
$(".conemail").colorbox({width:"470px", height:"630px", transition: 'none', speed:'50', inline:true, href:"#contactus"}).fadeIn(100);
});
</script>
<script type="text/javascript">
//CONTACT US FORM
$(document).ready(function(){
//submittimg contact us form
$('.contactUsForm').submit( function(){
//validating the form
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var contactemail = document.getElementById('email-contactus');
if (!filter.test(contactemail.value)) { $('#email-contactus').css({background: '#f99', color: '#fff'}); } else {$('#email-contactus').css({background: '#fff', color: '#868686'});}
if (document.cform.name.value == "") { $('#name').css({background: '#f99', color: '#fff'}); } else {$('#name').css({background: '#fff', color: '#868686'});}
if (document.cform.message.value == "") { $('#message').css({background: '#f99', color: '#fff'}); } else {$('#message').css({background: '#fff', color: '#868686'});}
if ((document.cform.name.value == "") || (!filter.test(contactemail.value)) || (document.cform.message.value == "")){return false;}
if ((document.cform.name.value != "") && (filter.test(contactemail.value)) && (document.cform.message.value != "")) {
$('p.intro').css({background: 'none'});
$('p.intro').activity({segments: 8, steps: 5, opacity: 0.3, width: 5, space: 0, length: 7, color: '#0b0b0b', speed: 2});
//send ajax request
$.post('contactus.php',{
contactname:$('#name').val(),
contactemail:$('#email-contactus').val(),
message:$('#message').val()},
function(data){
$('p.intro').activity(false);
$('p.intro').css({background: 'url(img/envelope.png) no-repeat center', backgroundPosition: '0 -50px'});
});
//waits 2000, then closes the form and fades out
setTimeout('parent.$.fn.colorbox.close()', 2500);
//stay on the page
return false;
}
});
});
</script>
<script type="text/javascript">
// NEWSLETTER SIGNUP FORM
$(document).ready(function(){
//submittimg contact us form
$('#newsletter-signup').submit( function(){
//validating the form
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var email = document.getElementById('email');
var name = document.getElementById('name');
if (!filter.test(email.value)) {$('#email').css({background: '#f77', color: '#fff'});} else {$('#email').css({background: '#fff', color: '#000'});}
if ( (!filter.test(email.value)) ){return false;}
if ( (filter.test(email.value)) ) {
$('.feedback').activity({segments: 8, steps: 5, opacity: 0.3, width: 3, space: 0, length: 4, color: '#0b0b0b', speed: 2});
//send ajax request
$.post('signup.php',{email:$('#email').val()},
//return data
function(data){
$('.feedback').activity(false);
$('.feedback').css({background: 'url(img/cheers.png) no-repeat', backgroundPosition: '15px 10px'});
document.getElementById("submit").disabled = true;
document.getElementById("email").disabled = true;
});
//stay on the page
return false;
}
});
});
</script>
Se que esto no viene al tema pero las redes sociales tienen una serie de normativas para la utilización de su logotipo en botones personalizados, deberías de leerlas.
Un saludo.
<div id="slider">
<?php
$captions = array();
$tmp = $wp_query;
$slider = get_term_by('id', of_get_option('webfolio_slidertag'), 'sliders' ) ;
$slider = $slider->slug;
$wp_query = new WP_Query('post_type=featured&orderby=menu_order&order=ASC&showposts=-1&sliders='. $slider);
if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post();
$fitemlink = get_post_meta($post->ID,'webfoliof_fitemlink',true);
$fitemcaption = get_post_meta($post->ID,'webfoliof_fitemcaption',true);
?>
<?php
$thumbId = get_image_id_by_link ( get_post_meta($post->ID, 'webfoliof_slideimage_src', true) );
$thumb = wp_get_attachment_image_src($thumbId, 'slide', false);
?>
<a href="<?php echo $fitemlink;?>">
<img src="<?php echo $thumb[0] ?>" alt="<?php echo $fitemcaption ?>" title="<?php echo $fitemcaption ?>"/>
</a>
<?php
endwhile; wp_reset_query();
endif;
$wp_query = $tmp;
?>
</div>
<!-- END SLIDER -->
<!-- SLIDER SETTINGS -->
<script type="text/javascript">
$j = jQuery.noConflict();
$j(window).load(function() {
$j('#slider').nivoSlider({
effect:'random',
slices:15,
animSpeed:<?php if(of_get_option('webfolio_slideranimationspeed')==''): echo '500';
else: echo of_get_option('webfolio_slideranimationspeed');
endif;?>,
pauseTime:<?php if(of_get_option('webfolio_sliderpausetime')==''): echo '3000';
else: echo of_get_option('webfolio_sliderpausetime');
endif;?>,
startSlide:0, //Set starting Slide (0 index)
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3...
controlNavThumbs:false, //Use thumbnails for Control Nav
controlNavThumbsFromRel:false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav:true, //Use left & right arrows
pauseOnHover:true, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.8, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){} //Triggers after all slides have been shown
});
});
</script>
<!-- END SLIDER -->