Make sections of your site (template) accessible to members only.
Create a template with a loginform and the processform tag. The form should at least provide username, password and action. e.g.:
<?php | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
$uploadHandler = new \Acme\FileUpload\UploadHandler(); | |
$uploadHandler | |
->setFormFieldName('upload') | |
->setTargetDirectory(__DIR__ . '/../uploads') | |
->addValidator(new JpegFileTypeValidator()) | |
->addValidator(new maxFileSizeValidator(4096)) |
<?php | |
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck. | |
// Happy to be proven wrong! | |
final class Router { | |
private $dependencies; | |
public function __construct (Dependencies $dependencies) { | |
$this->dependencies = $dependencies; | |
// You might say that this is Service Locator, but it's not. This router is toplevel, | |
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI. |
<?php | |
$plugin_info = array( | |
'pi_name' => 'debug_override', | |
'pi_version' =>'1.0', | |
'pi_author' =>'GDmac', | |
'pi_author_url' => '', | |
'pi_description' => '', | |
'pi_usage' => '{exp:debug_override override="all|ajax"} default is override on ajax calls', | |
); |
<?php | |
$req = parse_url($_SERVER['REQUEST_URI']); | |
// querystring | |
isset($req['query']) ? parse_str($req['query'], $req['query_arr']) : $req['query_arr'] = array(); | |
// route | |
$req['route'] = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])); |
Many smartphone users (probably most) use dedicated apps for their social sharing. However, when clicking on a share button on websites, the user is redirected to the website instead of to the app for twitter and facebook. This document tries to offer an alternative route for sharing on mobile.
<?php | |
$plugin_info = array( | |
'pi_name' => 'example_plugin', | |
'pi_version' => '0.1', | |
'pi_author' => 'John Doe', | |
'pi_author_url' => '', | |
'pi_description' => '', | |
'pi_usage' => '', | |
); |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
$plugin_info = array( | |
'pi_name' => 'Admin edit link', | |
'pi_version' => '1.0', | |
'pi_author' => 'GDmac', | |
'pi_author_url' => '', | |
'pi_description'=> 'Admin Edit link', | |
'pi_usage' => Admin_edit_link::usage() | |
); |
<?php | |
// from http://php.net/manual/en/function.debug-backtrace.php#111255 | |
// adapted for codeigniter | |
// database/DB_driver.php method query() | |
//... | |
// Save the query for debugging | |
if ($this->save_queries == TRUE) | |
{ | |
$this->queries[] = $sql . "\n# ".get_caller_info(); |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once(BASEPATH . 'libraries/Ftp.php'); | |
class EE_FTP extends CI_FTP { | |
var $timeout = 90; | |
/** | |
* FTP Connect |