Search Results for 'code'
-
AuthorSearch Results
-
March 2, 2016 at 4:08 am #172394
oelen000
ParticipantHi, I am using bbpress on a website together with the plugin from LCweb called private content. The problem i have is that registered users cannot see the actual post. They only have the possibility to comment on the post. The text of the post itself is not shown. When i disable private content plugin it’s working great. I had support from LCweb and they told me that they double checked their code and from their side everything was ok and I should look for support at the BBpress forum. Anybody any idea?
March 1, 2016 at 3:04 pm #172380In reply to: add a specific class
Robin W
Moderatorcreate a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php
Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/loop-single-forum.php
bbPress will now use this template instead of the original
and you can amend thisamend line 12 to
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class('', $classes[] = 'hello' ); ?>>March 1, 2016 at 6:20 am #172372In reply to: vbulletin 3.x import
Stephen Edgar
KeymasterThe
———————-is typically due to WordPress losing its database connection 🙁If you open up a second tab to your
/wp-adminpage and occasionally refresh that page (30-60mins) that should prevent that from happening again.February 29, 2016 at 3:10 pm #172361Topic: Forums footer is missing
in forum Pluginsjunglejim620
ParticipantHi bbPress,
I added a new page with this shortcode [bbp-forum-index] for the forums but freaky the default site “footer level 1 and level 2 widget” disappeared; however when I click the Topic link go to the Topic page is fine showing both footers?
Can anyone help me how to fix the forum index page to populate the footer?
Please help, Thanks
February 29, 2016 at 1:37 pm #172357In reply to: bbp_new_forum hook
fterra
ParticipantBesides that I just noticed that both
"save_post_{$post->post_type}"and wp_insert_post are fired automaticaly during editing, to keep the forum saved as a draft.
So maybe you will benefit more from bbp_forum_attributes_metabox_save really.
Otherwise you will need some checks to see if it’s not a draft auto-save like in bbPress following code – also note the aforementioned hook being fired at the end:
(/includes/admin/forums.php)/** * Pass the forum attributes for processing * * @since bbPress (r2746) * * @param int $forum_id Forum id * @uses current_user_can() To check if the current user is capable of * editing the forum * @uses bbp_get_forum() To get the forum * @uses bbp_is_forum_closed() To check if the forum is closed * @uses bbp_is_forum_category() To check if the forum is a category * @uses bbp_is_forum_private() To check if the forum is private * @uses bbp_close_forum() To close the forum * @uses bbp_open_forum() To open the forum * @uses bbp_categorize_forum() To make the forum a category * @uses bbp_normalize_forum() To make the forum normal (not category) * @uses bbp_privatize_forum() To mark the forum as private * @uses bbp_publicize_forum() To mark the forum as public * @uses do_action() Calls 'bbp_forum_attributes_metabox_save' with the * forum id * @return int Forum id */ public function attributes_metabox_save( $forum_id ) { if ( $this->bail() ) return $forum_id; // Bail if doing an autosave if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $forum_id; // Bail if not a post request if ( ! bbp_is_post_request() ) return $forum_id; // Nonce check if ( empty( $_POST['bbp_forum_metabox'] ) || !wp_verify_nonce( $_POST['bbp_forum_metabox'], 'bbp_forum_metabox_save' ) ) return $forum_id; // Only save for forum post-types if ( ! bbp_is_forum( $forum_id ) ) return $forum_id; // Bail if current user cannot edit this forum if ( !current_user_can( 'edit_forum', $forum_id ) ) return $forum_id; // Parent ID $parent_id = ( !empty( $_POST['parent_id'] ) && is_numeric( $_POST['parent_id'] ) ) ? (int) $_POST['parent_id'] : 0; // Update the forum meta bidness bbp_update_forum( array( 'forum_id' => $forum_id, 'post_parent' => (int) $parent_id ) ); do_action( 'bbp_forum_attributes_metabox_save', $forum_id ); return $forum_id; }February 29, 2016 at 1:13 pm #172355In reply to: bbp_new_forum hook
fterra
ParticipantIf you use wp_insert_post, remember to check if the post being saved is a forum.
Default forum type value is'forum'.
But you should use bbp_get_forum_post_type() to use its current value in case it has been altered by some filter.
You may also take advantage of the following wordpress dynamic hook:
"save_post_{$post->post_type}"
which you would hook to with something like:
add_action("save_post_" . bbp_get_forum_post_type(), "my_hook");February 29, 2016 at 11:39 am #172350In reply to: best rated forum post display
Pascal Casier
ModeratorWhat exactly are you looking for ? Some plugins for ranking:
https://wordpress.org/plugins/bbpress-votes/
https://bbpress.org/forums/topic/voting-on-user-submitted-posts/
https://wordpress.org/plugins/universal-star-rating/
https://wordpress.org/plugins/rating-widget/
https://wordpress.org/plugins/kk-star-ratings/
https://wordpress.org/plugins/ec-stars-rating/
https://wordpress.org/plugins/wp-postratings/
…I don’t use any of them, but for sure if you don’t want to code, there are enough options.
Pascal.
February 29, 2016 at 11:18 am #172349In reply to: bbp_new_forum hook
fterra
ParticipantYes, @antipole,
after I wrote to you I tried the bbp_forum_attributes_metabox_save hook and it has worked for me.
But I guess it’s also possible to use wp_insert_post hook as suggested by John James Jacoby.
bbp_forum_attributes_metabox_save will most likely fire only in admin page.
On the other hand wp_insert_post will most likely fire both in admin page and front-end. Seems like front-end forum creation requires the use of [bbp-forum-form] shortcode, which I have never tried.February 29, 2016 at 8:42 am #172340Robin W
Moderatorthe issue is not in creating the functionality, but in styling
for instance you get the posts column using
bbp_get_forum_topic_count($forum_id)but need styling to add that to the list of forums, which depends on how your theme does it.
February 29, 2016 at 8:18 am #172338In reply to: Spectate capability
Pascal Casier
ModeratorHi,
You could create a new role based on the spectate. Follow our codex on https://codex.bbpress.org/custom-capabilities/If you want to limit topic creation for a specific forum, you can also have a look if my ‘bbP Toolkit’ plugin can help. It has a ‘protected forum’ possibility to allow only specific roles to create topics on some forums.
Pascal.
February 29, 2016 at 6:47 am #172336siparker
ParticipantOk, so if i can find someone to do the work and get the urls fixed then submit the code into trac it might get integrated into the core by someone in the future?
I understand about the money thing also. I am just trying to think of a way to kickstart the development on the platform again as its on its way to being a really good forum software. it has almost all of the basics covered and some great plugins too. its just those few bits that mean it cant be used by some people. I would love to see bbpress be the defacto choice over phpbb or vbulletin and thought if i could sponsor the development then perhaps it might encourage a valuable dev to get more involved?
February 28, 2016 at 1:38 pm #172319In reply to: Yet another sidebar issue
Robin W
Moderatorok, sorry been tied up elsewhere, and only just got back to looking at this.
I think I can get it working and would suggest you do the following
1. take a copy of page.php and save it into your theme as bbpress.php
so you end up with
wp-content/themes/%mytheme%/bbpress.php where %mytheme% is your currently active theme’s name.
Now edit that file as follows
The theme seems to be looking for a value of the sidebar for the post meta of the page ID. Since I suspect that bbpress is not having that at that point, it can’t look it up.
Now the page.php (which is now bbpress.php!) tries to set this in line 4 using
$sidebar = get_post_meta($id, "qode_show-sidebar", true);and then the page.php (which is now bbpress.php!) later on looks for what value between 1 and 4 that is set to, which would determine what if any sidebars are shown.
therefore in bbpress.php try changing line 4 from
$sidebar = 1
save the file and see what happens
then try
$sidebar = 2
$sidebar = 3
$sidebar = 4each should change what sidebar appears and where, so you should be able to get one working !
Do come back if anything isn’t clear, or if you need further help, or just to tell us that we’re wonderful (or rubbish!)
February 28, 2016 at 11:55 am #172316Topic: add a specific class
in forum Themesneecride
ParticipantHello,
I look for how to add a class css on loop-single-forum.php line 12
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>on default
bbp_forum_class();sorry I’m french ! I do not understand English too
February 28, 2016 at 10:22 am #172315Pascal Casier
ModeratorHi siparker,
I won’t start about your first line about the ‘money’, but for adding new functionalities of finding code for existing tickets, https://bbpress.trac.wordpress.org is one of the places that can be used for that. If a ticket is there and there is code attached, it makes a fair chance to be added into future versions.
Pascal.
February 28, 2016 at 10:16 am #172314In reply to: Changing Author ID on submit
Pascal Casier
ModeratorHi,
If this is the standard wordpress function (never used this function before), then you cannot have a ‘post_author_id’, should be ‘user_ID’ and the ‘post_author’ should be ‘comment_author’ …
See https://codex.wordpress.org/Plugin_API/Filter_Reference/preprocess_commentBut this is for comments, not for replies …
Pascal.
February 28, 2016 at 9:22 am #172313Robkk
ModeratorWell you cannot modify the functions in the template.php by copying over the file like the file in the bbPress default theme, which is in
wp-content\plugins\bbpress\templates\defaultTo customize the code in template.php you would have to filter the code. Paste any new functions you create with the filters from the template.php file into a functions.php file in your child theme or in a custom functionality plugin.
https://codex.wordpress.org/Function_Reference/add_filter
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-5/
February 28, 2016 at 8:10 am #172311In reply to: Importing from phpbb3 to bbpress
abiliocaetano
ParticipantI used cms2cms to migrate one of my forums.
in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.
if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.
to do this you just have to:
Open/edit:
/styles/prosilver/template/overall_header.html
(or the template you are using)search for:
// Send vars to template
$template->assign_vars(array(
‘FORUM_ID’ => $forum_id,and just above this lines add this piece of code:
##################################
$titleac = trim($topic_data[‘topic_title’]);
$relativeurl = str_replace(‘ ‘,’-‘,$titleac);
$relativeurl = strtolower($relativeurl);
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
#####################################I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/
regards,
February 27, 2016 at 7:11 pm #172307In reply to: phpbb to bbpress converter and best practice?
abiliocaetano
ParticipantHi all,
in addition to what everyone wrote, I would like to add something very important: keep the SEO juice.
if you want to keep all your SERP positions in google you must 301 redirect every topic from your old phpbb forum to the new bbpress topics.
to do this you just have to:
Open/edit:
/styles/prosilver/template/overall_header.html
(or the template you are using)search for:
// Send vars to template
$template->assign_vars(array(
‘FORUM_ID’ => $forum_id,and just above this lines add this piece of code:
##################################
$titleac = trim($topic_data[‘topic_title’]);
$relativeurl = str_replace(‘ ‘,’-‘,$titulo);
$relativeurl = strtolower($relativeurl);
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.YOURDOMAIN.com/forums/topic/”.$relativeurl.”/”);
#####################################I have little more detail of the bbpress permalink, etc configurations in this article: http://abiliocaetano.com/seo-migrate-phpbb-to-bbpress/
regards,
February 27, 2016 at 6:40 am #172285In reply to: Anyway to auto-populate a forum structure?
Stephen Edgar
KeymasterYou can also use the built in export WordPress WXR (which is just an XML file), and WordPress Importer plugin.
February 26, 2016 at 9:30 pm #172276In reply to: Yet another sidebar issue
Robkk
ModeratorYour theme looks to be using post meta to display the sidebars, so there might be custom fields to configure which sidebar to display which will most likely be on the default WordPress post types (page and post) when you create/edit them. These options may not be on the bbPress post type creation/editing screens in the WordPress backend.
I see there is a ton of code that might not even be usable because bbPress post types may not have these custom field options to configure things like the slider, background color, and other options I can see in the code.
I do see from the classes that this uses a responsive grid layout so maybe focus and keep this class as it is a two column layout, one for the content and one for the sidebar.
two_columns_66_33 grid2 clearfixYou may need to contact your theme author for further help on this.
February 26, 2016 at 8:26 pm #172274In reply to: Yet another sidebar issue
dgalfano
ParticipantSure! Thanks for looking!
https://gist.github.com/anonymous/34d96600379e037b60ae
(mod note: when people search the forums, they hate scrolling through giant pieces of code. Small snippets use code tags, large files use external services to host the code.)
February 26, 2016 at 8:06 pm #172272In reply to: BBPress not working with Optimizepress Theme
Robin W
ModeratorAs far as I can see the solution is with that code snippet – it fits the problem description very well
can you amend line
if ($forumPage->post_type == 'forum'){to
if ($forumPage->post_type == bbp_get_forum_post_type() ){and try it again
February 26, 2016 at 7:30 pm #172265In reply to: best rated forum post display
Robkk
ModeratorYou can install a plugin like WP Ulike and use that for rating posts.
Then you can create a custom bbPress view using this function. Add this php code snippet into your child themes functions.php file or in a plugin that can hold custom code snippets like the functionality plugin.
function rkk_register_custom_view() { bbp_register_view( 'top-rated-topics', __( 'Top Rated Topics' ), array( 'meta_key' => '_topicliked', 'orderby' => 'meta_value_num' , 'post_status' => 'publish' ), false ); } add_action( 'bbp_register_views', 'rkk_register_custom_view' );Then paste this shortcode in a page called Top Rated Topics.
[bbp-single-view id='top-rated-topics']February 26, 2016 at 7:01 pm #172263In reply to: Yet another sidebar issue
Robin W
Moderatorok, can you paste the page.php file here please AND make sure you enclose it all as code !
February 26, 2016 at 5:52 pm #172260In reply to: BBPress not working with Optimizepress Theme
Robin W
Moderatorok, just eliminating as sometimes local (pc) installations can have url issues.
Can you tell us in
Dashboard>settings>forums
what the forums root is set to and also do yiu bave a wordpress page with
[bbp-forum-index]on it? and if what is the url of that page? -
AuthorSearch Results