Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 13,126 through 13,150 (of 32,521 total)
  • Author
    Search Results
  • #140339

    In reply to: List user post total

    ronthai
    Participant

    Nope, that does not seem to be working.
    I tried several different ways, but all just output the same.

    I got to this code, but still outputs the Totals for guests without a value/number:

    <?php if ( bbp_is_anonymous() ) {
    		echo "Guest Post"; }
    		else {
    		$post_count = ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) );
    		echo "Total Topics: " . $post_count; 	
    		$post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) );
    		echo "Total Replies: " . $post_count; } ?>
    #140336
    Stephen Edgar
    Keymaster

    I see this at the bottom of your site when viewing a topic

    add_shortcode( 'member', 'member_check_shortcode' ); function member_check_shortcode( $atts, $content = null ) { if ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) return $content; return ''; }

    #140334
    Sloppy Buns
    Participant

    I have worked part of this out and have implemented a is_bbpress format for forum pages so I can choose what sidebars to put on my forum pages however I am still not able to get sidebars to show up on profile or most popular topics.

    What I require is the is_ codex for these pages so I can write a script to place sidebars on these pages, I have found that the User profile has these html body classes:
    bbp-user-page single singular bbpress
    is_bbpress() does not work

    and Most Popular Topics:
    bbp-view bbpress

    This should be is_bbpress() however is_bbpress() does not work.

    Any help would be greatly appreciated.

    #140325

    In reply to: bbPress 2.5.1 is out!

    Stephen Edgar
    Keymaster

    @cyberdrone See this to get the translations or get started with translating bbPress. https://wordpress.org/plugins/bbpress-protected-forums/


    @david7h6
    What shortcode is broken?

    #140316

    In reply to: List user post total

    Stephen Edgar
    Keymaster

    Try bbp_is_anonymous to check if it’s an anonymous user before outputting the post count.

    #140292
    Lynqoid
    Participant

    You could hide the bbPress breadcrumb with some CSS.

    .bbp-breadcrumb { display:none; }

    #140288

    In reply to: List user post total

    ronthai
    Participant

    any idea where to add the code to have it show under the avatar in topics/replies?

    I think the count works, just can not get it placed correctly

    #140287

    In reply to: List user post total

    Lynqoid
    Participant

    Give this a try:

    $post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ) + ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) );
    		echo "Total Posts: " . $post_count;
    #140285

    In reply to: List Of Shortcodes

    ronthai
    Participant
    #140284

    Topic: List Of Shortcodes

    in forum Themes
    simon_loke
    Participant

    I need a list of shortcodes such as Profile edit,activity,user members and others..
    I want to have every shortcode to place different page.

    #140270
    Hansaplastique
    Participant

    Hi Stephen,

    In my search for a “fix” I totally forgot about the popup “Crayon Syntax Highlighter” offers.
    I’ve been playing around with this for about a year now and ended up using “CodeColorer” as I was creating my own WYSIWYG editor. I think I’ll explore the Crayon option again.

    As for the editor; I don’t know how to start such a wider discussion.
    I agree that ideally you’d like to use the editor that comes with WordPress, even if it’s just to stay more consistent (comments vs forum posts).
    How would one go about that?

    #140261
    comagnum
    Participant

    I’ve searched everywhere, to no avail. There used to be a plugin for this for older versions of bbpress (post count pro I believe it was called) but there aren’t any plugins for this anymore. I’m limited on my code knowledge, but I’d really like for this to be accheived. We’re a compeitive gaming community and vBulletin has been a staple of our professional/amateur gaming life since the beginning. I’ve decided to make the move to bbpress to have a more seemless site integration between users, posts, and news. My ultimate goal is to make the forums as similar to vBulletin as possible, but all of the plugins that accheived this goal do not work with the newer versions. I’d like for the post total to be listed under the users name when they post, as well as in their profiles. In addition custom user roles would be a plus, but not requred. If anyone can point me in the right direction, I’d be very grateful.

    #140258
    Simon Barnett
    Participant

    Thanks for the detailed reply, Stephen. I probably meant Forum Root rather than Forum Index, but the way you describe it is exactly what I’m after.

    I had considered what to do about the list getting too long and it will almost certainly be a matter of listing only the freshest 10 topics per forum. Clicking the Forum title would take you to the full list.

    Now that I know where to begin I’ll probably figure it out eventually (new to BBPress but not afraid of code), but if you have some suggestions on where to get started or even a block of code to copy-paste I certainly wouldn’t object to using it : )

    If get around to it first I’ll post my findings here for the knowledge base.

    #140256
    Stephen Edgar
    Keymaster

    Arabic is 96% translated already, see this to get you started https://codex.bbpress.org/bbpress-in-your-language/

    #140253
    Stephen Edgar
    Keymaster

    You can add some widgets to your side bar or shortcodes to a page

    https://codex.bbpress.org/shortcodes/ https://codex.bbpress.org/widgets/

    Also there are a few other docs on the codex worth looking at

    Codex

    #140252
    Stephen Edgar
    Keymaster

    Cool, that will work, thanks for the follow up and code example πŸ™‚

    Stephen Edgar
    Keymaster

    Thanks for adding the Codex page @jwarren πŸ™‚

    bbp_get_user_profile_url

    #140250
    Stephen Edgar
    Keymaster

    I just updated that page to ‘Topics – How many topics to show per page’

    As to combining the ‘Forum Index with Topics by Freshness’ I’m not exactly sure what you mean by this, for example look at the following two pages here on bbpress.org

    https://bbpress.org/forums/forum/installation/ <- That’s the ‘Instalation’ forum 25 topics/page
    https://bbpress.org/forums/forum/troubleshooting/ <- That’s the ‘Troubleshooting’ forum 25 topics/page

    If you wanted to have something like below on a single page then you would have to customize your templates or use some shortcodes on your page to get the layout you want. It is quite doable but once you get 50 topics for example in a forum finding ‘Forum B’ or any other forums below that list will be extremely difficult.

      Forum A

    • Topic 1
    • Topic 2
    • Topic 3
    • … etc
      Forum B

    • Topic 1
    • Topic 2
    • Topic 3
    • … etc
    #140248
    Stephen Edgar
    Keymaster

    Some seriously nice work in your script πŸ™‚

    I have just merged your changes into mine
    https://gist.github.com/ntwb/7889409/revisions

    And I forked your Gist and merged those changes into yours https://gist.github.com/ntwb/7955389/revisions

    Both files are the same and you can download either to use and test, using the /revisions it should show you a little clearer the changes I made.

    In summary the main updates were:
    * Fixes PHP Class name – From Example_Converter to miniBB
    * Includes forum slug
    * Uses the callback_topic_reply_count for topic/reply counts
    * Added topic Author IP
    * Added topic slug
    * Added topic status (Open/Closed) and callback
    * Added reply post id
    * Added reply title and reply title callback
    * Added reply slug
    * Updated password verify class miniBB
    * Stores custom user profile _bbp_minibb_user_instantmessenger, _bbp_minibb_user_occupation, _bbp_minibb_user_location & _bbp_minibb_user_interests in wp_usermeta

    #140247
    ijourneaux
    Participant

    I have bbPress up and running but was wondering how I might be able to allow users to get an sms text message when there is a new forum post. I have played around with the WordPress Text message plugin but Wasn’t able to figure out a way to incert the codes onto the form pages.

    Ian

    #140246
    Stephen Edgar
    Keymaster

    I see where you are coming from, I just went and took a look around backticks in Crayon Syntax Highligher.

    Tex uses backticks and appears to render fine based on this http://aksandbox.webege.com/?p=92, I also tried some MySQL with backticks and that also rendered correctly.

    You can also add/create your own languages for Crayon:
    https://github.com/aramk/crayon-syntax-highlighter/blob/master/langs/readme.md

    Some more background on the issues in the past can be read in these two tickets and this was one the main reasons backticks were implemented.
    https://bbpress.trac.wordpress.org/ticket/2091 & https://bbpress.trac.wordpress.org/ticket/2317

    While looking for a solution I noticed that I’m not the only one experiencing this back tick problem – frankly; the editor for bbPress needs some serious reconsideration … isn’t it time for a capable WYSIWYG editor?

    I also think we do need a better editor in bbPress, or more so a better editor in WordPress itself that we can use in the ‘front end’ of bbPress.

    The install base and use of bbPress is quite large and varied and we try to make it work for all of these cases and is one of the reasons recommending to use plugins that work with bbPress to support your own use case.

    Maybe we should have a wider discussion on the bbPress editor and the options available to us.

    #140244
    serks
    Participant

    Thanks for response Stephan,
    I actually managed to do this by using some code in loop-search.php and I used the same code in loop-replies.php…heres the code that does it…

    
    <?php if(get_post_type() == 'reply'):?>
    
           <?php // CHECK IF THIS REPLY IS UNDER MEMBERS ONLY FORUM.
           $parent = array_reverse(get_post_ancestors($post->ID)); // get an array of all the parent pages in order from most distant to closest.
           $first_parent = get_page($parent[0]); //get the first page in the array, which is the most distant parent
           $int = apply_filters('the_ID', $first_parent->ID); //filter the $first_parent to get only the wordpress page/post ID, which is an integer like 49 or 565. store it as a variable $int
           ?>
    		
            <?php if($int == 48) :?>
    	        <?php // DISPLAY A MESSAGE SAYING THE REPLY IS HIDDEN ?>
    	        <?php if(!user_subscribed()):?>
    		        <?php //bbp_get_template_part( 'loop', 'search-reply-membersonly'); ?>
    		        <div class="hidden-forum-comment">This comment is only visible to subscribers. <a href="/join">Click here to subscribe.</a></div>
    	        <?php endif;?>
            <?php else :?>
                    <?php bbp_get_template_part( 'loop', 'search-reply'); ?>
            <?php endif ;?>
    
    <?php elseif(get_post_type() == 'forum'): ?>
    	<?php bbp_get_template_part( 'loop', 'search-forum'); ?>
    <?php elseif(get_post_type() == 'topic'): ?>	
    	<?php bbp_get_template_part( 'loop', 'search-topic'); ?>
    <?php endif;?>
    
    

    Hope i’ve pasted that correctly.
    48 is the ID of the Members Only Forum.
    !user_subscribed() is one of my own functions to check if a user is subscribed to a product with DAP (Digital Access Pass).

    If anyone needs more help with this just ask. Be happy to help.

    Stephen Edgar
    Keymaster

    It looks like the issue is fixed?

    Anyway see the comment on this ticket in Trac for more details https://bbpress.trac.wordpress.org/ticket/2204#comment:3

    On each bbPress related page, the bbPress adds a class ‘bbPress’ to the body html element, so adding something like below would solve the problem in a non-obtrusive way.

    body.bbPress #nav > li.menu-item-318 > a {
    formatting for the highlighted menu item class
    }

    Where, menu-item-318 is the id of the page which should have been highlighted by the current_page_parent or current_menu_item class, which are not attached (for which this ticket is for).
    Of course, this is just a hack, but it does get the work done.

    #140229
    Hansaplastique
    Participant

    Thanks Stephen for the reply and suggestion.

    I’ve looked at those yes and they work great except for code that has backticks in it πŸ™ … Some examples shell code that is being posted on my forum actually uses backticks in the code which makes it all a big mess … πŸ™

    The current “fancy” editor doesn’t work well with code either, specially when switching back and forth between WYSIWYG and code.
    In this day and age I’d like to avoid that my visitors have to “code” their own HTML to get a message posted right.

    What I’ve done so far:
    – create my own rich editor
    – disable backticks in bbPress

    This works pretty good, but it most certainly is not perfect either.
    Obviously changing bbPress core files is a no-no from a maintenance perspective (hence my request).

    While looking for a solution I noticed that I’m not the only one experiencing this back tick problem – frankly; the editor for bbPress needs some serious reconsideration … isn’t it time for a capable WYSIWYG editor?

    No disrespect intended to the developers!!
    I really appreciate the enormous amount of work they have done, and I understand that my editor issues are maybe not the top priority.
    I really like bbPress as a forum for WordPress, and I consider it so far the best option out there.

    #140226
    JakubMarian
    Participant

    Hello, I am trying to integrate bbPress seamlessly into my custom WordPress theme. However, this theme defines several global variables which are then used by the theme files.

    These variables are defined as global variables in header.php of the wordpress theme and are used without problems in all theme files. Example:

    header.php
    global $variable;
    $variable = "value";

    single.php
    global $variable;
    echo $variable; // outputs "value" as it should

    So far, so good. But if I try to use the variable in a bbPress theme file, it is empty:

    content-single-topic.php
    global $variable;
    echo $variable; // outputs ""

    When bbPress is done, the variable comes back to life:

    loop-single.php
    echo $variable; // outputs "value" as it should
    the_content(); // all the bbPress stuff, $variable empty – what happens there?
    echo $variable; // outputs "value" again

    Using print_r($GLOBALS), it turns out that in fact all the custom variables cease to exist for the time bbPress is doing its job and than come back to life.

    How can I pass a global value to the bbPress theme files without doing absurd things like querying the database?

Viewing 25 results - 13,126 through 13,150 (of 32,521 total)
Skip to toolbar