Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,076 through 9,100 (of 32,511 total)
  • Author
    Search Results
  • #160512
    andrew55
    Participant

    Thanks – this is a great start. Although, my skill level just isn’t there yet with writing functions for WordPress. Here is the php snippet I have that will create the value I need to have displayed in profile area of topics and replies:

    <?php
    require_once '/home/site/public_html/amember/library/Am/Lite.php';
    if (Am_Lite::getInstance()->haveSubscriptions(2))
    {
    ?>
    <p>custom text 1</p>
    <?php
    }
    else {
    if (Am_Lite::getInstance()->isLoggedIn())
    {
    ?>
    <p>custom text 2</p>
    <?php
    }
    else {
    ?>
    <p>custom text 3</p>
    <?php
    }
    }
    ?>

    If anyone is willing to help, that would be great.

    #160494
    Jake Hall
    Participant

    Hi All,

    I am working on making bbPress work with my current theme, and, previously it was using page.php properties to draw the forum etc. I fixed that by adding a bbpress file to the theme root, however, I am not getting any posts whatsoever appear when looking in topics.

    Does bbPress use the normal the_content(); functions that wordpress use, or are their different functions I am simply missing here?

    The Codex is really bad and doesn’t seem to explain any of this, but I’d be super happy if someone could prove me wrong on that.

    Thanks,

    Jake

    Robkk
    Moderator

    you can tag anybody that is not in the topic manually.

    just type @username

    im talking about the little dropdown that suggests people to @mentino that is shown in this image that will show only people in the topic.

    here is the code any where i got it from

    Add the New BuddyPress Mentions Interface to bbPress Forum Replies

    BBC
    Participant

    Hi Rob

    I have an extra question
    If I read your post for the second time
    It looks if I can only tag people who are already in the threat
    Is that correct?
    Or can I (with your code) tag everyone who is one the forum?
    That is what I am looking for.

    Hope to hear from you.
    Thank Conrad

    #160483
    WutHirsch
    Participant

    Not completely.
    But the mythemeshop support helped me a lot.

    The correct code is:

    .bbpress .sidebar.c-4-12 {
      display: none;
    }
    .bbpress .article {
      width: 100%;
    }

    Also i was able to change the breadcrumb / the forum base title into another word.
    Simply add this code into: bbpress.php:

    
    // bbPress, change Forum title in bbpress 
     
    function isa_custom_forum_title() {
     
         return 'Enter your title';
    }
     
    add_filter('bbp_get_forum_archive_title', 'isa_custom_forum_title');
    #160482
    nirgalo
    Participant

    Hi, bbpress 2.5.6, when I use the [bbp-topic-tags] shortcode, it displays a certain number of tags, but not all the tags assigned to topics. Is this normal? Is the code limiting the output to some max count? Can this be changed? Thanks.

    #160481

    In reply to: Request: Voting

    Lars Henriksen
    Participant

    Thank you very much Chad for taking your time to explain this.

    It works – almost like I wanted.

    The only thing that bugs me, is that you can’t vote for a single reply – it is by topic.

    If you can only vote for an entire topic/thread, it would be more logical to place the buttons next to the subscribe/favorite links in the top.

    I tried to add the code to the ‘content-single-topic-lead.php’ but to no avail.

    You can see it here.

    Anyways, I’m happy with my set up now, thanks again.

    #160473

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    Sorry, I just noticed a typo in my post. The php file you need to alter is loop-single-reply.php and it’s going to be in your plugins/bbpress/templates/default/bbpress folder. But it may also be in your theme’s folder if your theme has custom bbpress template files. If your theme has a bbpress folder in it themes/{your theme}/bbpress than that’s the file your need to make your adjustments to.

    Make your simple addition: put <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?> inbetween <?php do_action( 'bbp_theme_before_reply_content' ); ?> and <?php do_action( 'bbp_theme_after_reply_content' ); ?> either before the content <?php bbp_reply_content(); ?> or after it. It all depends on what you prefer.

    And then put it in your theme’s child folder: themes/{child-theme}/bbpress/loop-single-reply.php.

    If you aren’t using a child theme (highly recommended, BTW) you’ll will have to modify this file directly and replace it in the default folder. And, every time you update your theme and/or bbpress you may need to recreate this modification.

    And for css modifications you’ll have to insert the appropriate css mods (use Google Chrome to identify the css selectors and properties/values) into a custom.css file/plugin–I either use the one in Jetpack or in a stand alone plugin. You can also add the css modifications into your child theme’s .css file.

    –Refer to the plugin author’s support page on wordpress.org. There are a lot of valuable css tips and suggestions. Also, the author had proven to be very helpful in getting his plugin up and running for most people.

    Oh, and my website is currently in the development stage and won’t be made public for awhile. I’m building it at my leisure, “The joy of hobby sites.”

    Hopefully this clears up a few things. It’s kinda hard to describe everything in detail. I just end up muddling through until it looks/acts OK. As a suggestion make sure you keep a default/unmodded .php file handy to switch back and forth with until everything works. Wouldn’t want to have to bother reupping a new file from a theme/bbpress .zip file every time you screw something up.

    Good luck, Chad

    #160470
    Stephen Edgar
    Keymaster

    Hmmm…. I’m assuming in that case then you have no other parts (or major parts at least) missing from the DB schema you posted in the original post? e.g. No topic_title table listing the topics separately.

    If that is the case you’d now want to ignore those mappings I posted, rather remap them to the the topic and reply sections instead of the forums section.

    This is now where we add some limiting SQL expressions to separate your topics from replies.

    In the Example.php file at the end of the topics section you’ll see:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'replies_table',
    	'from_fieldname'  => 'the_topic_id',
    	'join_tablename'  => 'topics_table',
    	'join_type'       => 'INNER',
    	'join_expression' => 'USING replies_table.the_topic_id = topics_table.the_topic_id',
    	'from_expression' => 'WHERE forums_table.the_topic_id = 0',
    	'to_type'         => 'topic'
    );
    

    We’ll modify that to the following:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'forum_table',
    	'from_expression' => 'WHERE forums_table.Forum_Parent = 0',
    	'to_type'         => 'topic'
    );
    

    Similarly at the end of the replies section, we change that join expression to:

    
    // Setup any table joins needed for the topic section
    $this->field_map[] = array(
    	'from_tablename'  => 'forum_table',
    	'from_expression' => 'WHERE forums_table.Forum_Parent != 0',
    	'to_type'         => 'reply'
    );
    

    Now assuming I’ve got the logic correct in understanding your Forum_Parent/Forum_Ancestor what equals 0 and what does not equal 0 then we should be good to go 🙂

    So the topics join expression is limiting the queries for your ‘thread starter’ topics, then in the reply section expression we ignore those previously ignored topics already imported and are assuming the remaining entries in the table are replies to those topics. The Forum_Ancestor of each reply should then point to the “parent topic ID’ mapping.

    I think that’s it, one thing you’ll notice is that we also are not actually creating any forums to import the topics into, all the topics will import without being allocated to a forum, this can be bulk updated later, actually we can set a default forum for topics and relies, I’ll get back to you on that bit of code that I can’t remember of the top of my head right this second 😉

    Robkk
    Moderator

    Is this the same code that bbpress is using on this forum?

    i dont think so, i think its something else, maybe just BuddyPress but i think they took out the notifications for each @mention.

    if you use what i am talking about you type @ then after that a bunch of users names show up that are in the topic for you to put their name in.

    You are also talking about a plugin functionality

    i mean a plugin that you can paste code snippets llke the one i put above into ,

    https://wordpress.org/plugins/functionality/

    Is there also a plugin who can do this?

    For @mention notifications , BuddyPress. For placing code snippets you can use the plugin i mentioned above.

    BBC
    Participant

    @robkk
    Thank for reaction.
    Is this the same code that bbpress is using on this forum?
    You are also talking about a plugin functionality
    Is there also a plugin who can do this?
    If not then I will ask my web builder to implement your code.

    Again thanx

    Greetings
    Conrad

    @bbc

    #160450

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    I’m trying Thumbs Rating. It doesn’t tie into any user meta, so you can’t restrict the voting to only registered/logged-in users. However, it works very well and very fast. It only adds post meta so it shouldn’t noticeably slow-down your site even with thousands of topics/replies.

    After activation, per the plugin developers instructions I put the following code into my loop-single-relay.php:
    <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>
    goes somewhere between <div class="bbp-reply-content"> and </div>
    –this is theme specific and has to be modified based on your needs. I found that placing the vote before or after and not inside the content works best as the “quote” function in the forum(s) gets screwed up with the added voting content.

    That means before/after the <?php do_action( 'bbp_theme_before/after_reply_content' ); ?>

    Of course, as a lightweight plugin some serious css work is required. And it would be best to place this modified .php file into a bbpress child theme folder to ensure it continues to work after updates.

    Good luck, Chad

    #160434
    Chad R. Schulz
    Participant

    I’m building a discussion board site that won’t use the standard bbpress forum interface. Forums will be embedded in individual post/pages with shortcodes. And all forum-type URLs will redirect to the appropriate post/page.

    So no one will have access to the normal forum structure/hierarchy. Will I still need to create categories/sub-categories/forums for the individual forums?

    This site may eventually have hundreds of forums and I’m looking to provide the best possible performance.

    Any help welcome, Thanks.
    Chad

    #160422
    jaydd
    Participant

    Hello!
    I have a forum being diplayed with forum index shortcode on a wp page. I would like to ask if there is a way to display the title of the parent of the sub-forum or the topic on the sub-forum’s or topic’s page, so always the titles of parents that one above the sub-forum or topic in the hierarchy.

    So the the point of all this would be to let the user know which forum he’s in.
    Thanks,
    Daniel

    #160413
    Robkk
    Moderator
    #160407
    tummybos
    Participant

    Thanks very much @robkk. The link on wp user query is a great tool to solve my problem.
    Concerning the use of BuddyPress, i think the link will be a problem in the sense that the links to the profiles that will be displayed will not link to the users forum profile. I want the links to go to user’s bbPress profile page, not the default wordpress user page nor the buddypress profile.
    So I have decided to go by the Wp user query way, but please how am I going to create the php code. Am i supposed to wrote it in a page? or where should I put the code and how will i create the page?
    Thanks.

    #160405
    Robkk
    Moderator

    @screenwavemedia

    create a copy of page.php rename it to bbpress.php and put a conditional tag into the code.

    i think use bbp_is_search()

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    bbPress Conditional Tags

    Robkk
    Moderator

    @mentions is not part of bbPress yet.

    but for now you can use the @mentions feature from BuddyPress and use on forums with this code.

    copy this into your child themes functions.php or use a functionality plugin.

    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
     
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );

    and i think you would get an email notification from BuddyPress anytime you get @mentioned

    for multiple users you can just separate it with a space.

    #160389
    Robkk
    Moderator

    There is a way using the wp user query

    https://codex.wordpress.org/Class_Reference/WP_User_Query

    plugins like BuddyPress have this type of feature too.

    bbPress does not have a feature/shortcode like this, but if you use BuddyPress , bbPress is compatible with it.

    #160384
    Lisa
    Participant

    Thank you, Stephen, for taking the time to create a mapping graphic. Much appreciated!

    One question: In my Forum code, the Forum_Parent, which is “0” (zero) identifies it as a thread starter, and because the Forum_Ancestor is not “0” (zero), lists it as a reply, underneath the parent, and multiples are ordered by date DESC. How does bbPress handle this? If I understand the methodology, I’ll do better at the mapping. Do I simply use the Forum_Parent for ALL?

    Hope I am clear in my question…

    Lisa

    #160381
    tummybos
    Participant

    I have a bbPress driven forum on http://ictgiants.com/questions/category/all and I want to create a page that will display the registered users on my website similar to http://stackoverflow.com/users.

    Please if there is a plugin or shortcode that does this, that is what I need
    Any idea and links will be appreciated.
    Thanks in advance

    #160377
    mvasicm
    Participant

    Hi there,
    I have bbp-register shortcode, but I need to implement next step in the registration. Im using Paid Membership Pro to make membership levels. For now, I have only registration into bbpress, but the user is not redirected on the page where he can choose his membership level…Every new member is registered without any membership.

    Is it possible to add this feature into registration process?

    Thanks!!

    #160372
    Robin W
    Moderator

    ok, undo that previous change by deleting that file, it was rubbish !

    Then in your function file add

    function default_reply_subscribed() {
    
    		// Get _POST data  IE is this a first post of a topic?
    		if ( bbp_is_post_request() && isset( $_POST['bbp_topic_subscription'] ) ) {
    			$topic_subscribed = (bool) $_POST['bbp_topic_subscription'];
    
    		// Get edit data  IE either the author or someone else is editing a topic or reply
    		} elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) {
    
    			// Get current posts author
    			$post_author = bbp_get_global_post_field( 'post_author', 'raw' );
    
    			// Post author is not the current user EG a moderator is altering this. In this case we'll leave the default to blank, 
    			//as much of the time mods are correcting or moderating, their not interested in the topic itself !
    			if ( bbp_get_current_user_id() !== $post_author ) {
    				$topic_subscribed = bbp_is_user_subscribed_to_topic( $post_author );
    
    			// Post author is the current user  IE you're editing your own post, so default should be to see any replies
    			} else {
    				$topic_subscribed = true ;
    				//the next line is what it used to say instead of true
    				//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    			}
    
    		// Get current status
    		} elseif ( bbp_is_single_topic() ) {
    			//the user is writing a new reply ?
    			$topic_subscribed = true ;
    			//the next line is what it used to say instead of true
    			//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    
    		// No data
    		} else {
    			$topic_subscribed = true;
    			//used to say false !
    		}
    
    		// Get checked output
    		$checked = checked( $topic_subscribed, true, false );
    
    		return apply_filters( 'default_reply_subscribed', $checked, $topic_subscribed );
    	}
    	
    add_filter ('bbp_get_form_topic_subscribed', 'default_reply_subscribed') ;
    
    function default_log_edit_false() {
    
    		// Get _POST data
    		if ( bbp_is_post_request() && isset( $_POST['bbp_log_reply_edit'] ) ) {
    			$reply_revision = $_POST['bbp_log_reply_edit'];
    
    		// No data
    		} else {
    			$reply_revision = 0;
    		}
    
    		return apply_filters( 'default_log_edit_false', checked( $reply_revision, true, false ) );
    	}
    
    add_filter ('bbp_get_form_reply_log_edit', 'default_log_edit_false' ) ;

    Functions files and child themes – explained !

    that should do both topic edit and reply subscribed.

    #160368
    WutHirsch
    Participant

    O.K. Guys, i find the problem by my own.
    Typing Error, the right code is:

    #bbpress-forums, .article, div#content_box.sidebar_layout {
    	width: 100%;
    }

    But now my Start Page got a full width too, again.
    Hmm, ok so i have to try to fix it again.
    It would be easier if i would find the Page id from the forum root.

    But i dont know, where can i find it.
    Normaly i can see the page id in the urls.
    Its not possible here.

    #160366
    WutHirsch
    Participant

    Hello everyone,

    i am very new to CSS & HTMl, i tried to solve my problem by my own, but i didn’t get it.
    Maybe someone has a idea how i can fix my new bbpressforum.

    Only half of the site is used by BBpress. BBpress should use all the remaining free space.

    Thats why i tried yet.
    The widget area dissapeard and bbpress should fill out the empty space.
    But yeah, how you can see its not working. (http://www.forest-game.de)

    My Code:

    #bbpress-forums .article, div#content_box.sidebar_layout {
    	width: 100%;
    }
    #bbpress-forums .article, .sidebar.c-4-12 {
    	display: none;
    }

    Edit:, oh i did something wrong. The widgets areas on the other sites dissapeared too ^-^

    Kindly regards

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