Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 76 through 100 (of 32,294 total)
  • Author
    Search Results
  • enkoes
    Participant

    @houd, thanks for your help.

    I tried your code but the ‘span’ tag does not work as expected.
    Strangely, I think the code itself is correct because ‘strong’ tag (bold text) does work when I added it in the code for testing purpose. Like this:

    function wp_bbpress_allow_tags(){
        return array(
            'span'=> array(
                'class'     => true,
                'style'     => true,
            ),
            'strong'     => array(),
        );
    }
    add_filter('bbp_kses_allowed_tags', 'wp_bbpress_allow_tags');

    Don’t know what go wrong.

    houd
    Participant

    You need to pick the allowed html tags that the users can use in your “functions.php”, like so:

    function wp_bbpress_allow_tags(){
        return array(
            'span'=> array(
                'class'     => true,
                'style'     => true,
            ),
    	// add other tags to allow here
        );
    }
    add_filter('bbp_kses_allowed_tags', 'wp_bbpress_allow_tags');

    Keep in mind the tags you pick here are the only tags that will be allowed, so list all of them here.

  • Don’t ask me why the default allowed tags are different than the default shown TinyMCE buttons.
#240830

Topic: View the topic title

in forum Themes
simsdreams
Participant

Hello ,
I hope I can explain clearly what I want.
The topic title from the last post should be displayed

As can be seen in the following picture:
Bild 1
this picture is from my Woltlab forum. I specifically mean what I marked yellow!
I would like to have the same thing in the bbPress forum!
At the point I marked in the following picture.
bild 2
So the name of the last topic is displayed above the date and time.
What should the code look like here?

I hope you can help me .

greetings from simsdreams

#240828
soniyabajoria
Participant

Security risk: privesc. It could be possible to elevate a user’s privileges to a higher permission level.

Severity: critical

Fixed in: 2.6.5

Security risk: privesc. It could be possible to elevate a user’s privileges to a higher permission level.

Severity: high

Fixed in: 2.6.5

Security risk: xss. Data from an attacker could be interpreted as code by site visitors’ web browsers. The ability to run code in another site visitors’ browser can be abused to steal information, or modify site configuration.

Severity: medium

Fixed in: 2.6.0

Security risk: xss. Data from an attacker could be interpreted as code by site visitors’ web browsers. The ability to run code in another site visitors’ browser can be abused to steal information, or modify site configuration.

Severity: medium

Fixed in: 2.6.5

Security risk: sqli. The plugin contains a vulnerability wherein unauthenticated visitors could inject SQL statements into WordPress. SQL injection could allow an attacker to gain control of your site.

Severity: low

Fixed in: 2.0

Security risk: xss. Data from an attacker could be interpreted as code by site visitors’ web browsers. The ability to run code in another site visitors’ browser can be abused to steal information, or modify site configuration.

Severity: low

Fixed in: 2.5.9

Security risk: sqli. The plugin contains a vulnerability wherein unauthenticated visitors could inject SQL statements into WordPress. SQL injection could allow an attacker to gain control of your site.

Severity: low

Fixed in: 2.0

Security risk: xss. Data from an attacker could be interpreted as code by site visitors’ web browsers. The ability to run code in another site visitors’ browser can be abused to steal information, or modify site configuration.

Severity: low

Fixed in: 2.5.10

Security risk: sqli. The plugin contains a vulnerability wherein unauthenticated visitors could inject SQL statements into WordPress. SQL injection could allow an attacker to gain control of your site.

Severity: low

Fixed in: 2.5.13

#240806

If anyone out there needs to quickly do an emergency fix to their live site before updating to 2.6.11, here are the changed lines of code between 2.6.10 and 2.6.11:

https://bbpress.trac.wordpress.org/changeset/7272

I’m not advocating for hacking on weird files on live sites, but I understand everyone’s situations are different, and thought maybe this could be helpful to see.

#240798

2.6.11 is out!

Blog post imminent.

Changelog code page updated.

Sorry everyone 😔

#240783
Eusebiu Oprinoiu
Participant

