jfb_output_premium_panel_tease

This is an exact copy of jfb_output_premium_panel() from the premium addon; it of course just doesn't include implementation.

Description

jfb_output_premium_panel_tease(); 

..


Usage

  1. if ( !function_exists( 'jfb_output_premium_panel_tease' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-fb-autoconnect/AdminPage.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jfb_output_premium_panel_tease(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/AdminPage.php  
  1. function jfb_output_premium_panel_tease() 
  2. global $jfb_homepage; 
  3. global $opt_jfbp_notifyusers, $opt_jfbp_notifyusers_subject, $opt_jfbp_notifyusers_content, $opt_jfbp_commentfrmlogin, $opt_jfbp_wploginfrmlogin, $opt_jfbp_registrationfrmlogin, $opt_jfbp_bpregistrationfrmlogin, $opt_jfbp_cache_avatars, $opt_jfbp_cache_avatars_fullsize, $opt_jfbp_cache_avatar_dir, $opt_jfbp_cachedir_changetoblog; 
  4. global $opt_jfbp_buttonstyle, $opt_jfbp_buttonsize, $opt_jfbp_buttontext, $opt_jfbp_buttonimg, $opt_jfbp_requirerealmail; 
  5. global $opt_jfbp_redirect_new, $opt_jfbp_redirect_new_custom, $opt_jfbp_redirect_existing, $opt_jfbp_redirect_existing_custom, $opt_jfbp_redirect_logout, $opt_jfbp_redirect_logout_custom; 
  6. global $opt_jfbp_restrict_reg, $opt_jfbp_restrict_reg_url, $opt_jfbp_restrict_reg_uid, $opt_jfbp_restrict_reg_pid, $opt_jfbp_restrict_reg_gid; 
  7. global $opt_jfbp_show_spinner, $opt_jfbp_allow_link, $opt_jfbp_allow_disassociate, $opt_jfbp_autoregistered_role, $jfb_data_url; 
  8. global $opt_jfbp_wordbooker_integrate, $opt_jfbp_signupfrmlogin, $opt_jfbp_localize_facebook; 
  9. global $opt_jfbp_xprofile_map, $opt_jfbp_xprofile_mappings, $jfb_xprofile_field_prefix; 
  10. global $opt_jfbp_bpstream_login, $opt_jfbp_bpstream_logincontent, $opt_jfbp_bpstream_register, $opt_jfbp_bpstream_registercontent; 
  11. global $opt_jfbp_email_rejected_msg, $opt_jfbp_avatar_full_dimensions_w, $opt_jfbp_avatar_full_dimensions_h; 
  12. global $opt_jfbp_link_buttontext, $opt_jfbp_unlink_buttontext; 
  13. function disableatt() { echo (defined('JFB_PREMIUM')?"":"disabled='disabled'"); } 
  14. ?> 
  15. <!--Show the Premium version number along with a link to immediately check for updates--> 
  16. <form name="formPremUpdateCheck" method="post" action=""> 
  17. <h3><?php _e('Premium Options', 'wp-fb-autoconnect')?> <?php echo (defined('JFB_PREMIUM_VER')?"<span style='font-size:x-small;'>(<a href=\"javascript:document.formPremUpdateCheck.submit();\">".__('Check for Updates', 'wp-fb-autoconnect')."</a>)</span>":""); ?></h3> 
  18. <input type="hidden" name="VersionCheckNow" value="1" /> 
  19. </form> 
  20.  
  21. <?php  
  22. if( !defined('JFB_PREMIUM') ) 
  23. echo "<div class=\"jfb-admin_warning\"><i><b>".__("The following options are available to Premium users only.", "wp-fb-autoconnect")."</b><br />".__("For information about the WP-FB-AutoConnect Premium Add-On, including purchasing instructions, please visit the plugin homepage:", "wp-fb-autoconnect") . " <b><a target='preminfo' href=\"$jfb_homepage#premium\">here</a></b></i>.</div>"; 
  24. ?> 
  25.  
  26. <form name="formPremOptions" method="post" action=""> 
  27.  
  28. <b><?php _e('MultiSite Support', 'wp-fb-autoconnect')?>:</b><br/> 
  29. <input disabled='disabled' type="checkbox" name="musupport" value="1" <?php echo ((defined('JFB_PREMIUM')&&function_exists('is_multisite')&&is_multisite())?"checked='checked'":"")?> > 
  30. <?php _e('Automatically enabled when a MultiSite install is detected', 'wp-fb-autoconnect')?> 
  31. <?php jfb_output_simple_lightbox("", __("The free plugin is not aware of users registered on other sites in your WPMU installation, which can result in problems i.e. if someone tries to register on more than one site. The Premium version will actively detect and handle existing users across all your sites.", "wp-fb-autoconnect"))?><br /><br /> 
  32.  
  33. <b><?php _e('E-Mail Permissions', 'wp-fb-autoconnect')?>:</b><br /> 
  34. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_requirerealmail?>" value="1" <?php echo get_option($opt_jfbp_requirerealmail)?'checked="checked"':''?> /> <?php _e("Request and REQUIRE access to user's email address", 'wp-fb-autoconnect')?> 
  35. <?php jfb_output_simple_lightbox("", __("The basic option to request user email addresses will prompt your visitors, but they can still choose not to share it (in the Facebook login prompt). This option performs a secondary check to REQUIRE them to share; if they don't, the site won't log them in (until they click the button again, and agree to share their address).", 'wp-fb-autoconnect'))?><br /> 
  36. <?php add_option($opt_jfbp_email_rejected_msg, __("Sorry, this site requires an e-mail address to log you in.", 'wp-fb-autoconnect'));?> 
  37. <?php _e("Message to users who deny e-mail access:", 'wp-fb-autoconnect')?> <input <?php disableatt() ?> type="text" size="55" name="<?php echo $opt_jfbp_email_rejected_msg; ?>" value="<?php echo get_option($opt_jfbp_email_rejected_msg); ?>" /><br /><br/> 
  38.  
  39. <b><?php _e('Button Style', 'wp-fb-autoconnect')?>:</b><br /> 
  40. <?php add_option($opt_jfbp_buttontext, "Login with Facebook"); 
  41. add_option($opt_jfbp_buttonsize, "2"); 
  42. $btnDefault = $jfb_data_url . "/assets/btn01.png"; 
  43. add_option($opt_jfbp_buttonimg, $btnDefault); 
  44. $btnPreview = get_option($opt_jfbp_buttonimg); 
  45. if(!$btnPreview) $btnPreview = $btnDefault; 
  46. ?> 
  47.  
  48. <input <?php disableatt() ?> type="radio" style="float:left;" name="<?php echo $opt_jfbp_buttonstyle; ?>" value="0" <?php echo (get_option($opt_jfbp_buttonstyle)==0?"checked='checked'":"")?>> 
  49. <div class="jfb-greybox" style="float:left;"> 
  50. <b><?php _e('Original', 'wp-fb-autoconnect')?> (xfbml):</b><br/> 
  51. <?php _e('Text', 'wp-fb-autoconnect')?>: <input <?php disableatt() ?> type="text" size="30" name="<?php echo $opt_jfbp_buttontext; ?>" value="<?php echo get_option($opt_jfbp_buttontext); ?>" /><br /> 
  52. <?php _e('Style', 'wp-fb-autoconnect')?>:  
  53. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_buttonsize; ?>" value="2" <?php echo (get_option($opt_jfbp_buttonsize)==2?"checked='checked'":"")?>><?php _e('Small', 'wp-fb-autoconnect')?> 
  54. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_buttonsize; ?>" value="3" <?php echo (get_option($opt_jfbp_buttonsize)==3?"checked='checked'":"")?>><?php _e('Medium', 'wp-fb-autoconnect')?> 
  55. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_buttonsize; ?>" value="4" <?php echo (get_option($opt_jfbp_buttonsize)==4?"checked='checked'":"")?>><?php _e('Large', 'wp-fb-autoconnect')?> 
  56. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_buttonsize; ?>" value="5" <?php echo (get_option($opt_jfbp_buttonsize)==5?"checked='checked'":"")?>><?php _e('X-Large', 'wp-fb-autoconnect')?><br /> 
  57. </div><br clear="all"/> 
  58. <input <?php disableatt() ?> type="radio" style="float:left;" name="<?php echo $opt_jfbp_buttonstyle; ?>" value="1" <?php echo (get_option($opt_jfbp_buttonstyle)==1?"checked='checked'":"")?>> 
  59. <div class="jfb-greybox" style="float:left;"> 
  60. <b><?php _e('Image (styleable)', 'wp-fb-autoconnect')?>:</b><br/> 
  61. <?php _e('URL', 'wp-fb-autoconnect')?>: <input <?php disableatt() ?> type="text" size="80" name="<?php echo $opt_jfbp_buttonimg; ?>" value="<?php echo get_option($opt_jfbp_buttonimg); ?>" /><br/> 
  62. <?php _e('Preview', 'wp-fb-autoconnect')?>: <img style="vertical-align:middle;margin-top:5px;" src="<?php echo $btnPreview?>" alt="(Login Button)" /> 
  63. </div><br clear="all"/><br/> 
  64.  
  65. <b><?php _e('Additional Buttons', 'wp-fb-autoconnect')?>:</b><br /> 
  66. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_commentfrmlogin?>" value="1" <?php echo get_option($opt_jfbp_commentfrmlogin)?'checked="checked"':''?> /> <?php _e('Add a Facebook Login button below the comment form', 'wp-fb-autoconnect')?><br /> 
  67. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_wploginfrmlogin?>" value="1" <?php echo get_option($opt_jfbp_wploginfrmlogin)?'checked="checked"':''?> /> <?php _e('Add a Facebook Login button to the standard Login page', 'wp-fb-autoconnect')?> (wp-login.php)<br /> 
  68. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_registrationfrmlogin?>" value="1" <?php echo get_option($opt_jfbp_registrationfrmlogin)?'checked="checked"':''?> /> <?php _e('Add a Facebook Login button to the Registration page', 'wp-fb-autoconnect')?> (wp-login.php)<br /> 
  69. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_bpregistrationfrmlogin?>" value="1" <?php echo get_option($opt_jfbp_bpregistrationfrmlogin)?'checked="checked"':''?> /> <?php _e('Add a Facebook Login button to the BuddyPress Registration page', 'wp-fb-autoconnect')?> (/register)<br /> 
  70. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_signupfrmlogin?>" value="1" <?php echo get_option($opt_jfbp_signupfrmlogin)?'checked="checked"':''?> /> <?php _e('Add a Facebook Login button to the Signup page (WPMU Only)', 'wp-fb-autoconnect')?> (wp-signup.php)<br /><br /> 
  71.  
  72. <!-- Facebook's OAuth 2.0 migration BROKE my ability to localize the XFBML-generated dialog. I've reported a bug, and will do my best to fix it as soon as possible. 
  73. <b>Facebook Localization:</b><br /> 
  74. <?php add_option($opt_jfbp_localize_facebook, 1); ?> 
  75. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_localize_facebook?>" value="1" <?php echo get_option($opt_jfbp_localize_facebook)?"checked='checked'":""?> > 
  76. Translate Facebook prompts to the same locale as your Wordpress blog (Detected locale: <i><?php echo ( (defined('WPLANG')&&WPLANG!="") ? WPLANG : "en_US" ); ?></i>) 
  77. <dfn title="The Wordpress locale is specified in wp-config.php, where valid language codes are of the form 'en_US', 'ja_JP', 'es_LA', etc. Please see http://codex.wordpress.org/Installing_WordPress_in_Your_Language for more information on localizing Wordpress, and http://developers.facebook.com/docs/internationalization/ for a list of locales supported by Facebook.">(Mouseover for more info)</dfn><br /><br /> 
  78. --> 
  79.  
  80. <b><?php _e('Avatars', 'wp-fb-autoconnect')?>:</b><br /> 
  81. <script type="text/javascript">function isNumber(evt) {evt = (evt) ? evt : window.event;var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false;}return true;}</script>  
  82. <?php  
  83. add_option($opt_jfbp_cache_avatars_fullsize, get_option($opt_jfbp_cache_avatars));  
  84. add_option($opt_jfbp_avatar_full_dimensions_w, 200); 
  85. add_option($opt_jfbp_avatar_full_dimensions_h, 200);  
  86. ?>  
  87. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_cache_avatars?>" value="1" <?php echo get_option($opt_jfbp_cache_avatars)?'checked="checked"':''?> /> 
  88. <?php _e('Cache Facebook avatars locally', 'wp-fb-autoconnect')?> (<?php _e('thumbnail', 'wp-fb-autoconnect')?>) <?php jfb_output_simple_lightbox("", __("This will make a local copy of Facebook avatars, so they'll always load reliably, even if Facebook's servers go offline or if a user deletes their photo from Facebook. They will be fetched and updated whenever a user logs in.", "wp-fb-autoconnect"));?><br /> 
  89. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_cache_avatars_fullsize?>" value="1" <?php echo get_option($opt_jfbp_cache_avatars_fullsize)?'checked="checked"':''?> /> 
  90. <?php _e('Cache Facebook avatars locally', 'wp-fb-autoconnect')?> (<?php _e('large', 'wp-fb-autoconnect')?>): 
  91. <input <?php disableatt() ?> onkeypress="return isNumber(event)" type="text" size="4" name="<?php echo $opt_jfbp_avatar_full_dimensions_w; ?>" value="<?php echo get_option($opt_jfbp_avatar_full_dimensions_w) ?>" /> 
  92. <input <?php disableatt() ?> onkeypress="return isNumber(event)" type="text" size="4" name="<?php echo $opt_jfbp_avatar_full_dimensions_h; ?>" value="<?php echo get_option($opt_jfbp_avatar_full_dimensions_h) ?>" /> 
  93. <?php jfb_output_simple_lightbox("", __("The 'thumbnail' avatar is what will be shown when your themerequestsavatars sized 50x50 or less (Facebook's default thumbnail size). If your theme displays avatars larger than this, you'll want to cache larger avatars as well (but note that there's a small per-login performance cost to copying the files locally, so if you're not actually using large avatars, I recommend leaving this option disabled).", 'wp-fb-autoconnect') . "<br/><br/>" .  
  94. __("Please note that the dimensions you specify should be considered a MAXIMUM; Facebook will attempt to scale the avatar as close to your requested dimensions as possible, and then crop it down to fit. If you just want the largest possible image, you can enter very large numbers (i.e. 99999x99999). But since the final size is not precisely guaranteed, please consider using CSS to ensure the images mesh nicely with your theme.", 'wp-fb-autoconnect'))?><br/> 
  95.  
  96. <?php add_option($opt_jfbp_cache_avatar_dir, 'facebook-avatars'); ?> 
  97. <?php _e('Cache dir', 'wp-fb-autoconnect')?>: 
  98. <?php 
  99. //If this is multisite, we'll allow the use of the uploaddir of *any* blog in the network (not just the current one). 
  100. //This way, all the blogs can share the same avatar cache if desired. 
  101. if(function_exists('is_multisite') && is_multisite()) 
  102. global $wpdb; 
  103. $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered ASC", $wpdb->siteid), ARRAY_A ); 
  104. echo "<select name='".$opt_jfbp_cachedir_changetoblog."'>"; 
  105. foreach ($blogs AS $blog) 
  106. switch_to_blog($blog['blog_id']); 
  107. $path = wp_upload_dir(); 
  108. restore_current_blog(); 
  109. $selectedBlogID = get_option($opt_jfbp_cachedir_changetoblog); 
  110. if($selectedBlogID == 0) $selectedBlogID = get_current_blog_id(); 
  111. $selected = ($selectedBlogID == $blog['blog_id'])?" selected='true' ":''; 
  112. echo '<option '.$selected.' value="'.$blog['blog_id'].'">'.$path['basedir'].'</option>'; 
  113. echo "</select>\\"; 
  114. //If this is NOT multisite, we'll always use the current blog's upload_dir as the basedir for our avatar cache 
  115. else 
  116. $path = wp_upload_dir(); 
  117. update_option($opt_jfbp_cachedir_changetoblog, 0); 
  118. ?><span style="background-color:#FFFFFF; color:#aaaaaa; padding:2px 0;"><i><?php echo $path['basedir']; ?>/</i></span><?php 
  119. ?> 
  120. <input <?php disableatt() ?> type="text" size="15" name="<?php echo $opt_jfbp_cache_avatar_dir; ?>" value="<?php echo get_option($opt_jfbp_cache_avatar_dir); ?>" /> 
  121. <?php jfb_output_simple_lightbox("", __("Changing the cache directory will not move existing avatars or update existing users; it only applies to subsequent logins. It's therefore recommended that you choose a cache directory once, then leave it be.", 'wp-fb-autoconnect'))?><br /><br/> 
  122. <!--  
  123. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_wordbooker_integrate?>" value="1" <?php echo get_option($opt_jfbp_wordbooker_integrate)?'checked="checked"':''?> /> <?php _e('Use Facebook avatars for comments imported by the Wordbooker plugin', 'wp-fb-autoconnect')?> 
  124. <?php jfb_output_simple_lightbox("", __("The Wordbooker plugin allows you to push blog posts to your Facebook wall, and also to import comments on these posts back to your blog. This option will display real Facebook avatars for imported comments, provided the commentor logs into your site at least once.", 'wp-fb-autoconnect'))?><br /><br /> 
  125. --> 
  126.  
  127. <b><?php _e('Manual Linking & Unlinking', 'wp-fb-autoconnect')?>:</b><br /> 
  128. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_allow_link?>" value="1" <?php echo get_option($opt_jfbp_allow_link)?'checked="checked"':''?> /> <?php _e('Allow users to manually link their Wordpress/Buddypress accounts to Facebook', 'wp-fb-autoconnect')?> 
  129. <?php jfb_output_simple_lightbox("", __("This will add a button to each non-Facebook-connected user's Wordpress (and Buddypress) profile page, allowing them to manually link their blog account to their Facebook profile. Although this plugin does try to match connecting Facebook users to existing Wordpress accounts by e-mail, this option provides a way for users to explicitly identify their local blog account - even if their e-mails don't match.", 'wp-fb-autoconnect'))?><br /> 
  130. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_allow_disassociate?>" value="1" <?php echo get_option($opt_jfbp_allow_disassociate)?'checked="checked"':''?> /> <?php _e('Allow users to disassociate their Wordpress/Buddypress accounts from Facebook', 'wp-fb-autoconnect')?> 
  131. <?php jfb_output_simple_lightbox("", __("This will add a button to each connected user's Wordpress (and Buddypress) profile page, allowing them to disassociate their blog account from their Facebook profile. User accounts which are not connected to Facebook will display 'Not Connected' in place of a button.", 'wp-fb-autoconnect'))?><br /> 
  132. <input disabled='disabled' type="checkbox" name="admindisassociate" value="1" <?php echo (defined('JFB_PREMIUM')?"checked='checked'":"")?> /> <?php _e('Allow administrators to disassociate Wordpress/Buddypress user accounts from Facebook', 'wp-fb-autoconnect')?> 
  133. <?php jfb_output_simple_lightbox("", __("This option is always enabled for administrators.", 'wp-fb-autoconnect'))?><br /> 
  134.  
  135. <?php add_option($opt_jfbp_link_buttontext, __("Link with Facebook", 'wp-fb-autoconnect'));?> 
  136. <?php add_option($opt_jfbp_unlink_buttontext, __("Disassociate From Facebook", 'wp-fb-autoconnect'));?> 
  137. <?php _e('Link button text (shown on user profiles)', 'wp-fb-autoconnect')?>: <input <?php disableatt() ?> type="text" size="30" name="<?php echo $opt_jfbp_link_buttontext; ?>" value="<?php echo get_option($opt_jfbp_link_buttontext); ?>" /><br /> 
  138. <?php _e('Disassociate button text (shown on user profiles)', 'wp-fb-autoconnect')?>: <input <?php disableatt() ?> type="text" size="30" name="<?php echo $opt_jfbp_unlink_buttontext; ?>" value="<?php echo get_option($opt_jfbp_unlink_buttontext); ?>" /><br /><br/> 
  139.  
  140. <b><?php _e('Shortcode Support', 'wp-fb-autoconnect')?>:</b><br /> 
  141. <input disabled='disabled' type="checkbox" name="shortcodesupport" value="1" <?php echo (defined('JFB_PREMIUM')?"checked='checked'":"")?> /> 
  142. <?php _e('Enable shortcode for rendering Facebook buttons to your posts and pages', 'wp-fb-autoconnect')?> 
  143. <?php  
  144. $lbContent = sprintf(__("Shortcode support will allow you to manually place Facebook login buttons in your posts or pages, simply by inserting the tag %s in their content. The Facebook button will only be shown when nobody is logged into the site; otherwise, nothing is shown. If you'd like to specify something to output for logged-in users, you can use the %s parameter, like %s.", 'wp-fb-autoconnect'), "<b>[jfb_facebook_btn]</b>", "'loggedin'", "<b>[jfb_facebook_btn loggedin='Welcome!']</b>"); 
  145. $lbContent .= "<br/><br/>"; 
  146. $lbContent .= sprintf(__("With the Premium addon installed, shortcode support is always enabled. For general information on Wordpress shortcode, please see %s.", 'wp-fb-autoconnect'), "<a href='http://codex.wordpress.org/Shortcode' target='shortcode'>http://codex.wordpress.org/Shortcode</a>");  
  147. jfb_output_simple_lightbox("", $lbContent)?><br /><br /> 
  148.  
  149. <b><?php _e('Double Logins', 'wp-fb-autoconnect')?>:</b><br /> 
  150. <input disabled='disabled' type="checkbox" name="doublelogin" value="1" <?php echo (defined('JFB_PREMIUM')?"checked='checked'":"")?> /> 
  151. <?php _e('Automatically handle double logins', 'wp-fb-autoconnect')?>  
  152. <?php jfb_output_simple_lightbox("", sprintf(__("If a visitor opens two browser windows, logs into one, then logs into the other, the security nonce check will fail. This is because in the second window, the current user no longer matches the user for which the nonce was generated. The free version of the plugin reports this to the visitor, giving them a link to their desired redirect page. The premium version will transparently handle such double-logins: to visitors, it'll look like the page has just been refreshed and they're now logged in. For more information on nonces, please visit %s.", 'wp-fb-autoconnect'), "<a href='http://codex.wordpress.org/WordPress_Nonces' target='nonces'>http://codex.wordpress.org/WordPress_Nonces</a>"))?><br /><br /> 
  153.  
  154. <b><?php _e('Autoregistered User Role', 'wp-fb-autoconnect')?>:</b><br /> 
  155. <?php 
  156. add_option($opt_jfbp_autoregistered_role, get_option('default_role')); 
  157. $currSelection = get_option($opt_jfbp_autoregistered_role); 
  158. $editable_roles = get_editable_roles(); 
  159. if ( empty( $editable_roles[$currSelection] ) ) $currSelection = get_option('default_role'); 
  160. ?> 
  161. <?php _e('Users who are autoregistered with Facebook will be created with the role:', 'wp-fb-autoconnect')?>  
  162. <select <?php disableatt() ?> name="<?php echo $opt_jfbp_autoregistered_role?>" id="<?php echo $opt_jfbp_autoregistered_role?>"> 
  163. <?php wp_dropdown_roles( $currSelection ); ?> 
  164. </select><br /><br /> 
  165.  
  166. <b><?php _e('Widget Appearance', 'wp-fb-autoconnect')?>:</b><br /> 
  167. <?php echo sprintf(__("Please use the %s if you'd like to:", 'wp-fb-autoconnect'), "<a href='".admin_url('widgets.php')."' target='widgets'>WP-FB AutoConnect <b><i>Premium</i></b> Widget</a>"); ?><br /> 
  168. • <?php _e("Customize the Widget's text", 'wp-fb-autoconnect')?> <?php jfb_output_simple_lightbox("", __("You can customize the text of: User, Pass, Login, Remember, Forgot, Logout, Edit Profile, Welcome.", 'wp-fb-autoconnect'))?><br /> 
  169. • <?php _e("Show/Hide any of the Widget's links, checkboxes, or textfields", 'wp-fb-autoconnect')?> <?php jfb_output_simple_lightbox("", __("You can show or hide:", 'wp-fb-autoconnect') . "<ul style='list-style-type:disc;list-style-position:inside;'><li>".__('The User/Pass fields (leaving Facebook as the only way to login)', 'wp-fb-autoconnect')."</li><li>".__("The 'Register' link (only applicable if registration is enabled on the site/network)", 'wp-fb-autoconnect')."</li><li>".__("The 'Remember' tickbox", 'wp-fb-autoconnect')."</li><li>".__("The 'Edit Profile' link", 'wp-fb-autoconnect')."</li><li>".__("The 'Forgot Password' link", 'wp-fb-autoconnect')."</li></ul>")?><br />  
  170. • <?php _e("Show the user's avatar next to their username (when logged in)", 'wp-fb-autoconnect')?><br /> 
  171. • <?php _e("Point the 'Edit Profile' link to the BP profile, rather than WP", 'wp-fb-autoconnect')?><br/> 
  172. • <?php _e("Point the 'Forgot Password' link to a custom URL of your choosing", 'wp-fb-autoconnect')?><br /> 
  173. • <?php _e("Allow the user to simultaneously logout of your site *and* Facebook", 'wp-fb-autoconnect')?><br /><br /> 
  174.  
  175. <b><?php _e('AJAX Spinner', 'wp-fb-autoconnect')?>:</b><br /> 
  176. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_show_spinner; ?>" value="0" <?php echo (get_option($opt_jfbp_show_spinner)==0?"checked='checked'":"")?> ><?php _e("Don't show an AJAX spinner", 'wp-fb-autoconnect')?><br /> 
  177. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_show_spinner; ?>" value="1" <?php echo (get_option($opt_jfbp_show_spinner)==1?"checked='checked'":"")?> ><?php _e('Show a white AJAX spinner to indicate the login process has started', 'wp-fb-autoconnect')?> (<img src=" <?php echo $jfb_data_url ?>/assets/spinner_white.gif" alt="spinner" />)<br /> 
  178. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_show_spinner; ?>" value="2" <?php echo (get_option($opt_jfbp_show_spinner)==2?"checked='checked'":"")?> ><?php _e('Show a black AJAX spinner to indicate the login process has started', 'wp-fb-autoconnect')?> (<img src=" <?php echo $jfb_data_url ?>/assets/spinner_black.gif" alt="spinner" />)<br /><br /> 
  179.  
  180. <b><?php _e('AutoRegistration Restrictions', 'wp-fb-autoconnect')?>:</b><br /> 
  181. <?php add_option($opt_jfbp_restrict_reg_url, '/') ?> 
  182. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="0" <?php echo (get_option($opt_jfbp_restrict_reg)==0?"checked='checked'":"")?>><?php _e('Open - Anyone can login (Default)', 'wp-fb-autoconnect')?><br /> 
  183. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="1" <?php echo (get_option($opt_jfbp_restrict_reg)==1?"checked='checked'":"")?>><?php _e('Closed - Only login existing blog users', 'wp-fb-autoconnect')?><br /> 
  184. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="2" <?php echo (get_option($opt_jfbp_restrict_reg)==2?"checked='checked'":"")?>><?php echo sprintf(__("Invitational - Only autoregister users who've been invited via the %s plugin", 'wp-fb-autoconnect'), '<a target="secureinvites" href="http://wordpress.org/extend/plugins/wordpress-mu-secure-invites/">Secure Invites</a>')?> <?php jfb_output_simple_lightbox("", __("For invites to work, the connecting user's Facebook email must be accessible, and it must match the email to which the invitation was sent.", 'wp-fb-autoconnect'))?><br /> 
  185. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="3" <?php echo (get_option($opt_jfbp_restrict_reg)==3?"checked='checked'":"")?>><?php _e('Friendship - Only autoregister friends of Facebook user id:', 'wp-fb-autoconnect')?> <input <?php disableatt() ?> type="text" size="15" name="<?php echo $opt_jfbp_restrict_reg_uid?>" value="<?php echo get_option($opt_jfbp_restrict_reg_uid) ?>" /> <?php jfb_output_simple_lightbox("", sprintf(__("To find your Facebook uid, login and view your Profile Pictures album. The URL will be something like '%s'. In this example, your uid would be 789 (the numbers after the last decimal point).<br/><br/>Note: For this feature to work, the user you enter here must login via this Facebook app at least once.", 'wp-fb-autoconnect'), "http://www.facebook.com/media/set/?set=a.123.456.789"))?><br /> 
  186. <!--<input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="4" <?php echo (get_option($opt_jfbp_restrict_reg)==4?"checked='checked'":"")?>><?php _e('Membership - Only autoregister members of Facebook group id:', 'wp-fb-autoconnect')?> <input <?php disableatt() ?> type="text" size="15" name="<?php echo $opt_jfbp_restrict_reg_gid?>" value="<?php echo get_option($opt_jfbp_restrict_reg_gid); ?>" /> <?php jfb_output_simple_lightbox("", sprintf(__("To find a group's id, view its URL. If it's something like '%s', the id would be 12345678. If it uses a vanity URL (like %s) and is public, you can use %s to find its id. If the group is both private/secret AND it uses a vanity URL, you'll have to use Facebook's Graph Explorer tool to lookup the id. Visit %s, then click 'Submit.' Assuming you're a member of the group, you should see it listed in the result, along with its id.", 'wp-fb-autoconnect'), "www.facebook.com/groups/12345678/", "www.facebook.com/groups/MyGroupName/", "<a href='http://lookup-id.com' target='vanity'>lookup-id.com</a>", "<a href='https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dgroups' target='explorer'>here</a>") . "<br/><br/>" . __("In order to use this option, you'll need to submit your app for review by Facebook. Please see FAQ#56 for more info:", 'wp-fb-autoconnect') . " <a href='$jfb_homepage#faq56' target='extendedfaq'>here</a>")?><br />--> 
  187. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_restrict_reg; ?>" value="5" <?php echo (get_option($opt_jfbp_restrict_reg)==5?"checked='checked'":"")?>><?php _e('Fanpage - Only autoregister fans of Facebook page id:', 'wp-fb-autoconnect')?> <input <?php disableatt() ?> type="text" size="15" name="<?php echo $opt_jfbp_restrict_reg_pid?>" value="<?php echo get_option($opt_jfbp_restrict_reg_pid); ?>" /> <?php jfb_output_simple_lightbox("", sprintf(__("To find a page's id, view one of its photo albums. The URL will be something like '%s'. In this example, the id would be 789 (the numbers after the last decimal point).", 'wp-fb-autoconnect'), "http://www.facebook.com/media/set/?set=a.123.456.789") . "<br/><br/>" . __("In order to use this option, you'll need to submit your app for review by Facebook. Please see FAQ#56 for more info:", 'wp-fb-autoconnect') . " <a href='$jfb_homepage#faq56' target='extendedfaq'>here</a>")?><br /> 
  188. <?php _e('Redirect URL for denied logins:', 'wp-fb-autoconnect')?> <input <?php disableatt() ?> type="text" size="30" name="<?php echo $opt_jfbp_restrict_reg_url?>" value="<?php echo get_option($opt_jfbp_restrict_reg_url) ?>" /><br /><br /> 
  189.  
  190. <b><?php _e('Custom Redirects', 'wp-fb-autoconnect')?>:</b><br /> 
  191. <?php add_option($opt_jfbp_redirect_new, "1"); ?> 
  192. <?php add_option($opt_jfbp_redirect_existing, "1"); ?> 
  193. <?php add_option($opt_jfbp_redirect_logout, "1"); ?> 
  194. <?php _e('When a new user is autoregistered on your site, redirect them to:', 'wp-fb-autoconnect')?><br /> 
  195. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_new; ?>" value="1" <?php echo (get_option($opt_jfbp_redirect_new)==1?"checked='checked'":"")?> ><?php _e('Default (refresh current page)', 'wp-fb-autoconnect')?><br /> 
  196. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_new; ?>" value="2" <?php echo (get_option($opt_jfbp_redirect_new)==2?"checked='checked'":"")?> ><?php _e('Custom URL', 'wp-fb-autoconnect')?>: 
  197. <input <?php disableatt() ?> type="text" size="47" name="<?php echo $opt_jfbp_redirect_new_custom?>" value="<?php echo get_option($opt_jfbp_redirect_new_custom) ?>" /> <small>(<?php echo sprintf(__('Supports %s variables', 'wp-fb-autoconnect'), "%username%")?>)</small><br /><br /> 
  198. <?php _e('When an existing user returns to your site, redirect them to:', 'wp-fb-autoconnect')?><br /> 
  199. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_existing; ?>" value="1" <?php echo (get_option($opt_jfbp_redirect_existing)==1?"checked='checked'":"")?> ><?php _e('Default (refresh current page)', 'wp-fb-autoconnect')?><br /> 
  200. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_existing; ?>" value="2" <?php echo (get_option($opt_jfbp_redirect_existing)==2?"checked='checked'":"")?> ><?php _e('Custom URL', 'wp-fb-autoconnect')?>: 
  201. <input <?php disableatt() ?> type="text" size="47" name="<?php echo $opt_jfbp_redirect_existing_custom?>" value="<?php echo get_option($opt_jfbp_redirect_existing_custom) ?>" /> <small>(<?php echo sprintf(__('Supports %s variables', 'wp-fb-autoconnect'), "%username%") ?>)</small><br /><br /> 
  202. <?php _e('When a user logs out of your site, redirect them to:', 'wp-fb-autoconnect')?><br /> 
  203. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_logout; ?>" value="1" <?php echo (get_option($opt_jfbp_redirect_logout)==1?"checked='checked'":"")?> ><?php _e('Default (refresh current page)', 'wp-fb-autoconnect')?><br /> 
  204. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_redirect_logout; ?>" value="2" <?php echo (get_option($opt_jfbp_redirect_logout)==2?"checked='checked'":"")?> ><?php _e('Custom URL', 'wp-fb-autoconnect')?>: 
  205. <input <?php disableatt() ?> type="text" size="47" name="<?php echo $opt_jfbp_redirect_logout_custom?>" value="<?php echo get_option($opt_jfbp_redirect_logout_custom) ?>" /><br /><br /> 
  206.  
  207. <b><?php _e('Welcome Message', 'wp-fb-autoconnect')?>:</b><br /> 
  208. <?php add_option($opt_jfbp_notifyusers_content, "Thank you for logging into " . get_option('blogname') . " with Facebook.\nIf you would like to login manually, you may do so with the following credentials.\n\nUsername: %username%\nPassword: %password%"); ?> 
  209. <?php add_option($opt_jfbp_notifyusers_subject, "Welcome to " . get_option('blogname')); ?> 
  210. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_notifyusers?>" value="1" <?php echo get_option($opt_jfbp_notifyusers)?'checked="checked"':''?> /> <?php _e('Send a custom welcome e-mail to users who register via Facebook', 'wp-fb-autoconnect')?> <small>(*<?php _e('If we know their address', 'wp-fb-autoconnect')?>)</small><br /> 
  211. <input <?php disableatt() ?> type="text" size="102" name="<?php echo $opt_jfbp_notifyusers_subject?>" value="<?php echo get_option($opt_jfbp_notifyusers_subject) ?>" /><br /> 
  212. <textarea <?php disableatt() ?> cols="85" rows="5" name="<?php echo $opt_jfbp_notifyusers_content?>"><?php echo get_option($opt_jfbp_notifyusers_content) ?></textarea><br /><br /> 
  213.  
  214. <b><?php _e('BuddyPress Activity Stream', 'wp-fb-autoconnect')?>:</b><br /> 
  215. <?php add_option($opt_jfbp_bpstream_logincontent, sprintf(__("%s logged in with Facebook", 'wp-fb-autoconnect'), "%user%")); ?> 
  216. <?php add_option($opt_jfbp_bpstream_registercontent, sprintf(__("%s registered with Facebook", 'wp-fb-autoconnect'), "%user%")); ?> 
  217. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_bpstream_register?>" value="1" <?php echo get_option($opt_jfbp_bpstream_register)?'checked="checked"':''?> /> <?php _e('When a new user autoconnects to your site, post to the BP Activity Stream:', 'wp-fb-autoconnect')?> 
  218. <input <?php disableatt() ?> type="text" size="50" name="<?php echo $opt_jfbp_bpstream_registercontent?>" value="<?php echo get_option($opt_jfbp_bpstream_registercontent) ?>" /><br /> 
  219. <input <?php disableatt() ?> type="checkbox" name="<?php echo $opt_jfbp_bpstream_login?>" value="1" <?php echo get_option($opt_jfbp_bpstream_login)?'checked="checked"':''?> /> <?php _e('When an existing user returns to your site, post to the BP Activity Stream:', 'wp-fb-autoconnect')?> 
  220. <input <?php disableatt() ?> type="text" size="50" name="<?php echo $opt_jfbp_bpstream_logincontent?>" value="<?php echo get_option($opt_jfbp_bpstream_logincontent) ?>" /><br /><br /> 
  221.  
  222. <b><?php _e('BuddyPress X-Profile Mappings', 'wp-fb-autoconnect')?>:</b><br /> 
  223. <?php _e("This section will let you automatically fill in your Buddypress users' X-Profile data from their Facebook profiles.", 'wp-fb-autoconnect')?><br /> 
  224. <small>• <?php _e('Some limitations exist regarding which X-Profile fields can be populated', 'wp-fb-autoconnect')?></small> <?php jfb_output_simple_lightbox("", __("Only 'Text Box, ' 'Multi-Line Text Box, ' and 'Date Selector'-type profile fields can be mapped at this time. Due to unpredictability in matching freeform values from Facebook to pre-defined values on BuddyPress, support for dropdowns, radiobuttons, and checkboxes MAY be added in the future.", 'wp-fb-autoconnect'))?><br /> 
  225. <small>• <?php _e('Some limitations exist regarding which Facebook fields can be imported', 'wp-fb-autoconnect')?></small> <?php jfb_output_simple_lightbox("", __("Because some Facebook fields are formatted differently, each one needs to be explicitly implemented. I've included an initial selection of fields (i.e. Name, Gender, Birthday, Bio, etc), but if you need another field to be available, please request it on the support page and I'll do my best to add it to the next update.", 'wp-fb-autoconnect'))?><br /> 
  226. <small>• <?php _e("In order to import fields marked with an asterisk (i.e. Birthday*), you'll need to submit your app for review by Facebook. Please see FAQ#56 for more info:", 'wp-fb-autoconnect'); echo " <a href='$jfb_homepage#faq56' target='extendedfaq'>here</a>"; ?></small><br/><br/> 
  227.  
  228. <?php 
  229. //If people report problems with Buddypress detection, use this more robust method: http://codex.buddypress.org/plugin-development/checking-buddypress-is-active/ 
  230. if( !function_exists('bp_has_profile') ) echo "<i>".__("BuddyPress Not Found. This section is only available on BuddyPress-enabled sites.", 'wp-fb-autoconnect')."</i>"; 
  231. else if ( !bp_has_profile() ) echo __("Error: BuddyPress Profile Not Found. This should never happen - if you see this message, please report it on the plugin support page.", 'wp-fb-autoconnect'); 
  232. else 
  233. //Present the 3 mapping options: disable mapping, map new users, or map new and returning users ?>  
  234. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_xprofile_map; ?>" value="0" <?php echo (get_option($opt_jfbp_xprofile_map)==0?"checked='checked'":"")?> ><?php _e('Disable Mapping', 'wp-fb-autoconnect')?> 
  235. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_xprofile_map; ?>" value="1" <?php echo (get_option($opt_jfbp_xprofile_map)==1?"checked='checked'":"")?> ><?php _e('Map New Users Only', 'wp-fb-autoconnect')?> 
  236. <input <?php disableatt() ?> type="radio" name="<?php echo $opt_jfbp_xprofile_map; ?>" value="2" <?php echo (get_option($opt_jfbp_xprofile_map)==2?"checked='checked'":"")?> ><?php _e('Map New And Returning Users', 'wp-fb-autoconnect')?><br /><?php 
  237.  
  238. //Make a list of which Facebook fields may be mapped to each type of xProfile field. Omitted types (i.e. checkbox) are treated as "unmappable." 
  239. //The format is "xprofile_field_type"->"(fbfieldname1, fbfieldDisplayname1), (fbfieldname2, fbfieldDisplayname2), ..." 
  240. //(Available FB fields are documented at: https://developers.facebook.com/docs/reference/api/user/) 
  241. $allowed_mappings = array( 
  242. 'textbox' =>array('id'=>"ID", 'name'=>"Name", 'first_name'=>"First Name", 'middle_name'=>"Middle Name", 'last_name'=>"Last Name",  
  243. 'gender'=>"Gender", 'link'=>"Profile URL", "website"=>"Website*", 'bio'=>"Bio*",  
  244. 'political'=>"Political*", "religion"=>"Religion*", 'relationship_status'=>"Relationship*", "location"=>"City*",  
  245. 'hometown'=>"Hometown*", 'languages'=>"Languages*", 'music'=>'Music*'),  
  246. 'textarea'=>array('id'=>"ID", 'name'=>"Name", 'first_name'=>"First Name", 'middle_name'=>"Middle Name", 'last_name'=>"Last Name",  
  247. 'gender'=>"Gender", 'link'=>"Profile URL", "website"=>"Website*", 'bio'=>"Bio*",  
  248. 'political'=>"Political*", "religion"=>"Religion*", 'relationship_status'=>"Relationship*", "location"=>"City*",  
  249. 'hometown'=>"Hometown*", 'languages'=>"Languages*", 'music'=>'Music*'),  
  250. 'datebox' =>array('birthday'=>'Birthday*')); 
  251. $allowed_mappings = apply_filters('wpfb_xprofile_allowed_mappings', $allowed_mappings); 
  252.  
  253. //Go through all of the XProfile fields and offer possible Facebook mappings for each (in a dropdown). 
  254. //(current_mappings is used to set the initial state of the panel, i.e. based on what mappings are already in the db) 
  255. $current_mappings = get_option($opt_jfbp_xprofile_mappings); 
  256. while ( bp_profile_groups() ) 
  257. //Create a "box" for each XProfile Group 
  258. global $group; 
  259. bp_the_profile_group(); 
  260. ?><div style="width:520px; padding:5px; margin:2px 0; background-color:#EEEDDA; border:1px solid #CCC;"><?php 
  261. echo "Group \"$group->name\":<br />"; 
  262.  
  263. //And populate the group box with Textarea(xprofile field)->Dropdown(possible facebook mappings) 
  264. while ( bp_profile_fields() ) 
  265. //Output the X-Profile field textarea 
  266. global $field; 
  267. bp_the_profile_field(); 
  268. ?><input disabled='disabled' type="text" size="20" name="<?php echo $field->name ?>" value="<?php echo $field->name; ?>" /> -> 
  269.  
  270. <?php  
  271. //If there aren't any available Facebook mappings, just put a disabled textbox and "hidden" field that sets this option as '0'  
  272. if( !isset($allowed_mappings[$field->type]) || !$allowed_mappings[$field->type] ) 
  273. echo "<input disabled='disabled' type='text' size='30' name='$field->name"."_unavail"."' value='(".__("No Mappings Available", 'wp-fb-autoconnect').")' />"; 
  274. echo "<input type='hidden' name='$field->id' value='0' />"; 
  275. continue; 
  276.  
  277. //Otherwise, list all of the available mappings in a dropdown. 
  278. ?><select name="<?php echo $jfb_xprofile_field_prefix . $field->id?>"> 
  279. <option value="0">(<?php _e('No Mapping', 'wp-fb-autoconnect')?>)</option><?php 
  280. foreach($allowed_mappings[$field->type] as $fbname => $userfriendlyname) 
  281. echo "<option " . ($current_mappings[$field->id]==$fbname?"selected":"") . " value=\"$fbname\">$userfriendlyname</option>"; 
  282. ?></select><br /><?php 
  283. ?></div><?php 
  284. }?> 
  285.  
  286. <input type="hidden" name="prem_opts_updated" value="1" /> 
  287. <div class="submit"><input <?php disableatt() ?> type="submit" name="Submit" value="<?php _e('Save Premium', 'wp-fb-autoconnect')?>" /></div> 
  288. </form> 
  289. <?php