Search Results for 'code'
-
AuthorSearch Results
-
August 14, 2015 at 11:35 pm #165380
In reply to: SMF Import Help Needed
Robkk
ModeratorSince you still need help on this. First do not import SMF to phpbb, just try leaving it in SMF and import from there. users have had problems importing from phpBB lately but not SMF.
You have to make sure you are not using a remote database.
Make sure to always check the import troubleshooting.
Run through this topic to see if you have any similar issues others may of have, and Stephen may have answered already.
August 14, 2015 at 11:20 pm #165378In reply to: New to bbPress – Help on Page Theme
Robkk
ModeratorYou need help with bbPress using a certain theme template?? Is that what you are saying??
This guide will help you (I hope), I am not entirely sure you want specifically though. I bet the information is useful to learn though.
August 14, 2015 at 6:59 pm #165369In reply to: Topics and replys exists and dont at the same time!
Robkk
ModeratorTry some troubleshooting, and also link to your site to a forum where the error occurs. Also tell me your WordPress and bbPress versions are.
August 14, 2015 at 12:55 pm #165359In reply to: View all posts across multiple forums
Robin W
Moderatoryou can use the shortcode [bbp-topic-index] in a new page – this will show the latest 15 topics across all forums with pagination.
August 14, 2015 at 5:31 am #165355In reply to: Limit tags to a pre-defined list?
strategeek
ParticipantHere is a working code. Hooray!
function displayTagElements($selectedTags, /* $userRole, */ $task){ $html= array(); $tags = get_categories(array('hide_empty' => 0, 'taxonomy' => 'topic-tag')); $selectedTagsArray = explode(',', $selectedTags); if($userRole != 'bbp_participant' || $task != 'edit') { $html[] = ""; foreach($tags as $tag) { $selected = ''; if (in_array($tag->name, $selectedTagsArray)) { $selected = 'checked'; } $html[] = "<input type='checkbox' name='bbp_topic_tags[]'".$selected." value=". $tag->name .">". $tag->name; } } else { $html[] = $selectedTags; } return implode('', $html);August 13, 2015 at 1:57 pm #165344In reply to: bbPress Shortcode
Robin W
ModeratorAugust 13, 2015 at 1:57 pm #165343In reply to: No Admin Sections Available
Robin W
ModeratorAugust 13, 2015 at 4:33 am #165334Topic: bbPress Shortcode
in forum InstallationAcs-Yt
ParticipantHi,
I was not able to find a shortcode like [bbPress_forum] to add a forum on a page. Is there a code available?
August 12, 2015 at 11:08 pm #165331In reply to: Getting only one comment
Robkk
Moderatorthe
bbpress.phptemplate looks fine to me.There might be other custom functions for bbPress somewhere though? or cache?
Try some troubleshooting. See if it is a plugin issue, issue is only present in your custom theme, and maybe run the repair tools to recalculate.
August 12, 2015 at 10:10 pm #165329In reply to: Limit tags to a pre-defined list?
23creative
Participantits been a while and im not 100% sure this will work (in terms of sanitation checks) but if you change
$html[] = '<select class="chzn-select" multiple="multiple" name="bbp_topic_tags[]" id="bbp_topic_tags">'; foreach($tags as $tag){ $selected = ''; if (in_array($tag->name, $selectedTagsArray)) { $selected = 'selected="selected"'; } $html[] = '<option '.$selected.' value="'.$tag->name.'">'.$tag->name.'</option>'; } $html[] = '</select>';to
foreach($tags as $tag){ $selected = ''; if (in_array($tag->name, $selectedTagsArray)) { $selected = 'checked="selected"'; } $html[] = '<input '.$selected.' type="checkbox" name="bbp_topic_tags" value="'.$tag->name.'">'.$tag->name; }i haven’t tested it but it should get you close
August 12, 2015 at 9:41 pm #165326In reply to: List subscribers of a forum
Robkk
Moderator@casiepa Thanks for creating a plugin to solve this problem for users. It is greatly appreciated. I have a few questions though.
How do I use it??
The setting are confusing me a little bit, and it doesn’t seem to show the subscriptions, but I do not really know where to manage them in the plugin. I just see a list of users with a button that says `[has role]’. I also do not think your plugin works for sub-forums/child forums of categories.
How does it work exactly??
I try to set it up, but I am still confused. Also there are a few errors while activating it with debug set to true in my wp-config.php file.
define('WP_DEBUG', true);August 12, 2015 at 7:40 pm #165322August 12, 2015 at 6:09 pm #165320Leng7881
ParticipantLog’s who knew? From further examination due to the log telling me to look I found that I have a gh_ in front of the function name when declaring it. There error is also in your updated code above. Now that I took that out it works great. Here is the code without the minor syntax error and thank you for this.
function post_published_create_topic( $ID, $post ) { $checkduplicate = get_post_meta( $ID, 'gh_topic_created',true); if ( empty( $checkduplicate ) ) { $author = $post->post_author; $name = get_the_author_meta( 'display_name', $author ); $title = $post->post_title; $permalink = get_permalink( $ID ); $excerpt = $post->post_excerpt; $subject = sprintf( '%s: %s', $name, $title ); $message = sprintf ('[b]%s[/b]' . "\n" . 'By %s' . "\n\n" . '[i]%s[/i]' . "\n\n" . 'View: %s' . "\n\n", $title, $name, $excerpt, $permalink ); $tags = wp_get_post_tags( $ID, array( 'fields' => 'names' ) ); $new_post = array( 'post_title' => $subject, 'post_content' => $message, 'post_parent' => 72, 'post_status' => 'publish', 'post_type' => 'topic' ); $topic_meta = array( 'forum_id' => $new_post['post_parent'] ); $topic_id = bbp_insert_topic($new_post, $topic_meta); if ( !empty( $topic_id ) ) { add_post_meta($ID, 'gh_topic_created', 'true', true); $term_taxonomy_ids = wp_set_object_terms( $topic_id, $tags, 'topic-tag' ); bbp_update_forum(array('forum_id' => 72)); } } } add_action( 'publish_post', 'post_published_create_topic', 10, 2 );August 12, 2015 at 5:13 pm #165318In reply to: bbPress URL Rewrite shenanigans
Jake Hall
ParticipantAs I expected, was something to do with the rewrite rules. Was a very simple fix, I simply started messing with the rewrite until it worked. This is how mine works flawlessly should anyone have the same issur and somehow stumble across this thread.
Note: This is for lighttpd. This is not an Apache or Nginx solution.
# This is mainly a fix for bbPress and its functions url.rewrite = ( "^/(wp-admin|wp-includes|wp-content|gallery2)/(.*)" => "$0", "^/(.*)\.(.+)$" => "$0", "^/(.+)/?$" => "/index.php/$1" ) }All I did here was remove the additional forward slash within each rule.
Now my links work perfectly!
August 12, 2015 at 1:44 pm #165316Topic: Get next and previous page in wp_header
in forum TroubleshootingMartin Babinec
ParticipantI’d like to add
<link rel="prev" href=".." />and<link rel="next" href=".." />tags into<head>of bbpress forum page. So I need to get links for the next and previous pages of my forum. It has to be outputed inwp_headaction but in that time the bbPress class is not initialized yet, so I cannot get any information from that. Can you help me?August 12, 2015 at 10:56 am #165314ghoush
ParticipantAre you getting any error messages in your error logs? This code, unmodified, is working fine for me on 4.2.4.
August 11, 2015 at 10:11 pm #165304In reply to: Can’t modify a post forum (users nor admin)
Robkk
ModeratorI tried the theme and plugins with bbPress and I didn’t come across any issues.
I am kind of thinking it could be the index.php in your url causing the issue, but I am not really sure.
https://codex.wordpress.org/Using_Permalinks#PATHINFO:_.22Almost_Pretty.22
Since I am not 100% sure, you can try some troubleshooting to see if you can find the solution to your problem.
August 11, 2015 at 9:25 pm #165302Leng7881
ParticipantI got the id from the Reveal ID’s thank you for that. I am trying to get this to work on my website which currently is on a localhost so can’t send you to it. I have put the code in the functions and changed the number to 72 (my forum id), however, when I post it does not create a new topic in that forum. I have been poking around trying to get it to work and have found that some places say the publish_post is deprecated and others that say to ignore that it still works. I’m currently using wordpress version 4.2.4 and here is the code I put in my functions.
function gh_post_published_create_topic( $ID, $post ) { $checkduplicate = get_post_meta( $ID, 'gh_topic_created',true); if ( empty( $checkduplicate ) ) { $author = $post->post_author; $name = get_the_author_meta( 'display_name', $author ); $title = $post->post_title; $permalink = get_permalink( $ID ); $excerpt = $post->post_excerpt; $subject = sprintf( '%s: %s', $name, $title ); $message = sprintf ('[b]%s[/b]' . "\n" . 'By %s' . "\n\n" . '[i]%s[/i]' . "\n\n" . 'View: %s' . "\n\n", $title, $name, $excerpt, $permalink ); $tags = wp_get_post_tags( $ID, array( 'fields' => 'names' ) ); $new_post = array( 'post_title' => $subject, 'post_content' => $message, 'post_parent' => 72, 'post_status' => 'publish', 'post_type' => 'topic' ); $topic_meta = array( 'forum_id' => $new_post['post_parent'] ); $topic_id = bbp_insert_topic($new_post, $topic_meta); if ( !empty( $topic_id ) ) { add_post_meta($ID, 'gh_topic_created', 'true', true); $term_taxonomy_ids = wp_set_object_terms( $topic_id, $tags, 'topic-tag' ); bbp_update_forum(array('forum_id' => 72)); } } } add_action( 'publish_post', 'post_published_create_topic', 10, 2 );Any help on why this wouldn’t work for me would me much appreciated.
August 11, 2015 at 7:16 pm #165298In reply to: Change font size
Robkk
ModeratorThis is the default font-size in the bbPress stylesheet. You can overwrite the statment or install a plugin like bbp style pack which I think would take care of this for you.
#bbpress-forums { background: 0 0; clear: both; margin-bottom: 20px; overflow: hidden; font-size: 12px; }August 11, 2015 at 6:35 pm #165297In reply to: Inserting Forum Element on Front Page
Robkk
ModeratorAugust 11, 2015 at 6:21 pm #165295In reply to: Alternative to “You must be logged in…”
Robkk
ModeratorYou can copy the
form-topic.phpinto your theme/child theme into a folder called bbpress to customize the file used on your site.You can scroll all the way to the bottom of the file, and replace the current message
<div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic"> <div class="bbp-template-notice"> <p>You must be <a href="<?php echo site_url('/wp-login.php') ?>">logged in</a> or <a href="<?php echo site_url('/wp-login.php?action=register') ?>">registered</a> to create new topics.</p> </div> </div>August 11, 2015 at 5:53 pm #165293In reply to: Showing Profile Information
Robkk
ModeratorIn BBpress each user has the ability to edit their profile users/USER/edit/
Here they can add their name, their website link and their bio by default. However, this information is never actually displayed on their profile. Why is this?The bio should show.
https://bbpress.org/forums/profile/robkk/
As for most of the other fields, not sure really. I know though they are just going off of WordPress’s profile fields, and whatever is added to that though. I don’t know why the devs haven’t put at least website there. Maybe it is easy for spammers to take advantage of that?? First Name and Last Name could make good choices to display on the users profile too.
I will probably make a suggestion to the devs later to add more profile data to the user’s profile.
You can of course display the data in the profile by editing a template or installing a plugin.
Copy
user-profile.phpfrom the bbPress templates in the plugin to your child theme in a folder called bbpress.Just surround the code with conditionals to only display the information when the user has inputted any information.
You have something like this for first name.
<?php if ( bbp_get_displayed_user_field( 'first_name' ) ) : ?> <p class="bbp-user-fname"><?php bbp_displayed_user_field( 'first_name' ); ?></p> <?php endif; ?>YOu can also use the plugin, to display the current fields and also custom fields.
August 11, 2015 at 3:38 pm #165290In reply to: Merge Topics Problem
Robkk
ModeratorTry some troubleshooting especially what is listed for plugins. Deactivate every plugin except bbPress to see if the topics can merge correctly. Activate BuddyPress right after to see if topics merge correctly in groups and normal forums. Next, activate every other plugin one at a time to see what could be causing an issue.
If you still cannot merge topics with only bbPress activated, try the other possible solutions listed like trying a default theme to see if that fixes your issue.
August 11, 2015 at 6:00 am #165280In reply to: bbp_setup_current_user was called incorrectly
Stephen Edgar
KeymasterFor others bumping into this topic, the codex article is here:
August 10, 2015 at 5:26 pm #165270In reply to: bbp_setup_current_user was called incorrectly
mdw
ParticipantI just found the codex article, I will search for what plugin is causing it
-
AuthorSearch Results