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
<?php | |
/* | |
//CÓDIGO A INSERTAR EN EL HEADER DEL THEME DE MOODLE | |
ftp://dominio.es//domains/dominio.es/public_html/tuaulavirtual/theme/essential/layout/includes/header.php | |
<!-- jvrdbug --> | |
<?php | |
include($_SERVER['DOCUMENT_ROOT'].'/tuaulavirtual/check_user_can_access_content.php'); | |
//echo "<div style='display:none' id='jvrdbug'>".($_SERVER['DOCUMENT_ROOT'].'/tuaulavirtual/check_user_can_access_content.php')."</div>"; |
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
<?php | |
/** | |
* Template Name: Movie Reviews | |
**/ | |
get_header(); | |
?> | |
<?php | |
global $post; | |
$posts = get_posts( array( 'post_type' => 'movie-reviews' ) ); |
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
//php function to convert text url into links. | |
function makeClickableLinks($s) { | |
return preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a target="blank" rel="nofollow" href="$1" target="_blank">$1</a>', $s); | |
} | |
//usage | |
echo makeClickableLinks($str); |
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
//fn to prevent file caching | |
function flushVersion(length) { | |
var glyphs = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP1234567890"; | |
var version = ""; | |
for (var j = 0; j < length; j++) { | |
var i = Math.floor(Math.random() * glyphs.length); | |
version += glyphs.charAt(i); | |
} | |
return version; | |
} |
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
<?php | |
//secure-submit-functions.php | |
// Strips nasty tags from code.. | |
function cleanEvilTags($data) { | |
$data = preg_replace("/javascript/i", "javascript",$data); | |
$data = preg_replace("/alert/i", "alert",$data); | |
$data = preg_replace("/about:/i", "about:",$data); | |
$data = preg_replace("/onmouseover/i", "onmouseover",$data); | |
$data = preg_replace("/onclick/i", "onclick",$data); | |
$data = preg_replace("/onload/i", "onload",$data); |
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
<?php | |
/* | |
Plugin Name: WP API Load Time Enhancement | |
*/ | |
//http://codex.wordpress.org/Must_Use_Plugins | |
$listener_term = '/webservices/'; | |
$current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ''; | |
// if $current_url contains $listener_term |
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
<?php | |
//create custom post type: movie review | |
function movie_reviews_init() { | |
$args = array( | |
'label' => 'Movie Reviews', | |
'public' => true, | |
'show_ui' => true, | |
'capability_type' => 'page',//post | |
'hierarchical' => false, | |
'rewrite' => array('slug' => 'movie-reviews'), |
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
<?php | |
function normalize_filename($string) { | |
$extension = substr(strrchr($string,'.'),1); | |
// delete extension | |
$string = preg_replace('/\.[^.]+$/','',$string); | |
//utf8_encode($string); | |
$a = array(' ','À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ø','ù','ú','�»','ü','ý','ÿ','Ā','ā','Ă','ă','Ą','ą','Ć','ć','Ĉ','ĉ','Ċ','ċ','Č','č','Ď','ď','Đ','đ','Ē','ē','Ĕ','ĕ','Ė','ė','Ę','ę','Ě','ě','Ĝ','ĝ','Ğ','ğ','Ġ','ġ','Ģ','ģ','Ĥ','ĥ','Ħ','ħ','Ĩ','ĩ','Ī','ī','Ĭ','ĭ','Į','į','İ','ı','IJ','ij','Ĵ','ĵ','Ķ','ķ','Ĺ','ĺ','�»','ļ','Ľ','ľ','Ŀ','ŀ','Ł','ł','Ń','ń','Ņ','ņ','Ň','ň','ʼn','Ō','ō','Ŏ','ŏ','Ő','ő','Œ','œ','Ŕ','ŕ','Ŗ','ŗ','Ř','ř','Ś','ś','Ŝ','ŝ','Ş','ş','Š','š','Ţ','ţ','Ť','ť','Ŧ','ŧ','Ũ','ũ','Ū','ū','Ŭ','ŭ','Ů','ů','Ű','ű','Ų','ų','Ŵ','ŵ','Ŷ','ŷ','Ÿ','Ź','ź','�»','ż','Ž','ž','ſ','ƒ','Ơ','ơ','Ư','ư','Ǻ','�»','Ǽ','ǽ','Ǿ','ǿ'); | |
$b = array('-','A','A','A','A','A','A' |
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
var app = { | |
layout: { | |
init: function() { | |
app.loader.init(); | |
console.info("1. app layout init"); | |
var wwidth = window.innerWidth; | |
var wheight = window.innerHeight; | |
windowdata(wwidth,wheight); | |
} |
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
var $test = $(".ricochet"), | |
multiply = function(x,y) { | |
console.log("multiply ok: " + x * y); | |
}, | |
siberet = function(add2div){ | |
$test.html("siberet ok");//write inside .ricochet | |
}; | |
siberet( multiply(2,4) );//initialize everythin' |
OlderNewer