Search Results for 'code'
-
AuthorSearch Results
-
December 11, 2013 at 2:27 am #140138
In reply to: Website input default value is "Array"
Stephen Edgar
KeymasterIt was late last night and maybe I was seeing things, I have just tried to reproduce the issue and cannot.
The fix for this was Trac Ticket #2476 and in changeset r5187.
Can you check the contents of this file on your server please, it should match this file at Line #92
/includes/users/functions.php#L92'url' => 'comment_author_url'December 11, 2013 at 12:52 am #140136In reply to: Edit time allowed issue, BUG
ronthai
ParticipantNevermind, I found the problem. I remembered I did this before:
I have a statistics plugin that uses the server time instead of the WP timezone settings.
Therefore I added
<?php date_default_timezone_set('Asia/Bangkok'); ?>to the plugins php and that was in the sidebar always present.Now I removed it the Edit Allowed Time works correct.
December 10, 2013 at 8:56 pm #140121In reply to: Hide Sidebar
pmuktan
ParticipantI pasted this code under main wp-config.php and side is gone.
function disable_all_widgets( $sidebars_widgets ) {
if ( function_exists(‘is_bbpress’) ) {
if (is_bbpress()) {
$sidebars_widgets = array(false);
remove_all_actions(‘bp_register_widgets’);
unregister_sidebar( ‘bp_core_widgets’ );
}
}
return $sidebars_widgets;
}add_filter(‘sidebars_widgets’, ‘disable_all_widgets’, 1, 1);
My question is how do we remo Options like Topic Type and Topic Status ???
Thank you.
December 10, 2013 at 5:04 pm #140117Topic: Request: Backticks optional?
in forum Requests & FeedbackHansaplastique
ParticipantI really love bbPress and have been gratefully using it on my website.
No disrespect intended, and just a friendly request for consideration,…
Would it be possible to make the backtick functionality for posting optional?
Ie. a setting in the config page saying something like “Use backticks for code posting”?I’m running into situations where the actual content a user wants post should have backticks in it, without the filtering modifying it (for example shell related code examples).
Modifying the core files of bbPress is of course not a real option, just a temporary bandaid at best, and I know others have been looking into the backtick debacle as well (for example GhettoBSD).
December 10, 2013 at 2:44 pm #140116In reply to: Hide Sidebar
Robin W
Moderatoryou can use ‘widget logic’ plugin to control what is shown in sidebars. for bbpress the logic is
is_bbpress()to display and
!is_bbpress()to hideor if you want a forum specific sidebar use ‘bbpress WP’ tweaks plugin.
Profile images use the gravatar image see http://en.gravatar.com/ for details
December 10, 2013 at 8:42 am #140103In reply to: Exclude WP plugin (page navi)
ronthai
ParticipantDarn, 10 minutes just past, could not edit anymore.
Why are we doing so difficult?
Simple css did the job as always:.bbpress .wpns_wrapper { display:none ! important;}December 10, 2013 at 8:29 am #140102In reply to: Exclude WP plugin (page navi)
ronthai
ParticipantNothing seems to work, either gone WP side also or no changes.
Maybe it could be done inside the php?
Only if it is easy, the page number under the forums page is not the end of the world./* Plugin Name: Page navi slider Plugin URI: Description: An advanced, fully customizable and actually responsive navigation plugin using jQuery slider Version: 1.2.2 Author: Iznogood1 Author URI: denisns1@free.fr */ //Installation / Uninstallation require_once(dirname( __FILE__ ) . '/inc/install.php'); //Administration require_once(dirname( __FILE__ ) . '/inc/settings.php'); //Display the plugin require_once(dirname( __FILE__ ) . '/inc/frontend.php'); //Version function wpns_version(){ $v=get_plugin_data(__File__); return $v['Version']; } //Load style and JS function wpns_style_and_scripts() { wp_register_style('page_navi_slider_style', plugins_url('style/page-navi-slider.css', __FILE__) ); wp_enqueue_style('page_navi_slider_style' ); wp_enqueue_script('page-navi-slider-script', plugins_url('/js/page-navi-slider.min.js', __FILE__), array( 'jquery', 'jquery-ui-slider' ), true); wp_enqueue_script('jQueryUiTouch', plugins_url('/js/jquery.ui.touch-punch.min.js', __FILE__), array( 'jquery' ), true); if(ereg('MSIE 7',$_SERVER['HTTP_USER_AGENT'])){ wp_register_style('page_navi_slider_styleIE', plugins_url('style/page-navi-slider.ie.css', __FILE__) ); wp_enqueue_style('page_navi_slider_styleIE' ); } } //Localization load_plugin_textdomain( 'page-navi-slider', '', dirname( plugin_basename( __FILE__ ) ) . '/lang' ); //Actions and filtes add_action( 'wp_enqueue_scripts', 'wpns_style_and_scripts' ); register_activation_hook(__FILE__, 'wpns_install' ); register_deactivation_hook(__FILE__, 'wpns_remove_auto_display' ); register_uninstall_hook(__FILE__, 'wpns_uninstall'); wpns_auto_display(); //Main function function page_navi_slider(){ //Prepare pagination global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $pagination = array( 'base' => @add_query_arg('page','%#%'), 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => all, 'type' => 'array', prev_next => false, ); if( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ); if( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => str_replace( ' ' , '+', get_query_var( 's' ) ) ); //Display the plugin $page_links=paginate_links( $pagination ); wpns_frontend($current,$wp_query->max_num_pages,$page_links,get_option('wpns_settings')); }December 10, 2013 at 8:13 am #140099In reply to: Exclude WP plugin (page navi)
Stephen Edgar
KeymasterPushing my knowledge in this are so a quick stab before I go for the night (11pm here)
Rather than
is_singlehave a look atis_archiveDecember 10, 2013 at 7:56 am #140091In reply to: Exclude WP plugin (page navi)
Stephen Edgar
KeymasterThe main bbPress conditional tag is
is_bbpressTry
<?php if ( !is_bbpress ) : ?>December 10, 2013 at 6:39 am #140080In reply to: Theming the Recent Replies Widget
Stephen Edgar
KeymasterIf you are going to make changes use a custom
bbpress.cssfile in your theme so updates don’t override your changes 🙂
https://codex.bbpress.org/theme-compatibility/December 10, 2013 at 6:34 am #140079In reply to: Trouble Creating Topics
Stephen Edgar
KeymasterTry running the ‘Remap existing users to default forum roles’ repair tool.
https://codex.bbpress.org/repair-forums/
It also looks like you are using another plugin to control access to bbPress forums.
What is this plugin and does it work with bbPress’ roles?
December 10, 2013 at 6:27 am #140078In reply to: Missing strings
Stephen Edgar
KeymasterThat said one of the strings ‘You must be logged in to create new topics’ IS translated here so it might be the case of updating your translations.
Details to update your translations are here https://codex.bbpress.org/bbpress-in-your-language/
I would also look at the 115 of 1034 strings yet to be translated looking at the details here and get those translated and then contact your local Hebrew translation team via https://he.wordpress.org/contact/ to get the strings approved.
December 10, 2013 at 2:06 am #140073In reply to: changing forum role output
Stephen Edgar
KeymasterFollow the steps to copy the template files that you need to customize as per this:
https://codex.bbpress.org/theme-compatibility/
Primarily it will be
loop-single-reply.phpbut you will need to look at a few of the other templates also.Before Line #45:
<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>
After Line #45:
<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false ) ); ?>Around that same area in that file you will want call whatever WooCommerce function you need to display the users group.
eg.
<div><?php woo_user_group( userid() ); ?></div>
(I have no idea what functions WooCommerce use)December 9, 2013 at 9:06 pm #140066In reply to: Theming the Recent Replies Widget
ronthai
ParticipantTo style the widget use this, I did it to mine and now is just a background with text and lines.
Title stripped, border stripped, ect.
Adjust it as needed.#bbp_replies_widget-2 {width: 400px ! important; height: 500px ! important; float:right;} #bbp_replies_widget-2 .widget-title { display:none ! important } #bbp_replies_widget-2 { border: none ! important; box-shadow: none ! important; background-color: #DDE8F4 ! important; }It could be that yours has a different number #bbp_replies_widget-2, so maybe 1 or 3 or 4
You can find it in the Page Source of your forum or use Firebug
I use the ID instead of the class, incase of using the widget more then once. Then you can style them separate.December 9, 2013 at 5:22 pm #140061In reply to: Moving from Xenforo
Stephen Edgar
KeymasterWhat version of Xenforo are you importing from?
Do you see anything like ‘Starting Conversion’, ‘Converting Forums’, ‘Converting Topics’ etc?
If you don’t see the above confirm your Xenforo database configs to use with bbPress importer via your Xenforo
config.phpfile./public_html/xenforo/library/config.phpDecember 9, 2013 at 2:21 pm #140052In reply to: User profile link, only show username.
Robin W
Moderatorok, I’ve cut justsayno1’s code into a plugin, which you can download from here
This will then override any user choice, and enforce only username as the display
Download this to your PC, and then using dashboard>plugins>add new and select upload files and upload the zipped file to your site
Let me know what works and doesn’t
Three things :
1. As justsayno1 says – the avatar will display the “display name” as the “alt” choice.
2. The profile page still appears to have the “display name”
3. I haven’t yet worked out how to take out the user choice to edit what is displayed, even though of course that is now redundant ie doesn’t work
@Mr-B – give it a go and let me know what works and what doesn’t – I basically just nicked Justsayno’s code.
@Justsayno1 on No. 1 above, can you point me to where the get-avatar function is in main wordpress (the file name would be great) and I’ll amend and cut that code into the plugin as well
@Justsayno1 on No.s 2 & 3 – have you fixed these, and if so can you point me to the solutions, and again I’ll add then to the plugin.December 9, 2013 at 6:16 am #140033Topic: Exclude WP plugin (page navi)
in forum Pluginsronthai
ParticipantHi, I have page navi installed on the WP side in the footer, just gives page numbers 1, 2, 3, …
Problem is it also shows on the forum index (forums list page) as just 1 page.
I tried the<?php if ( !is_singular('bbpress') ) : ?>, but that does not work, with or without the ‘bbpress’Any idea’s on how to exclude the php from on the forum/bbpress side?
December 8, 2013 at 7:01 pm #140027In reply to: changing forum role output
Stephen Edgar
KeymasterYou could use this plugin https://wordpress.org/plugins/bbpress-string-swap/
Or you can use this plugin https://gist.github.com/ntwb/7864894
Or just add the code from the plugin to your themes
functions.phporbbpress-functions.phpfile.add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' ); function ntwb_bbpress_custom_role_names() { return array( // Keymaster bbp_get_keymaster_role() => array( 'name' => 'My Custom Keymaster Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) ), // Moderator bbp_get_moderator_role() => array( 'name' => 'My Custom Moderator Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) ), // Participant bbp_get_participant_role() => array( 'name' => 'My Custom Participant Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) ), // Spectator bbp_get_spectator_role() => array( 'name' => 'My Custom Spectator Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() ) ), // Blocked bbp_get_blocked_role() => array( 'name' => 'My Custom Blocked Role Name', 'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() ) ) ); }December 8, 2013 at 5:05 pm #140020In reply to: Bulgarian translation
Stephen Edgar
KeymasterDecember 8, 2013 at 4:54 pm #140018In reply to: How to Add Static Topics?
Stephen Edgar
KeymasterYou could create a new role for your users based on the participant role without the
publish_topicsrole.https://codex.bbpress.org/bbpress-user-roles-and-capabilities/#participant
December 8, 2013 at 3:07 pm #140004Topic: Custom profile fileds
in forum Requests & Feedbackmartin
ParticipantIs there a way to add cutoms fileds to the profile in an other way than changing the code? Because after an update those changes I will make will be deleted anyway. Maybe someone knows a plugin, or maybe this should be a feature for bbpress?
December 8, 2013 at 12:28 pm #140001In reply to: Adding a Rank Image below users avatar
Lynq
ParticipantHey!
Adding an image based on user rank is relatively easy to achieve…
Inside your theme files there is a file called loop-single-reply.php, you can find the author ID of the current reply and then from there get all the data for that user.$userdata = get_user_meta( bbp_get_reply_author_id ( bbp_get_reply_id() ) );This will fetch the user data then you can just use an if statement to check the current role and output an image tag.
For your second question I do something similar to the user legend on teamoverpowered.com – I am using Wp-UserOnline and I just add the shortcode to my template files.
Good luck!
December 8, 2013 at 12:15 pm #139998In reply to: Recent Topics Widget Date and Time
Lynq
ParticipantIn the core files there is a file called widgets.php inside /plugins/bbpress/includes/common
If you look at line 677 (in my version) there is a topics widget class (class BBP_Topics_Widget), you could create your own plugin and copy the class across (renaming it) and then create your own bbPress widget, without altering the core code.
Good luck!
December 8, 2013 at 3:32 am #139990In reply to: Menu link to Profile
ronthai
ParticipantIf your theme supports blank pages (Page Attributes), use that to give the “illusion” that it is not a redirect.
The above link+php is for the edit page.
If you look at the link after URL you see: partial_url/php_code/last_part_of_the_URLThe last part of the URL is what you have to change for the topics, replies, favorites, subscriptions or edit
December 8, 2013 at 3:16 am #139989In reply to: Menu link to Profile
ronthai
ParticipantI just added to my menu all forum links from a user:
topics, replies, favorites, subscriptions, edit
all under 1 main “Your Forum Settings & Stats” Dropdown, but just call it anything you want.Get the plugin “WP exec PHP” : https://wordpress.org/plugins/wp-exec-php/
No security risk, since you can set the permission for who can add php to pages and such.Create pages for any links to the profile you want and add the following REDIRECT with php-code in it (adjust to your own domain)
<meta http-equiv="refresh" content="0;URL=http://domain.com/forums/users/<?php global $current_user; get_currentuserinfo(); echo $current_user->user_login . ""; ?>/edit/">You could delay the refresh and add a little text to the page, or anything you want.
With many thanks to Diggories (above somewhere) for the php code to get the username in a URL
-
AuthorSearch Results