Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,751 through 11,775 (of 32,504 total)
  • Author
    Search Results
  • #147051
    Robin W
    Moderator

    you will need to filter two functions

    1. bbp_get_forum_freshness_link

    2. You will need to amend the freshness function

    Layout and functionality – Examples you can use

    I have no idea how into coding you are, so come back and let me know so that I can help you further

    How much php do you know
    do you know how to edit files
    do you know how to ftp

    yoosuke
    Participant

    Hello from Japan!
    bbpress is great!

    Well, I’m in trouble.
    so I would appreciate if you help me.

    1.
    By default, an anchor tag is given to texts of “freshness“. like…

    <a>2hours, 1minute ago</a>

    To remove the anchor tag from freshness texts, which files should I modify ?
    Could you please tell me a path to get to the file?

    2.
    By default, a comma is used in display of “freshness”. like..

    2hours,(←here!) 1minute ago

    I want to also remove the comma.
    In this case, a file to be modified will be the same as the file described above?

    Thanks for reading,
    and I’m looking forward to your reply…

    WordPress: ver3.9.1
    bbPress: ver2.5.3

    #147043
    Jerry
    Participant

    This is a rare event for me; I figured this out within 4 hours of posting it. I am including the solution in case someone else decides they want to do the same thing. I had the input name correct: bbp_topic_content. As I was guessing above, I merely had to create a new function. Below is the variable declaration in javascript, and the function that auto-populates the content field of a new topic:
    $("textarea[name='bbp_topic_content']").val(data.description);

    add_action ( 'bbp_get_the_content', 'bbp_description_to_topic');
    function bbp_description_to_topic(){
        $value = get_post_meta( bbp_get_topic_id(), 'bbp_topic_content', true);
        echo "<p><textarea style='width: 414px; height: 151px' name='bbp_topic_content' value='".$value."'></textarea></p>";
    }
    #147042
    artgeek
    Participant

    I’m working on a site that uses both BuddyPress and bbPress. All the BP functionality is in a community parent directory and I’d like to run bbPress out of the same, e.g.

    http://mydomain.com/community/forums

    I was able to create this page and use the bbPress shortcode to display the forum index at this location, but this doesn’t change any of the rest of the directory structure of my forums, e.g., when I click on a forum, I’m redirected to

    http://mydomain.com/forums/forum/myforumname

    The community parent directory is lost. Is there a way for me to keep all bbPress URLs under the community directory?

    Jerry
    Participant

    I put this in “pimp your press”, but now I think it belongs in the troubleshooting forum. Not certain.

    I have created custom fields for my bbpress topics, and I have learned how to auto-populate those fields when a user clicks a button. I have also learned how to auto-populate the Topic Title. I am using javascript to auto-populate the topic title. Here is how I assign the data:

    $("input[name='bbp_topic_title']").val(data.title);

    I am showing this as an example to show what I need. My question is; am I able to auto-populate the content of a new topic, much like I am doing with the title for a new topic?

    To auto-populate the content of a new topic, I assume I need to have the correct term, which I think would be ‘bbp_topic_content’? So it would look like this?

    $("input[name='bbp_topic_content']").val(data.description);

    Here are three functions I am using for custom fields:

    add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
    function bbp_extra_fields() {
     $value = get_post_meta( bbp_get_topic_id(), 'bookCover', true);
       echo '<label for="bookCover">Book Cover URL</label><br>';
       echo "<p><input type='text' name='bookCover' value='".$value."'></p>";
    }
    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
     
    function bbp_save_extra_fields($topic_id=0) {
      if (isset($_POST) && $_POST['bookCover']!='')
        update_post_meta( $topic_id, 'bookCover', $_POST['bookCover'] );
    }
    add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields');
    //add_action('bbp_template_before_main_content', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
      $topic_id = bbp_get_topic_id();
      $valuec = get_post_meta( $topic_id, 'bookCover', true);
    }

    I am thinking that I need some sort of “add_action” to get this accomplished? Do I need to create a new function? I’ve been looking in templates.php to try and get a hint to figure this out. Any help would be GREATLY appreciated. Thanks.

    Jerry
    Participant

    I have created custom fields for my bbpress topics, and I have learned how to auto-populate those fields when a user clicks a button. I have also learned how to auto-populate the Topic Title. I am using javascript to auto-populate the topic title. Here is how I assign the data:
    $("input[name='bbp_topic_title']").val(data.title);
    I am showing this as an example to show what I need. My question is; am I able to auto-populate the content of a new topic, much like I am doing with the title for a new topic?

    To auto-populate the content of a new topic, I assume I need to have the correct term, which I think would be ‘bbp_topic_content’? So it would look like this?
    $("input[name='bbp_topic_content']").val(data.description);
    Here are three functions I am using for custom fields:

    add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
    function bbp_extra_fields() {
     $value = get_post_meta( bbp_get_topic_id(), 'bookCover', true);
       echo '<label for="bookCover">Book Cover URL</label><br>';
       echo "<p><input type='text' name='bookCover' value='".$value."'></p>";
    }
    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
     
    function bbp_save_extra_fields($topic_id=0) {
      if (isset($_POST) && $_POST['bookCover']!='')
        update_post_meta( $topic_id, 'bookCover', $_POST['bookCover'] );
    }
    add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields');
    //add_action('bbp_template_before_main_content', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
      $topic_id = bbp_get_topic_id();
      $valuec = get_post_meta( $topic_id, 'bookCover', true);
    }
    

    I am thinking that I need some sort of “add_action” to get this accomplished? Do I need to create a new function? Any help would be GREATLY appreciated. Thanks.

    #147023
    demonboy
    Participant

    I’m sure this has been asked before but I can’t find a solution yet. I’d like to style one particular forum differently to the others, in particular all the replies in every topic. Do I use the post id or the forum name? My forum is called ‘assignments’ and the forum post id is 2881, but of course all topics within that forum have a different post id. Can’t work it out. I’ve tried variations on this:

    #bbpress-forums #post-2881 .bbp-reply-content {font-family:Verdana, Geneva, sans-serif; font-size:0.8em;}

    Any pointers?

    #147021
    inventor1
    Participant

    Ok finally fixed it, and it’s working with the plugin.
    I just added these lines for functions.php
    See the code here:

    https://bbpress.trac.wordpress.org/ticket/1478#comment:7

    #147009

    In reply to: Templating Issue

    Robin W
    Moderator

    ok, the simplest way would be as follows

    In you theme create a directory called bbpress

    ie wp-content/your-theme-name/bbpress

    The copy the following file into this

    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php

    so you end up with a file

    wp-content/your-theme-name/bbpress/loop-single-forum.php

    bbpress will now sue this file instead of the default one, so then edit this file to change line 68 from

    <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
    

    to

    <span class="bbp-topic-freshness-author"><?php //bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
    

    If your theme is a child theme, then that will be fine. If it is a main theme, then just keep a note of this change, as you may have to repeat it on a theme update.

    boblebad
    Participant

    I can’t say that it was something really simple, cause looking around the database and settings in the Dashboard for a couple of hours without finding anything that was related to the problem, i just killed of Paid Memberships Pro and reinstalled it.

    Problem solved.

    Did i find the cause ? – No, i don’t know whether there’s a bug or something else messed it up.

    So is this thread of any help ? – Don’t know, maybe, you just know to kick PMPro out and reinstall it, then it all works again.

    Should you however know what the problem was or could be, then post it, cause there are so many people out there having this problem in one form or the other.

    And that leads me to think that there’s something not coded as it should, i don’t know whether it’s bbPress or all the plugins that is the main issue, but if it’s all the others, then there must be a lack of information from the developers of bbPress – how else can so many plugin developer get this wrong ??

    Most of the time, when reading the threads about this, it comes down to restricting access to the forums, it’s the source of the problem, and in my opinion it should be possible out-of-the-box.

    If the problem re-occurres, i’ll get back 🙂

    #146990
    Robin W
    Moderator
    #146984
    flipdamusic
    Participant

    Hi,
    i have the challenge to show the latest topics for the role members in the topic index view. I’m new to bbpress so i’ve to learn a lot.

    I’m using buddypress with sidewide and group forums. Each group has one forum.
    When I’m using a site and shortcode [bbp-topic-index] only all topics from the sidewide forums are shown. What I’ve learned is that this is a default behavior – i hope i’m not wrong 🙂

    Now I want to show all latest topics / posts for all members belonging to their group / group forum – optimal on the latest topic page. The users are members (bbpress) and abonnents (WordPress).
    How do i accomplish that ?

    #146969
    ebarcena
    Participant

    sorry I forgot to mention that you should include the nav parent id for all the menus where you don’t want the link do be displayed:

    #main-nav .edit-my-profile, #footer-nav .edit-my-profile, #any-nav .edit-my-profile {
    display: none;
    }
    #146968
    ebarcena
    Participant

    A temporary fix:

    // Filter wp_nav_menu() to add profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) { 	
    	if (!is_user_logged_in())
    		return $menu;
    	else
    		$current_user = wp_get_current_user();
    		$user=$current_user->user_login ;
    		$profilelink = '<li class="edit-my-profile"><a href="http://www.mysite.com/forums/users/' . $user . '/edit">My Profile/Edit Profile</a></li>';
    		$menu = $menu . $profilelink;
    		return $menu;
    }

    and then add this in your CSS file:

    .edit-my-profile {display: none;}

    I’m still interested in getting Robin’s function to work without the CSS fix.

    #146966
    Stephen Edgar
    Keymaster

    Not sure if this is related, but on my test install when there are second-level replies to import it messes bbPress list of replies.

    Yes, saw the same thing, because the replies it tries to list are linking to parent topics that do not exist.

    EDIT: do not believe I haven’t read your own posts LOL. I just wanted to describe the path I have followed in case it would bring some light on your side…

    Thinking ‘out loud’ is all good, helps ideas for even funkier SQL queries 😉

    Unfortunately, it seems the converter doesn’t accept this…

    No it doesn’t, it is pretty limited in how we can do joins and joining a table with the same name it ignores when it comes time to merge all the sections field mappings. We can work around this for now by putting all of the join bits in the from_expression thus the following works:

    
    'from_expression' => 'INNER JOIN wp_symposium_topics t ON symposium_topics.topic_parent = t.tid WHERE symposium_topics.topic_parent != 0 AND symposium_topics.topic_group = 0 AND t.topic_parent = 0',
    

    I also setup some groups (and what a painful experience that was), I agree it would be nice to get the group topics imported also but lets do that in v2 after I add some of the previously mentioned changes to improve the capabilities of the main converter script.

    Pull request sent with above change…

    #146965

    In reply to: Forum Root Page Issues

    TulsaREIA
    Participant

    For people still looking for an easy solution to this issue, I found a simple solution.

    I wanted my blog categories to use excepts but when that setting is turned on, the root forum page does not display because it is truncated as described above.

    So I turned excepts off so that the forum displayed correctly and then to make the the rest of my site use excepts, I installed the plug in “posts in page”. Then I created new pages with the shortcode from the plugin to create new static pages for my posts to display in excerpts. I updated my menus and widgets to display links to the new pages so that site visitors can easily browse the posts by seeing excerpts. Plus I did not have to hard code the forum or theme.

    #146963
    Robin W
    Moderator

    yes, that’s what I am saying – it does take a minute or two to think about, – in effect it’s what you have at the moment, as the plugin ignores any group setting for moderators. The extra code would just allow a limitation for those who would like to limit moderators, whilst saving running unnecessary code for keymaster and moderators without forum restrictions.

    Anyway I’ll take a look at it, in the meantime you currently have a workable solution with the code mod to move.php.

    #146962
    elaborate
    Participant

    The site is hosted locally so I can’t give you an actual live URL if that’s what you mean?

    The page is a ‘customized’ version of the BuddyPress Settings page located at DOMAIN/members/USER/settings/.

    Just think of it as a blank WordPress page with that URL.

    By “the content” I mean the <form id="bbp-your-profile> element, and everything within it, on the Edit page at DOMAIN/forums/profile/USER/edit/.

    The template file that contains the form is called form-user-edit.php.

    #146955
    lagrou
    Participant

    Problem I see, is that with this version all of the replies are imported, including second-level ones which have the topic ID as parent instead of their parent ID. Not sure if this is related, but on my test install when there are second-level replies to import it messes bbPress list of replies. Whereas with no second-level replies in WPS forum, it works fine.

    To get only first-level replies, I have changed the above into:
    "SELECT s.* FROM wp_symposium_topics s INNER JOIN wp_symposium_topics t ON s.topic_parent = t.tid WHERE s.topic_parent != 0 AND s.topic_group = 0 AND t.topic_parent = 0"

    Which works fine as dumped in a PHP page. And then into:

    // Reply id (Stored in postmeta)
    $this->field_map[] = array(
    	'from_tablename'  => 'symposium_topics s',
    	'from_fieldname'  => 'tid',
    	'join_tablename'  => 'symposium_topics t',
    	'join_type'       => 'INNER',
    	'join_expression' => 'ON s.topic_parent = t.tid',
    	'from_expression' => 'WHERE s.topic_parent != 0 AND s.topic_group = 0 AND t.topic_parent = 0',
    	'to_type'         => 'reply',
    	'to_fieldname'    => '_bbp_post_id'
    );

    Unfortunately, it seems the converter doesn’t accept this…

    EDIT: do not believe I haven’t read your own posts LOL. I just wanted to describe the path I have followed in case it would bring some light on your side…

    #146948
    Robin W
    Moderator

    @trymedo – great really pleased !

    When you get a moment can you just try http://www.mysite.com/topics without my plugin. I just want to confirm that it is my ‘double sort’ that is causing your issue. If it is, then I’ll probably just add a keymaster and moderator check to ignore the ‘get col’ part so that it doesn’t do that if not needed. It would then mean that the server isn’t having to check every post for these groups, so would speed response for large forums such as yours. Then the code within the move.php could be re-instated, and I wouldn’t need to spend time working out what it does !

    At the moment keymasters & moderators can see all posts and forums, although I suspect that someone will want a moderator to only see and moderate a sub group of forums. I plan therefore to do the check to say if ‘keymaster’ or if ‘moderator without a group set’ then skip the for the ‘get_col’ filters, which would speed sorts for large forums such as yours and get round the issue of the double sort. Moderators with a group set would still go into the double sort, so would fall foul of the double sort if that’s how you would want them set. Give me feedback on this please, so I can work on what I should do !

    #146947
    ovizii
    Participant

    The plugin author of the plugin I mentioned coded What I asked for, you can find the thread here: https://wordpress.org/support/topic/need-some-help-getting-this-right-1

    Fixes the Recent Replies perfectly!!!

    #146942
    lagrou
    Participant

    Looking at this now, threaded replies are using the same topic_parent field, though they are using this as a pointer to the ‘reply parent’ rather than the topic parent.

    Confirmed. To select first-level replies only, that would be using SQL:

    "SELECT * FROM wp_symposium_topics WHERE topic_group = 0 AND topic_parent IN (SELECT tid FROM wp_symposium_topics WHERE topic_parent = 0)"

    And to select second-level replies only:

    "SELECT * FROM wp_symposium_topics WHERE topic_parent != 0 AND topic_group = 0 AND topic_parent NOT IN (SELECT tid FROM wp_symposium_topics WHERE topic_parent = 0)"

    Note that I’m excluding groups forum. Now, how to mimick this with the converter?

    #146941
    Nathan
    Participant

    Hi Christian,
    The code I ended up using was not my original idea. I didn’t hook into a new user creation. What this does is inverts the subscribe list. It turns it into an unsubscribe list. So any user should be subscribed to any new forum by default. Let me know if something is not working for you, and I’ll see what I can do!

    – Nathan

    #146939

    In reply to: CSS Plugin

    street2k
    Participant

    What would be a helpful idea is for people who has a customized css color template of the bbpress.css file to post an image of their theme with a copy of the css so anyone who would like to achieve the same or similar outcome as a guide. So the ppl who aren’t code savvy can use it for their forum. That way there is no need for a plugin to be created.

    #146934
    Robin W
    Moderator

    @trymedo

    yes that’s on my list together with a bunch of other code wrangling ! It always a balance between whether you release something because it’s good enough and whether you make it perfect, then release only to find that it still needs changing !

    Given limited time to work on these things, if I got it how I think it will eventually look, it would be another 3-4 months before I released version 1.

    But please keep feedback coming !

Viewing 25 results - 11,751 through 11,775 (of 32,504 total)
Skip to toolbar