Advertisement
vjpo

+ pagination

Feb 7th, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.19 KB | None | 0 0
  1. <?php
  2. // удалить или откомментить строку
  3. // $recent_posts = get_posts( array( 'numberposts' => 10, 'author' => $curauth->ID ) );
  4. // теперь if ($recent_posts) { ... } не действует, но можно его полностью удалить, чтоб не мешалось
  5. // if ($recent_posts) {
  6. // ...
  7. // }
  8. // вместо него вставить этот код, предварительно добавив или отредактировав под себя детали и параметры
  9.  
  10.  
  11. /*
  12. Plugin Name: WordPress Users
  13. Plugin URI: http://kempwire.com/wordpress-users-plugin
  14. Description: Display your WordPress users and user profiles.
  15. Version: 1.4
  16. Author: Jonathan Kemp
  17. Author URI: http://kempwire.com/
  18.  
  19. Copyright 2009-2011  Jonathan Kemp  (email : kempdogg@gmail.com)
  20.  
  21. This program is free software: you can redistribute it and/or modify
  22. it under the terms of the GNU General Public License as published by
  23. the Free Software Foundation, either version 3 of the License, or
  24. (at your option) any later version.
  25.  
  26. This program is distributed in the hope that it will be useful,
  27. but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  29. GNU General Public License for more details.
  30.  
  31. You should have received a copy of the GNU General Public License
  32. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  33.    
  34. */
  35.  
  36. add_action('admin_menu', 'wpu_admin_menu');
  37. add_action('wp_head', 'noindex_users');
  38. add_action('wp_head', 'wpu_styles');
  39. add_filter('the_content', 'wpu_get_users', 1);
  40.  
  41. function wpu_get_users($content) {  
  42.     if(is_page(get_option('wpu_page_id'))) {
  43.        
  44.         if(isset($_GET['uid'])) {
  45.             display_user();
  46.         } else {
  47.             echo $content;
  48.             display_user_list();
  49.         }
  50.     } else {
  51.         //display the content
  52.         return $content;
  53.     }
  54. }
  55.  
  56. function wpu_get_roles()
  57. {
  58.     global $wpdb;
  59.    
  60.     $administrator = get_option('wpu_roles_admin');
  61.     $subscriber = get_option('wpu_roles_subscriber');
  62.     $author = get_option('wpu_roles_author');
  63.     $editor = get_option('wpu_roles_editor');
  64.     $contributor = get_option('wpu_roles_contributor');
  65.    
  66.     $rolelist = array('administrator'=>$administrator, 'subscriber'=>$subscriber, 'author'=>$author, 'editor'=>$editor, 'contributor'=>$contributor);
  67.    
  68.     $roles = array();
  69.    
  70.     foreach($rolelist as $key=>$value)
  71.     {
  72.         if($value == 'yes')
  73.             array_push($roles, $key);
  74.         else
  75.         {}
  76.     }
  77.    
  78.     if (empty($roles))
  79.         $roles = array('administrator', 'subscriber', 'author', 'editor', 'contributor');
  80.  
  81.     $searches = array();
  82.  
  83.     foreach ( $roles as $role )
  84.         $searches[] = "$wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE '%$role%'";
  85.        
  86.     //create a string for use in a MySQL statement
  87.     $meta_values = implode(' OR ', $searches);
  88.    
  89.     return $meta_values;
  90. }
  91.  
  92. function display_user_list() {
  93.  
  94.     // if $_GET['page'] defined, use it as page number
  95.     if(isset($_GET['page'])) {
  96.         $page = $_GET['page'];
  97.     } else {
  98.         // by default we show first page
  99.         $page = 1;
  100.     }
  101.     $limit = get_option('wpu_users_per');
  102.    
  103.     // counting the offset
  104.     $offset = ($page - 1) * $limit;
  105.    
  106.     // Get the authors from the database ordered by user nicename
  107.     global $wpdb;
  108.     $meta_values = wpu_get_roles();
  109.    
  110.     $query = "SELECT $wpdb->users.ID, $wpdb->users.user_nicename FROM $wpdb->users INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $meta_values ORDER BY $wpdb->users.user_nicename LIMIT $offset, $limit";
  111.     $author_ids = $wpdb->get_results($query);
  112.    
  113.        
  114.     $output = '';
  115.  
  116.     // Loop through each author
  117.     foreach($author_ids as $author) {
  118.  
  119.         // Get user data
  120.         $curauth = get_userdata($author->ID);
  121.  
  122.         $output .= get_user_listing($curauth);
  123.     }
  124.          
  125.     echo $output;
  126.  
  127.     // how many rows we have in database
  128.     $totalitems = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE $meta_values)");
  129.  
  130.     $adjacents = 3;
  131.  
  132.     $concat = wpu_concat_index();
  133.  
  134.     echo getPaginationString($page, $totalitems, $limit, $adjacents, $concat);
  135. }
  136.  
  137. function getPaginationString($page = 1, $totalitems, $limit = 15, $adjacents = 1, $concat)
  138. {      
  139.     //defaults
  140.     if(!$adjacents) $adjacents = 1;
  141.     if(!$limit) $limit = 15;
  142.     if(!$page) $page = 1;
  143.    
  144.     //other vars
  145.     $prev = $page - 1;                                  //previous page is page - 1
  146.     $next = $page + 1;                                  //next page is page + 1
  147.     $lastpage = ceil($totalitems / $limit);             //lastpage is = total items / items per page, rounded up.
  148.     $lpm1 = $lastpage - 1;                              //last page minus 1
  149.    
  150.     /*
  151.         Now we apply our rules and draw the pagination object.
  152.         We're actually saving the code to a variable in case we want to draw it more than once.
  153.     */
  154.     $pagination = "";
  155.     if($lastpage > 1)
  156.     {  
  157.         $pagination .= "<div class=\"wpu-pagination\"";
  158.         $pagination .= ">";
  159.  
  160.         //previous button
  161.         if ($page > 1)
  162.             $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$prev\">« prev</a>";
  163.         else
  164.             $pagination .= "<span class=\"wpu-disabled\">« prev</span>";  
  165.        
  166.         //pages
  167.         if ($lastpage < 7 + ($adjacents * 2))   //not enough pages to bother breaking it up
  168.         {  
  169.             for ($counter = 1; $counter <= $lastpage; $counter++)
  170.             {
  171.                 if ($counter == $page)
  172.                     $pagination .= "<span class=\"wpu-current\">$counter</span>";
  173.                 else
  174.                     $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$counter\">$counter</a>";                  
  175.             }
  176.         }
  177.         elseif($lastpage >= 7 + ($adjacents * 2))   //enough pages to hide some
  178.         {
  179.             //close to beginning; only hide later pages
  180.             if($page < 1 + ($adjacents * 3))       
  181.             {
  182.                 for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
  183.                 {
  184.                     if ($counter == $page)
  185.                         $pagination .= "<span class=\"wpu-current\">$counter</span>";
  186.                     else
  187.                         $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$counter\">$counter</a>";                  
  188.                 }
  189.                 $pagination .= "<span class=\"wpu-elipses\">...</span>";
  190.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$lpm1\">$lpm1</a>";
  191.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$lastpage\">$lastpage</a>";    
  192.             }
  193.             //in middle; hide some front and some back
  194.             elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
  195.             {
  196.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=1\">1</a>";
  197.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=2\">2</a>";
  198.                 $pagination .= "<span class=\"wpu-elipses\">...</span>";
  199.                 for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
  200.                 {
  201.                     if ($counter == $page)
  202.                         $pagination .= "<span class=\"wpu-current\">$counter</span>";
  203.                     else
  204.                         $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$counter\">$counter</a>";                  
  205.                 }
  206.                 $pagination .= "...";
  207.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$lpm1\">$lpm1</a>";
  208.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$lastpage\">$lastpage</a>";    
  209.             }
  210.             //close to end; only hide early pages
  211.             else
  212.             {
  213.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=1\">1</a>";
  214.                 $pagination .= "<a href=\"" . get_permalink() . $concat . "page=2\">2</a>";
  215.                 $pagination .= "<span class=\"wpu-elipses\">...</span>";
  216.                 for ($counter = $lastpage - (1 + ($adjacents * 3)); $counter <= $lastpage; $counter++)
  217.                 {
  218.                     if ($counter == $page)
  219.                         $pagination .= "<span class=\"wpu-current\">$counter</span>";
  220.                     else
  221.                         $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$counter\">$counter</a>";                  
  222.                 }
  223.             }
  224.         }
  225.        
  226.         //next button
  227.         if ($page < $counter - 1)
  228.             $pagination .= "<a href=\"" . get_permalink() . $concat . "page=$next\">next »</a>";
  229.         else
  230.             $pagination .= "<span class=\"wpu-disabled\">next »</span>";
  231.         $pagination .= "</div>\n";
  232.     }
  233.    
  234.     return $pagination;
  235.  
  236. }
  237.  
  238. function wpu_concat_index()
  239. {
  240.     $url = $_SERVER['REQUEST_URI'];
  241.     $permalink = get_permalink(get_the_id());
  242.    
  243.     if(strpos($permalink, '?'))
  244.         return '&';
  245.     else
  246.         return '?';
  247. }
  248.  
  249. function wpu_concat_single()
  250. {
  251.     $url = $_SERVER['REQUEST_URI'];
  252.     $permalink = get_permalink(get_the_id());
  253.    
  254.     if(strpos($permalink, '?'))
  255.         return '&';
  256.     else
  257.         return '?';
  258. }
  259.  
  260. function get_user_listing($curauth) {  
  261.     global $post;
  262.     $concat = wpu_concat_single();
  263.    
  264.     $html = "<div class=\"wpu-user\">\n";
  265.     if (get_option('wpu_image_list')) {
  266.         if(get_option('wpu_avatars') == "gravatars") {
  267.             $gravatar_type = get_option('wpu_gravatar_type');
  268.             $gravatar_size = get_option('wpu_gravatar_size');
  269.             $display_gravatar = get_avatar($curauth->user_email, $gravatar_size, $gravatar_type);
  270.             $html .= "<div class=\"wpu-avatar\"><a href=\"" . get_permalink($post->ID) . $concat . "uid=$curauth->ID\" title=\"$curauth->display_name\">$display_gravatar</a></div>\n";
  271.         } elseif (get_option('wpu_avatars') == "userphoto") {
  272.             if(function_exists('userphoto_the_author_photo'))
  273.             {
  274.                 $html .= "<div class=\"wpu-avatar\"><a href=\"" . get_permalink($post->ID) . $concat . "uid=$curauth->ID\" title=\"$curauth->display_name\">" . userphoto__get_userphoto($curauth->ID, USERPHOTO_THUMBNAIL_SIZE, "", "", array(), "") . "</a></div>\n";
  275.             }
  276.         }
  277.     }
  278.     $html .= "<div class=\"wpu-id\"><a href=\"" . get_permalink($post->ID) . $concat . "uid=$curauth->ID\" title=\"$curauth->display_name\">$curauth->display_name</a></div>\n";
  279.     if (get_option('wpu_description_list')) {
  280.         if ($curauth->description) {
  281.             if (get_option('wpu_description_limit')) {
  282.                 $desc_limit = get_option('wpu_description_limit');
  283.                 $html .=  "<div class=\"wpu-about\">" . substr($curauth->description, 0, $desc_limit) . " [...]</div>\n";
  284.             } else {
  285.                 $html .=  "<div class=\"wpu-about\">" . $curauth->description . "</div>\n";
  286.             }
  287.         }
  288.     }
  289.     $html .= "</div>";
  290.     return $html;
  291. }
  292.  
  293. function display_user() {  
  294.     global $post;
  295.    
  296.     if (isset($_GET['uid'])) {
  297.         $uid = $_GET['uid'];
  298.         $curauth = get_userdata($uid);
  299.     }
  300.    
  301.     if ( $curauth ) {
  302. // убираем $recent_posts
  303.         // $recent_posts = get_posts( array( 'numberposts' => 10, 'author' => $curauth->ID ) );
  304.         $recent_comments = wpu_recent_comments($uid);
  305.         $created = date("F jS, Y", strtotime($curauth->user_registered));
  306.        
  307.         $html = "<p><a href=" . get_permalink($post->ID) . ">&laquo; Back to " . get_the_title($post->ID) . " page</a></p>\n";
  308.        
  309.         $html .= "<h2>$curauth->display_name</h2>\n";
  310.        
  311.         if (get_option('wpu_image_profile')) {
  312.             if(get_option('wpu_avatars') == "gravatars") {
  313.                 $html .= "<p><a href=\"http://en.gravatar.com/\" title=\"Get your own avatar.\">" . get_avatar($curauth->user_email, '96', $gravatar) . "</a></p>\n";
  314.             } elseif (get_option('wpu_avatars') == "userphoto") {
  315.                 if(function_exists('userphoto_the_author_photo'))
  316.                 {
  317.                     $html .= "<p>" . userphoto__get_userphoto($curauth->ID, USERPHOTO_FULL_SIZE, "", "", array(), "") . "</p>\n";
  318.                 }
  319.             }
  320.         }
  321.    
  322.         if ($curauth->user_url && $curauth->user_url != "http://") {
  323.             $html .= "<p><strong>Website:</strong> <a href=\"$curauth->user_url\" rel=\"nofollow\">$curauth->user_url</a></p>\n";
  324.         }
  325.        
  326.         $html .= "<p><strong>Joined on:</strong>  " . $created . "</p>";
  327.        
  328.         if (get_option('wpu_description_profile')) {
  329.             if ($curauth->description) {
  330.                 $html .= "<p><strong>Profile:</strong></p>\n";
  331.                 $html .= "<p>$curauth->description</p>\n";
  332.             }
  333.         }
  334.  
  335.         /* здесь было
  336.         if ($recent_posts) {
  337.                    // la la la
  338.         }
  339.         wp_reset_query();      
  340.                 */
  341.  
  342. // вставка  
  343.                 wp_reset_query();
  344.         global $wp_query, $paged;
  345.         $wp_query = new WP_Query();
  346.         $wp_query->query('author='.$curauth->ID.'&showposts=10'.'&paged='.$paged);
  347.         if (have_posts()) :
  348.         $html .= "<h3 style='padding:5px 0;' class='autor_res_post'>ВСЕ ЗАПИСИ АВТОРА</h3>\n";
  349.         $html .= "<ul class='autor_res_post'>\n";
  350.  
  351.         while ($wp_query->have_posts()) : $wp_query->the_post();
  352.         $html .= "<li>";
  353.             if ( is_user_logged_in() && current_user_can('edit_post'))
  354.             {
  355.             $html .= '<a class="redaktor" href="' . get_edit_post_link($post->ID) . '">Редактировать</a><br/>';
  356.             }
  357.         $html .= '<a href="'.get_permalink().'" rel="bookmark">'. get_the_title() . '</a></li>';
  358.         endwhile;
  359.  
  360.         $html .= '</ul>';
  361.         $html .= '<div class="navigation">';
  362.         $html .=  '<div class="alignleft">' . get_previous_posts_link( 'Prev' ) . '</div>';
  363.         $html .=  '<div class="alignright">' . get_next_posts_link( 'Next' ) . '</div>';
  364.         $html .= '</div>';
  365.         else :
  366.         $html .= "<h3 style='padding:5px 0;' class='autor_res_post'>У АВТОРА ПОКА НЕТ СТАТЕЙ</h3>\n";
  367.         endif;
  368.         wp_reset_query();
  369.  
  370. // конец
  371.         if ($recent_comments) {
  372.             $html .= "<h3>Recent Comments by $curauth->display_name</h3>\n";
  373.             $html .= "<ul>\n";
  374.             foreach($recent_comments as $key=>$comment)
  375.             {
  376.                 $html .= "<li>\"" . $comment->comment_content . "\" on <a href=" . get_permalink($comment->comment_post_ID) . "#comment-" . $comment->comment_ID . ">" . get_the_title($comment->comment_post_ID) . "</a></li>";
  377.             }
  378.             $html .= "</ul>\n";
  379.         }
  380.        
  381.         echo "<div id=\"wpu-profile\">
  382.         ";
  383.         echo $html;
  384.         echo "</div>
  385.         ";
  386.     }
  387. }
  388.  
  389. function wpu_recent_comments($uid)
  390. {
  391.     global $wpdb;
  392.    
  393.     $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_ID, comment_post_ID, SUBSTRING(comment_content, 1, 150) AS comment_content
  394.     FROM $wpdb->comments
  395.     WHERE user_id = %s
  396.     ORDER BY comment_ID DESC
  397.     LIMIT 10
  398.     ", $uid ) );
  399.  
  400.     return $comments;
  401. }
  402.  
  403. function noindex_users() {
  404.     if(is_page(get_option('wpu_page_id')) && get_option('wpu_noindex_users') == 'yes') {
  405.         if($_GET['uid'] == "")
  406.             echo '  <meta name="robots" content="noindex, follow"/>
  407.             ';
  408.     }
  409. }
  410.  
  411. // 2.0 Feature
  412. function wpu_styles() {
  413.     if(is_page(get_option('wpu_page_id'))) {
  414.         echo '<link href="' . get_bloginfo ( 'wpurl' ) . '/wp-content/plugins/wordpress-users/wpu-styles.css" rel="stylesheet" type="text/css" />
  415.         ';
  416.     }
  417. }
  418.  
  419. function wpu_admin_menu() {  
  420.     add_options_page('WordPress Users Options', 'WordPress Users', 'manage_options', __FILE__, 'wpu_admin');
  421. }
  422.  
  423. function wpu_admin() {
  424.     if($_POST['wpu_hidden'] == 'Y') {
  425.         //Form data sent
  426.         $pageid = $_POST['wpu_page_id'];
  427.         update_option('wpu_page_id', $pageid);
  428.            
  429.         $usersperpage = $_POST['wpu_users_per'];
  430.         update_option('wpu_users_per', $usersperpage);
  431.            
  432.         $avatars = $_POST['wpu_avatars'];
  433.         update_option('wpu_avatars', $avatars);
  434.        
  435.         $gravatar_type = $_POST['wpu_gravatar_type'];
  436.         update_option('wpu_gravatar_type', $gravatar_type);
  437.            
  438.         $gravatar_size = $_POST['wpu_gravatar_size'];
  439.         update_option('wpu_gravatar_size', $gravatar_size);
  440.        
  441.         $noindex_users = $_POST['wpu_noindex_users'];
  442.         update_option('wpu_noindex_users', $noindex_users);
  443.        
  444.         $roles_admin = $_POST['wpu_roles_admin'];
  445.         update_option('wpu_roles_admin', $roles_admin);
  446.        
  447.         $roles_editor = $_POST['wpu_roles_editor'];
  448.         update_option('wpu_roles_editor', $roles_editor);
  449.        
  450.         $roles_author = $_POST['wpu_roles_author'];
  451.         update_option('wpu_roles_author', $roles_author);
  452.        
  453.         $roles_contributor = $_POST['wpu_roles_contributor'];
  454.         update_option('wpu_roles_contributor', $roles_contributor);
  455.        
  456.         $roles_subscriber = $_POST['wpu_roles_subscriber'];
  457.         update_option('wpu_roles_subscriber', $roles_subscriber);
  458.        
  459.         $image_list = $_POST['wpu_image_list'];
  460.         update_option('wpu_image_list', $image_list);
  461.        
  462.         $description_list = $_POST['wpu_description_list'];
  463.         update_option('wpu_description_list', $description_list);
  464.        
  465.         $image_profile = $_POST['wpu_image_profile'];
  466.         update_option('wpu_image_profile', $image_profile);
  467.        
  468.         $description_profile = $_POST['wpu_description_profile'];
  469.         update_option('wpu_description_profile', $description_profile);
  470.        
  471.         $desc_limit = $_POST['wpu_description_limit'];
  472.         update_option('wpu_description_limit', $desc_limit);
  473.     ?>  
  474.         <div class="updated"><p><strong><?php _e('Options saved.' ); ?></strong></p></div>
  475.     <?php  
  476.     } else {
  477.         //Normal page display
  478.         $pageid = get_option('wpu_page_id');
  479.         $usersperpage = get_option('wpu_users_per');
  480.         $gravatar_type = get_option('wpu_gravatar_type');
  481.         $gravatar_size = get_option('wpu_gravatar_size');
  482.         $noindex_users = get_option('wpu_noindex_users');
  483.         $image_list = get_option('wpu_image_list');
  484.         $description_list = get_option('wpu_description_list');
  485.         $image_profile = get_option('wpu_image_profile');
  486.         $description_profile = get_option('wpu_description_profile');
  487.         $desc_limit = get_option('wpu_description_limit');
  488.        
  489.         if (empty($usersperpage))   $usersperpage = 10;
  490.         if(get_option('wpu_avatars') == 1) {
  491.             if (empty($gravatar_type))  $gravatar_type = "mystery";
  492.             if (empty($gravatar_size))  $gravatar_size = 80;
  493.         }
  494.     }
  495. ?>
  496.    
  497.     <div class="wrap">
  498.         <h2><?php _e('WordPress Users Options') ?></h2>
  499.            
  500.         <form name="wpu_admin_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
  501.             <input type="hidden" name="wpu_hidden" value="Y">
  502.             <table>
  503.                 <tr>
  504.                     <td>&nbsp;</td>
  505.                     <td>&nbsp;</td>
  506.                     <td></td>
  507.                 </tr>
  508.                 <tr>
  509.                     <td><?php _e("Page ID: " ); ?>&nbsp;</td>
  510.                     <td colspan="2"><input type="text" name="wpu_page_id" value="<?php echo $pageid; ?>" size="3">&nbsp; ID of the page on which you want to display the user directory.</td>
  511.                 </tr>
  512.                 <tr>
  513.                     <td>&nbsp;</td>
  514.                     <td>&nbsp;</td>
  515.                     <td></td>
  516.                 </tr>
  517.                 <tr>
  518.                     <td><?php _e("Users Per Page: " ); ?>&nbsp;</td>
  519.                     <td colspan="2"><input type="text" name="wpu_users_per" value="<?php echo $usersperpage; ?>" size="3">&nbsp; How many users you want to display at once.</td>
  520.                 </tr>
  521.                 <tr>
  522.                     <td>&nbsp;</td>
  523.                     <td>&nbsp;</td>
  524.                     <td></td>
  525.                 </tr>
  526.                 <tr>
  527.                     <td><?php _e("Noindex User Listings: " ); ?>&nbsp;</td>
  528.                     <td colspan="2"><input name="wpu_noindex_users" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_noindex_users')); ?> />&nbsp; Insert robots noindex meta tag on user listings to prevent search engine indexing.</td>
  529.                 </tr>
  530.                 <tr>
  531.                     <td>&nbsp;</td>
  532.                     <td>&nbsp;</td>
  533.                     <td></td>
  534.                 </tr>
  535.                 <tr>
  536.                     <td colspan="3">
  537.                         <h3>Select Which Users to Display</h3>
  538.                         <p><small><strong>Note:</strong> If no options are selected, all users will be displayed.</small></p>
  539.                     </td>
  540.                 </tr>
  541.                 <tr>
  542.                     <td colspan="3"><input name="wpu_roles_admin" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_roles_admin')); ?> />&nbsp; <?php _e("Administrator" ); ?></td>
  543.                 </tr>
  544.                 <tr>
  545.                     <td>&nbsp;</td>
  546.                     <td>&nbsp;</td>
  547.                     <td></td>
  548.                 </tr>
  549.                 <tr>
  550.                     <td colspan="3"><input name="wpu_roles_editor" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_roles_editor')); ?> />&nbsp; <?php _e("Editors" ); ?></td>
  551.                 </tr>
  552.                 <tr>
  553.                     <td>&nbsp;</td>
  554.                     <td>&nbsp;</td>
  555.                     <td></td>
  556.                 </tr>
  557.                 <tr>
  558.                     <td colspan="3"><input name="wpu_roles_author" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_roles_author')); ?> />&nbsp; <?php _e("Authors" ); ?></td>
  559.                 </tr>
  560.                 <tr>
  561.                     <td>&nbsp;</td>
  562.                     <td>&nbsp;</td>
  563.                     <td></td>
  564.                 </tr>
  565.                 <tr>
  566.                     <td colspan="3"><input name="wpu_roles_contributor" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_roles_contributor')); ?> />&nbsp; <?php _e("Contribtors" ); ?></td>
  567.                 </tr>
  568.                 <tr>
  569.                     <td>&nbsp;</td>
  570.                     <td>&nbsp;</td>
  571.                     <td></td>
  572.                 </tr>
  573.                 <tr>
  574.                     <td colspan="3"><input name="wpu_roles_subscriber" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_roles_subscriber')); ?> />&nbsp; <?php _e("Subscribers" ); ?></td>
  575.                 </tr>
  576.                 <tr>
  577.                     <td>&nbsp;</td>
  578.                     <td>&nbsp;</td>
  579.                     <td></td>
  580.                 </tr>
  581.                 <tr>
  582.                     <td colspan="3"><h3>Profile Options</h3></td>
  583.                 </tr>
  584.                 <tr>
  585.                     <td colspan="3"><input name="wpu_image_list" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_image_list')); ?> />&nbsp; <?php _e("Display user images on directory page." ); ?></td>
  586.                 </tr>
  587.                 <tr>
  588.                     <td>&nbsp;</td>
  589.                     <td>&nbsp;</td>
  590.                     <td></td>
  591.                 </tr>
  592.                 <tr>
  593.                     <td colspan="3"><input name="wpu_description_list" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_description_list')); ?> />&nbsp; <?php _e("Display user descriptions on directory page." ); ?></td>
  594.                 </tr>
  595.                 <tr>
  596.                     <td>&nbsp;</td>
  597.                     <td>&nbsp;</td>
  598.                     <td></td>
  599.                 </tr>
  600.                 <tr>
  601.                     <td>&nbsp;</td>
  602.                     <td>&nbsp;</td>
  603.                     <td></td>
  604.                 </tr>
  605.                 <tr>
  606.                     <td colspan="3"><input name="wpu_image_profile" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_image_profile')); ?> />&nbsp; <?php _e("Display user images on profile page." ); ?></td>
  607.                 </tr>
  608.                 <tr>
  609.                     <td>&nbsp;</td>
  610.                     <td>&nbsp;</td>
  611.                     <td></td>
  612.                 </tr>
  613.                 <tr>
  614.                     <td colspan="3"><input name="wpu_description_profile" type="checkbox" value="yes" <?php checked('yes', get_option('wpu_description_profile')); ?> />&nbsp; <?php _e("Display user descriptions on profile page." ); ?></td>
  615.                 </tr>
  616.                 <tr>
  617.                     <td>&nbsp;</td>
  618.                     <td>&nbsp;</td>
  619.                     <td></td>
  620.                 </tr>
  621.                 <tr>
  622.                     <td>&nbsp;</td>
  623.                     <td>&nbsp;</td>
  624.                     <td></td>
  625.                 </tr>
  626.                 <tr>
  627.                     <td colspan="3"><input type="text" name="wpu_description_limit" value="<?php echo $desc_limit; ?>" size="3">&nbsp; <?php _e("Number of characters to display of user description on the directory page." ); ?></td>
  628.                 </tr>
  629.                 <tr>
  630.                     <td colspan="3">
  631.                         <p><small><strong>Note:</strong> If no limit is specified, entire user description will be displayed.</small></p>
  632.                     </td>
  633.                 </tr>
  634.                 <tr>
  635.                     <td>&nbsp;</td>
  636.                     <td>&nbsp;</td>
  637.                     <td></td>
  638.                 </tr>
  639.                 <tr>
  640.                     <td colspan="3"><h3>Avatar Options</h3></td>
  641.                 </tr>
  642.                 <tr>
  643.                     <td><?php _e("Avatar Type: " ); ?></td>
  644.                     <td colspan="2"><input id="wpu_avatars_gravatars" type="radio" name="wpu_avatars" value="gravatars" <?php checked('gravatars', get_option('wpu_avatars')); ?> /> Gravatars</td>
  645.                 </tr>
  646.                 <tr>
  647.                     <td></td>
  648.                     <td colspan="2"><input id="wpu_avatars_userphoto" type="radio" name="wpu_avatars" value="userphoto" <?php checked('userphoto', get_option('wpu_avatars')); ?> /> User Photo</td>
  649.                 </tr>
  650.                 <tr>
  651.                     <td>&nbsp;</td>
  652.                     <td>&nbsp;</td>
  653.                     <td></td>
  654.                 </tr>
  655.                 <tr>
  656.                     <td colspan="3"><strong>Gravatar Options:</strong></td>
  657.                 </tr>
  658.                 <tr>
  659.                     <td>&nbsp;</td>
  660.                     <td>&nbsp;</td>
  661.                     <td></td>
  662.                 </tr>
  663.                 <tr>
  664.                     <td><?php _e("Gravatar Type: " ); ?>&nbsp;</td>
  665.                     <td><input type="text" name="wpu_gravatar_type" value="<?php echo $gravatar_type; ?>" size="15">&nbsp; Gravatar type - ex. mystery, blank, gravatar_default, identicon, wavatar, monsterid</td>
  666.                 </tr>
  667.                 <tr>
  668.                     <td>&nbsp;</td>
  669.                     <td>&nbsp;</td>
  670.                     <td></td>
  671.                 </tr>
  672.                 <tr>
  673.                     <td><?php _e("Gravatar Size: " ); ?>&nbsp;</td>
  674.                     <td><input type="text" name="wpu_gravatar_size" value="<?php echo $gravatar_size; ?>" size="2"> px &nbsp; Size of gravatar in the user listings.</td>
  675.                 </tr>
  676.                 <tr>
  677.                     <td colspan="3"><p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options') ?>" /></p></td>
  678.                 </tr>
  679.             </table>
  680.         </form>
  681.     </div>
  682. <?php
  683. }
  684. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement