Plugin Directory

Changeset 579420


Ignore:
Timestamp:
07/30/2012 07:06:07 PM (14 years ago)
Author:
ejackisch
Message:
 
Location:
profile-custom-content-type/trunk
Files:
19 added
7 edited

Legend:

Unmodified
Added
Removed
  • profile-custom-content-type/trunk/class/default_options.php

    r516918 r579420  
    117117                    "height"=>150,
    118118                ),
     119                "archive" => array(
     120               
     121                ),
    119122                'slug' => 'person',
    120123                "permissions"=> array(
  • profile-custom-content-type/trunk/css/profile-cct.css

    r516918 r579420  
    3535    margin-bottom: 0;
    3636}
     37
     38.ui-autocomplete { position: absolute; cursor: default; background-color:#fff;border:1px solid #ddd;padding:4px;}   
     39.ui-autocomplete li{list-style-type:none;}
     40* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
     41
     42.profile-cct-filter-box{
     43    margin-right:16px;
     44    float:left;
     45}
  • profile-custom-content-type/trunk/profile-custom-content-type.php

    r544690 r579420  
    33Plugin Name: Profile Custom Content Type
    44Plugin URI:
    5 Version: 1.1.8.2
     5Version: 1.2
    66Text Domain: profile_cct
    77Domain Path: /languages
     
    4444define( 'PROFILE_CCT_BASENAME', plugin_basename(__FILE__) );
    4545define( 'PROFILE_CCT_DIR_URL',  plugins_url( ''  , PROFILE_CCT_BASENAME ) );
    46 
     46require(PROFILE_CCT_DIR_PATH.'/class/profile_widget.php');
    4747require(PROFILE_CCT_DIR_PATH.'profile-taxonomies.php');
    4848require(PROFILE_CCT_DIR_PATH.'profile-manage-table.php');
     
    7171     */
    7272    public function __construct () {
    73 
     73        //remove_filter('template_redirect', 'redirect_canonical');
    7474        add_shortcode('profilelist', array( $this, 'profile_list_shortcode') );
    7575        add_shortcode('profile', array( $this, 'profile_single_shortcode') );
     76        add_shortcode('profilesearch', array( $this, 'profile_search_shortcode') );
     77        add_shortcode('profilenavigation', array( $this, 'profile_navigation_shortcode') );
    7678       
    7779        add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
     
    8587       
    8688        add_action( 'template_redirect',  array( $this,'check_freshness'));
     89       
    8790        add_action( 'wp_insert_post_data', array( $this,'save_post_data'),10,2);
    8891       
     
    97100        add_action( 'admin_init',array($this,'admin_init'));
    98101       
    99        
    100 
     102        add_action( 'template_redirect', array($this,'process_search'));
     103       
     104        //add_action( 'template_redirect', array($this,'force_profile_cct_archive_page'));
     105       
     106        add_action( 'init', array($this, 'register_alphabet_taxonomy'));
     107       
     108        add_action( 'profile_cct_display_archive_controls', array($this, 'display_archive_controls'));
     109       
    101110        $this->settings_options = get_option('Profile_CCT_settings');
    102111
     
    477486     * @return void
    478487     */
     488     
    479489    function orderby_menu( $orderby ) {
     490   
     491        if($this->automatic_ordering)
     492            return $orderby;
     493           
    480494        $new_orderby = 'menu_order ASC';
    481        
     495        //$new_orderby = 'menu_order ASC';
    482496        if( $this->is_main_query ): // only run this if we are dealing with the main query
    483497            // check to see that we are on the profile taxonomies
     
    508522     */
    509523    function pre_get_posts( $query ) {
    510        
    511         if( $query->is_main_query() )
     524        if($query->get('post_type') != "profile_cct")return;
     525       
     526        if( $query->is_main_query() ):
    512527            $this->is_main_query = true;
    513         else
     528            $this->automatic_ordering = true;
     529           
     530            $orderby = $this->settings_options['sort_order'];       //Default sort order
     531            if(isset($_GET['orderby']))$orderby = $_GET['orderby'];
     532           
     533            $query->set('order', 'asc');
     534            if(isset($_GET['order']) && $_GET['order'] == "desc")$query->set('order', $_GET['order']);
     535           
     536            switch($orderby){
     537                case 'last_name':
     538                    $query->set('meta_key', 'profile_cct_last_name');
     539                    $query->set('orderby', 'meta_value');
     540                   
     541                break;
     542                case 'first_name':
     543                    $query->set('orderby', 'title');
     544   
     545                break;
     546                case 'date':
     547                    $query->set('orderby', 'date');
     548                   
     549                break;
     550                default:
     551                    $this->automatic_ordering = false; //orderby_menu function will sort profiles by their manually set order
     552            }
     553           
     554           
     555        else:
    514556            $this->is_main_query = false;
     557        endif;
    515558       
    516559    }
     
    606649        if(!is_admin()):
    607650            wp_enqueue_script('jquery-ui-tabs');
     651            wp_enqueue_script('jquery-ui-autocomplete');
    608652            wp_enqueue_style( 'profile-cct',PROFILE_CCT_DIR_URL. '/css/profile-cct.css' );
    609653        endif;
     
    828872        endif;
    829873    }
     874   
     875   
    830876    /**
    831877     * save_post_data function.
     
    886932        $data['post_content'] = $content;
    887933
    888         if(is_array($_POST["profile_cct"]))
     934        if(is_array($_POST["profile_cct"])):
    889935            update_post_meta($postarr['ID'], 'profile_cct', $profile_cct_data);
    890 
    891         return $data;
     936            update_post_meta($postarr['ID'], 'profile_cct_last_name', $profile_cct_data["name"]['last']);
     937        endif;
     938       
     939       
     940        //echo $first_letter;
     941       
     942        $first_letter = strtolower(substr($profile_cct_data["name"]['last'], 0, 1));
     943        //if($first_letter && $postarr['ID']):
     944            //echo $first_letter;
     945            //echo $postarr['ID'];
     946            ( wp_set_post_terms($postarr['ID'], $first_letter, 'profile_cct_letter', false) );
     947        //endif;
     948        return $data;   
    892949
    893950    }
     
    19121969        $tax_query = array();
    19131970        $taxonomies = get_taxonomies();
    1914         foreach($atts as $key=>$att):
    1915             if(in_array("profile_cct_".$key, $taxonomies)):
    1916                
    1917                 array_push(
    1918                     $tax_query,
    1919                     array(
    1920                         'taxonomy'=>'profile_cct_'.$key,    ////aaghhjjjhg forgot the taxonomies are prefixed
    1921                         'field'=>'slug',
    1922                         'terms'=>$att,     
    1923                         )
    1924                     );
    1925             endif;
    1926         endforeach;
     1971        if($atts):
     1972            foreach($atts as $key=>$att):
     1973                if(in_array("profile_cct_".$key, $taxonomies)):
     1974                   
     1975                    array_push(
     1976                        $tax_query,
     1977                        array(
     1978                            'taxonomy'=>'profile_cct_'.$key,    ////aaghhjjjhg forgot the taxonomies are prefixed
     1979                            'field'=>'slug',
     1980                            'terms'=>$att,     
     1981                            )
     1982                        );
     1983                endif;
     1984            endforeach;
     1985        endif;
    19271986       
    19281987        //Whether to OR or AND the criterias
     
    19341993            'post_type'=>'Profile_CCT',
    19351994            'order'=>'ASC',
    1936             'orderby'=>'title',
     1995            'orderby'=>'menu_order',
    19371996            'tax_query'=>$tax_query,
    19381997            'post__not_in'=>explode(",", $atts['exclude']),
    1939             'posts_per_page'=>-1
     1998            'posts_per_page'=>-1,
    19401999            );
    1941        
     2000   
     2001   
     2002        if($atts['order']):
     2003            $query['order'] = $atts['order'];
     2004        endif;
     2005   
    19422006        //If include is set
    19432007        if($atts['include']):
     
    19452009        endif;
    19462010       
     2011        if($atts['orderby']):
     2012            switch($atts['orderby']){
     2013                case 'first_name':
     2014                    $query['orderby'] = 'title';
     2015                    break;
     2016                case 'last_name':
     2017                    $query['meta_key']='profile_cct_'.$atts['orderby'];
     2018                    $query['orderby'] = 'meta_value';
     2019                    break;
     2020                case 'date':
     2021                    $query['orderby'] = 'post_date';
     2022                    break;
     2023            }
     2024           
     2025        endif;
     2026        //print_r($query); 
    19472027        $the_query = new WP_Query($query);
    19482028   
     
    20062086    }
    20072087   
    2008    
    2009 
     2088    function get_all_names(){
     2089        global $wpdb;
     2090        $data = get_transient("profile_cct_name_list");
     2091        if(!$data):
     2092            $query = "SELECT post_title FROM $wpdb->posts WHERE post_type = 'profile_cct' AND post_status = 'publish'";
     2093            $data = $wpdb->get_results($query);
     2094            set_transient("profile_cct_name_list", $data, 10 * 60);
     2095        endif;
     2096        return $data;
     2097    }
     2098   
     2099    function profile_search_shortcode($atts){
     2100        //static $has_search_box = false;
     2101        ob_start();
     2102        ?>
     2103       
     2104        <div class="profile-cct-search">
     2105            <form action="<?php echo get_bloginfo('siteurl'); ?>" method="get">
     2106               
     2107                <input type="text" name="s" class="profile-cct-search" />
     2108                <input type="hidden" name="post_type" value="profile_cct" />
     2109                <input type="submit" value="Search People" />
     2110            </form>
     2111       
     2112            <?
     2113            $names = array();
     2114            $query_results = $this->get_all_names();
     2115            foreach($query_results as $result):
     2116                $names[] = $result->post_title;
     2117            endforeach;
     2118            ?> 
     2119           
     2120            <script>
     2121                jQuery(function() {
     2122                    var availableTags = <?php echo json_encode($names); ?>;
     2123                    jQuery( ".profile-cct-search" ).autocomplete({
     2124                        source: availableTags
     2125                    });
     2126                });
     2127            </script>
     2128           
     2129           
     2130           
     2131        </div>
     2132        <?
     2133        return ob_get_clean();
     2134    }
     2135   
     2136    function process_search(){
     2137        if(($_GET['post_type'] != 'profile_cct')):
     2138            return;
     2139        endif;
     2140       
     2141        $query = $_GET['s'];
     2142       
     2143        $page = get_page_by_title( $query, null, "profile_cct");
     2144        if(empty($page)):
     2145            return;
     2146            if(file_exists(get_stylesheet_directory().'/archive-profile_cct.php')):
     2147                include (get_stylesheet_directory().'/archive-profile_cct.php');
     2148                exit;
     2149            endif;
     2150        endif;
     2151       
     2152        $permalink = get_permalink($page->ID);
     2153        wp_redirect($permalink);
     2154        exit;
     2155    }
     2156   
     2157   
     2158   
     2159    function register_alphabet_taxonomy(){
     2160        if(!taxonomy_exists("profile_cct_letter")):
     2161       
     2162        $args = array(
     2163            'labels' => array ( 'name' => 'Letter', 'singular_name' => 'Letter' ),
     2164            'rewrite' => array(
     2165                'slug' => 'letter',
     2166                'with_front' => true,
     2167                'feeds' => true,
     2168                'pages' => true
     2169            ),
     2170            'show_ui' => false,
     2171            'show_tagcloud' => false,
     2172            'show_in_nav_menus' => false,
     2173            'public' => true,
     2174            'query_var' => true,
     2175            'hierarchical' => false,
     2176            );
     2177        register_taxonomy( 'profile_cct_letter', 'profile_cct', $args );
     2178        endif;
     2179       
     2180        if(!term_exists('a', 'profile_cct')):
     2181            foreach(range('a','z') as $letter):
     2182               
     2183                ( wp_insert_term($letter, 'profile_cct_letter'));
     2184            endforeach;
     2185        endif;
     2186    }
     2187   
     2188    function profile_navigation_shortcode($atts){
     2189        //Parse the comma seperated display_tax attribute and turn it into an associative array
     2190        if($atts['display_tax']):
     2191            $atts['display_tax'] = explode(',', $atts['display_tax']);
     2192            $tax_array = array();
     2193            foreach($atts['display_tax'] as $tax):
     2194                $tax_array['profile_cct_'.trim($tax)] = true;
     2195            endforeach;
     2196            $atts['display_tax'] = $tax_array;
     2197        endif;
     2198       
     2199       
     2200        echo do_action('profile_cct_display_archive_controls', array('mode'=>'shortcode','options'=>$atts));
     2201    }
     2202
     2203    function display_archive_controls($args){
     2204        global $wp_query;
     2205        //If we're neither on a profile_cct archive page nor trying to show the profilenav widget/shortcode....
     2206        if( $wp_query->get('post_type') != "profile_cct" && !$args['mode'] )
     2207            return;
     2208       
     2209       
     2210        if($args['mode']!='shortcode'):
     2211            //If we're not using the shortcode then load the settings from the settings page
     2212            $options = $this->settings_options['archive'];
     2213        else:
     2214            //If we're using shortcode, first see if we have set parameters and if so use them instead
     2215            if(!empty($args['options'])):
     2216                $options = $args['options'];
     2217            else:
     2218                $options = $this->settings_options['archive'];
     2219            endif;
     2220        endif;
     2221        ?>
     2222       
     2223       
     2224        <div class="profile-cct-archive-controls">
     2225            <?php
     2226           
     2227            if($options['display_searchbox']):
     2228                echo '<h6>Search By name</h6>';
     2229                echo $this->profile_search_shortcode(array());
     2230            endif;
     2231           
     2232            if(count($options['display_tax']) || $options['display_orderby']):
     2233                $this->display_taxonomy_navigation($options);
     2234            endif;
     2235           
     2236            if($options['display_alphabet']):
     2237                $this->display_alphabet_navigation();
     2238            endif;
     2239             
     2240            ?>
     2241        </div>
     2242        <?php
     2243    }
     2244   
     2245   
     2246    function display_taxonomy_navigation($options){
     2247        ?>
     2248        <div class="profile-cct-archive-filters" style="overflow:hidden;">
     2249            <h6>Filter &amp; Order Profiles</h6>
     2250            <form action="<?php echo get_bloginfo('siteurl'); ?>" method="get">
     2251            <?
     2252            $taxonomies = get_object_taxonomies("profile_cct"); //i swear this line used to be here and then disappeared.
     2253            foreach($taxonomies as $tax):
     2254               
     2255                if(!$options['display_tax'][$tax])continue;
     2256                ?>
     2257                <div class="profile-cct-filter-box">   
     2258                    <select name="<?php echo $tax; ?>">
     2259                                <option value="">All</option>
     2260                            <?php foreach(get_terms($tax) as $term): ?>
     2261                               
     2262                                <option value="<?php echo $term->slug;?>" <?php selected($term->slug, get_query_var($tax)); ?>><?php echo $term->name; ?></option>
     2263                            <?php endforeach; ?>
     2264                    </select>
     2265                    <br />
     2266                    <span class="small"><?php echo substr($tax, 12); /* strip off the prefix */ ?></span>
     2267                </div>
     2268                <?php
     2269            endforeach; ?> 
     2270           
     2271            <?php if($options['display_orderby']): ?>
     2272                <div class="profile-cct-filter-box">
     2273                    <select name="orderby">
     2274                        <option value="">Default</option>
     2275                        <option value="first_name" <?php selected('first_name', $_GET['orderby']); ?>>First Name</option>
     2276                        <option value="last_name" <?php selected('last_name', $_GET['orderby']); ?>>Last Name</option>
     2277                        <option value="date_added"  <?php selected('date', $_GET['orderby']); ?>>Date Added</option>
     2278                    </select>
     2279                    <br />
     2280                    <span class="small">order by</small>
     2281                </div>
     2282            <?php endif; ?>
     2283           
     2284            <input type="hidden" name="post_type" value="profile_cct">
     2285            <input type="submit" value="Apply Filters" />
     2286           
     2287            </form>
     2288        </div>
     2289        <?
     2290    }
     2291   
     2292   
     2293    function display_alphabet_navigation(){
     2294        ?>
     2295        <div class="profile-cct-archive-letters">
     2296            <h6>Show all profiles starting with letter: </h6>
     2297            <ul style="list-style-type:none;margin-left:0;">
     2298            <?php
     2299                $active_letters = get_terms("profile_cct_letter");
     2300                $l = array();
     2301                foreach($active_letters as $letter):
     2302                    $l[] = strtoupper($letter->name);
     2303                endforeach;
     2304                foreach(range('A', 'Z') as $letter): ?>
     2305                    <li style="display:inline;">
     2306                        <?php
     2307                        $current = get_query_var('profile_cct_letter');
     2308                        if(!strcasecmp($current, $letter )):
     2309                            echo '<strong>'.$letter.'</strong>';
     2310                        elseif(in_array($letter, $l)): ?>
     2311                            <a href="<?php echo get_bloginfo('siteurl'); ?>?post_type=profile_cct&amp;profile_cct_letter=<?php echo strtolower($letter); ?>"><?php echo $letter; ?></a>
     2312                        <?php else: ?>
     2313                            <?php echo $letter; ?>
     2314                        <?php endif; ?>
     2315                    </li>
     2316                <? endforeach; ?>
     2317            </ul>
     2318        </div>
     2319        <?
     2320    }
     2321   
     2322   
    20102323//END SHORTCODES   
    20112324    /**
  • profile-custom-content-type/trunk/readme.txt

    r544690 r579420  
    33Tags: profile, user
    44Requires at least: 3.2
    5 Tested up to: 3.3.1
    6 Stable tag: 1.1.8.2
     5Tested up to: 3.4.1
     6Stable tag: 1.2
    77
    88Manage and display advanced user profiles on your website.
     
    2626Everything can be styled with CSS
    2727
    28 Dashboard icon from http://p.yusukekamiyamane.com/
     28Dashboard icon from http://p.yusukekamiyamane.com/  
    2929
    3030Social icons from http://paulrobertlloyd.com/2009/06/social_media_icons/
     
    34341. Extract the zip file into wp-content/plugins/ in your WordPress installation
    35352. Go to plugins page to activate
     363. Recommended: Some minor changes to theme files (archive.php, search.php, taxonomy.php) to accommodate profile cct features (see "Usage" for details)
     37
     38The plugin (optionally) makes use of jQuery UI tabs so you'll need to grab some CSS for that if your theme doesn't already have it and you want tabbed content on profile pages.
     39See http://jqueryui.com/themeroller/ to find or create a style for the tabs
    3640
    3741== Usage ==
     
    3943The plugin will generate pages for individual profiles as well as for lists of people.
    4044
    41 For further flexibility you can use the [profilelist] and [profile] shortcodes to display profiles anywhere on a site.
     45The profile form your users will fill out can be fully customized in Profiles->Settings, as well as how profiles are displayed on your site.
    4246
    43 =[profilelist] shortcode=
     47Additional information on this customization is available at http://wiki.ubc.ca/Documentation:UBC_Content_Management_System/Managing_People_Profiles_and_Directories
     48
     49= Archive Pages =
     50
     51By default you can see a list of profiles on your site at example.com/your-site-path/person
     52
     53To display filtering/searching controls on the archive page you have three options:
     541. modify your taxonomy.php template and archive.php (or archive-profile_cct.php) in your theme folder and include the line <?php do_action("profile_cct_display_archive_controls"); ?> where you want the controls to appear. The plugin will function fine without this but it won't be as easy for your users to search/filter/browse profiles. (The controls can be customized as well on the Settings page)
     552. Use the Profile navigation widget. It'll include the fields you specify in the settings page.
     563. Use the [profilenavigation] shortcode (More info in the shortcode section of this document.
     57
     58**Note: Make sure you enable some navigation elements in the Profiles->Settings page under the Settings tab**
     59
     60
     61In addition, you may want to customize the search results page for profile_cct posts and only display the_excerpt() in the loop (the_excerpt() will output the list view as set on the profile settings page)
     62
     63See the examples folder for examples of these theme modifications
     64
     65For other uses you can use the [profilelist] and [profile] shortcodes to display profiles anywhere on a site.
     66
     67= [profilelist] shortcode =
    4468
    4569[profilelist] by default shows all profiles in list view format
     
    5074You can specify multiple taxonomies to filter by, by default then only profiles that meet ALL the specified criteria will be displayed. Alternatively you can also add query="or" to the shortcode to show profiles meeting at least one of the criterias.
    5175
     76Filtering by letter:
     77[profilelist letter="a"] returns all profiles where last name starts with letter 'a'.
     78
     79Ordering results:
     80[profilelist orderby = orderfield] where 'orderfield' is either first_name, last_name, or date. By default it will use the manual ordering specified on the Profiles->Order Profiles page
     81You can also show results in descending order, eg [profilelist orderby='first_name' order='desc']
     82
     83
    5284Displaying more details:
    5385use display="full" to show full profiles, or display="name" to only shows names. Default behaviour shows the list view as set in the settings.
     86
    5487
    5588Show a specific set of people:
     
    5790Displays the people with the corresponding id
    5891
    59 =[profile] shortcode=
     92= [profile] shortcode =
    6093
    6194With this shortcode you can display a single profile. (This can also be accomplished with the [profilelist] shortcode with the right parameters, but this is a more straightforward option)
     
    6598By default the full view will be shown, but you can set display="list" instead to show the list view.
    6699
     100= [profilesearch] shortcode =
     101
     102Display a search box (with jquery-ui Autocomplete) to search for profiles by name
     103
     104= [profilenavigation] shortcode =
     105
     106Displays profile navigation. If no parameters are supplied it'll rely on the options set in the settings page. If at least one parameter is supplied then the global settings will be ignored
     107display_searchbox=true to show the search box
     108display_alphabet=true to show the letter list
     109display_orderby=true to show the orderby field
     110display_tax="comma separated list of taxonomies" to show dropdowns to filter by those taxonomies.
     111
     112eg [profilenavigation display_searchbox="true" display_tax="location, position"] will show a searchbox as well as two dropdown menus to filter by the two specified taxonomies
     113
     114== Screenshots ==
     115
     1161. Listing profiles in the dashboard
     1172. A profile form for the user to fill out, fully customizable in the settings
     1183. Social network links, custom taxonomies, etc
     1194. Custom taxonomies for profiles can be easily set up to filter profiles by.
     1205. Drag and Drop profiles around to customize how they're ordered. Alternatively they can be sorted automatically by first name, last name, date
     1216. Main plugin settings screen. Tabs at the top to access various settings
     1227. Settings tab containing general settings
     1238. Custom taxonomies will show up in the menu in the dashboard
     1249. The Form Builder where you can set up a profile form for your users to fill out by dragging and dropping the desired fields into place
     12510. Profile View Builder where you can decide what shows up on users' profile pages.
     12611. List View Builder
     12712. Custom fields can be added which can then be added to the form and the views
     12813. Where users go to edit their profile
     129
    67130== Change log ==
     131
     132= Version 1.2 =
     133* added [profilesearch] shortcode
     134* added automatic ordering (first name, last name, date added) for archive pages and shortcode
     135* profiles can now be filtered by first letter of last name
     136* added filter/search interface on archive page
     137* also added widget and shortcode to display filter/search interface
     138* fixed a bug that may cause PHP errors when [profilelist] is called with no arguments
     139* fixed image uploader to be compatible with WordPress 3.4
     140* fixed minor formatting issues
     141
    68142= Version 1.1.8.1 =
    69143* Version Number bump
  • profile-custom-content-type/trunk/views/fields/phone.php

    r516918 r579420  
    123123    $field->display_text( array( 'field_type'=>$type,  'class'=>'type', 'default_text'=>'Work', 'value'=>$data['option'], 'type'=>'text', 'tag'=>'span') );
    124124   
    125    
    126     $field->display_text( array( 'field_type'=>$type,  'class'=>'tel-1', 'default_text'=>'735', 'separator'=>':','value'=>$data['tel-1'], 'type'=>'text', 'tag'=>'span') );
     125    $seperator=':';
     126    if(empty($data['option']))
     127        $seperator = '';
     128    $field->display_text( array( 'field_type'=>$type,  'class'=>'tel-1', 'default_text'=>'735', 'separator'=>$seperator,'value'=>$data['tel-1'], 'type'=>'text', 'tag'=>'span') );
    127129   
    128130    $seperator = ' -';
    129     if(empty($data['tel-1']))
    130         $seperator = ':';
     131    if(empty($data['tel-1'])):
     132        if(empty($data['option']))
     133            $seperator = '';
     134        else
     135            $seperator = ':';
     136    endif;
    131137       
    132138    $field->display_text( array( 'field_type'=>$type,  'class'=>'tel-2', 'default_text'=>'279', 'separator'=>$seperator, 'value'=>$data['tel-2'], 'type'=>'text', 'tag'=>'span') );
  • profile-custom-content-type/trunk/views/fields/picture.php

    r544690 r579420  
    246246?>
    247247
     248
     249
    248250</head>
    249251<body>
     
    294296    <form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo admin_url('admin-ajax.php'); ?>?action=profile_cct_picture_add_photo&step=2&post_id=<?php echo $post_id; ?>" >
    295297            <label for="upload"><?php _e('Choose an image from your computer:','user-avatar'); ?></label><br /><input type="file" id="upload" name="uploadedfile" />
    296             <input type="hidden" name="action" value="save" />
     298
    297299            <?php wp_nonce_field('user-avatar') ?>
    298300        <p class="submit"><input type="submit" value="<?php esc_attr_e('Upload'); ?>" /></p>
  • profile-custom-content-type/trunk/views/settings.php

    r544690 r579420  
    1010if( empty($this->settings_options['slug'] ) )
    1111    $this->settings_options['slug'] = $default_options['slug'];
     12   
     13if( empty($this->settings_options['archive'] ) )
     14    $this->settings_options['archive'] = $default_options['archive'];
    1215
    1316if( empty($this->settings_options['permissions'] ) )
     
    3538            $this->settings_options['slug'] = 'person';
    3639        endif;
    37    
     40       
     41        $order_by = $_POST['sort_order'];
     42        if(in_array($order_by, array("manual", "first_name", "last_name", "date"))):
     43            $this->settings_options['sort_order'] = $order_by;
     44        endif;
     45       
     46       
     47        $archive = $_POST['archive'];
     48        $this->settings_options['archive'] = $archive;
     49       
    3850        // lets deal with permissions   
    3951        $post_permissions = $_POST['options']['permissions'];
     
    100112    </tr>
    101113    </tbody></table>
     114   
     115   
     116    <h3>Sort Order</h3>
     117    <table class="form-table">
     118    <tbody>
     119    <tr valign="top">
     120        <th scope="row"><label for="slug">Order by</label></th>
     121        <td>
     122            <select name="sort_order" id="sort_order">
     123                <option value="manual" <?php selected("manual", $this->settings_options['sort_order']); ?>>Manually</option>
     124                <option value="first_name" <?php selected("first_name", $this->settings_options['sort_order']); ?>>First Name</option>
     125                <option value="last_name" <?php selected("last_name", $this->settings_options['sort_order']); ?>>Last Name</option>
     126                <option value="date" <?php selected("date", $this->settings_options['sort_order']); ?>>Date Added</option>
     127            </select><br />
     128            if using manual sorting, go to <em>Profiles->Order Profiles</em> to set the order
     129        </td>
     130    </tr>
     131
     132    </tbody></table>
     133   
     134   
     135   
     136    <h3>Profile Archive Navigation Form</h3>
     137    <p>Which navigation to display on profile listing page</p>
     138    <table class="form-table">
     139    <tbody>
     140    <tr valign="top">
     141        <th scope="row"><label for="archive_display_searchbox">Show Search Box</label></th>
     142        <td>
     143            <input type="checkbox" name="archive[display_searchbox]" id="archive_display_searchbox" <?php checked($this->settings_options['archive']['display_searchbox'], 'on'); ?> />
     144        </td>
     145    </tr>
     146   
     147    <tr valign="top">
     148        <th scope="row"><label for="archive_display_alphabet">Show Alphabet Listing</label></th>
     149        <td>
     150            <input type="checkbox" name="archive[display_alphabet]" id="archive_display_alphabet" <?php checked($this->settings_options['archive']['display_alphabet'], 'on'); ?> />
     151        </td>
     152    </tr>
     153   
     154    <tr valign="top">
     155        <th scope="row"><label for="archive_display_orderby">Show Order By</label></th>
     156        <td>
     157            <input type="checkbox" name="archive[display_orderby]" id="archive_display_orderby" <?php checked($this->settings_options['archive']['display_orderby'], 'on'); ?> />
     158        </td>
     159    </tr>
     160   
     161    <tr valign="top">
     162        <th scope="row">Show Taxonomies</th>
     163        <td>
     164            <?php
     165                foreach(get_object_taxonomies('profile_cct') as $tax): ?>
     166                    <input type="checkbox" name="archive[display_tax][<?php echo $tax; ?>]" id="archive_display_tax_<?php echo $tax; ?>" <?php checked($this->settings_options['archive']['display_tax'][$tax], 'on'); ?> /><label style="padding-left:6px;"for="archive_display_tax_<?php echo $tax; ?>"><?php echo substr($tax, 12); ?></label><br />
     167                <?php endforeach;
     168            ?>
     169        </td>
     170    </tr>
     171   
     172   
     173
     174    </tbody></table>
     175   
     176   
    102177   
    103178   
Note: See TracChangeset for help on using the changeset viewer.