Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 14,951 through 14,975 (of 32,503 total)
  • Author
    Search Results
  • #122819
    Destillator
    Participant

    Thanks for the suggestion, but unfortunately changing the permalink-settings didn’t help. I’ve narrowed it down a little bit further; I use a wrapper for the entire forums with a file bbpress.php in my theme. Where a simple the_content statement first rendered the forums, they now fail to do so. If I replace the_content in bbpress.php with the code that’s present in plugins/bbpress/templates/bbp-twentyten/archive-forum.php, the frontpage shows up. But all links lead to 404 not found pages. Am I missing something here?

    ratsoid2
    Participant

    Hey guys,
    I am doing a project needs a forum, so I’m using bbPress 2.0. Since it’s for my company which is multinational and we have more than 1 language spoken, I modified the Recent Replies and Recent Topics widgets to show the parent forum so that people can determine if they can actually understand what is in there. You can add the Show Parent Forum through te widget option and I sticked to the original code format when doing the mod.

    I didn’t create a plugin for this, if someone wants to, they can go ahead and do just that. Maybe add others options that they want. Code is below:

    http://pastebin.ca/2293446

    put it in a .php file, and in functions.php add something like

    include TEMPLATEPATH . '/lib/widgets/widget-bbpress.php';

    of course, replace /lib/widgets/widget-press.php with your location to the file.

    #122745
    Pietro
    Participant

    Hi Guys!
    Please … I found of course the ShortCode Page on http://codex.bbpress.org/shortcodes/ BUT … I do not know if and how insert in a page the EDIT PROFILE code … Any help ??

    For instance, when I go to see my profile, I can use different link …
    Here’s a ScreenShot on http://www.pietrosferrino.com/ScreenShot.png.
    How can I use that links in order to make by myself a page where every single user can use them?
    Thank You.
    Pietro

    #122736
    on3advertising
    Participant

    Just got the whole thing working. Here is the code:

    function restrictForum(){
    $db_name = 'dbname';
    $con = mysql_connect("url","username","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);
    $cust_id_form = ('
    Enter Your Customer #
    ');
    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 continue.');
    echo do_shortcode('[bbp-login]');

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

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

    } elseif (!is_user_logged_in()){
    echo $cust_id_form;
    }
    }
    add_shortcode('forum-login-restrict','restrictForum');

    #122734
    AMEtro
    Participant

    Without the fix located at http://mysitemyway.com/docs/index.php/BbPress I get the default blank blog page at /forums/, with it, I get the error Fatal error: Call to undefined function mysite_after_page_content() in /home/content/39/10190339/html/wp-content/themes/twentytwelve/archive-forum.php on line 25
    This only shows up at the bottom, but I can still click on my forum post.
    But when clicking on the forum post, I get the errorFatal error: Call to undefined function mysite_before_entry() in /home/content/39/10190339/html/wp-content/themes/twentytwelve/forum.php on line 26
    And it does NOT display my post, only displays this error. I tried searching the mysite function, but no solution to be found.
    bbPress: 2.2.3
    Wordpress:3.5
    Site: troop121.us

    #122731
    Fee
    Participant

    Hello,

    absolutely happy about the integration of bbPress 2 into BuddyPress groups I tested this out today. BuddyPress was already installed with group forums on, but not used yet. Installed bbPress completely fresh.
    WP 3.5 multisite, bbPress 2.2.3, BuddyPress 1.7-bleeding-#6628, using bp-default theme.
    I followed these steps: http://codex.buddypress.org/buddypress-site-administration/migrating-from-old-forums-to-bbpress-2/
    and this guide: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/

    Result: I can create everything vom backend: Forums, topics, replies.
    I can add topics in frontend to sitewide forums.
    But I cannot create topics to a group forum, also in new groups from frontend – only from backend.
    I found the bug here that Forum tab doesn’t show up at group creation. I don’t know if that matters – if I turn group forum on after creation in admin panel, the tab is there, with all forum empty messages and new topic form. And these group forums show up in the backend forums view under group forums, so the hierarchy is correct.

    Sure this is a test / dev install, no live site. And there’s no hurry, but I’d like to test more out with your plugin 🙂
    Is there something I did wrong until here? Or I could try?

    thanks, Fee

    #122728
    Anonymous User
    Inactive

    Alright. Everything fixed. 😉

    To set the post positions new​​, I created a curious script using the function ‘bb_update_post_positions’ and an sql-query to get all topics by id. I loop through the topics and make an function call for an modified ‘bb_update_post_positions’.

    I describe here only my approach to solve the problem. My php code itself could be dangerous. 🙂

    But if someone has the same problems importing old data (bbPress 1.x)  I’ll help via email.

     

     

     

     

    #122716
    Anonymous User
    Inactive

    Hi JJJ,

    after studying the bbPress 1.1 converter code and an deep look into the mySQL data I know the error. In my installation the field post_position is set for all old post to ‘0’. It’s possible that this is an error form the originally convert from phpBB to bbPress 0.9 some years ago.

    From the import:
    ‘join_expression’ => ‘USING (topic_id) WHERE posts.post_position IN (0,1)’

    So for now – i’m searching for an solution to reset the post_position.

    #122715
    on3advertising
    Participant

    Okay something really strange is happening, I think it’s something to do with the GET method. When I enter the customer ID into the field and hit Submit, my URL blows up! For some reason it’s displaying my connection information for the WordPress db (obviously a big problem). And it keeps growing every time I submit. Not sure if it’s because I’m on a xampp server. Looks something like this


    http://localhost/~homeFolder/Website/forum/?cid=555112&log=myusername&pwd=THEPASSWORD&user-cookie=1&redirect_to=http%3B%2C%Mlocalhost%2F~homeFolder%Website%2F&_wpnonce=a7841878&_wp_http_referer=%2F~homeFolder%Website%2Fforum%2F

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

Viewing 25 results - 14,951 through 14,975 (of 32,503 total)
Skip to toolbar