Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,251 through 23,275 (of 32,468 total)
  • Author
    Search Results
  • #79955
    chrishajer
    Participant

    I think you could probably add it an allowed tags, but I don’t think I’ve ever seen it.

    https://bbpress.org/plugins/topic/admin-can-post-anything/

    https://bbpress.org/forums/topic/plugin-using-the-strike-tag#post-3709

    https://bbpress.org/forums/topic/allowing-html#post-5279

    To align the text, you’re going to need to allow a div or span I think, with a limited number of attributes.

    There was some recent discussion too, with someone posting a lot of code, but I can’t find that reply right now.

    #79887

    In reply to: Link Cloaking

    aiitee
    Member

    hey kawauso, thanks for that code i will try it!

    i was thinking to cloak almost all links inside a post or thread.

    mostly links to download sites like megaupload or rapidshare, etc. but also links to anything inside a post.

    the code from kawauso is exactly what i’m talking about.

    cya and thanks!

    #79923

    In reply to: Some PHP help please

    The cleanest way of doing this hasn’t been mentioned. Instead of using echo commands, it’s a lot easier to just wrap HTML.

    <?php if ( bb_is_user_logged_in() ) : ?>
    this
    <?php elseif : ?>
    not this
    <?php endif; ?>

    #79920
    Mark
    Member

    @olaf, muchos appreciado senor, but I’ve already written my own workaround. :) Just more of a suggestion based on situations I’ve ran into, something to consider as a future feature to make it easier for those who aren’t at home with PHP.

    The problem with simply truncating such a thing is you could wind up with a front page description of something like “The following forum is a good place to…” or something of the sort. I’ve looked at a lot of other bbPress sites in the last couple of months, and they all seem to be fairly out of the box setups, so I’m not so sure this is really widely being sought out, just something that would be fairly easy to implement and might aid in future scalability of bbPress installations.

    #79929
    gerikg
    Member

    part 1. This will work in BBpress only: <?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?> put that in the header.php I’m not sure how to do it in WP to make it work.

    part 2. edit the logged-in.php in your bb theme

    #79921

    In reply to: Some PHP help please

    gerikg
    Member

    me either..

    try this..

    <?php if ( bb_is_user_logged_in() )  echo "";
    else
    echo "PUT_YOUR_LINK_IN_HERE"; ?>

    see if that works, hopefully someone who can write php will chime in.

    #31916
    AphelionZ
    Participant

    I need to create a few urls from my forum root at /community like so:

    /community/forums/ – shows just a simple list of all forums

    /community/leaderboards/ -custom functionality

    /community/achievements/ – more custom functionality

    It’s easy enough to achieve this with a query string and if statements in front-page.php, but I’m trying to use .htaccess to achieve this like so:

    RewriteRule ^forums/$ index.php?view=forums [L,QSA]

    I was getting the bbpress 404 page until I drilled down into bb-admin/functions.bb-core.php and changed line 667 from

    $issue_404 = true;

    to

    $issue_404 = false

    It worked fine but I’m not comfortable changing the core code like that, as it’s indicitave that I’m doing something wrong – but what exactly? What should I change about my approach to get the page to serve correctly?

    #79859
    amylmc
    Member

    I’m not code savvy. Can you please advise the specifics of what and where within the file to add it?

    Thank you!

    #79919
    Olaf Lederer
    Participant

    Maybe you can shorten the desription using this custom php function?

    if (!function_exists('substring_words')) {
    function substring_words($str, $txt_len, $prefix = ' [...]') {
    $words = explode(' ', $str);
    $count = 0;
    $new_str = '';
    $abbr = '';
    foreach ($words as $val) {
    if ($count < $txt_len) {
    $new_str .= $val.' ';
    $count = $count + strlen($val);
    }
    }
    $new_str = rtrim($new_str, ' ,.;:');
    $new_str .= (strlen($str) > $txt_len) ? $prefix : '';
    return $new_str;
    }
    }

    #79844
    Mark
    Member

    Downgrading is not an option.

    If I could use signatures here, that would be my new one. :)

    #79909
    01020230302
    Member

    I have it integrated with WPMU and it works fine in that respect – linking user/pass from WPMU and so on. However, when I login as admin I am able to create post,reply. When I login as a member I am not able to create a new topic and I see the words ‘REPLY’ but no option to :(

    gerikg
    Member

    Josef, take out in wp-config

    /**bbpress integration **/
    define('USER_COOKIE', 'wordpressuser');
    define('PASS_COOKIE', 'wordpresspass');
    define('COOKIEPATH', $base);
    define('SITECOOKIEPATH', '/');
    define('COOKIE_DOMAIN', '.thisissite2.com'); // same as bbPress

    and bb-config

    $bb->wp_home = 'http://thisissite2.com/';
    $bb->wp_siteurl = 'http://thisissite2.com/';

    // Integrating with mu
    $bb->cookiepath = '/';
    $bb->cookiedomain = '.thisissite2.com'; // leading . allows subdomain sharing
    $bb->usercookie = 'wordpressuser'; // WPMU doesn't hash cookies
    $bb->passcookie = 'wordpresspass'; // WPMU doesn't hash cookies

    Use this plugin https://wordpress.org/extend/plugins/bbpress-integration/

    If you’re using MU you will get 4 lines, cookiehash, cookie_domain, sitecookiepath, and cookiepath.

    get the information from there and put it right AFTER this line in wp-config

    * @package WordPress
    */

    then paste only cookie_domain, sitecookiepath, and cookiepath in bb-config file. leave out cookiehash right after

    * @package bbPress
    */

    Then get new keys, use this link https://api.wordpress.org/secret-key/1.1/salt it has 8 keys put it in both like you did before. Don’t forget the BB_ prefix in bb-config.

    Clear your cache and cookies. Give it a try. if that doesn’t work then look in your BB dashboard and check your settings on wordpress integration. make sure if you left out “www” in wordpressd to leave it out on bbpress.

    #79704

    In reply to: Need A Project ShowOff

    @kernow

    Thanks! :)

    raumgleiter
    Member

    Hi,

    With the help of a lot of posts about this topic on this forum I was able to come to a point where I have useres between Wp and BB integrated and I also started the deep integration of WP template and BB press on a test site here:

    http://www.itouchaudio.com/forum

    I added code to my bbpress config to be able to call wordpress functions. Then I copied over the Wp header.php from my wordpress theme into the bbpress theme folder (hope that was right). Now what you see on the above link is the result so far. still got quite a bit of problems I guess. The CSS of the forum seems to be not available so ….

    I am wondering this: What do i do with the CSS files… At the moment I am loading the CSS file from wordpress theme but also the CSS file from the bb press theme…. Of course that doesn’t work 100% as you can see but what should i do? How can you have the CSS for both the Wp and BB theme integrated to work together?

    BTW: In case this is important I am using the bbpress forum theme (the one that mimics the look of the bbpress forum, the one right here).

    I know this goes a bit already into a CSS problem, not specifically BB press anymore but I was hoping some of you might be able to point me into the right direction looking at what I got so far.

    Thanks for any help.

    #79885

    In reply to: Link Cloaking

    johnhiler
    Member
    #79883

    In reply to: Link Cloaking

    <?php
    /*
    Plugin Name: Remove Links (conditional)
    Description: Removes links for non-registered users. Based on <a href="http://ckon.wordpress.com/2007/07/12/bbpress-plugin-bb-tweaks/">bb tweaks</a>.
    Plugin URI: https://bbpress.org/forums/topic/hide-links
    Version: 0.01
    */

    function bb_strip_links( $text ) {
    global $topic;

    $forums = array(
    1,
    2,
    3,
    );

    if ( !in_array( $topic->forum_id, $forums ) )
    return $text;

    if ( !bb_current_user_can( 'write_post' ) )
    $text = preg_replace('|<a (.+?)>(.+?)</a>|i', __('(Login or register to download)'), $text);

    return $text;

    }

    add_filter('post_text', 'bb_strip_links');

    ?>

    #79866
    chrishajer
    Participant

    Many people want integration so that your users can log in to either bbPress or WordPress and not have to log in again when they switch from blog to forum, or forum to blog.

    Others want ‘deep integration’ so they can use WordPress functions (like get_sidebar, get_footer and get_header) in their bbPress installation. Sometimes they want deep integration to make the two themes look similar or identical. Sometimes they want to be able to pull WordPress information into bbPress or vice-versa.

    I integrated a forum with a blog one time but I normally have no use for it. It’s not worth the trouble for me, and I don’t need integration of users or functions.

    #79326

    In reply to: Widgets for bbpress?

    chrishajer
    Participant

    Marius- please stick to one topic per post. I thought this was about widgets then I see this comment about removing the tags bar. If you want to remove the tags, just look in your template files for wherever the tag cloud is displayed, and remove that code. I don’t see a link to your forum so I can’t tell you exactly what to remove.

    I think tags are normally attached to each topic, and also to the front page, and you would need to remove the places where tags can be added as well. Just find those sections in your template files, and delete them or comment them out. Make a copy of all the files first in case you make a mistake and need to revert back.

    #50311

    Okay, after much lucky guessing with regards to the user object handling, I have an ALPHA VERSION of a plugin to do this. There’s nothing to stop spambots, this is purely a proof of concept, I’ll try adding a captcha or something later if necessary. Email verification sounds like a royal pain though. Save the files exactly where I’ve said and as ever, make sure you leave no whitespace around the PHP tags. Apart from that, please test it but it’s your own risk if you run it on a production server.

    my-plugins/register-post/load.php:

    <?php
    /*
    Plugin Name: Register & Post
    Description: Allows a user to register and make a post at the same time.
    Author: Kawauso
    Version: Alpha
    */

    // Add the post form
    add_action( 'post_post_form', 'register_post_form' );

    function register_post_form() {

    global $h2, $forum, $topic;

    if( bb_is_user_logged_in() )
    return;

    // Setup the register form

    $profile_info_keys = bb_get_profile_info_keys();

    unset( $profile_info_keys['first_name'], $profile_info_keys['last_name'], $profile_info_keys['display_name'], $profile_info_keys['occ'], $profile_info_keys['from'], $profile_info_keys['user_url'], $profile_info_keys['interest'] );

    $bb_register_error = new WP_Error;

    $user_login_error = $bb_register_error->get_error_message( 'user_login' );

    ?>
    <style type="text/css">p#post-form-forum-container{display:none}</style>
    <form class="postform post-form" id="postform" method="post" action="<?php bb_uri( 'my-plugins/register-post/create.php', null, BB_URI_CONTEXT_FORM_ACTION )?>">
    <h2 class="postform">Register and post?</h2>
    <fieldset>
    <table width="100%">
    <tr class="form-field form-required required<?php if ( $user_login_error ) echo ' form-invalid error'; ?>">
    <th scope="row">
    <label for="user_login"><?php _e('Username'); ?></label>
    <?php if ( $user_login_error ) echo "<em>$user_login_error</em>"; ?>
    </th>
    <td>
    <input name="user_login" type="text" id="user_login" size="30" maxlength="30" value="<?php echo $user_login; ?>" />
    </td>
    </tr>
    <?php

    if ( is_array($profile_info_keys) ) :
    foreach ( $profile_info_keys as $key => $label ) :
    $class = 'form-field';
    if ( $label[0] ) {
    $class .= ' form-required required';
    }
    if ( $profile_info_key_error = $bb_register_error->get_error_message( $key ) )
    $class .= ' form-invalid error';

    ?>

    <tr class="<?php echo $class?>">
    <th scope="row">
    <label for="<?php echo $key?>"><?php echo $label[1]?></label>
    <?php if ( $profile_info_key_error ) echo "<em>$profile_info_key_error</em>"; ?>
    </th>
    <td>
    <input name="<?php echo $key?>" type="text" id="<?php echo $key?>" size="30" maxlength="140" value="<?php echo $$key?>" />
    </td>
    </tr>

    <?php

    endforeach; // profile_info_keys
    endif; // profile_info_keys

    ?>
    </table>

    <br />

    <?php
    bb_load_template( 'post-form.php', array('h2' => $h2) );
    bb_nonce_field( bb_is_topic() ? 'create-post_' . $topic->topic_id : 'create-topic' );
    if ( bb_is_forum() ) {
    echo '<input type="hidden" name="forum_id" value="' . $forum->forum_id . '" />' . "n";
    } elseif ( bb_is_topic() ) {
    echo '<input type="hidden" name="topic_id" value="' . $topic->topic_id . '" />' . "n";
    }
    echo "n</fieldset>n</form>n";

    }

    my-plugins/register-post/create.php:

    <?php

    require_once('../../bb-load.php');

    $profile_info_keys = bb_get_profile_info_keys();

    unset( $profile_info_keys['first_name'], $profile_info_keys['last_name'], $profile_info_keys['display_name'], $profile_info_keys['occ'], $profile_info_keys['from'], $profile_info_keys['user_url'], $profile_info_keys['interest'] );

    $user_login = '';
    $user_safe = true;

    $bb_register_error = new WP_Error;

    if ( $_POST && 'post' == strtolower($_SERVER['REQUEST_METHOD']) ) {
    $_POST = stripslashes_deep( $_POST );
    $_POST['user_login'] = trim( $_POST['user_login'] );
    $user_login = sanitize_user( $_POST['user_login'], true );
    if ( $user_login !== $_POST['user_login'] ) {
    $bad_input = true;
    if ( $user_login )
    $bb_register_error->add( 'user_login', sprintf( __( "%s is an invalid username. How's this one? <strong>%s</strong>" ), esc_html( $_POST['user_login'] ), $user_login ) );
    else
    $bb_register_error->add( 'user_login', sprintf( __( '%s is an invalid username.' ), esc_html( $_POST['user_login'] ) ) );
    }

    foreach ( $profile_info_keys as $key => $label ) {
    if ( is_string($$key) )
    $$key = esc_attr( $$key );
    elseif ( is_null($$key) )
    $$key = esc_attr( $_POST[$key] );

    if ( !$$key && $label[0] == 1 ) {
    $bad_input = true;
    $$key = false;
    $bb_register_error->add( $key, sprintf( __( '%s is required' ), $label[1] ) );
    }
    }

    if ( !$bad_input ) {

    // Invoke non-user post checks here
    if ( !$post_content = trim($_POST['post_content']) )
    bb_die(__('You need to actually submit some content!'));

    if ( isset($_POST['topic']) && $forum_id = (int) $_POST['forum_id'] ) {

    $topic = trim( $_POST['topic'] );

    if ('' == $topic)
    bb_die(__('Please enter a topic title'));

    } elseif ( isset($_POST['topic_id'] ) ) {
    $topic_id = (int) $_POST['topic_id'];
    bb_check_admin_referer( 'create-post_' . $topic_id );
    }

    if ( !topic_is_open( $topic_id ) )
    bb_die(__('This topic has been closed'));

    // Invoke registration
    $user_id = bb_new_user( $user_login, $_POST['user_email'], null );
    if ( is_wp_error( $user_id ) ) { // Error creating user

    foreach ( $user_id->get_error_codes() as $code )
    $bb_register_error->add( $code, $user_id->get_error_message( $code ) );

    if ( $bb_register_error->get_error_message( 'user_login' ) )
    $user_safe = false;

    } elseif ( $user_id ) { // Registration success

    foreach( $profile_info_keys as $key => $label )
    if ( strpos($key, 'user_') !== 0 && $$key !== '' )
    bb_update_usermeta( $user_id, $key, $$key );

    do_action('register_user', $user_id);

    // Create the current user object

    $wp_auth_object->set_current_user( $user_id );

    $bb_current_user = $wp_auth_object->current;

    // Do last minute post/topic checks
    if ( !empty($topic) && $forum_id = (int) $_POST['forum_id'] ) {

    if ( !bb_current_user_can('write_posts') )
    bb_die(__('You are not allowed to post. Are you logged in?'));

    if ( !bb_current_user_can( 'write_topic', $forum_id ) )
    bb_die(__('You are not allowed to write new topics.'));

    if ( !bb_current_user_can( 'write_topic', $forum_id ) )
    bb_die(__('You are not allowed to write new topics in this forum.'));

    bb_check_admin_referer( 'create-topic' );
    $topic_id = bb_new_topic( $topic, $forum_id, $tags );

    }

    if ( !bb_current_user_can( 'write_post', $topic_id ) )
    bb_die(__('You are not allowed to post in this topic.'));

    // Create the new post
    $post_id = bb_new_post( $topic_id, $_POST['post_content'] );

    $tags = trim( $_POST['tags'] );
    bb_add_topic_tags( $topic_id, $tags );

    $link = get_post_link( $post_id );

    $topic = get_topic( $topic_id, false );

    if ( $topic->topic_posts )
    $link = add_query_arg( 'replies', $topic->topic_posts, $link );

    do_action( 'bb-post.php', $post_id );

    if ( $post_id )
    wp_redirect( $link );
    else
    wp_redirect( bb_get_uri(null, null, BB_URI_CONTEXT_HEADER) );
    exit;
    }
    }
    }

    // If you've reached this point, there must have been an error

    $user_login_error = $bb_register_error->get_error_message( 'user_login' );

    if( empty( $user_login_error ) ) // For some reason, error strings are not always available (i.e. for invalid emails)
    $user_login_error = __( 'Something went wrong! Check what you entered and try again.' );

    bb_die( $user_login_error );

    #79701

    In reply to: Need A Project ShowOff

    Atin
    Member

    Ok, I got your concept.

    However, “Need A Project” can be successful for Indian Engineering Students and you should first try to show it off to your customers i.e. indian engineering students and not here as it seems to be of no use for the guys discussing around

    I will be happy to help you with your project and I hope you can understand that being an Indian I can have an idea about what they people need.

    You can contact me at atingupta at live dot com.

    Have a Happy Day! :)

    #79826

    topic_author()

    #79821
    jivago
    Member

    Open your database, search table “wp_usermeta”, check meta_key “nicname” and change “meta_value” to your nicname for user admin in wordpress.

    This was the problem in my case. I hope help you

    Sorry for my english :(

    #79804
    chrishajer
    Participant

    The constants have different names in wp-config.php and bb-config.php. Just copy and paste the VALUES not the whole line.

    bb-config.php:

    define( 'BBDB_NAME', '123456789' );
    define( 'BBDB_USER', '987654321' );
    define( 'BBDB_PASSWORD', 'goodpassword' );
    define( 'BBDB_HOST', 'localhost or something else' );

    wp-config.php:

    define('DB_NAME', '123456789');
    define('DB_USER', '987654321');
    define('DB_PASSWORD', 'goodpassword');
    define('DB_HOST', 'localhost or something else');

    For bbPress, the constants are name BBDB_ and for WordPress they’re just DB_. You can copy and paste the values, but make sure you don’t change the names from BBDB_ in your bb-config.php.

    #79808

    In reply to: Changing font

    chrishajer
    Participant

    Find the class in style.css in your theme, and change the font there.

    In the text box here, this takes care of it.

    textarea#post_content {
    font-family: arial, helvetica, sans-serif;
    font-size:2.0em;
    color: green;
    }

    You can also just find .postform textarea in the style.css and add your rules there. Either way seemed to work fine.

    #79782

    Probably a good idea, let me know how this one works :P

Viewing 25 results - 23,251 through 23,275 (of 32,468 total)
Skip to toolbar