Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,001 through 15,025 (of 32,581 total)
  • Author
    Search Results
  • #123037
    Hansaplastique
    Participant

    If anyone can tell me how to properly post code I’ll try again. 🙁

    #123036
    Hansaplastique
    Participant

    Sorry that the code looks a little messy, the code-tag didn’t do a very good job at keeping the indentation and there is no edit button …. hmmm.
    I’ll just give it another try.


    function bbp_mce_override( $args = array() ) {
    $args['teeny'] = false;
    return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_mce_override' );

    if (!is_super_admin()) // remove buttons for non admins
    {
    function add_tinymce_buttons($buttons)
    {
    $arr_size=count($buttons);
    $remove_these=array('blockquote','wp_adv','fullscreen','wp_more');

    for ($counter=$arr_size; $counter>=0; $counter--)
    {
    if ( in_array($buttons[$counter],$remove_these) )
    {
    unset($buttons[$counter]);
    }
    }

    array_push($buttons,'image');

    return $buttons;
    }

    function add_tinymce_buttons_2($buttons)
    {
    unset($buttons);
    return $buttons;
    }

    add_filter('mce_buttons', 'add_tinymce_buttons');
    add_filter('mce_buttons_2', 'add_tinymce_buttons_2');
    }

    #123035
    Hansaplastique
    Participant

    I’ve used the following code to remove some buttons for non-admins.
    This will keep your normal editor in the admin pages as they should stay, yet visitors of my bbPress forum can only use a few buttons.
    You can find a list of “standard” buttons in tinyMCE here.

    Place this code in the functions.php file of your theme.
    (ps. I’m no expert and pretty new to bbPress – but this worked like a charm for me)

    function bbp_mce_override( $args = array() ) {
    $args['teeny'] = false;
    return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_mce_override' );

    // *********************** CUSTOMIZE TINYMCE BUTTONS FOR BBPRESS *****************************
    if (!is_super_admin()) // remove buttons for non admins
    {
    function add_tinymce_buttons($buttons)
    {
    $arr_size=count($buttons);
    // remove blockquote, kitchen-sink, full-screen and the more-button
    $remove_these=array('blockquote','wp_adv','fullscreen','wp_more');

    for ($counter=$arr_size; $counter>=0; $counter--)
    {
    if ( in_array($buttons[$counter],$remove_these) )
    {
    unset($buttons[$counter]);
    }
    }

    // add the "image" button
    array_push($buttons,'image');

    return $buttons;
    }

    // Erase the entire 2nd button bar
    function add_tinymce_buttons_2($buttons)
    {
    unset($buttons);
    return $buttons;
    }

    add_filter('mce_buttons', 'add_tinymce_buttons');
    add_filter('mce_buttons_2', 'add_tinymce_buttons_2');
    }

    #123034
    Hansaplastique
    Participant

    I’m no expert (and pretty new to bbPress), but this is how I forced tinyMCE for bbPress 2.2.3 to use my stylesheet for content.

    You’ll need a CCS file with your preferences of course, and add the following code to functions.php found in the root of your theme – in my case I’m using the CSS of my theme.
    This will also apply the selected CSS to the editor in your admin pages (for Posts etc).

    function tinymce_other_css_for_content( $init ) {
    $init['content_css'] = get_bloginfo('stylesheet_url');
    return $init;
    }

    add_filter('tiny_mce_before_init', 'tinymce_other_css_for_content');

    #123019
    rewindcaz
    Participant

    In any theme file (preferably header.php), how can I check if the current page is a bbp-user-page, the pages that show info regarding the bbp-user. Using bbp_is_user_home() I can see if the current user is on his user-page, but I need to check if the user-page is current regardless of who is viewing it. Anyone know how? Thanks

    AllenPayne
    Participant

    @John James Jacoby

    Ultimate TinyMCE buttons show up now after using your code but they don’t work.

    I just created a new bbpress post and used the Ultimate TinyMCE’s buttons to make some text bold, change the font size, color, underline, etc.. and when i submitted the post only the bold text remained unchanged. All my other formatting (font size, color, underline) was not preserved and was lost after submission.

    Please help.

    #122838
    rewindcaz
    Participant

    I’m running into an odd problem, I need to apply some custom changes to the base forums page/index, which would be easy except for this issue: If I try to get the url, title, or any value of the index page, it uses all the values from the last Category in that forum. To further clarify, if my 4 main categories of my forum index are:

    – Forums –
    Basketball
    Football
    Volleyball
    Tennis

    And on this index page wherever I use echo the_title();, it will show “Tennis” instead of “Forums”. It does this for ANY wp variable/function etc. The Forum Index simply uses the values of the last category. If I change the order of the categories, or add a new forum, the forum index values will change to the last descending forum. This is making it impossible for me to print specific information out on the forums index page.

    Anyone have any idea what the issue is that’s causing it? I’ve played around with permalinks, pages, posts etc… it always does the same thing.

    #122836
    rewindcaz
    Participant

    The closest thing I could find is:

    echo get_the_title($post->post_parent);

    However, that only grabs the parent from one step back in the bread crumb. I need to get the “main” or “base” parent of all pages/threads under the parent. Say the forum structure is like this:

    Forum > Tennis > Tutorials > Thread Name 1

    The set “parent” in that is “Tennis” (bolded above). Is there a way I can print that main parent for all bbPress pages?

    #122835
    rewindcaz
    Participant

    All I want is a way to print the name of the parent category for any given bbPress page from the header.php file of my theme.

    I need something as simple as:

    echo forum_name($forum->forum_parent);

    Although that doesn’t work for me. Anyone know how to get the parent name? Thanks!

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

Viewing 25 results - 15,001 through 15,025 (of 32,581 total)
Skip to toolbar