Search Results for 'code'
-
Search Results
-
Greetings,
I am looking for the pro version of the plugin: https://wordpress.org/plugins/bbp-user-ranks-lite/ which allows the ability for me to have role based badges below certain members on my forums however both the author’s website and the codecanyon posts of this plugin have been disabled so I am unable to get this plugin, if anyone has a copy they can send me or somewhere I can buy it I will be greatful.
Topic: Custom Fields
On my site I am the only one that can create a new topic (anyone can reply) I am trying to introduce a couple of pieces of text that will be added to the end of the content of each reply. (they are twitter names and twitter hashtags).
I have found this piece of code that allows me to add some input fields to a new topic but it only works at the front end, I have been trying with no luck to find a hook I can use to get this to work on the back end. Can any one help please ?
add_action ( ‘bbp_theme_before_topic_form_content’, ‘bbp_extra_fields’);
function bbp_extra_fields() {
$value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field1’, true);
echo ‘<label for=”bbp_extra_field1″>hashtag</label><br>’;
echo “<input type=’text’ name=’bbp_extra_field1′ value='”.$value.”<br>’>”;
$value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field2’, true);
echo ‘<br><label for=”bbp_extra_field2″>Twitter Name</label><br>’;
echo “<input type=’text’ name=’bbp_extra_field2′ value='”.$value.”‘>”;
}
/* Write out to meta table */
add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 1 );
add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 1 );
$topic_id = bbp_get_topic_id();
function bbp_save_extra_fields($topic_id) {
if (isset($_POST) && $_POST[‘bbp_extra_field1’]!=”)
update_post_meta( $topic_id, ‘bbp_extra_field1’, $_POST[‘bbp_extra_field1’] );
if (isset($_POST) && $_POST[‘bbp_extra_field2’]!=”)
update_post_meta( $topic_id, ‘bbp_extra_field2’, $_POST[‘bbp_extra_field2’] );
}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.