This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time_stamp($from){ | |
$cmt_date = $from; | |
$from = strtotime($from); | |
if ( empty($to) ) | |
$to = time(); | |
$diff = (int) abs($to - $from); | |
if($diff <= 1){ | |
$since = '1 second'; | |
} else if($diff <= 60 ){ | |
$since = sprintf(_n('%s second', '%s seconds', $diff), $diff); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SetEnd(txt) { | |
if (txt.createTextRange) { | |
//IE | |
var FieldRange = txt.createTextRange(); | |
FieldRange.moveStart('character', txt.value.length); | |
FieldRange.collapse(); | |
FieldRange.select(); | |
} | |
else { | |
//Firefox and Opera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$password_regular = 'A(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])[-_a-zA-Z0-9]{6,}z' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.rb_slider = function(i) { | |
if( i ){ | |
this.rb_slider_zoom_in(!i); | |
}else{ | |
this.rb_slider_zoom_out(!i); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rb_get_next_attachment( $post_id, $previous = false ){ | |
global $wpdb; | |
$post = get_post($post_id); | |
$current_post_date = $post->post_date; | |
if( $previous ){ | |
$order = 'DESC'; | |
$where = "p.post_date < '$current_post_date'"; | |
}else{ | |
$order = 'ASC'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* facebook */ | |
if( isset($_POST['facebook_create_item_wpnonce']) ){ | |
if( wp_verify_nonce($_POST['facebook_create_item_wpnonce'], 'facebook_create_item') ){ | |
$twitter_user = isset( $_POST['facebook_user'] ) ? $_POST['facebook_user'] : ''; | |
if( $twitter_user ){ | |
$wall_social_feed_options['facebook'][$twitter_user] = array( | |
'category' => 1, | |
'limit' => 20, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function(){ | |
var activetab = new String(window.location.hash); | |
activetab = activetab.substring(1); | |
if($('#tab-'+activetab).hasClass('active')|| activetab=="") return; | |
$('#tab-'+activetab).click(); | |
},100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On window load. This waits until images have loaded which is essential | |
jQuery(window).load(function(){ | |
// Fade in images so there isn't a color "pop" document load and then on window load | |
jQuery(".wedding-page .album-cover img").fadeIn(500); | |
// clone image | |
jQuery('.wedding-page .album-cover img').each(function(){ | |
var el = jQuery(this); | |
el.css({"position":"absolute"}).wrap("<div class='img_wrapper' style='display: inline-block'>").clone().addClass('img_grayscale').css({"position":"absolute","z-index":"998","opacity":"0"}).insertBefore(el).queue(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $('img.photo',this).imagesLoaded(myFunction) | |
// execute a callback when all images have loaded. | |
// needed because .load() doesn't work on cached images | |
// Modified with a two-pass approach to changing image | |
// src. First, the proxy imagedata is set, which leads | |
// to the first callback being triggered, which resets | |
// imagedata to the original src, which fires the final, | |
// user defined callback. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wallpress_pagenavi( $the_query ) { | |
global $wp_query, $wp_rewrite; | |
//User wordpress function paginate_links to create pagination, see codex.wordpress.org/Function_reference/paginate_links | |
if ( $the_query ) $wp_query = $the_query; | |
$pages = ''; | |
$max = $wp_query->max_num_pages; | |
if ( !$current = get_query_var( 'paged' ) ) $current = 1; | |
$a['base'] = ( $wp_rewrite->using_permalinks() ) ? user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ) : @add_query_arg( 'paged', '%#%' ); |
OlderNewer