Chuckie, try logging in using the standard WordPress login page and rollback to the previous version.
https://publictalksoftware.co.uk/wp-login.php

#240782
Eusebiu Oprinoiu
Participant

You can get older versions from the Advanced page on WordPress.org.
You can find a dropdown with previous versions at the bottom of this page.

https://wordpress.org/plugins/bbpress/advanced/

Once you download the version you want, upload the ZIP archive under Plugins > Add New.
You will be asked to overwrite the existing plugin. Click Yes, and you are back to normal.

#240774
Eusebiu Oprinoiu
Participant

Hello, Robin!

I tried all the steps you mentioned before opening this ticket.
I cleared both the page and object caches and resaved the permalink rules in case this was causing the 404 errors. (although permalink issues would cause problems regardless of the logged-in status)

In addition to the 404 errors, pages containing queries, like the Blog page or post-type archive pages, load as they should, with 200 OK status, but do not display any content. (the queries return null)

Reverting to bbPress 2.6.9 solves the issue.
And as I mentioned, this only happens for anonymous visitors. For administrators and logged-in users the pages work as expected.

#240767
Robin W
Moderator

Otherwise it is doable but far beyond free help – as I say bbpress just uses wordpress registration so maybe contact a wordpress developer who can do some code for you.

#240763
ttiefenbach
Participant

Thanks for the quick reply! Unfortunately, your code returned the topic’s title.

That allowed me to narrow my search, though, and I was able to get the correct functions for my permalink structure:

function my_filter_thumbnail_id( $thumbnail_id, $post = null ) {
	if ( $post->post_type != 'topic' )
		return $thumbnail_id;
	
	$forumid = bbp_get_topic_forum_id();
	if ( $forumid == 6728 )
		$thumbnail_id = 7091;

	return  $thumbnail_id;
}
add_filter( 'post_thumbnail_id', 'my_filter_thumbnail_id', 20, 5 );

I could probably use the bbp_get_forum_title() function to get the tiel to compare, like you suggested, but I went with just validating the ID since it was working.

Thanks for your help!!

#240761
Robin W
Moderator

$forumname = bbp_get_forum_title( $post->forum_id );

#240759
ttiefenbach
Participant

I’m trying to get a default featured image to display using a filter of “post_thumbnail_id” in my child theme’s functions.php file. I’m able to add a default thumbnail for post_type of topic, but I’d like it to be a custom thumbnail based on the id, or name of the forum the topic is in. Here’s what I have so far:

function my_filter_thumbnail_id( $thumbnail_id, $post = null ) {
	if ( $post->post_type != 'topic' )
		return $thumbnail_id;
	
	$forumname = get_forum_name( $post->forum_id );
	if ( $forumname == "wellness")
		$thumbnail_id = 7091;

	return  $thumbnail_id;
}
add_filter( 'post_thumbnail_id', 'my_filter_thumbnail_id', 20, 5 );

The issue is, “get_forum_name(),” is an undefined function. I’m not looking to override the default functions of bbPress, just be able to access the forum_id or forum_name from my theme’s functions.php file. Any help would be greatly appreciated! Thanks

#240736
Robin W
Moderator

bbpress just uses wordpress registration.

Wordpress requires users to have an email address for various reasons, including password changing and resetting.

Whilst this is certainly achievable with code, I do not know of any plugin that allows this.

No-one sees the email address apart from WordPress admins and the user.

#240734
Dean Scott
Participant
Field       Type    Collation  Null  Key  Default  Extra  Privileges
post_parent  int(11)   NULL     YES    —    NULL      —    select,insert,update,references 
#240732
Dean Scott
Participant

It’s in the OP.

Can you confirm what type of constraint is present on the post_parent column? The error uses the word KEY, which is a constrained column. Obviously, it can’t be a PRIMARY key, since ID is PRIMARY and AUTO INCREMENT, so post_parent set as UNIQUE, INDEX, or other?

