Changeset 579420
- Timestamp:
- 07/30/2012 07:06:07 PM (14 years ago)
- Location:
- profile-custom-content-type/trunk
- Files:
-
- 19 added
- 7 edited
-
class/default_options.php (modified) (1 diff)
-
class/profile_widget.php (added)
-
css/profile-cct.css (modified) (1 diff)
-
examples (added)
-
examples/archive.php (added)
-
examples/examples.txt (added)
-
examples/search.php (added)
-
examples/taxonomy.php (added)
-
profile-custom-content-type.php (modified) (14 diffs)
-
readme.txt (modified) (7 diffs)
-
screenshot-1.gif (added)
-
screenshot-10.gif (added)
-
screenshot-11.gif (added)
-
screenshot-12.gif (added)
-
screenshot-13.gif (added)
-
screenshot-2.gif (added)
-
screenshot-3.gif (added)
-
screenshot-4.gif (added)
-
screenshot-5.gif (added)
-
screenshot-6.gif (added)
-
screenshot-7.gif (added)
-
screenshot-8.gif (added)
-
screenshot-9.gif (added)
-
views/fields/phone.php (modified) (1 diff)
-
views/fields/picture.php (modified) (2 diffs)
-
views/settings.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
profile-custom-content-type/trunk/class/default_options.php
r516918 r579420 117 117 "height"=>150, 118 118 ), 119 "archive" => array( 120 121 ), 119 122 'slug' => 'person', 120 123 "permissions"=> array( -
profile-custom-content-type/trunk/css/profile-cct.css
r516918 r579420 35 35 margin-bottom: 0; 36 36 } 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 3 3 Plugin Name: Profile Custom Content Type 4 4 Plugin URI: 5 Version: 1. 1.8.25 Version: 1.2 6 6 Text Domain: profile_cct 7 7 Domain Path: /languages … … 44 44 define( 'PROFILE_CCT_BASENAME', plugin_basename(__FILE__) ); 45 45 define( 'PROFILE_CCT_DIR_URL', plugins_url( '' , PROFILE_CCT_BASENAME ) ); 46 46 require(PROFILE_CCT_DIR_PATH.'/class/profile_widget.php'); 47 47 require(PROFILE_CCT_DIR_PATH.'profile-taxonomies.php'); 48 48 require(PROFILE_CCT_DIR_PATH.'profile-manage-table.php'); … … 71 71 */ 72 72 public function __construct () { 73 73 //remove_filter('template_redirect', 'redirect_canonical'); 74 74 add_shortcode('profilelist', array( $this, 'profile_list_shortcode') ); 75 75 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') ); 76 78 77 79 add_action( 'admin_menu', array( $this, 'add_menu_page' ) ); … … 85 87 86 88 add_action( 'template_redirect', array( $this,'check_freshness')); 89 87 90 add_action( 'wp_insert_post_data', array( $this,'save_post_data'),10,2); 88 91 … … 97 100 add_action( 'admin_init',array($this,'admin_init')); 98 101 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 101 110 $this->settings_options = get_option('Profile_CCT_settings'); 102 111 … … 477 486 * @return void 478 487 */ 488 479 489 function orderby_menu( $orderby ) { 490 491 if($this->automatic_ordering) 492 return $orderby; 493 480 494 $new_orderby = 'menu_order ASC'; 481 495 //$new_orderby = 'menu_order ASC'; 482 496 if( $this->is_main_query ): // only run this if we are dealing with the main query 483 497 // check to see that we are on the profile taxonomies … … 508 522 */ 509 523 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() ): 512 527 $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: 514 556 $this->is_main_query = false; 557 endif; 515 558 516 559 } … … 606 649 if(!is_admin()): 607 650 wp_enqueue_script('jquery-ui-tabs'); 651 wp_enqueue_script('jquery-ui-autocomplete'); 608 652 wp_enqueue_style( 'profile-cct',PROFILE_CCT_DIR_URL. '/css/profile-cct.css' ); 609 653 endif; … … 828 872 endif; 829 873 } 874 875 830 876 /** 831 877 * save_post_data function. … … 886 932 $data['post_content'] = $content; 887 933 888 if(is_array($_POST["profile_cct"])) 934 if(is_array($_POST["profile_cct"])): 889 935 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; 892 949 893 950 } … … 1912 1969 $tax_query = array(); 1913 1970 $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; 1927 1986 1928 1987 //Whether to OR or AND the criterias … … 1934 1993 'post_type'=>'Profile_CCT', 1935 1994 'order'=>'ASC', 1936 'orderby'=>' title',1995 'orderby'=>'menu_order', 1937 1996 'tax_query'=>$tax_query, 1938 1997 'post__not_in'=>explode(",", $atts['exclude']), 1939 'posts_per_page'=>-1 1998 'posts_per_page'=>-1, 1940 1999 ); 1941 2000 2001 2002 if($atts['order']): 2003 $query['order'] = $atts['order']; 2004 endif; 2005 1942 2006 //If include is set 1943 2007 if($atts['include']): … … 1945 2009 endif; 1946 2010 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); 1947 2027 $the_query = new WP_Query($query); 1948 2028 … … 2006 2086 } 2007 2087 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 & 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&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 2010 2323 //END SHORTCODES 2011 2324 /** -
profile-custom-content-type/trunk/readme.txt
r544690 r579420 3 3 Tags: profile, user 4 4 Requires at least: 3.2 5 Tested up to: 3. 3.16 Stable tag: 1. 1.8.25 Tested up to: 3.4.1 6 Stable tag: 1.2 7 7 8 8 Manage and display advanced user profiles on your website. … … 26 26 Everything can be styled with CSS 27 27 28 Dashboard icon from http://p.yusukekamiyamane.com/ 28 Dashboard icon from http://p.yusukekamiyamane.com/ 29 29 30 30 Social icons from http://paulrobertlloyd.com/2009/06/social_media_icons/ … … 34 34 1. Extract the zip file into wp-content/plugins/ in your WordPress installation 35 35 2. Go to plugins page to activate 36 3. Recommended: Some minor changes to theme files (archive.php, search.php, taxonomy.php) to accommodate profile cct features (see "Usage" for details) 37 38 The 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. 39 See http://jqueryui.com/themeroller/ to find or create a style for the tabs 36 40 37 41 == Usage == … … 39 43 The plugin will generate pages for individual profiles as well as for lists of people. 40 44 41 For further flexibility you can use the [profilelist] and [profile] shortcodes to display profiles anywhere on asite.45 The profile form your users will fill out can be fully customized in Profiles->Settings, as well as how profiles are displayed on your site. 42 46 43 =[profilelist] shortcode= 47 Additional 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 51 By default you can see a list of profiles on your site at example.com/your-site-path/person 52 53 To display filtering/searching controls on the archive page you have three options: 54 1. 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) 55 2. Use the Profile navigation widget. It'll include the fields you specify in the settings page. 56 3. 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 61 In 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 63 See the examples folder for examples of these theme modifications 64 65 For other uses you can use the [profilelist] and [profile] shortcodes to display profiles anywhere on a site. 66 67 = [profilelist] shortcode = 44 68 45 69 [profilelist] by default shows all profiles in list view format … … 50 74 You 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. 51 75 76 Filtering by letter: 77 [profilelist letter="a"] returns all profiles where last name starts with letter 'a'. 78 79 Ordering 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 81 You can also show results in descending order, eg [profilelist orderby='first_name' order='desc'] 82 83 52 84 Displaying more details: 53 85 use 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 54 87 55 88 Show a specific set of people: … … 57 90 Displays the people with the corresponding id 58 91 59 = [profile] shortcode=92 = [profile] shortcode = 60 93 61 94 With 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) … … 65 98 By default the full view will be shown, but you can set display="list" instead to show the list view. 66 99 100 = [profilesearch] shortcode = 101 102 Display a search box (with jquery-ui Autocomplete) to search for profiles by name 103 104 = [profilenavigation] shortcode = 105 106 Displays 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 107 display_searchbox=true to show the search box 108 display_alphabet=true to show the letter list 109 display_orderby=true to show the orderby field 110 display_tax="comma separated list of taxonomies" to show dropdowns to filter by those taxonomies. 111 112 eg [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 116 1. Listing profiles in the dashboard 117 2. A profile form for the user to fill out, fully customizable in the settings 118 3. Social network links, custom taxonomies, etc 119 4. Custom taxonomies for profiles can be easily set up to filter profiles by. 120 5. Drag and Drop profiles around to customize how they're ordered. Alternatively they can be sorted automatically by first name, last name, date 121 6. Main plugin settings screen. Tabs at the top to access various settings 122 7. Settings tab containing general settings 123 8. Custom taxonomies will show up in the menu in the dashboard 124 9. 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 125 10. Profile View Builder where you can decide what shows up on users' profile pages. 126 11. List View Builder 127 12. Custom fields can be added which can then be added to the form and the views 128 13. Where users go to edit their profile 129 67 130 == 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 68 142 = Version 1.1.8.1 = 69 143 * Version Number bump -
profile-custom-content-type/trunk/views/fields/phone.php
r516918 r579420 123 123 $field->display_text( array( 'field_type'=>$type, 'class'=>'type', 'default_text'=>'Work', 'value'=>$data['option'], 'type'=>'text', 'tag'=>'span') ); 124 124 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') ); 127 129 128 130 $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; 131 137 132 138 $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 246 246 ?> 247 247 248 249 248 250 </head> 249 251 <body> … … 294 296 <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; ?>" > 295 297 <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 297 299 <?php wp_nonce_field('user-avatar') ?> 298 300 <p class="submit"><input type="submit" value="<?php esc_attr_e('Upload'); ?>" /></p> -
profile-custom-content-type/trunk/views/settings.php
r544690 r579420 10 10 if( empty($this->settings_options['slug'] ) ) 11 11 $this->settings_options['slug'] = $default_options['slug']; 12 13 if( empty($this->settings_options['archive'] ) ) 14 $this->settings_options['archive'] = $default_options['archive']; 12 15 13 16 if( empty($this->settings_options['permissions'] ) ) … … 35 38 $this->settings_options['slug'] = 'person'; 36 39 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 38 50 // lets deal with permissions 39 51 $post_permissions = $_POST['options']['permissions']; … … 100 112 </tr> 101 113 </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 102 177 103 178
Note: See TracChangeset
for help on using the changeset viewer.