Edit

Nodes

Items

85

Per Page

20

Page

  • Find which file a function is defined in

    Subtitle: 
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    Notes: 
    <?php
    
    $reflFunc=new ReflectionFunction('name_of_function');
    
    echo($reflFunc->getFileName().':'.$reflFunc->getStartLine());
    
    ?>
  • Custom Post Types

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Type

    Adds custom post type called "Reviews"

    <?php
    function create_post_type(){
      register_post_type('review',
        array(
          'labels'=>array(
            'name'=>__('Reviews'),
            'singular_name'=>__('Review')
          ),
          'public'=>true,
          'has_archive'=>true,
          'capabilities'=>array(
              'edit_post'=>'edit_review',
              'edit_posts'=>'edit_reviews',
              'publish_posts'=>'publish_review',
              'read_post'=>'read_review',
          ),
        )
      );
    }
    add_action('init','create_post_type');
    ?>

    Add abilities to "Reviews" post type

    <?php
    function add_theme_caps(){
        $subscribers=get_role('subscriber');
        $subscribers->add_cap('edit_review');
        $subscribers->add_cap('edit_reviews');
        $subscribers->add_cap('publish_review');
        $subscribers->add_cap('read_review');
        $admins=get_role('administrator');
        $admins->add_cap('edit_review');
        $admins->add_cap('edit_reviews');
        $admins->add_cap('publish_review');
        $admins->add_cap('read_review');
    }
    add_action('admin_init','add_theme_caps');
    ?>

    Add custom fields to "Reviews" post type

    <?php
    add_action('admin_init','add_review_metas');
    function add_review_metas(){
      add_meta_box('review_rating-meta','Rating','review_rating','review','normal','low');
    }
    function review_rating(){
      global $post;
      $custom=get_post_custom($post->ID);
      $review_rating=$custom['review_rating'][0];
        for($x=1;$x<6;$x++){
            echo('<input');
            if($x==$review_rating) echo(' checked="checked"');
            echo(' type="radio" name="review_rating" id="review_rating_'.$x.'" value="'.$x.'"/><label for="review_rating_'.$x.'">'.$x.'</label>'."\n");
    
        }
    }
    add_action('save_post','save_details');
    function save_details(){
      global $post;
      update_post_meta($post->ID,'review_rating',$_POST["review_rating"]);
    }
    ?>
  • In the Weeds

    Subtitle: 
    Restaurant Management Tool
    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Type
    Installation URL: 
    http://stage.orgnsm.org/in-the-weeds
    Images: 
  • Post referencing setup

    Subtitle: 
    Assign multiple disciplines to a project
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    <?php
    
    
    // Adds custom post type for Projects and Services
    
    function create_post_type(){
    
      register_post_type('project',
        array(
          'labels' => array(
            'name' => __('Projects'),
            'singular_name' => __('Project')
          ),
          'taxonomies' => array('category'),
          'public' => true,
          'has_archive' => true,
          'capabilities' => array(
              'edit_post' => 'edit_project',
              'edit_posts' => 'edit_projects',
              'publish_posts' => 'publish_project',
              'read_post' => 'read_project',
          ),
          'supports' => array(
              'title','editor','thumbnail'
          ),
        )
      );
    
      register_post_type('service',
        array(
          'labels' => array(
            'name' => __('Services'),
            'singular_name' => __('Service')
          ),
          'public' => true,
          'has_archive' => true,
          'capabilities' => array(
              'edit_post' => 'edit_service',
              'edit_posts' => 'edit_services',
              'publish_posts' => 'publish_service',
              'read_post' => 'read_service',
          ),
          'supports' => array(
              'title','editor','thumbnail'
          ),
        )
      );
    
    }
    
    add_action('init','create_post_type');
    
    
    
    
    
    function add_theme_caps(){
    
        $subscribers = get_role( 'subscriber' );
    
        //$subscribers->add_cap( 'edit_project' );
        //$subscribers->add_cap( 'edit_projects' );
        //$subscribers->add_cap( 'publish_project' );
    
        $subscribers->add_cap( 'read_project' );
        $subscribers->add_cap( 'read_service' );
    
        $admins = get_role( 'administrator' );
    
        $admins->add_cap( 'edit_project' );
        $admins->add_cap( 'edit_projects' );
        $admins->add_cap( 'publish_project' );
        $admins->add_cap( 'read_project' );
    
        $admins->add_cap( 'edit_service' );
        $admins->add_cap( 'edit_services' );
        $admins->add_cap( 'publish_service' );
        $admins->add_cap( 'read_service' );
    
    }
    
    add_action('init','add_theme_caps');
    
    
    
    
    
    // Adds custom field to the PROJECT custom post type
    
    function add_project_metas(){
        add_meta_box(
            'project_service-meta',
            'Service',
            'project_service',
            'project',
            'normal',
            'low'
        );
    }
    add_action('admin_init','add_project_metas');
    
    
    function project_service(){
        global $post;
        $custom=get_post_custom($post->ID);
        $project_services=$custom['project_service'][0];
        $project_services=unserialize($project_services);
        $args=array(
            'post_type'=>'service',
            'posts_per_page'=>'200',
            'orderby'=>'title',
            'order'=>'ASC'
        );
        $loop=new WP_Query($args);
        while($loop->have_posts()):$loop->the_post();
            echo('<div><input type="checkbox" name="project_services[]" value="'.get_the_ID().'" id="project_service_'.get_the_ID().'"');
            if(is_array($project_services)&&in_array(get_the_ID(),$project_services)) echo(' checked="checked"');
            //checked($project_services,get_the_ID());
            echo('><label for="project_service_'.get_the_ID().'">'.get_the_title(get_the_ID()).'</label></div>');
        endwhile;
    }
    
    
    
    function save_details(){
        global $post;
        update_post_meta($post->ID,'project_service',$_POST["project_services"]);
    }
    
    add_action('save_post','save_details');
    
    
    
    
    ?>
  • Covidien Portal

    Subtitle: 
    A resource and tool for physicians
    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://covidien.orgnsm.org
    Images: 
  • Foster Care Training

    Subtitle: 
    Education Service Promotion
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://fostercaretraining.org
    Images: 
  • AG &amp; Associates

    Subtitle: 
    Construction Portfolio &amp; Promotion
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://agassociatesinc.com
    Images: 
  • Calvin Associates

    Subtitle: 
    Lawyer Firm Promotional
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://calvin-associates.com
    Images: 
  • Ferber Law

    Subtitle: 
    Lawyer Firm Promotional
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://danvillelaw.com
    Images: 
  • Oakland Police

    Subtitle: 
    Charity Information &amp; Donation
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://oaklandpolicefoundation.org
    Images: 
  • Orgnsm (ROOT)

    Subtitle: 
    Community Outreach Divisions Catalog
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://orgnsm.org
    Images: 
    Process Imagery: 
  • Tru frame

    Subtitle: 
    Product promotion
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Images: 
  • Lotto-rithm

    Subtitle: 
    Algorithm knowledge promotion
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Images: 
  • Rate Your Customer / Rate My Contractor

    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    45
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    45
    Attribute Type: 
    Topics
    Images: 
  • IXIAS

    Subtitle: 
    my homepage
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    10
    Attribute Type: 
    Topics
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://ixias.orgnsm.org
    Images: 
  • NeuroGenesix

    Subtitle: 
    Dance Music Event Information
    Context: 
    Connection: 
    Attribute Type: 
    Type
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Installation URL: 
    http://neurogenesix.melanieblau.org
    Images: 
    Process Imagery: 
  • Font-embed Rundown

    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    TTF - Works in most browsers except IE and iPhone
    EOT - IE only
    WOFF - Compressed, emerging standard
    SVG - iPhone/iPad
  • Using jQuery flexslider with animated captions callback

    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    jQuery(window).load(function(){
    
    
    
        jQuery('.flexslider').flexslider( {
    
            pauseOnHover: true,
            controlsContainer: ".flex-container",
        	slideshowSpeed: 8000,
    
            before: function(slider){
                var currentSlide = slider.slides.eq(slider.currentSlide);
                jQuery(currentSlide).find('.flex-caption').animate({'opacity':'0','right':'30px'},700);
            },
            after: function(slider){
                var currentSlide = slider.slides.eq(slider.currentSlide);
                jQuery(currentSlide).find('.flex-caption').animate({'opacity':'1','right':'0'},700);
            },
            start: function(slider){
                var currentSlide = slider.slides.eq(slider.currentSlide);
                jQuery(currentSlide).find('.flex-caption').animate({'opacity':'1','right':'0'},700);
            },
    
        } );
    
    
    
    } );
    .flex-container .flexslider ul.slides li a p.flex-caption{
        background-color: rgba(255,255,255,.9);
        color: rgba(55,55,55,.98);
        font-size: 20px;
        position: absolute;
        bottom: 0;
        right: 0;
        right: 30px;
        left: auto;
        z-index: 1;
        padding: 15px;
        width: 33.3%;
        font-style: italic;
        margin: 0;
        opacity: 0;
    }
  • Removes fields pending for deletion to uninstall a stuck module

    Context: 
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    DELETE FROM `field_config` WHERE `field_config`.`deleted` = 1;
  • Reading/setting Drupal config variables

    Context: 
    Connection: 
    Attribute Type: 
    Type
    Connection: 
    Weight: 
    100
    Attribute Type: 
    Topics
    <?php
    function organic_context_config_page(){
        $form = array();
        $form['onthisdate_maxdisp'] = array(
            '#type' => 'textfield',
            '#title' => t('Maximum number of links'),
            '#default_value' => variable_get('onthisdate_maxdisp', 3),
            '#size' => 2,
            '#maxlength' => 2,
            '#description' => t("The maximum number of links to display in the block."),
            '#required' => TRUE,
        );
        return system_settings_form($form);
    }
    ?>