Now, I can run SQL in phpMyAdmin directly addressing post_parent, as in SELECT * FROM wp_posts WHERE post_parent != 0 AND post_type = topics OR post_type = replies;
and the result is a screen full of all topics and replies.

Yet this particular query syntax: SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts FORCE INDEX (PRIMARY, post_parent) throws the “doesn’t exist” error, so it must have something to do with the properties of post_parent not being an INDEX? So, HOW to make it one, per the above question.

#240730
jlemee
Participant

I don’t understand why it’s not work.
I have a function for topic links and function for answer (reply) links

// change answer links displayed
add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;

function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                    'reply'  => bbp_get_reply_to_link ( $r ),
                    // 'edit'   => bbp_get_topic_edit_link ( $r ),
                    'edit'   => bbp_get_reply_edit_link ( $r ),
                    'trash'  => bbp_get_reply_trash_link ( $r ),

                ), $r['id'] );
    return $r['links'] ;
}

//change topic links displayed
add_filter ('bbp_topic_admin_links', 'change_topic_admin_links' ) ;
function change_topic_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_topic_admin_links', array(
                    'reply'  => bbp_get_topic_reply_link ( $r ),
                    // 'edit'   => bbp_get_topic_edit_link ( $r ),
                    'edit'   => bbp_get_topic_edit_link ( $r ),
                    'trash'  => bbp_get_topic_trash_link ( $r ),

                ), $r['id'] );
    return $r['links'] ;
}
#240729
Robin W
Moderator

so this should work, but looks like your function

// change admin links displayed
add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;

function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                'edit'    => bbp_get_reply_edit_link   ( $r ),
				//'move'    => bbp_get_reply_move_link   ( $r ),
				//'split'   => bbp_get_topic_split_link  ( $r ),
				'trash'   => bbp_get_reply_trash_link  ( $r ),
				//'spam'    => bbp_get_reply_spam_link   ( $r ),
				//'approve' => bbp_get_reply_approve_link( $r ),
				'reply'   => bbp_get_reply_to_link     ( $r )

                ), $r['id'] );
return $r['links'] ;
}
#240727
Robin W
Moderator

try

add_filter ('bbp_get_reply_admin_links', 'change_admin_links' ) ;

#240725
jlemee
Participant

I found it on a bbpress support discussion because I only wanted you to keep the modify, edit and trash links. But the link to edit never worked, before or after adding this code

#240724
Dean Scott
Participant

I’m looking directly at wp_posts table. post_parent key has matching values to post_type records (topics, replies) and verified by your code returning zero for any mismatches.

I’ve also added a copy of my theme’s page.php (parent = Kyma, child = Frontech), renamed it bbpress.php, and put it in both parent and child root theme folders (unaltered, because there’s nothing in the theme interfering with the layout and placement of BBP). No change.

#240723
Robin W
Moderator

hmmm…

so have you actually looked at the database tables? or are you getting the status from my code?

#240722
Dean Scott
Participant

I just discovered more at the end of the PHP error…

LIMIT 0, 15 made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), bbp_has_replies, WP_Query->__construct, WP_Query->query, WP_Query->get_posts

Is this helpful?

Yes, I’ve switched to 2024 theme AND deactivated all plugs, one-by-one. Same error.

#240721
Robin W
Moderator

where did this code come from?

#240718
jlemee
Participant

bbp_get_topic_edit_link work but bbp_get_reply_edit_link not work, my page is blank, can you help me please ? (bbp_get_reply_to_link(), bbp_get_topic_edit_link() and bbp_get_reply_trash_link() works perfectly)

// change admin links displayed
add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;

function change_admin_links ($r) {
    $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                    'reply'  => bbp_get_reply_to_link ( $r ),
                    // 'edit'   => bbp_get_topic_edit_link ( $r ),
                    'edit'   => bbp_get_reply_edit_link ( $r ),
                    'trash'  => bbp_get_reply_trash_link ( $r ),

                ), $r['id'] );
    return $r['links'] ;
}

thanks for your help

Viewing 25 results - 76 through 100 (of 32,294 total)
Skip to toolbar