Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,876 through 4,900 (of 32,522 total)
  • Author
    Search Results
  • #187254

    In reply to: Forum Freshness

    Robin W
    Moderator

    suggest you try this in your functions file

    add_filter ('bbp_convert_date', 'rew_convert_date', 10 , 3 ) ;
    
    function rew_convert_date ($time, $d, $translate) {
    $d = 'G' ;
    $time = mysql2date( $d, $time, $translate );
    return apply_filters( 'rew_convert_date', $time, $d, $translate );
    }

    may or may not work !

    vicky962
    Participant

    Dear team,

    I want to hide attachments and external Url’s for guest users, how can we do it, is there any plugin that can do it , or please send me code to achieve it.

    Thanks in Advance.

    Regards,
    Waqas

    #187252
    melodies
    Participant

    On my forum, the timestamp on the posts are 7 hours in the past.
    When a new post is made, it starts at “7 hours ago” rather than “just now,” “1 minute ago,” etc.

    The general time is set correctly in the WP > Dashboard > settings and all other timestamps displayed across the site are accurate (messages, notifications, etc). Only notifications relating to bbPress are off by 7 hours.

    This same issue can be found in an old thread post (Link below):

    The time zone is off by 7 hours in my bbpress plugin forums

    However, the solution in that post is outdated, since the code layout in has changed, and “line 178 in /wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php” no longer exists for manual alteration.

    Can you please tell me which file I can edit in bbPress to manually subtract 7 hours from the freshness output timestamp of all future forum posts?

    Thank you.

    #187213
    Robin W
    Moderator

    just had a quick look at what was in the free version, and looks like the pro version may have what you want – it claims

    Buddpress profile link integration (New in V1.0.4)
    BBpress profile link integration (New in V1.0.4)
    BBpress Online User Statistics (New in V1.0.5)

    maybe worth looking at

    CBX User Online for WordPress

    #187211
    Robin W
    Moderator

    not within free help – code digging would be needed.

    #187199

    In reply to: bbpress performance

    Fabian
    Participant

    Yes, BuddyPress registers its autoloader, but includes most files through BP_Component::includes() anyway. Thats only half-way implemented.

    #187196

    In reply to: bbpress performance

    Fabian
    Participant

    @johnjamesjacoby thats not true, WP has a “polyfill” for autoloading, and actively uses it on every request, even on legacy PHP 5.2. So autoloading is officially supported.

    These are first numbers about the impact of an unconfigured bbPress on a fresh WP server response time:

    PHP 5.6 + opcache : +35 % SRT
    PHP 7.0 + opcache : +28 % SRT
    PHP 7.1 no opcache: +28 % SRT

    As you can see bottleneck is loading and parsing. Note that the speedup of opcache in PHP 7 is about 6x.

    #187177
    rogerlridge
    Participant

    Thanks for the reply, I’m currently using that plugin but it doesn’t work the way I need it to. It tells me the number of users currently online but not currently viewing any particular thread, forum or page for that matter. But thank you for the suggestion. If you know of a way to maybe code it so that it does that please feel free to share whatever info you might have as it would be greatly appreciated! 😀

    #187168
    moejonet
    Participant

    because i cant edit my reply my correction:

    
    function bbp_update_reply_position( $reply_id = 0, $reply_position = 0 ) {
    
        global $wpdb;
        
    	// Bail if reply_id is empty
    	$reply_id = bbp_get_reply_id( $reply_id );
    	if ( empty( $reply_id ) )
    		return false;
    
    	// If no position was passed, get it from the db and update the menu_order
    	if ( empty( $reply_position ) ) {
    		$reply_position = bbp_get_reply_position_raw( $reply_id, bbp_get_reply_topic_id( $reply_id ) );
    	}
    	
    	$db_menu_order = $wpdb->get_var("select menu_order from {$wpdb->posts} where ID={$reply_id}");
    	
    	if($db_menu_order == $reply_position)
    	    return (int) $reply_position;
    
    	// Update the replies' 'menp_order' with the reply position
    	wp_update_post( array(
    		'ID'         => $reply_id,
    		'menu_order' => $reply_position
    	) );
    
    	return (int) $reply_position;
    }
    
    #187165
    moejonet
    Participant

    I would propose following changes in bbp_update_reply_position in bbpress/replies/functions.php:2128.

    
    function bbp_update_reply_position( $reply_id = 0, $reply_position = 0 ) {
    
    	// Bail if reply_id is empty
    	$reply_id = bbp_get_reply_id( $reply_id );
    	if ( empty( $reply_id ) )
    		return false;
    
    	// If no position was passed, get it from the db and update the menu_order
    	if ( empty( $reply_position ) ) {
    		$reply_position = bbp_get_reply_position_raw( $reply_id, bbp_get_reply_topic_id( $reply_id ) );
    	}
    	
    	$post = get_post($reply_id);
    	
    	if($post->menu_order == $reply_position)
    	    return (int) $reply_position;
    
    	// Update the replies' 'menp_order' with the reply position
    	wp_update_post( array(
    		'ID'         => $reply_id,
    		'menu_order' => $reply_position
    	) );
    
    	return (int) $reply_position;
    }
    
    #187164
    moejonet
    Participant

    There is an infite loop on reply update caused by buddypress activity from bbpress if bbp_thread_replies() is false.

    activity tries to get reply position, in this call position is updated for the reply but we are still in edit_post action so wp_update_post is called recursively until server gives up.

    stacktrace:

    
    var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #2 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #3 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #4 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #5 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #6 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #7 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #8 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #9 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #10 /var/www/clients/client1/web17/web/wp-includes/post.php(3591): wp_insert_post(Array, false)
    #11 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #12 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #13 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #14 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #15 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #16 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #17 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #18 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #19 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #20 /var/www/clients/client1/web17/web/wp-includes/post.php(3591): wp_insert_post(Array, false)
    #21 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #22 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #23 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #24 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #25 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #26 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #27 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #28 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #29 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #30 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(45): wp_insert_post(Array)
    #31 /var/www/clients/client1/web17/web/wp-content/themes/mikmag-child/lib/core/MundrImportForums.php(663): bbp_insert_reply(Array, Array)
    #32 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): lib\core\MundrImportForums->post_import_forums_threads('')
    #33 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
    #34 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #35 /var/www/clients/client1/web17/web/wp-admin/admin-ajax.php(91): do_action('wp_ajax_post_im...')
    
    #187144
    vegetarianzen
    Participant

    Hello Team bbpress

    I am using the plugin bbpress. I want to customise that view of forum similar to http://www.veggieboards.com/forum/index.php this link.

    I have created the child theme and add the css folder and archive-forums.php file in the child theme. I am not able to customise plugin using css only because I want to change the structure. If I change plugin core file then future update overwrite my code and when I am place the complete plugin in child then its stop working and page become blank.

    Please give me the solution I am waiting your solutions.

    My bbpress plugin Version: 2.5.14

    Wordpress Version: 4.8.2

    Thanks

    #187141
    Robin W
    Moderator
    #187139
    rogerlridge
    Participant

    Does anyone know where I can edit or find the source code to edit the layout of the blockquote? I would like to add a little image on the side of the blockquote. Does anyone know where I can find the code to achieve this please? Thanks in advance

    #187137

    In reply to: Free BBPress Theme

    MakarkinPRO
    Participant

    thx. Yeah it’s working a bit what I want.

    Any idea of how to remove Name/Email registration fields from the ShortCode (which is generation login details on the page) ?

    2017-09-24_1652

    #187123
    Robin W
    Moderator
    if (bbp_is_topic_sticky( $topic_id )) {
    //do something 
    }
    #187121
    Mike Costanzo
    Participant

    Hi there!

    I’m importing forums from Rainmaker into WordPress 4.8.2 and BBPress 2.5.14. On first glance, it looks like all has done well; a quick glance at a sample Forum, for example, tells me:

    “This forum contains 74 topics and 698 replies.”

    However, my Topics and Replies are not being “found” when a Forum is clicked on:

    “Oh bother! No topics were found here!”

    This appears to be because the post_parent in wp_posts for all these Topics and Replies is set to “0” in the database. And what’s worse, the “Repair” tools like “Recalculate the parent topic for each post” or “Recalculate the parent forum for each post” do not fix the problem; post_parent remains at value 0.

    The only way I have found to populate a Topic with the correct post_parent value is to open that topic in the Editor and click Publish. But since I have hundreds of Topics and thousands of Replies, manually saving all these Posts is hardly a workable solution.

    Does anyone know of a better way to solve this problem that doesn’t involve nearly infinite man-hours of drudgery and toil?

    Thanks in advance for any help you might be able to give. Long live BBPress!

    #187120
    heppusiel
    Participant

    I just try latest version of BBPress, and this problem exist. Is there any fix coming? Codes above didn’t work for me.

    #187118
    Robin W
    Moderator

    @lovechard if you’d like some code around JJJ’s filtering suggestions, contact me via my website

    http://www.rewweb.co.uk

    #187110
    Bharat Karavadra
    Participant

    Hello,

    I have had to add a space after the https:// to avoid the screen appearing

    If you look at Peter Recks’ posts here:
    https:// http://www.karavadra.net/forums/topic/header-image-formatting/

    There are quotes with text ‘Reconsidering Study, Qualifications & Experience’ with a link to here:
    1) https:// http://www.karavadra.net/reconsidering-study-qualifications-experience/

    However, Peter has only put in a link in his post which is not to the link 1 above but to here:
    2) https:// romancecalling.xyz/?page_id=35

    When I look at the link in admin it appears correctly as link 2

    Why is the link being changed from the 2nd to the 1st on the user side and the title of the page being added?

    And more importantly how do I get it to appear as it as posted, namely link 2.

    Note: no a hrefs or any other shortcodes for links are being used — only the URLs 1 and 2.

    Thank you,

    Bharat

    #187092

    Also, is it not possible to write one query that deletes content from two tables (wp_posts and postmeta)?

    Correct; it is not possible. Each deletion from each table needs its own query. It’s not possible to know which meta-data IDs to delete without SELECTing which post IDs before deleting them.

    #187059

    You won’t be able to do this with just 1 query, because you’ll also want to delete the associated meta-data; that will take at least another query with the post IDs of the topics you’re trying to delete. If you’re using any type of caching, those caches should be purged also, which usually requires PHP or a cache-key reset.

    There are a few alternatives.

    * Admin > Tools > Forums > Reset will let you erase all bbPress content completely. It may timeout depending on your server configuration, but it will eventually get through it.
    * Use WP-CLI: http://wp-cli.org
    * Export the DB, do the data delete on a more capable server (or locally) then re-import it back in. This obviously is the more technical solution, but works really well in a pinch.

    #187057

    In reply to: New replies first

    seth23
    Participant

    This code worked for me. Is there any way to put an option on the topics pages for people to choose if they want the thread to go oldest to newest or newest to oldest?

    #187044

    I understand the need for this, but this is coming from bbPress so there is only so much we can do. bbPress has no way to to blanket unsubscribe someone from all of their forums/thread email subscriptions. If bbpress had a way to unsubscribe globally, then we could look into it but going topic by topic, which is how they have it setup does not work. Simply put bbPress doesn’t have the utilities to make it reasonably possible

    The bbp_topic_subscription_user_ids filter can be used to remove users from the array of users to be notified about new replies to topics.

    The bbp_forum_subscription_user_ids filter can be used to remove users from the array of users to be notified about new topics in a forum.

    On the Memberpress side, or in a separate add-on, they can filter those arrays, remove “inactive” members from those emails, and problem solved.

    I’d also argue that you actually don’t want to blanket unsubscribe anyone from anything, because if they ever re-subscribe, they’ll want to get all of their previous history back; right? If you purged all those subscriptions when their membership expires, that would kinda stink for them.

    #187042

    In reply to: bbpress performance

    Fabian
    Participant

    1) It is true and I’ll show you some more precise benchmarks on this for a concrete example. Take the filter bbp_map_meta_caps, it’s within a filter recursion, where the filter fires it self again. The recursively fires 4 times with bbpress only. Now if another plugins does the same, it could get up to 16. Plugin run times include each other through the filter api. In worst case you can’t just add them to each other, they bias by some non-linear function that is definitely not O(n).
    Your point is true, that you can’t blame a plugin for being slower in conjuntion to others. But, you as a developer, should avoid that other plugins can slowdown your own plugin, by minimal intrusion into the WordPress plugin API. And bbPress does not have this minimal intrusion. Of course it is a big software product, but there is high potential to conditionally hook into WP only on pages it needs to.

    2) No its not completely irrelevant. I wasnt clear enouh here, I’m not referring to file count, but yeah -how you said- file size or LLOC. Were not talking about vulcanizing scripts. You’re right, the PHP interpreter got very fast and it should not matter, but consider:

    a) Only the inclusion of bbpress main file makes PHP allocate about 600 KB. Thats a lot, considering 0 output bytes. And this happens on every request, every REST.

    b) Think about who runs a WordPress site, not people that have a dedicated high performance server. Usually its a webspace in a VM. These systems can power hundreds of sites, so the webserver does not just read 500 files at the same time, but lets say 10000. This lowers the chance to find the same PHP code in some cache between subsequent requests. The code size per request starts to matter here.

    b) It is a style thing, I dont want my programs to load 1MB code without using it. And yeah, there are many plugins that just follow WordPress style to include everything, but this does not mean it is a good style to follow. Unfortunately, there is no well known code metric that covers this. WP was created in darker times of PHP, without autoloaders. Why do we have them now? I dont get it why so few plugins properly use them, it takes a day to refactor your plugin and another to test.

    bbPress is not doing bad. It could just be more minimal if the forum is just a smaller part of your website. I dont expect 25 plugins to allocate 0 memory, but I expect 25 plugins not to clog my dashboard and frontpage, where I do not want them to load. I want them to do what they are supposed to do on specific pages within the front- and backend.
    Its true that woocomerce is the worst.
    I could optimize it though. It only loads on the shop frontpage, on the checkout page, on product pages, specific ajax actions and REST endpoints. The cart can be XHR, or one can keep on loading the plugin once a cookie is set. This technique makes the wp-admin dashboard fast too.

    (I’ll back with the benchmarks)

Viewing 25 results - 4,876 through 4,900 (of 32,522 total)
Skip to toolbar