Search Results for 'code'
-
Search Results
-
Hi all,
I’m trying to integrate the BuddyPress favorite (aka like system) system with BBPress.
But I can not implement ajax and the page will be reloaded.
How do I write it?
▼【functions.php】
function my_bp_activity_is_favorite($activity_id) { global $bp, $activities_template; return apply_filters( 'bp_get_activity_is_favorite', in_array( $activity_id, (array)$activities_template->my_favs ) ); } function my_bp_activity_favorite_link($activity_id) { global $activities_template; echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/favorite/' . $activity_id . '/' ), 'mark_favorite' ) ); } function my_bp_activity_unfavorite_link($activity_id) { global $activities_template; echo apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/unfavorite/' . $activity_id . '/' ), 'unmark_favorite' ) ); }▼【bbPress/templates/default/bbpress/loop-single.php】
<div id="post-<?php bbp_reply_id(); ?>" class="bbp-reply-header"> <!--omission--> <div class="favorite-wrap"> <?php $activity_id = get_post_meta( bbp_get_reply_id( $reply_id ), '_bbp_activity_id', true ); ?> <?php if ( is_user_logged_in() ) : ?> <?php bp_has_activities(); ?> <?php if ( !my_bp_activity_is_favorite($activity_id) ) : ?> <a href="<?php my_bp_activity_favorite_link($activity_id) ?>" class="button fav bp-secondary-action bp-tooltip" data-bp-tooltip="add" aria-pressed="false"> <span class="bp-screen-reader-text">add</span> </a> <?php else : ?> <a href="<?php my_bp_activity_unfavorite_link($activity_id) ?>" class="button unfav bp-secondary-action bp-tooltip" data-bp-tooltip="remove" aria-pressed="false"> <span class="bp-screen-reader-text">remove</span> </a> <?php endif; ?> <?php endif;?> </div> <!--omission--> </div><!-- #post-<?php bbp_reply_id(); ?> -->Help for figuring this one out is appreciated.
Best regardsTopic: Can’t change language
Hello everyone.
Website: Link
WordPress version: 4.9.8
bbPress version: 2.5.14Despite reading many threads about this, I still couldn’t figure out a way to change the language of the forum to hebrew. I will work you through what I did:
1. Download bbPress.
2. Add all the pages (login, register etc.) to the menu. (since the website is in hebrew, you can the pages find it under the second last menu item).
3. Download the hebrew .po and .mo files and put them in the directory /wp-content/languages/bbpress with the proper name (bbpress-he_IL.po and bbpress-he_IL.mo)
4. Check the websites register and login pages, still in english.
5. Edit “wp-config.php” file and added “define(‘BBLANG’, ‘bbpress_he_IL’);”.
6. Check the websites register and login pages, still in english.
Also things I have tried:
– Putting the .po and .mo files under /wp-content/languages/plugins/.– Made sure I don’t have a translation update under “Dashboard -> Updates” in wordpress.
Important Note:
The hebrew is not 100% finished, but from this guide I understood that it doesn’t matter as long as I manually override it.So the bottom line is – I really need help figuring that out. What am I missing?
Thanks for everyone who read and help,
Eitan.Topic: Whitelist html elements
I am using Image Upload for BBPress on my forum. This plugin allows users to insert images in posts.
I, forum admin as well as moderators can align images but normal users can’t.
I think there are permission issues.
How can i whitelist these tags
class="alignright", class="alignnone", class="aligncenter", class="alignleft"for normal user?Hi,
I am now looking for the solution of “changing the freshness time format in Japanese”.
I have already check the plugin “bbp tool kit” and it says on the checkbox “Shorten the display of the freshness”, it is only available in English”.
I have also tried set the code on function.php (10. Shorten freshness wording), obviously it is only available in English too.
It might be diffcult to understand why the freshness time format cannot change with different languages, still though, I am looking for the way to solve this matter.
At this moment, the Freshness time format in Japanese is like…,
A) 1 week, 9 hours ago or B) 3weeks, 4days ago
What I would like to do is…,
A) 7 days ago or B) 25 days ago
simply showing the “days”. I do not need “month, week or hours”.
Please let me know if there is a way to change the format with other languages.
Thank you so much for your help in advance.
Topic: AdRotate Banner Manager
Hello,
I would like to use AdRotate Banner Manager on my bbPress site and I tried to follow the basic tutorial from here: AdRotate tutorial
As a summary, I created a dummy page with my image and embedded link advert – so its working. However, inserting the same code into a new advert inside AdRotate Banner Manager has no effect on my page.
I save the advert for a group and from the group setting, I selected page injection into some of the site pages. It doesn’t appear on none.
Maybe there is a visibility issue? Or the theme DiBusiness does not support AdBanner? I disabled any add block on my site.
Thank you for any help.
Hi,
If the post is edited, the original post will be gone.
How to keep the original post?For example,
This reply was modified 1 second ago by bbpress. click to see original.Anyone knows the custom code for it?
Topic: TinyMCE Error
I’m trying to enable Visual Editor for my forum.
I’m using this code – https://codex.bbpress.org/enable-visual-editor/However, it doesn’t work for me and i see this errors:
jquery.js?ver=1.12.4:2 Uncaught Error: no such method 'instance' for autocomplete widget instance ... tinymce.min.js?ver=4711-20180425:2 Uncaught TypeError: Cannot read property 'refreshContentEditable' of undefinedMy bbPress version is 2.5.14
Wordpress – 4.9.7Tried to disable all plugins, didn’t help..
Topic: Odd slow-query
Hello,
Been optimizing my bbPress install, have managed to make it blazing fast with switching to MariaDB and configuring indexes.
Now i got rid of the usual slow-queries from my slow-query.log now something appeared that i haven’t seen before.
Is this a core bbPress query?
SELECT wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND wp_posts.post_parent IN (LONG LIST OF IDs) AND ( ( wp_postmeta.meta_key = '_bbp_forum_id' AND CAST(wp_postmeta.meta_value AS SIGNED) NOT IN ('11212874','22','1778309','2273738') ) ) AND wp_posts.post_type = 'reply' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC LIMIT 0, 1;Hello there!
Is it possible to migrate from IPB 4 to bbpress? From the importer i see only the option IPB 3 and doesn´t work as the IPB 4 database is different.
I saw also one thread https://codex.bbpress.org/getting-started/importing-data/import-forums/invision/ but not for the IPB 4x version. Can somebody help me please?
Thanks in advance