Search Results for 'code'
-
Search Results
-
Hello !
I am using the [bbp-single-forum] shortcode to display a topic in a page. But when I click on the pagination link (for example to go the the 2nd page), the links is not correct and I go to “not found page”.
Those links work correctly on the forum. It is only on page with shortcode that I got that issue.
Am I the only one to face that issue ?
PS : Sorry I can’t provide URL to see the issue because this forum is private on my training website :s
We have some custom code in the mu-customisations plugin which filters bp_core_fetch_avatar to add a variety of little image overlays to the user’s avatar (e.g. instrument icon, “Team” logo). (mu_add_overlays_to_avatar() in mu-buddypress.php)
This has been working fine throughout the site, but as of today (I suspect with the upgrade of BuddyPress from 2.8.2 to 4.2.0) it no longer works in bbPress discussions.
It does still work correctly in BuddyPress content, e.g. the “login widget” at the top of the sidebar with the user’s own avatar, the activity feed in the sidebar, member profile pages. But in the author info in bbPress discussion posts, the overlays are no longer appearing.
Could you please look into what might have changed here, and why the bbPress template for showing the author avatar seems to no longer be affected by our mu_add_overlays_to_avatar filter? Thanks!
http://prntscr.com/nig5is http://prntscr.com/nig6jwHi!
I Want to take a last message topic link for the header place near bread crumbs.
For what I add
<a href="<?php bbs_forum_last_reply_url(); ?>"to content-single-forum file. The reference works 50\50. Sometimes work correctly, but sometimes transfer to the last message other topics.
How to do it right and what else to add?Hi,
I am trying to create a plugin for my own use, I think the problem is a coding one.I have copied some of this code from a plugin and added some myself to try to create my own plugin rather than adding it to my function.php file.
1. I have added a new record in the postmeta table with the topic ID. meta key and meta value for every topic I have in the table.
2. I want a meta box at the backend on both the topic and reply screens, in the metabox for both screens I want to show the meta value of the associated topic.
I have done both these3. I would like to be able to change this value, but only in the topic screen.
With the code below, if I change the value in the reply screen when I update nothing changes which is great, but if I change the value in the topic screen, when I update I get a blank value returned and the original value in the table is also removed.
When I create a new topic I would also like to populate the meta table.*/
class bbPress_add_meta_fields {
/**
* Construct.
*/private $match_m_fields = array();
public function __construct() {
if ( is_admin() ) {
add_action( âload-post.phpâ, array( $this, âinit_metaboxâ ) );
add_action( âload-post-new.phpâ, array( $this, âinit_metaboxâ ) );
$this->match_m_fields = array(âtopicâ, âreplyâ);
}
}/**
* Meta box initialization.
*/
public function init_metabox() {
add_action( âadd_meta_boxesâ, array( $this, âadd_metaboxâ ) );
add_action( âsave_postâ, array( $this, âsave_metaboxâ ), 10, 2 );
}/**
* Adds the meta box.
*/
public function add_metabox() {
add_meta_box(
âbbp_m_field_metaboxâ,
__(âTwitter nameâ, âtextdomainâ ),
array( $this, ârender_metaboxâ ),
âtopicâ, âsideâ, âhighâ
);
add_meta_box(
âbbp_m_field_metaboxâ,
__( âTwitter nameâ, âtextdomainâ ),
array( $this, ârender_metaboxâ ),
âreplyâ, âsideâ, âhighâ
);}
/**
* Renders the meta box.
*/
public function render_metabox( $post ) {
// Add nonce for security and authentication.
wp_nonce_field( âcustom_nonce_actionâ, âcustom_nonceâ );// get the topic id
$post_id = get_the_ID();
$reply_topic_id = bbp_get_reply_topic_id( $post_id );
// get value from table
$twitval = get_post_meta( $reply_topic_id, âbbp_twitnameâ, true );
echo $twitval;
echo â<br><label for=âbbp_twitnameâ>Twitter Name</label><br>â;
echo â<input type=âtextâ name = âbbp_twitnameâ value= ââ . $twitval .’â>â;
//echo â<input type=âsubmitâ value=âSubmitâ />â;add_action ( âbbp_new_topicâ, âbbp_save_extra_fieldsâ, 10, 2 );
add_action ( âbbp_edit_topicâ, âbbp_save_extra_fieldsâ, 10, 2 );function bbp_save_extra_fields($reply_topic_id,$twitval) {
if (isset($_POST) && $_POST[âbbp_twitnameâ]!=â)
update_post_meta( $reply_topic_id, âbbp_twitnameâ, $twitval );
}
}/**
* Handles saving the meta box.
*
* @param int $reply_topic_id Post ID.
* @param WP_Post $post Post object.
* @return null
*/public function save_metabox( $reply_topic_id) {
// Add nonce for security and authentication.
$nonce_name = isset( $_POST[âcustom_nonceâ] ) ? $_POST[âcustom_nonceâ] :â;
$nonce_action = âcustom_nonce_actionâ;// Check if nonce is set.
if ( ! isset( $nonce_name ) ) {
return;
}// Check if nonce is valid.
if ( ! wp_verify_nonce( $nonce_name, $nonce_action ) ) {
return;
}// Check if user has permissions to save data.
if ( ! current_user_can( âedit_postâ, $reply_topic_id ) ) {
return;
}// Check if not an autosave.
if ( wp_is_post_autosave( $reply_topic_id ) ) {
return;
}// Check if not a revision.
if ( wp_is_post_revision( $reply_topic_id ) ) {
return;
}// Check to match the slug
if(!in_array($post->post_type, $this->match_m_fields)){
// return;
}$meta_box_text_value = $twitval;
if(isset($_POST[âbbp_twitnameâ])) {
$meta_box_text_value = $_POST[âbbp_twitnameâ];
}update_post_meta($reply_topic_id, âbbp_twitnameâ, $twitval);
}/**
* is_edit_page
* function to check if the current page is a post edit page
*/public function is_edit_page($new_edit = null){
global $pagenow;
//make sure we are on the backend
if (!is_admin()) return false;
if($new_edit == âeditâ)
return in_array( $pagenow, array( âpost.phpâ, ) );
elseif($new_edit == ânewâ) //check for new post page
return in_array( $pagenow, array( âpost-new.phpâ ) );
else //check for either new or edit
return in_array( $pagenow, array( âpost.phpâ, âpost-new.phpâ ) );
}}
new bbPress_add_meta_fields();
Why would the short code for latest topics display the topics for some users but not for others?
Non-logged in users and subscriber/participant levels cannot see the Topics on the page where the shortcode is used – yet they can see everything fine when they go the actual Forums.
But I as admin can see the Topics fine when I visit the page where the shortcode is used.
WordPress 5.1.1
bbPress 2.5.14Topic: Lattest Topic Widget
I use a widget on my bbpress forum site for recent topis. Itâs the standard bbpress widget. Before the topic title are 7 speech bubbles. I donât know if itâs always seven, but it doesnât look good and it has no real use. Can I change this to a emoji symbol, like fire, and maybe the number of replies to it? How can I find the right code?
I’d like to show the newest topics, but only the ones, which have more than 3 replies. I haven’t found a shortcode or a filter for this, is it possible to set this up somehow?
thanks
Hello bbPress team and users
I am currently setting up my first bbpress forum. I am using buddypress and gamipress (didnt set it up so far) too.
I use a widget on my bbpress forum site for recent topis. It’s the standard bbpress widget. Before the topic title are 7 speech bubbles. I don’t know if it’s always seven, but it doesn’t look good and it has no real use. Can I change this to a emoji symbol, like fire, and maybe the number of replies to it? How can I find the right code?
Another question somebody could maybe anwser. Can I show gamipress ranks and points below the avatar in postings or other informations from buddypress profiles, or any bbpress related informations?
Thank you in advance and have a nice day to the whole in community!
I’m trying to import an old vBulletin (3.8.3) forum to a new bbPress (2.5.14) setupon WordPress 5.1.1 and the initial import looks great. It imports the users (~13k) says something about deleting their WordPress password, then a moment later it seems to hang and no matter how long I leave it we never progress.
Calculating forum hierarchy (0 - 99) Converting forums (0 - 99) Delete users WordPress default passwords (12700 - 12799) Delete users WordPress default passwords (12600 - 12699) Delete users WordPress default passwords (12500 - 12599) Delete users WordPress default passwords (12400 - 12499) Delete users WordPress default passwords (12300 - 12399)Looking at the forum sections shows that it’s created the 22 forums and correctly set some of them as categories, they also show how many topics and replies are in each one correctly –
â Random Thoughts - Topics: 3,119 Replies: 54,698But only 27 topics across the entire forum are imported. It’s the same 27 topics every time as well. To the point that if I stop the import, and hit the start button again, it imports these same 27 topics once more now showing 54. Is there an error log I can find that might show me why it’s hanging up? The bit above with the Calculating Hierarchy is the last update I ever get in the window. I added the lines to turn on debug logging in WordPress but nothing every shows up.
define( 'WP_DEBUG', true ); // turn on debug mode if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { define( 'WP_DEBUG_LOG', true ); // log to wp-content/debug.log }One of the problems I’ve encountered in trying to use the TinyMCE editor in bbPress is styling the text inside the editor itself. The default fonts are serif, but suppose you want sans?
Attempting to override the font-family in the usual way — by modifying your theme’s CSS file — fails because the editor window of TinyMCE is in it’s own tiny little world as far as CSS is concerned.
In order to get TinyMCE to use your own stylesheet, you have to pass it as an argument when the editor is called. Here’s how to do it in bbPress.
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = array( 'content_css' => '/wp-content/themes/mytheme/css/tinymce-editor.css', ); return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );In the example above, “tinymce-editor.css” is the CSS file you want the editor to use. It is located in a folder entitled “CSS”, which is located in your theme folder “mytheme”. The code above can be copied and pasted into your functions.php file.
Other options for the editor can be found here. Notice that the value for “tinymce” can be an array. That’s what we’re doing above.
Additional arguments to pass in the array for the TinyMCE editor can be found here.
I hope this helps someone. The documentation for styling the editor text could be improved. I banged my head on this problem for years until I stumbled on the solution elsewhere.
Topic: Get rid of fixed separators
I had problems with fixed separators in source. I edited the core code, but is there any other way?
See my changes here:Topic: Shortcodes not working
I created a site using buddypress. The shortcodes like [bbp-login], [bbp-register], [bbp-lost-pass] not working. It just shows the shortcode. I tested it with the theme Twenty Seventeen and NO other plugin installed. WordPress 5.1.1, PHP 7.3 (tested also with 5.6 and 7.2), and Buddypress 4.2.0.
You can see it here: https://bbpress.at-creation.ch/login/
Thanks for your help.