Skip to content

Instantly share code, notes, and snippets.

View engram-design's full-sized avatar

Josh Crawford engram-design

View GitHub Profile
<?php
// Turn off all error reporting
error_reporting(0);
$dir = new DirectoryIterator($folder);
$json = array();
foreach ($dir as $index => $fileinfo) {
@engram-design
engram-design / _layout.html
Last active February 23, 2018 05:34
SEOMatic Setup
<!doctype html>
<html lang="en">
<head>
<!-- Responsive-ness -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SE-Oh -->
{% include '_includes/seo_meta' %}
</head>
@engram-design
engram-design / CustomUserDomainPlugin.php
Last active April 16, 2020 15:57
Custom UserController
<?php
namespace Craft;
class CustomUserDomainPlugin extends BasePlugin
{
/* --------------------------------------------------------------
* PLUGIN INFO
* ------------------------------------------------------------ */
public function getName()
@engram-design
engram-design / export.php
Last active September 12, 2023 12:01
ExpressionEngine PHP Export into JSON
<?php
$channel = $_GET['id'];
$content = array();
$fields_query = $this->EE->db->query("SELECT * FROM exp_channel_fields LEFT JOIN exp_channels ON exp_channel_fields.group_id = exp_channels.field_group WHERE exp_channels.channel_id = '$channel'");
$entries_query = $this->EE->db->query("SELECT * FROM exp_channel_data cd INNER JOIN exp_channel_titles ct ON cd.entry_id = ct.entry_id WHERE cd.channel_id = '$channel'");
$fields = $fields_query->result_array();