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 | |
add_filter( 'logout_url', 'change_logout_url', 10, 2 ); | |
function change_logout_url( $logout_url, $redirect ){ | |
$logout_url = site_url( '/logout/', 'login' ); | |
if ( ! empty( $redirect ) ) { | |
$logout_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $logout_url ); | |
} | |
return $login_url; | |
} |
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 | |
class jsondb | |
{ | |
public $result; | |
private $file; | |
private $data; | |
function __construct($file = "test43"){ | |
if(!file_exists($file)) fclose(fopen($file, "w+")); | |
if(!$this->file) $this->file = $file; |
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
backspace 8 | |
tab 9 | |
enter 13 | |
shift 16 | |
ctrl 17 | |
alt 18 | |
pause/break 19 | |
caps lock 20 | |
escape 27 | |
page up 33 |
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 | |
/** | |
* Copyright (C) <2012> <Corey Ballou> | |
* @author Corey Ballou <http://www.craftblue.com> | |
* @license MIT License | |
*/ | |
/** | |
* Handles FTP download of a remote file and stores it in a local file. | |
* |
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 | |
class ResumeDownload { | |
private $file; | |
private $name; | |
private $boundary; | |
private $delay = 0; | |
private $size = 0; | |
function __construct($file, $delay = 0) { | |
if (! is_file($file)) { |
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 | |
$data = file("data"); | |
$total = count($data); | |
$limit = 10; | |
$page = intval($_GET["page"]); | |
if($page<=0) $page = 1; | |
$pages = ($total) ? ceil($total/$limit) : 1; |
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 | |
// The Regular Expression filter | |
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; | |
// The Text you want to filter for urls | |
$text = "The text you want to filter goes here. http://google.com"; | |
// Check if there is a url in the text | |
if(preg_match($reg_exUrl, $text, $url)) { |