Skip to content

Instantly share code, notes, and snippets.

View boboldehampsink's full-sized avatar

Bob Olde Hampsink boboldehampsink

View GitHub Profile
@boboldehampsink
boboldehampsink / AutoActivatePlugin.php
Created November 7, 2013 10:21
Enable this to automatically activate new registrations in the CP
<?php
namespace Craft;
class AutoActivatePlugin extends BasePlugin
{
function getName()
{
return Craft::t('Auto activate from CP');
}
@boboldehampsink
boboldehampsink / UserPhotoPlugin.php
Created November 6, 2013 13:00
Upload user photos in the front-end. Use <input type="file" name="qqfile" /> to trigger Craft's native upload mechanism.
<?php
namespace Craft;
class UserPhotoPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Upload user photos on the front-end');
}
@boboldehampsink
boboldehampsink / SaveProfilePlugin.php
Created November 6, 2013 12:13
Save profile and user data simultaneously
<?php
namespace Craft;
class SaveProfilePlugin extends BasePlugin
{
function getName()
{
return Craft::t('Save profile too when saving user');
}
@boboldehampsink
boboldehampsink / AssetUploadPlugin.php
Last active December 26, 2015 20:49
Enable this plugin to connect <input type="file" name="fields[yourField]" /> as asset to yourField
<?php
namespace Craft;
class AssetUploadPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Upload assets on the front-end');
}
@boboldehampsink
boboldehampsink / gist:7039352
Created October 18, 2013 10:04
parentOf error
{% if not user %}
{% redirect "profiel" %}
{% endif %}
{% extends "_layout" %}
{% set title = "Gekoppelde familieleden" %}
{% set entry = craft.entries.section('registratie').authorId(currentUser.id).first() %}
{% if entry | length == 0 %}
{% set entry = craft.entries.section('registratie').first() %}
{% endif %}