Plugin Directory

Changeset 1823697


Ignore:
Timestamp:
02/17/2018 07:37:08 AM (8 years ago)
Author:
muun
Message:

added option to add more info about a member in overlay, mimicking the JS snippet + hosted version

Location:
muun-members-directory/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • muun-members-directory/trunk/muun-members-directory.php

    r1759070 r1823697  
    22/**
    33Plugin Name: Muun members directory
    4 Plugin URI: http://www.gomuun.com/wordpress
    5 Description: Get an always up to date overview of your coworking space and community members. A monthly subscription for Muun is needed.
    6 Tags: coworking, coworkingspace, community, remotework, members, member directory, members overview
    7 Version: 1.0
     4Plugin URI: http://www.gomuun.com/wordpress-plugin
     5Description: Get an always up to date member directory for your community. A monthly subscription for Muun is needed.
     6Tags: community, coworkingspace, remotework, members, member directory, members overview
     7Version: 1.2
    88Author: Muun
    99Author URI: http://www.gomuun.com
     
    1919      add_action( 'admin_menu', [ $this, 'admin_menu' ] );
    2020      add_action( 'wp_enqueue_scripts', [ $this, 'enqueue' ] );
     21      add_action( 'wp_enqueue_scripts', [ $this, 'add_js' ] );
    2122      add_shortcode( 'muun-members-directory', [ $this, 'shortcode' ] );
    2223
     
    3233      if( !empty( $this->options[ 'enable_style' ] ) )
    3334        wp_enqueue_style( 'muunmembers', 'https://www.gomuun.com/v1/css.css' );
     35    }
     36
     37    public function add_js() {
     38      if( empty( $this->options[ 'enable_popup' ] ) )
     39      wp_enqueue_script('muun-javascript', plugin_dir_url(__FILE__) . 'muun-javascript.js', array('jquery'));
    3440    }
    3541
     
    6369          if( $this->options[ 'inline_images' ] ) {
    6470            return sprintf( '
    65             <div class="muunmembers__member" style="background-image: url(%s)">
     71            <div class="muunmembers__member" data-muun-name="%s" style="background-image: url(%s)" data-muun-headline="%s" data-muun-bio="%s" data-muun-email="%s" data-muun-website="%s" data-muun-twitter="%s" data-muun-facebook="%s" data-muun-instagram="%s" data-muun-linkedin="%s" data-muun-expertises="%s">
    6672              <p class="muunmembers__name">%s</p>
    67               <p class="muunmembers__headline">%s</p>
    68             </div>', $v->user->avatar, $v->user->name, $v->user->headline );
     73            </div>',
     74            $v->user->name,
     75            $v->user->avatar,
     76            $v->user->headline,
     77            $v->user->bio,
     78            $v->user->email,
     79            $v->user->website,
     80            $v->user->twitter,
     81            $v->user->facebook,
     82            $v->user->instagram,
     83            $v->user->linkedin,
     84            implode(', ', $v->user->expertises),
     85            str_replace('%20', ' ', $v->user->name)
     86          );
    6987          } else {
    7088            return sprintf( '
     
    7290              <img src="%s" class="muunmembers__avatar">
    7391              <p class="muunmembers__name">%s</p>
    74               <p class="muunmembers__headline">%s</p>
    75             </div>', $v->user->avatar, $v->user->name, $v->user->headline );
     92            </div>', $v->user->avatar, $v->user->name );
    7693          }
    7794        }, $this->members );
    7895
    79         return sprintf( '<div id="muun-members" class="muunmembers">%s</div>', implode( '', $html ) );
     96        return sprintf( '<div id="muun-members" data-muun-brand-color="%s" class="muunmembers">%s</div>', $data, implode( '', $html ) );
    8097      }
    8198      return;
     
    100117          'space_id' => htmlentities( $_POST[ 'space_id' ] ),
    101118          'enable_style' => !empty( $_POST[ 'enable_style' ] ),
    102           'inline_images' => empty( $_POST[ 'inline_images' ] )
     119          'inline_images' => empty( $_POST[ 'inline_images' ] ),
     120          'enable_popup' => empty( $_POST[ 'enable_popup' ] )
    103121        ];
    104122        update_option( 'muunmembers_options', $save );
     
    120138          <table class="form-table">
    121139            <tr>
    122               <th scope="row"><label for="space_id">Your space's ID</label></th>
     140              <th scope="row"><label for="space_id">Your space ID</label></th>
    123141              <td><input name="space_id" type="text" id="space_id" value="<?=$option[ 'space_id' ]?>" class="regular-text" required="1" /></td>
    124142            </tr>
     
    130148              <th scope="row"><label for="inline-images">Inline avatar images</label></th>
    131149              <td><input name="inline_images" type="checkbox" id="inline_images" <?=( $option[ 'inline_images' ] ? '' : 'checked' )?> /></td>
     150            </tr>
     151            <tr>
     152              <th scope="row"><label for="enable_popup">Enable popup</label></th>
     153              <td><input name="enable_popup" type="checkbox" id="enable_popup" <?=( $option[ 'enable_popup' ] ? '' : 'checked' )?> /></td>
    132154            </tr>
    133155          </table>
  • muun-members-directory/trunk/readme.txt

    r1799484 r1823697  
    2626
    2727== Changelog ==
     281.2 The member directory now supports overlays. Get more information about each community member by clicking its image
     291.1 Some minor description changes to reflect the new Muun better
    28301. The initial version. 🚀
Note: See TracChangeset for help on using the changeset viewer.