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 | |
/* | |
A snippet of code to create static featured images for a WordPress post using | |
a YouTube or Vimeo video URL. I have used this code for several projects where | |
video posts or embedded videos needed to be static images in order to be more | |
mobile friendly as well as for improved page load times when used as a featured | |
image for the post. | |
I have added comments where it might be neccessary to modify the code or where | |
there is room for improvement. There are two primary functions to be used |
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 | |
/* Example of $url and $params */ | |
$url = 'http://api.host.com/'; | |
$params['key1'] = 'value1'; | |
$params['key2'] = 'value2'; | |
/* --------------------------- */ | |
function buildRequestURL( $url, $params ) { | |
$request_url = $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 | |
public function getMxitHeaders() { | |
if ( ! empty( $_SERVER["HTTP_X_MXIT_USERID_R"] ) ) { | |
$mxit->useragent = $_SERVER["HTTP_X_DEVICE_USER_AGENT"]; | |
$mxit->contact = $_SERVER["HTTP_X_MXIT_CONTACT"]; | |
$mxit->nick = $_SERVER["HTTP_X_MXIT_NICK"]; | |
$mxit->userid = $_SERVER["HTTP_X_MXIT_ID_R"]; // Deprecated (soon to be discontinued) | |
$mxit->mxitid = $_SERVER["HTTP_X_MXIT_USERID_R"]; | |
$mxit->login = $_SERVER["HTTP_X_MXIT_LOGIN"]; |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class My_Controller extends CI_Controller { | |
public function upload_files() | |
{ | |
if ($this->input->get('qqfile')) | |
{ | |
$file = $this->input->get('qqfile'); | |
} |