Search Results for 'code'
-
AuthorSearch Results
-
June 27, 2017 at 1:48 am #185182
In reply to: Recalculate the position of each reply
sourfew
Participant95000 topics
750000 replies
25000 usersWhen I run the script several times I think all posts are recalculated but not really sure.
I have som other issues as well.
Imported users do not get a site role or forum role.
Users post count is zero.
Users do not show up in the memberslist (front end) and are not searchable. But I can access user profiles and the number of topics, replies ans mentions seems to be ok.Post quotes are not always converted the right way and sometimes even bbcode are parsed resulting in very small text.
I have tried the import on both an newer VPS with php 7 and a older one with php 5.4.
Vbulletin version 4.2.2June 26, 2017 at 7:48 pm #185176In reply to: How do I remove the “topic type” and “topic status”
locutus1
Participant1) Good to know. That solves that.
2) This worked but only partly. My terminology may be wrong. I have a menu item which is a category. If you click it, it lists 4 main forums each of which is also a category. Under each main forum are listed its sub-forums. The code you gave me made the main forums bigger – 18 pt is good – but the sub-forums are a little small. If you click a sub-forum then it becomes a main forum and it’s 18 pt. So the code affects main forums only. I don’t know if this is clear so look at this. This is what I see if I click the menu item.
Main forum1
(indented) sub-forum1, sub-forum2, sub-forum3, sub-forum4
Main forum2
Main forum3Each main forum is 18 pt. I understand the sub-forums should be smaller than the main forums but they’re a little too small. Can that be adjusted? It’s OK if it can’t be.
3) I’m still working on this one.
Thanks a lot. I have other questions but I’ll make a new post.
June 26, 2017 at 1:36 pm #185172In reply to: List subscribers of a forum
PinkishHue
Participant@casiepa Hi again, I don’t see an option to send you a private message but wanted to let you know I installed the plugin (thanks), but I’ve noticed it has altered the display of my subforums (removed the topic and voice counts, and made the font larger), even though I have not checked that option in the plugin settings.
Here’s the info from the plugin if it’s any help.
WP version 4.8
Theme Make (child theme) 1.1.0
PHP version 5.6.30
bbPress version 2.5.12-6148
site url (removed, on localhost XAMPP)
Active Plugins Name and Version
– p1 bbP Toolkit 1.0.10
– p2 bbP shortcodes 2.8
– p3 bbPress 2.5.12
– p4 BuddyPress 2.8.2
– p5 User Switching 1.0.9
– p6 WordPress Social Login 2.3.3June 26, 2017 at 10:26 am #185168In reply to: List subscribers of a forum
PinkishHue
ParticipantThanks for all the info above. I’ve added the ‘bbPress-Topic-Subscribers’ plugin and that works great.
To try and do the same for forum subscriptions I’ve copied the files and changed all instances of ‘topic’ to ‘forum’, and it’s listing the users fine, but when you click the unsubscribe link nothing happens.
Looking at the code, I think it must be something in this section that is not right:
$forum_id = bbp_get_forum_id(); if ( $forum_id && current_user_can( 'moderate' ) ){ $subscribers = bbp_get_forum_subscribers( $forum_id ); if ( $subscribers ){ echo '<table style="width: 100%">'; foreach ( $subscribers as $subscriber ){ $subscriber = get_user_by( 'id', $subscriber ); echo '<tr>'; // avatar echo get_avatar( $subscriber->ID, 45 ); echo ' '; //username echo $subscriber->user_login; echo ' '; // remove button echo bbp_get_forum_subscription_link( array( 'user_id' => $subscriber->ID ) );Specifically maybe the ‘bbp_get_forum_subscription_link’ area? Does anyone have any suggestions on why this wouldn’t work for forums in the same way as topics? Many thanks for any help you can give.
June 26, 2017 at 5:17 am #185166In reply to: Add Featured Image to New Topics in Frontend WYSWYG
Stagger Lee
ParticipantHere it is.
You hijacked topic a bit.
I still dont understand why you use bbPress as Blog/Posts tool when WordPress is made for this. Almost as you are not so good on theming, and looking for shortcuts.– Make own image size
– Change “slider” to name of own image size.
– There is a class to center image, give it maybe some gray background for smaller featured mages. fix margins and paddings, etc…function ntwb_bbpress_random_single_topic() { global $post; if ( has_post_thumbnail($post->ID) ) echo get_the_post_thumbnail($post->ID,'slider',array('class' => 'forum-topic-featured')); } // Hook into action add_action('bbp_template_before_lead_topic','ntwb_bbpress_random_single_topic');June 26, 2017 at 3:48 am #185162In reply to: Add Featured Image to New Topics in Frontend WYSWYG
kariellen35
ParticipantBy the way… what I did end up doing which has been a real good work-around, is use the bbp style pack single forum short code to show my forums as pages. This has been great, because it allows for much more modification! So I just added my featured image to each forum’s page.
June 26, 2017 at 3:20 am #185160In reply to: Add Featured Image to New Topics in Frontend WYSWYG
kariellen35
ParticipantThank you so much for your help @stagger-lee! This code did work, however, it seems to only be for forum lists, which is an option already included in the bbp style pack plugin. I am trying to get the featured image to show up on the forum’s page itself (like what they do in buddypress groups) I don’t have forum lists accessible on my site so it’s not relevant to what I am doing. Thanks again for taking the time to post this tho!
June 25, 2017 at 10:07 pm #185159In reply to: show only if it applies to reply author
andrew55
ParticipantI don’t mean to ramble, but I think the solution will be something such as:
if (Am_Lite::getInstance()->haveSubscriptions(364) && ($reply_user_id($topic_id) ))I just add bbpress statement to my already existing “if” statement using an “And” operator.
I’m just getting caught up on the bbpress part.
Any suggestions on what the bbpress code would be to “just show for the author of this reply?”
Thanks for any help.
June 25, 2017 at 8:36 pm #185158In reply to: show only if it applies to reply author
andrew55
ParticipantI seems like this should work, but it doesn’t:
<?php if (bbp_get_reply_author_id($reply_id)) { ?> my other code goes here <?php } ?>It seems like it should wrap my code with a statement of “show only for the author of this reply” but it’s not working like this.
Any suggestions on what the code would be to “just show for the author of this reply?”
Thanks for any help.
June 25, 2017 at 3:54 pm #185155Topic: show only if it applies to reply author
in forum Troubleshootingandrew55
ParticipantI’ve got a simple “php if snippet” I’m trying to get into loop-single-reply.php.
Here is an example of my snippet (used for a seperate membership script):
<?php require_once '/members/library/Am/Lite.php'; $user = Am_Lite::getInstance()->getUser(); ?> <?php if (Am_Lite::getInstance()->haveSubscriptions(364)) { ?> <span class='custom-user-donation-badge'>I've Donated!</span> <?php } else { // do the other thing ?> <?php } ?>I need the code snippet to show only in the profile area of the reply author, if it applies to them.
In other words: “show this if it applies and only show if it applies to this specific reply author.”
I’ve used these before for something similar:
$reply_user_id = bbp_get_reply_author_id(); $reply_user = new WP_User( $reply_user_id )I’m still leaning php and bbpress. Any suggestions on how I can wrap my code snippet with these bbpress statements? This way, my code snippet will only apply if it applies to the specific author.
Thanks for any suggestions.
June 25, 2017 at 6:02 am #185150In reply to: Avatar link to user profile newspaper
PinkishHue
ParticipantSee this info –
To display just the avatar linked to the member profile you would use:
<?php bbp_topic_author_link( array( 'sep' => '<br />', 'show_role' => false, 'type' => 'avatar' ) ); ?>or for reply author’s:
<?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => false, 'type' => 'avatar' ) ); ?>Hope that helps
June 25, 2017 at 5:55 am #185149In reply to: How do I remove the “topic type” and “topic status”
PinkishHue
Participant1) Topic Type and Topic Status are only viewable to you/forum admins (aka keymasters), regular users do not see them
2) Wherever you add custom CSS (probably ‘Appearance > Customize’ in the admin menu’s), add this:
.bbp-forum-title { font-size: 18px; /* make this size whatever you prefer */ }3) This functionality isn’t built in to bbpress but you could add another plugin to make this happen. Here is an old topic that might provide some suggestions for you: https://bbpress.org/forums/topic/rating-and-sorting-plugin/
Hope that helps
June 24, 2017 at 3:08 am #185135In reply to: Add Featured Image to New Topics in Frontend WYSWYG
Stagger Lee
ParticipantHere is code for forum index, forum featured images, not topics:
/* Plugin Name: bbPress - Forum Icons Plugin URI: https://gist.github.com/ntwb/8277457 Description: bbPress - bbPress - Forum Icons Version: 0.1 Author: Stephen Edgar - Netweb Author URI: http://netweb.com.au */ // Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/ add_post_type_support('forum', array('thumbnail')); function ks_forum_icons() { if ( 'forum' == get_post_type() ) { global $post; if ( has_post_thumbnail($post->ID) ) echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon')); } } add_action('bbp_theme_before_forum_title','ks_forum_icons');June 24, 2017 at 3:04 am #185134In reply to: Add Featured Image to New Topics in Frontend WYSWYG
Stagger Lee
ParticipantIn theme functions.php or custom field with functions.php.
It gives featured image metaboxes in backend. Then you display featured image on front as any other post type featured. See how your theme is doing this and copy/paste whole code block.As you need only fetaured image allowed for admins and moderators you can use this:
add_post_type_support('topic', array('thumbnail')); add_post_type_support('forum', array('thumbnail')); /* Plugin Name: bbPress - Forum Icons Plugin URI: https://gist.github.com/ntwb/8277457 Description: bbPress - bbPress - Forum Icons Version: 0.1 Author: Stephen Edgar - Netweb Author URI: http://netweb.com.au */ // Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/ add_post_type_support('forum', array('thumbnail')); function ks_forum_icons() { if ( 'topic' == get_post_type() ) { global $post; if ( has_post_thumbnail($post->ID) ) echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon')); } } add_action('bbp_theme_before_topic_title','ks_forum_icons');I will see later what is the best way to allow all Users to set topic featured images.
But dont see much point in it. Thousands of forum topics, thousands of images on server x all WP image sizes. Big mess.June 24, 2017 at 12:28 am #185130In reply to: Add Featured Image to New Topics in Frontend WYSWYG
kariellen35
ParticipantStagger Lee, where did you add this code? Does it only bring up the image in forum or topic lists or does it appear on the forum page?
June 23, 2017 at 9:22 pm #185128In reply to: Is there an API for bbPress
TKServer
ParticipantThis was missing from bbp-api.php:
register_rest_route( 'bbp-api/v1', '/users/(?P<id>\d+)', array( 'methods' => 'GET', 'callback' => 'bbp_api_users_one', ) );and users.php was also missing.
I’m guessing that was intentional?
June 23, 2017 at 12:22 pm #185123In reply to: Removing/Editing “Oh Bother” text
Chad R. Schulz
ParticipantThey are php templates inside bbPress. The default location in bbPress is
/plugins/bbpress/templates/default/bbpress/look for the ones labelled feedback-no-*****.php and alter/edit the ones you want changed and place them into your theme’s bbpress folder.Easy peasy.
Chad
Robin W
Moderatorsounds like a whole project, and way beyond a few lines of code.
June 21, 2017 at 6:44 am #185086In reply to: Posting form isn’t responsive
PinkishHue
ParticipantThanks @robin-w, that works on the textarea. Still the topic title input and the fieldset above where it says ‘Create New Topic’ are overflowing out of the viewable area of the screen. Will post back with code if I figure out how to fix it.
June 20, 2017 at 9:40 am #185078In reply to: Add Featured Image to New Topics in Frontend WYSWYG
Stagger Lee
ParticipantMy code (comment) is for backend, metaboxes. Or so I believe.
June 20, 2017 at 3:42 am #185071In reply to: Add Featured Image to New Topics in Frontend WYSWYG
Stagger Lee
ParticipantSeems to still work.
add_post_type_support('topic', array('thumbnail'));add_post_type_support('forum', array('thumbnail'));<?php echo get_the_post_thumbnail($post_id, 'full'); ?>June 19, 2017 at 12:55 pm #185055In reply to: Change email sender
Brandon Allen
ParticipantThe default from email address for bbPress emails is noreply@(url).com. If you’re seeing wordpress@(url).com, it’s either not an email sent by bbPress, or you’re using a plugin that is changing the from address for all emails sent.
To change the bbPress email, you would use the filter
bbp_get_do_not_reply_address. For most (if not all) emails sent by your WordPress install, you’d use thewp_mail_fromfilter.June 19, 2017 at 3:50 am #185043In reply to: 404 page redirect for non logged in users
John James Jacoby
KeymasterDo you know where I can modify the redirect page so that it only shows the 404 page not found message and not a list of my site’s pages
It usually depends on the theme, but
404.phpis a good start. It probably has some function or functions that put out a sitemap, but that’s just a guess, and every sitemap type plugin is different.In addition to bbPress, there are legitimate Membership plugins that are better equipped to handle things like private pages or members-only sections of websites. If you haven’t used any, Restrict Content Pro and Paid Memberships Pro are good ones.
June 19, 2017 at 3:27 am #185036In reply to: 404 page redirect for non logged in users
John James Jacoby
KeymasterHi Kari,
With both the weekend and a major community summit, the past few days have been pretty slow around here.
This is a hard question to answer, because it depends on your forums and how you have them setup as private.
There are also security implications to consider. For example, if your forums are only for logged in users, redirecting to a login page vs. showing a 404 hints to hackers that something exists vs. it not existing, which incentivizes the hunt.
I usually try to recommend that forums use the login widgets, or otherwise have some always-available login form to use instead. That way private forums can still 404 for non-logged-in users, without the redirect hint.
If you do want to redirect anyways, you’ll need a custom plugin to modify the way bbPress works.
Unhook
bbp_forum_enforce_privateandbbp_forum_enforce_hidden, and write your own equivalent functions to usebbp_redirect()rather thanbbp_set_404().June 17, 2017 at 12:43 am #184998Topic: Search isn’t working
in forum Troubleshootingkariellen35
ParticipantI can’t find a search box activation option or short code for a search box. I have activated my theme’s own search function and it doesn’t pick up on words from within the forums pages. Do you have a forum search option?
Thank you for your time.
Take care,
Kari -
AuthorSearch Results