Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 14,976 through 15,000 (of 32,519 total)
  • Author
    Search Results
  • #122698
    evomedia
    Participant

    Hi i just insalled bbpress to test it but i cant figure out whats wrong i just get a blank page

    This is what ive dona so far: I installed the plugin–> created a forum–> created a page which i named forum–> entered the shortcode [bbp-forum-index]–> When i go to the front i see the page click it and up comes the forum i created when i then click the forum and i get the blank page…–> in the adressfield it says http://www.kanin.se/forums/forum/theforumicreated and the page i blank.

    I have the latest wordpress and bbpress

    feeling stupid for not seeing the possibly easy solution.

    I have searched this forum and the webb even watched a 30 min video on the setup of bbpress didnt get any smarter.

    Thanks for your help!

    #122689

    In reply to: Forum Icons ?

    Stephen Edgar
    Keymaster

    Sounds great Darren would love to see it, feel free to Pimp your site here.

    A plugin would be cool and like Jared there is much on my plate at the moment.

    Similar to Martin’s method above I have been using a custom icon font and targeting each forum like so with CSS where in this case the forum id is 34.

    
    .bbp-forum-34 i:before {
      content: "\e112"; /* glyphicons_ */
    }
    
    Lynq
    Participant

    All I can see at the moment is this: https://codex.bbpress.org/type/actions/

    I think the documentation is continually being worked on, but I believe the focus is more on the actual plugin at the moment, correct me if I am wrong anyone.

    If you do find a list of great actions and hooks then share them! All it takes is for one person to go through, use them and help others out by posting their findings.

    Good luck!

    timatooth
    Participant

    Thanks Lynq! I should have stated clearer that I’m looking for more bbPress actions/hooks/filters pages. Are there pages like this for bbPress the page on Actions only describes 10 actions.

    https://codex.bbpress.org/ seems to have articles about some functions and shortcodes but not hooks and filters.

    It would be nice to see a table which contains every action/hook/filter/callback with the argument descriptions or what parameters the callbacks get. Currently Ive been trying to decipher the inline documentation of the core files. 😀

    Lynq
    Participant

    This page has a lot of actions you can use.
    https://codex.wordpress.org/Plugin_API/Action_Reference

    And this page has a lot of filters you can use.
    https://codex.wordpress.org/Plugin_API/Filter_Reference

    timatooth
    Participant

    Hi everyone,

    Im new to the worldpress plugin scene coming from a more oop like language like java that uses JavaDoc or Doxygen to describe stuff.

    I was wondering how developers writing plugins are finding the hooks/actions/filters they need to solve something. I haven’t found http://codex.bbpress.org/ very helpful because its seems to only document a small collection of functions.

    I haven’t found it easy because IDEs don’t tend to detect functional apis with their code completion engines. Is it just a matter of slowly grinding through all the core files trying to memorize all the functions and callbacks? I hope not.

    #122664
    AllenPayne
    Participant

    @rsanchez1 Thanks a lot. Your post made me even more confused at first because i’m new to WordPress and PHP but after reading it a couple of more times and actually implementing what you said it made sense and i managed to get it to work.

    I used this code (please look at it and let me know if there are any errors):

    ————————————————————-

    function remove_bbpress_forum_freshness_date( $anchor, $forum_id) {

    $forum_id = bbp_get_forum_id( $forum_id );
    $active_id = bbp_get_forum_last_active_id( $forum_id );

    if ( empty( $active_id ) ) {
    $active_id = bbp_get_forum_last_reply_id( $forum_id );
    }
    if ( empty( $active_id ) ) {
    $active_id = bbp_get_forum_last_topic_id( $forum_id );
    }

    if (bbp_is_topic( $active_id ) ) {
    $link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    } elseif ( bbp_is_reply( $active_id ) ) {
    $link_url = bbp_get_forum_last_reply_url( $forum_id );
    }

    return "View Post";

    }

    add_filter('bbp_get_forum_freshness_link', 'remove_bbpress_forum_freshness_date', 10, 2);

    ——————————————————–

    function remove_bbpress_topic_freshness_date( $anchor, $topic_id) {

    $link_url = bbp_get_topic_last_reply_url( $topic_id );

    $time_since = bbp_get_topic_last_active_time( $topic_id );
    if ( empty( $time_since ) ) {
    return 'No Replies';
    } else {
    return "View Post";
    }

    }

    add_filter('bbp_get_topic_freshness_link', 'remove_bbpress_topic_freshness_date', 10, 2);

    ———————————————————-

    I have one more question. I gave this more thought and i think it would be better if i replace “View Post” with the post’s title on the forums page(not topics).

    To do this is have to change the first function above.

    Any ideas how should i change the code to return the post’s title instead of View Post?

    Thank you for your help. It’s very much appreciated.

    #122663
    risen32
    Participant

    I setup bbpress with a shortcode to display the forums on a page, you can see it here: http://www.clonescriptnews.com/forums/

    When you are on that page everything seems to be fine, however if you click on this:

    http://www.clonescriptnews.com/forum/forums/general/introductions/

    and look at the breadcrumbs, when you try to go back to “forums” by clicking on the breadcrumb Forum link, it’s linked to just “forum” and then it tries to open the forum inside what looks to be a post.

    you can view that here (if you click on the breadcrumb forum link, you’ll see this) http://www.clonescriptnews.com/forum/

    It seems that no matter what I do in the forum settings area with the forums base and forum slug that keeps happening.

    #122651
    rsanchez1
    Participant

    The filter passes the anchor tag HTML and the forum_id to your callback. To do this, you’ll have to change your filter, like so:


    function remove_bbpress_forum_freshness_date( $anchor, $forum_id) {
    }

    add_filter('bbp_get_forum_freshness_link', 'remove_bbpress_forum_freshness_date', 10, 2);

    So you can see that your filter callback would be passed the anchor and the forum id.

    In the bbPress code, it basically just gets the link for the forum, gets the title for the forum, gets the last active time for the forum, and constructs an anchor tag from all this information.

    In your filter callback, you can do like is done in the bbPress code:


    $forum_id = bbp_get_forum_id( $forum_id );
    $active_id = bbp_get_forum_last_active_id( $forum_id );

    if ( empty( $active_id ) ) {
    $active_id = bbp_get_forum_last_reply_id( $forum_id );
    }
    if ( empty( $active_id ) ) {
    $active_id = bbp_get_forum_last_topic_id( $forum_id );
    }

    if (bbp_is_topic( $active_id ) ) {
    $link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    } elseif ( bbp_is_reply( $active_id ) ) {
    $link_url = bbp_get_forum_last_reply_url( $forum_id );
    }

    As you can see, this code gets the ID of the last active item in the forum, be it topic or reply. It checks to see if the last active item was a topic or reply, and gets the appropriate url using the appropriate function.

    With the url, you can then construct an anchor tag, and the link would say “View Post” (or “View Topic” if you want to get specific). Then you would return that from the filter callback.

    For topics, it’s much easier since the last active will only be replies. The way you set up the filter and callback will be the same, just replacing forum with topic. To get the url, for View Post, do this:

    $link_url = bbp_get_topic_last_reply_url( $topic_id );

    In the code, it checks this to see if there have been any replies:

    $time_since = bbp_get_topic_last_active_time( $topic_id );
    if ( empty( $time_since ) ) {
    // there are no replies, you can return "No Replies"
    } else {
    // make anchor tag linking to "View Post"
    }

    I hope this clears things up a bit for you to try it yourself.

    #122650
    Lynq
    Participant

    This also works, you can specify a post parent if you use this.

    http://pastebin.com/vNMrR7za

    Or the WP_Query reference is here, which could help: https://codex.wordpress.org/Class_Reference/WP_Query

    Good luck!

    #122644
    Lynq
    Participant

    Can you use

    echo do_shortcode(‘[bbp-single-forum id=32]‘);

    Inside the template files, should work I think?

    #122639
    on3advertising
    Participant

    I’m so close using Jeff’s solution!

    I added a checker to the customer ID in the initial if statement since it was passing through regardless of what I entered.
    && mysql_num_rows($result) == 1

    So the complete code ended up looking like this:
    function restrictForum(){
    $db_name = 'dbname';
    $con = mysql_connect("url","usr","password");
    mysql_select_db("$db_name")or die("cannot select DB");
    $cust_id = mysql_real_escape_string($_GET['cid']);
    $sql = "SELECT * FROM customer_data WHERE customer_number = $cust_id";
    $result= mysql_query($sql);
    if ( isset( $_GET['cid'] ) && !empty( $_GET['cid'] ) && mysql_num_rows($result) == 1) {
    // cid (customer ID) is present, show the bbPress login form
    echo 'Please enter your username and password to complete the login process ';
    echo do_shortcode('bbp-login');

    } elseif ( $_GET['error'] == true ) {

    // cid entered was not valid
    echo 'The customer ID you entered is not valid.';

    } else {
    echo ('
    Enter Your Customer #
    (form name="cust-form" id="cust-form" method="get")
    (input name="cid" id="cid" type="text" maxlength="6" /)
    (input type="submit" value="Validate"'/)
    (/form));
    // cid is absent so show the form to validate it
    // do your custom form here that asks for the customer ID. Then if the customer ID
    // is correct/valid reload this page like /login?cid=123456 which will show
    // the bbPress login form.
    }
    }
    add_shortcode('forum-login-restrict','restrictForum');

    It’s weird though, whenever I enter an invalid customer ID, I get the MySQL error saying “mysql_num_rows() expects parameter 1 to be resource, boolean”.

    It’s also annoying that the bbpress shortcode I’m embedding is now showing up as text, literally “bbp-login” rather than the actual form using:
    echo do_shortcode('bbp-login');

    #122638
    on3advertising
    Participant

    I like your method, I’m also trying to figure out a way to keep it on one page. I just noticed your post so I will have to try it, but I did something like this. It doesn’t work:

    I have a login-form.php with the basic stuff (this forum keeps stripping my form code so I have to put some sloppy stuff in here:

    form method = "get"
    input name="cid" id="cid" type="text"

    I have a checklogin.php file:

    if(isset($_POST['submit'])){
    $db_name = 'dname';
    $con = mysql_connect("url,"username","password");
    mysql_select_db("$db_name")or die("cannot select DB");
    $cust_id = $_GET['cid'];
    $cust_id = stripslashes($cust_id);
    $cust_id = mysql_real_escape_string($cust_id);
    $sql="SELECT * FROM customer_data WHERE customer_number='$cust_id', LIMIT 1";
    if(mysql_num_rows($sql) == 1){
    $row = mysql_fetch_array($sql);
    session_start();
    $_SESSION['cid'] = $row['cid'];
    echo('kind of worked');
    } else {
    echo("worked");
    }
    }else {
    include_once("login-form.php");
    }

    Then I made my shortcode in functions.php that just calls the checklogin.php file:

    function restrictForum(){
    include_once("checklogin.php");
    }
    add_shortcode('forum-login-restrict','restrictForum');

    There is something seriously wrong with this method. I am studying your solution as best as I can to try and implement that as well.

    #122637
    on3advertising
    Participant

    I like your method, I’m also trying to figure out a way to keep it on one page. I just noticed your post so I will have to try it, but I did something like this. It doesn’t work:

    I have a login-form.php with the basic stuff (this forum keeps stripping my form code so I have to put some sloppy stuff in here:

    form method = "get"
    input name="cid" id="cid" type="text"

    I have a checklogin.php file:

    if(isset($_POST['submit'])){
    $db_name = 'synoptix';
    $con = mysql_connect("url,"username","password");
    mysql_select_db("$db_name")or die("cannot select DB");
    $cust_id = $_GET['cid'];
    $cust_id = stripslashes($cust_id);
    $cust_id = mysql_real_escape_string($cust_id);
    $sql="SELECT * FROM customer_data WHERE customer_number='$cust_id', LIMIT 1";
    if(mysql_num_rows($sql) == 1){
    $row = mysql_fetch_array($sql);
    session_start();
    $_SESSION['cid'] = $row['cid'];
    echo('kind of worked');
    } else {
    echo("worked");
    }
    }else {
    include_once("login-form.php");
    }

    Then I made my shortcode in functions.php that just calls the checklogin.php file:

    function restrictForum(){
    include_once("checklogin.php");
    }
    add_shortcode('forum-login-restrict','restrictForum');

    There is something seriously wrong with this method. I am studying your solution as best as I can to try and implement that as well.

    Andreas
    Participant

    To demonstrate the dilemma – groups are all here, including group forums:

    youthpolicy.org/community/forums/

    But then you go to any group and their forum, and it says ‘This group does not currently have any forums.’ We are on bbPress 2.2-bleeding, as suggested in the codex here.

    Weird.

    Bowe
    Participant

    Details

    Install: WP 3.5  (Multisite) + BBPress 2.2 Bleeding and BuddyPress 1.6.2
    Guide used: http://codex.buddypress.org/buddypress-site-administration/migrating-from-old-forums-to-bbpress-2/

    Procedure: We’ve ran the importer to import from BBPress 1 to BBPress 2. The migration wizard went fine and all the forums/topics and replies have been set. We’ve followed the guide and made sure BBPress 2 is set to be used as the BP Group Forums. For some reason this does not happen. We tried using the various Repair Forums tools, but they do not have effect.

    So right now we have working BBPress 2 Forums that do not integrate with the existing groups. Any suggestions on how to “remap” BBPress 2 forums to BP Groups?

    Thanks in advance!

    #122626

    In reply to: bbPress 2.2.3 Released

    0kee
    Participant

    Hi, since updating everything is working fine except the reply box for the forum isn’t re-sizing. I think it’s the wp-bbp_reply_content-editor-container. Sorry, new to this.
    I’m using wordpress 3.5 and bbpress 2.2.3 with the standard bbPress (twenty ten) theme. Anybody any ideas?
    http://userdrivendesign.org/?topic=music-assistive-technology

    Thanks
    Karl

    #122618

    This is a function of BuddyPress, that turns profile data into searchable links. Google around how to remove this; there are a few tutorials, and a page in the BuddyPress codex.

    Alexander
    Participant

    I guess it would be something like this (still not working though – incorrect loop?)

    Code example: http://pastebin.com/FnX6cfRK

    #122610
    Darren1981
    Participant

    Hey all,

    Since there is no support for “Categories” so to speak.. what i would like to do is create a custom main forum page and insert the forums manually… Now i know this can be done with shortcodes in posts and pages like as follows:

    [bbp-single-forum id=32]

    But what i am wondering is how would one go about inserting single forums into the BBpress .php template files.. for example the template content-archive-forum.php has the following php code which displays all forums:

    I would like to edit this file and insert forums manually.. is there a php version / code like the shortcodes to insert single forums ?

    Regards, Darren

    #122601
    bruceleebee
    Participant

    Hello,

    I am using skematiktheme.com wordpress theme, which is also styled for buddypress. I also have the lastest version of buddypress, bbpress, and wordpress installed.

    Not sure if I should be asking this in the buddypress forum or not, because most of the changes are related to bbpress forums which are integrated with buddypress.

    I want to change the font size. In general I just need to change the font size for the text in the body of posts, but it would be good if I could bump everything up by 4px. How do I change that?

    Can someone help me by explaining it in simple step-by-step language?

    For example: go here, then type this code here, and then change this, etc….

    Thanks,
    Ben

    Kyle Burnett
    Participant

    i am using another plugin (codepress admin columns) that calls do_action(‘load-edit.php’) to load all the plugins to get some info – namely custom columns. since and update to both – which, ironically both updated today – i get this error:

    Fatal error: Call to undefined method stdClass::add_help_tab() in /home/content/…/wp-content/plugins/bbpress/includes/admin/forums.php on line 118

    And if I get past that error, it’s the same thing for admin/topics.php and admin/replies.php.

    What I have traced it to is this:

    private function bail() {
    if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
    return true;

    return false;
    }

    For some reason bail() is not bailing. I – the user – am on options-general.php?page=codepress-admin-columns, and yet bail() thinks the current screen’s post type is ‘forum’ (or topic or reply).

    I’m thinking this is a naming convention problem? Why else would get_current_screen return as a ‘forum’ post_type when I’m no where near the forum – I’m just loading it to read some data.

    Thanks for any info.

    #122581
    AllenPayne
    Participant

    Managed to make it work using this 2 functions:

    function remove_bbpress_forum_freshness_date() {
    return '';
    }
    add_filter('bbp_get_forum_freshness_link', 'remove_bbpress_forum_freshness_date');

    function remove_bbpress_topic_freshness_date() {
    return '';
    }
    add_filter('bbp_get_topic_freshness_link', 'remove_bbpress_topic_freshness_date');

    But now i’m thinking to do something else. Instead of removing the date i want to rename it to something like “View Post”. The freshness date already links to the last post by default so i just want to rename it.

    Do you know how can i do this?

    #122571
    AllenPayne
    Participant

    I tried to use div.forums-topic-datetime with display: none; but i can’t get it to work. Can you please post the whole code? I’m fairly new to CSS.

    Regarding the PHP filers…I’m not sure how to do this either. Any help would be greatly appreciated.

    There is a plugin that addresses the first issue.

    https://wordpress.org/extend/plugins/bbpress-private-replies/

    Not sure of an easy way to restrict posting a thread without a few chunks of custom code.

Viewing 25 results - 14,976 through 15,000 (of 32,519 total)
Skip to toolbar