Skip to content

Instantly share code, notes, and snippets.

@jamesshannon
jamesshannon / site_events.php
Created December 21, 2012 22:29
Concrete Wall for #concrete5 -- Integration of the core discussion forums addon. This adds wall postings when a user creates a new discussion or replies to an existing one. Add this code anywhere that gets run on every request -- /config/site_events.php is a good place.
<?php
// register event so that our SiteDiscussionWallPoster::hookPageAdd() gets called when pages get added
Events::extend('on_page_add', 'SiteDiscussionWallPoster', 'hookPageAdd', false);
class SiteDiscussionWallPoster {
/**
* gets called when on_page_add event is fired. adds a wall posting if page of type "discussion_post" was added
@jamesshannon
jamesshannon / model.php
Created October 26, 2012 19:47
#concrete5 Model and DatabaseItemList class extensions to make for easier active record based CRUD
<?php
namespace LSL\Libraries;
defined('C5_EXECUTE') or die('Access Denied.');
/**
* @package lerteco_shared_libraries
* @subpackage helpers
* @copyright James Shannon
*/
@jamesshannon
jamesshannon / site_post.php
Created June 26, 2012 05:34
Concrete5 Password Reset Script
<?php
/**
* This script will reset your admin password to "password"
* It should be named site_post.php and placed at [your web root]/config/site_post.php
* After it's been copied, load your website, and your admin password will be reset
* **** REMEMBER TO DELETE THIS FILE AFTERWARDS, OR YOUR PASSWORD WILL BE CONSTANTLY RESET *****
* Enjoy. [email protected]
*/
$ui = UserInfo::getByID(USER_SUPER_ID);