Pastoid

The page you are looking at now is at this URL: http://pastoid.com/avy

This paste was last updated on April 14, 2009 at 4:14 pm.

Pasted Coderaw

<?php
class Projects extends Plugin
{
	/**
	 * Provides Plugin information.
	 **/	
	public function info() {
		return array(
		'name'=>'Projects',
		'version'=>'0.1',
		'url'=>'http://www.chrisjdavis.org/project/project_plugin',
		'author'=>'Chris J. Davis',
		'authorurl'=>'http://chrisjdavis.org/',
		'license'=>'Apache License 2.0',
		'description'=>'A more elegant way to display projects you own/manage on your website.',
		);
	}
 
	/**
	 * Set up the project content type on activation
	 * @param string $plugin_file The filename of the plugin being activated, compare to this class' filename
	 */
	function action_plugin_activation( $plugin_file ) {
		if( Plugins::id_from_file(__FILE__) == Plugins::id_from_file($plugin_file) ) {
			Post::add_new_type( 'project' );
		}
	}
 
	public function action_plugin_deactivation ( $file='' ) {
 
		if ( Plugins::id_from_file( $file ) == Plugins::id_from_file( __FILE__ ) ) {			
			// deactivate our custom post type
			Post::deactivate_post_type( 'project' );
		}
 
	}
 
	public function filter_default_rewrite_rules( $rules ) {
		$rules[] = array( 
			'name' => 'display_project',
			'parse_regex' => '%^project/?(?P<slug>.+)/?$%i',
			'build_str' => 'project/{$slug}',
			'handler' => 'PluginHandler',
			'action' => 'display_project',
			'priority' => 90,
			'description' => 'Display project info',
		);
		return $rules;
	}
 
	public function action_plugin_act_display_project( $handler ) {
		$paramarray = array();
		$paramarray['fallback'] = array(
			'project',
			'entry.single',
			'home',
		);
	}
	public function action_init () {
		Stack::add( 'template_header_javascript', array( $this->get_url() . '/project.js', 'javascript' ), 'project_js' );	
	}
}
?>

Toggle wordwrap

Referring DomainHits
Unknown Referer 127
pastoid.com 15
search.live.com 2
www.google.de 1
Is this paste spam?
<Hide