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 | |
//content type | |
header('Content-Type: image/png'); | |
$font = 'znikomit-webfont.ttf'; | |
$font_size = $_GET['s']; | |
$width = $_GET['w']; | |
$margin = 5; | |
$text = $_GET['t']; |
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 | |
// Print two names on the picture, which accepted by query string parameters. | |
$n1 = $_GET['n1']; | |
$n2 = $_GET['n2']; | |
Header ("Content-type: image/jpeg"); | |
$image = imageCreateFromPNG("someimage.png"); | |
$color = ImageColorAllocate($image, 255, 255, 255); |
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 | |
Header ("Content-type: image/jpeg"); | |
function ImageTTFCenter($image, $text, $font, $size, $angle = 45) { | |
$xi = imagesx($image); | |
$yi = imagesy($image); | |
$box = imagettfbbox($size, $angle, $font, $text); |
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 | |
$url = 'https://secure.globalproblems-globalsolutions.org/site/CRDonationAPI?luminateExtend=1.4.3&method=getDonationFormInfo&form_id=9020&api_key=unfkey&response_format=json&suppress_response_codes=true&v=1.0'; | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, // return web page | |
CURLOPT_HEADER => false, // don't return headers | |
CURLOPT_FOLLOWLOCATION => true, // follow redirects | |
CURLOPT_ENCODING => "", // handle all encodings | |
CURLOPT_USERAGENT => "spider", // who am 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
public function getConvioAuth() { | |
$url = esc_attr( get_option('convio_api_url') ) . 'SRConsAPI'; | |
$atts = array( | |
'method' => 'getSingleSignOnToken', | |
'api_key' => esc_attr( get_option('convio_api_key') ), | |
'login_name' => esc_attr( get_option('convio_api_auth_user') ), | |
'login_password' => esc_attr( get_option('convio_api_auth_pw') ), | |
'cons_id' => esc_attr( $_GET['cons_id'] ), | |
'v' => '1.0', | |
'response_format' => 'json' |
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
public function fetchUrl_POST($url, $fields){ | |
//open connection | |
$ch = curl_init(); | |
foreach($fields as $key=>$value) { | |
$fields_string .= $key.'='.$value.'&'; | |
} | |
rtrim($fields_string, '&'); | |
//set the url, number of POST vars, POST data | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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
<header id="header"> | |
<div> | |
<div> | |
<a href="/" id="logo"> | |
<img src="logo.svg"> | |
</a> | |
<h1>Page Title</h1> | |
</div> | |
<div> | |
<a href="#header-dropdown">MENU</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
<header id="header"> | |
<div> | |
<div> | |
<a href="/" id="logo"> | |
<img src="logo.svg"> | |
</a> | |
<h1>Page Title</h1> | |
</div> | |
<div> | |
<a id="show-dropdown" href="#header-dropdown">MENU</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
<?php | |
add_action( 'pre_get_posts', 'custom_get_posts' ); | |
function custom_get_posts( $query ) { | |
if( (is_category() || is_archive()) && $query->is_main_query() ) { | |
if ( $query->query_vars['post_type'] == 'staff' || $query->query_vars['post_type'] == 'stories' ) { | |
$query->query_vars['orderby'] = 'menu_order'; |
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
################################ | |
# START __posttype__ | |
################################ | |
function register__posttype__() { | |
$cpt_single = '__single__'; | |
$cpt_plural = '__plural__'; | |
$cpt_icon = '__icon__'; | |
$rewrite = array('slug' => '__slug__', 'with_front' => true); | |
$exclude_from_search = __exclude__; |