Search Results for 'code'
-
Search Results
-
How can I code an activity stream that lists only the most recent post for each topic, not all recent posts (which can include many posts from the same topic) as the standard widget does?
I’m using bbPress 2.5.14, BuddyPress 3.20 and WordPress 4.9.8 on a local dev server so no public link to the site.
I’m trying to write a conditional statement to auto tag new topics based on forum.
This is what I have so far
add_action ( 'bbp_insert_topic', 'myprefix_assign_tag_to_post' , 10, 1 ); add_action ( 'bbp_new_topic', 'myprefix_assign_tag_to_post', 10, 1 ); add_action ( 'bbp_edit_topic', 'myprefix_assign_tag_to_post', 10, 1 ); function myprefix_assign_tag_to_post($topic_id) { if( bbp_is_forum ( '168' ) && bbp_current_user_can_publish_topics() ) { wp_set_post_terms( $topic_id, 'introductions', 'topic-tag', true ); } elseif( bbp_is_forum ( '1343' ) && bbp_current_user_can_publish_topics() ) { wp_set_post_terms( $topic_id, 'discovery', 'topic-tag', true ); } }The problem is, this automatically tags the new topics with “Introductions” regardless of the forum. I tried replacing ‘bbp_is_forum’ with ‘bbp_is_single_forum’, and the same thing happens. I’ve tried replacing it with ‘bbp_is_forum_archive’ and nothing happens. I’ve even tried replacing the ID with slug, with and without the single quotes, trying it with just one IF statement, and I’m not getting the desired results.
I also tried using is_page, hoping it would be using the default WordPress call since it used in the functions.php for topics. No joy.
So, if someone could please tell me what I should be using instead of is_forum, is_single_forum, is_etc, that would be great.
I have 5 different forums.
Only one of them should serve as a Q&A forum where people can ask us questions. Nobody should be able to reply before we reply. I could think of two ways to make that happen:1. The forum is moderated and all topics have to be approved before they are posted together with our answers. After posting other people can reply too.
2. All the topics are initially private. So we can answer it and then make it public for receiving further replies.
I could not find code or plugins to make that happen and would be very grateful for any advice.
I’ve been working on a converter to import our Invision v4 forum to bbPress. I’ve got the users, forums and topics all importing reasonably well.
https://github.com/EnhancedAthlete/bbPress-Invision-v4-Converter
I’m having trouble with the titles which are stored in a language table:
core_sys_lang_words| word_id | ... | word_app | ... | word_key | word_default | word_custom | ... | 8379 | ... | forums | ... | forums_forum_2 | Generic Discussion | Generic Discussion | ...To retrieve a single forum title, I can use:
SELECT word_default as forum_name FROM ipbforum.core_sys_lang_words WHERE word_key = CONCAT('forums_forum_', 2)or to retrieve them all, something like:
SELECT word_default FROM ipbforum.core_sys_lang_words WHERE word_app = 'forums' AND word_key IN (SELECT CONCAT(prefix, id) FROM (SELECT 'forums_forum_' as prefix, ipbforum.forums_forums.id FROM ipbforum.forums_forums) AS t)Or all with the forum ids:
SELECT ipbforum.core_sys_lang_words.word_default as forum_name, word_key_table.forum_id as forum_id FROM ipbforum.core_sys_lang_words, (SELECT CONCAT(prefix, id) AS word_key, id AS forum_id FROM (SELECT 'forums_forum_' AS prefix, ipbforum.forums_forums.id FROM ipbforum.forums_forums) AS temp) AS word_key_table WHERE ipbforum.core_sys_lang_words.word_key = word_key_table.word_keybut I’m struggling to figure out how to write that in the
BBP_Converter_Baseextended classfield_map[].I’ve looked at some other converters and don’t see anything similarly complicated so I’m assuming there’s a more straightforward way.
Any pointers appreciated! Once this is figured, the converter should be good enough for most people’s use.
Topic: ArgumentCountError thrown
Hi,
i get the error
Too few arguments to function vvd_no_view_ip(), 2 passed in /home/sites/site64/web/wp-includes/class-wp-hook.php on line 286 and exactly 3 expected.
Users can create topics and write comments in it but when i want to see the topc and get this errorRegards, Thomas
I used WordPress v4.9.8 and bbPress v2.5.14.
This morning, my site, thecardinalnation.com was presenting 500 errors to all visitors. After three hours with support from my hosting provider, HostGator, they were able to isolate the problem to the bbPress plugin, which is now disabled. Obviously, my forums are down, but the base site is again available.
HG Level 2 support provided the following, which they said indicates that bbPress is trying to pull from PHP 5.4, although the site is now on 7.0. (The site was on 5.4 to start the day, but it was upgraded to 7.0 as part of their trouble-shooting.) HG also said that the 500 error problem would remain even if we took PHP back to 5.4.
The site is current on all code:
Wordpress 4.9.8
bbPress 2.5.14[Tue Nov 13 10:30:27 2018] [error] [client 192.185.1.20] Failed loading /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/ZendGuardLoader.so: /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/ZendGuardLoader.so: undefined symbol: zval_used_for_init, referer: http://thecardinalnation.com/login/
I am not an IT professional, but will do my best to get any additional information as required. Thank you in advance.
Brian Walton
Got to make a change in a website(can’t include it) and it uses bbpress. I’m relatively new to wp also, sorry for the trouble.
The
/forumsroute is being added to the nav bar and it’s configured correctly to be accessed but for some reason only the/forumsroute is not including a correct header/checking if there is a user logged in. How or where could I configure this.Hi there,
I want to do a test mailing in my staging area, to see if a new WP plugin works for BBpress. In order to do this, i want to change all emails to my personal email address for all that are subscribed to the forum (so i don’t accidentally send out mails to real users,(this has actually happened to me before)). The problem is that the WP user_email is found in the DB wp_users and the forum meta info is found in the DB wp_usermeta. What SQL statement would i use if i wanted to change the email of all bbpress “Participants” to “myemail@email.com”. I want to do something like:
UPDATE wp_users SET user_email = "myemail@email.com" WHERE wp_usermeta.meta_key = "participant";HELP: WP 4.9.8; bbPress 2.5.15; site: azor.vip
Hello, I am a senior citizen noob building a one-off site. I wish to post admin questions from my backend what will appear live on my site.
I have written my post and clicked on Published. Nothing happens. Some time ago when I asked this same question, I was told to do something with shortcodes. I became frustrated because I don’t know what a shortcode is, where I find it, and what I do with it. So I am re-visiting my original question.
I would be very grateful if you could give me some steps.
Topic: How to custom Query Loop…?
I would like to output topics with multiple tags.
For that, I wrote the following code, but it did not work as I expected.
<section class="fluits"> <?php $args_fluits = array( 'post_type' => 'topic', 'tax_query' => array( array( 'taxonomy' => 'tag_fluits', 'field' => 'term_id', 'terms' => array( 11, 22 ), ), ), ); $query_fluits = new WP_Query( $args_fluits ); ?> <?php if ( bbp_has_topics( $query_fluits ) ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php else : ?> <?php bbp_get_template_part( 'feedback', 'no-topics' ); ?> <?php endif; ?> </section> <section class="vegetables"> <?php $args_vegetables = array( 'post_type' => 'topic', 'tax_query' => array( array( 'taxonomy' => 'tag_vegetables', 'field' => 'term_id', 'terms' => array( 33, 44 ), ), ), ); $query_vegetables = new WP_Query( $args_vegetables ); ?> <?php if ( bbp_has_topics( $query_vegetables ) ) : ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php bbp_get_template_part( 'loop', 'topics' ); ?> <?php bbp_get_template_part( 'pagination', 'topics' ); ?> <?php else : ?> <?php bbp_get_template_part( 'feedback', 'no-topics' ); ?> <?php endif; ?> </section>Any hints or different args to use to achieve this?
Thanks.