Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,076 through 5,100 (of 32,481 total)
  • Author
    Search Results
  • #185182
    sourfew
    Participant

    95000 topics
    750000 replies
    25000 users

    When 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.2

    locutus1
    Participant

    1) 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 forum3

    Each 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.

    #185172
    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.3

    #185168
    PinkishHue
    Participant

    Thanks 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.

    #185166
    Stagger Lee
    Participant

    Here 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');
    #185162
    kariellen35
    Participant

    By 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.

    #185160
    kariellen35
    Participant

    Thank 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!

    #185159
    andrew55
    Participant

    I 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.

    #185158
    andrew55
    Participant

    I 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.

    #185155
    andrew55
    Participant

    I’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.

    #185150
    PinkishHue
    Participant

    See this info –

    bbp_topic_author_link

    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

    PinkishHue
    Participant

    1) 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

    #185135
    Stagger Lee
    Participant

    Here 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');
    #185134
    Stagger Lee
    Participant

    In 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.

    #185130
    kariellen35
    Participant

    Stagger 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?

    #185128
    TKServer
    Participant

    This 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?

    #185123
    Chad R. Schulz
    Participant

    They 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

    #185111

    In reply to: Multisite

    Robin W
    Moderator

    sounds like a whole project, and way beyond a few lines of code.

    #185086
    PinkishHue
    Participant

    Thanks @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.

    #185078
    Stagger Lee
    Participant

    My code (comment) is for backend, metaboxes. Or so I believe.

    #185071
    Stagger Lee
    Participant

    Seems 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'); ?>

    #185055

    In reply to: Change email sender

    Brandon Allen
    Participant

    @karilistermanyahoocom

    The 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 the wp_mail_from filter.

    #185043

    Do 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.php is 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.

    #185036

    Hi 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_private and bbp_forum_enforce_hidden, and write your own equivalent functions to use bbp_redirect() rather than bbp_set_404().

    #184998
    kariellen35
    Participant

    I 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

Viewing 25 results - 5,076 through 5,100 (of 32,481 total)
Skip to toolbar