Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 21,776 through 21,800 (of 32,495 total)
  • Author
    Search Results
  • #85766
    zaerl
    Participant

    Hi Tom, thank for your answer. Unfortunately I cannot took out the display name feature because my mother language isn’t english and in my idiom it’s impossible to write significant portion of text without using characters outside the ASCII base and as far as I know unicode characters can’t be used in login names.

    Anyway I think that I will hack the core even if I know that this isn’t a good thing. I think that I will add an extra check in $wp_users_object->update_user() which in turn call _put_user.

    #85765
    deadlyhifi
    Participant

    I was having this problem on my forum so I took out the display name feature.

    See https://bbpress.org/forums/topic/help-with-basic-command-to-add-new-profile-fields#post-65468

    And delete 'display_name' => array(1, __('Display name as')),

    #86187
    absolutex
    Member

    ok i get it to work :D

    find in meta database and change this table

    meta key

    user_bbdb_name

    and

    user_bbdb_user

    :D

    #86084

    In reply to: Umlaut in member name

    Dailytalker
    Member

    I solved the problem by adding the following additional code to the plugin:

    add_filter( 'get_user_display_name', 'rk_display_name' );

    function rk_display_name($name, $ID = 0) {

    if ( !seems_utf8( $name ) )

    return utf8_encode( $name );

    return $name;

    }

    #86168
    radovanx
    Member

    0.9 yes i use template where i can put le code for this ? thanks

    #54441

    In reply to: Add nofollow to links

    Hi,

    since i have the forum in a different frame of my page, i’d have to add the attribute “target_top” to every link.

    The code below is only for target_blank, or would it be possible to replace every “blank” with “top” and have it working?


    https://bbpress.org/forums/topic/add-nofollow-to-links#post-17523″


    And how do you make the code into a plugin? you copy and paste into a text file, save it as *.php and upload the file in the bbpress plugins folder?

    Thank you very much, every help is very appreciated!

    The Process

    #86128
    gerikg
    Member

    “manage the bbpress forum via the same admin login as the primary WP install.”

    https://wordpress.org/extend/plugins/bbpress-admin/

    “…main wp widgetized sidebar”

    If you did the deep integration you just have to stick <?php getsidebar() ?;> somewhere in you bbpress theme file then mess with you bbpress css to make it fit.

    “..same sort of functionality with editing php and css templates, etc. in bbpress as with WP”

    no such thing

    #86120
    fifthhouse
    Member

    Thanks everyone! I should be able to work this out with these plugins and guidelines. Cheers :)

    #85909
    Kevin Ryman
    Participant

    Once again, nice video tutorial. Keep them coming! :)

    #86118
    johnhiler
    Member

    There’s a nice Mass Delete Users plugin that lets you batch delete members:

    https://bbpress.org/plugins/topic/mass-delete-users/

    I’ve used it before, and it’s great!

    Just make sure to backup your data first, just to be on the safe side. :-)

    I think there are also plugins you can install to disable registration. Let me know if you are interested, and I can try to track one down!

    Kevin Ryman
    Participant

    Even though you changed your mind, this question of yours may come in handy to someone else. Thank you for asking. :)

    #85880
    Gautam Gupta
    Participant

    @Steven

    In the bb Attachments FAQ, it is written:

    if you get error: denied mime on every upload, mime_content_type function or shell access must exist to verify mime types – otherwise you can force all types to be allowed by editing bb-attachments.php and adding 'application/octet-stream' to each of the $bb_attachments['allowed']['mime_types']

    And as I can see in the dump you pasted, neither mime_content_type is enabled, nor shell access, so you would need to add 'application/octet-stream' to each of the $bb_attachments['allowed']['mime_types'] in bb-attachments.php.

    #86080

    In reply to: Umlaut in member name

    Dailytalker
    Member

    I looked a bit around and found a peace of code with which I was able to create a plugin.

    <?php

    /*

    Plugin Name: UTF-8 usernames

    Description: This plugin enables utf-8 characters in usernames. Mbstring must be enabled in the php.ini.

    */

    function sanitize_user_mbstring( $raw_username, $username, $strict = false ) {

    $raw_username = $username;

    $username = strip_tags($username);

    // Kill octets

    $username = preg_replace(‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username);

    $username = preg_replace(‘/&.+?;/’, ”, $username); // Kill entities

    // Usage of ‘mb_ereg_replace’ instead of ‘preg_replace’ to preserve accents.

    if ( $strict )

    $username = mb_ereg_replace(‘|[^a-z0-9 _.-@]|i’, ”, $username);

    return apply_filters(‘sanitize_user_mbstring’, $username, $raw_username, $strict);

    }

    add_action(‘sanitize_user’, ‘sanitize_user_mbstring’, 0, 3);

    ?>

    Unfortunately it doesn’t work properly. When it displays correctly in bbpress it doesn’t in wordpress and reverse. I don’t have access to the php.ini. Could it be, that the thing with “mbstring” is the problem?

    #77528

    In reply to: All RSS Feeds Broken?

    Dailytalker
    Member

    I solved the problem!

    I removed all “»” in the rss.php

    Replace the code of your rss.php with the following code and it should work:

    <?php<br />
    require('./bb-load.php');</p>
    <p>// Determine the type of feed and the id of the object<br />
    if ( isset($_GET['view']) || bb_get_path() == 'view' ) {</p>
    <p> // View<br />
    $feed = 'view';<br />
    $feed_id = isset($_GET['view']) ? $_GET['view'] : bb_get_path(2);</p>
    <p>} elseif ( isset($_GET['topic']) || bb_get_path() == 'topic' ) {</p>
    <p> // Topic<br />
    $feed = 'topic';<br />
    $topic = get_topic(isset($_GET['topic']) ? $_GET['topic'] : bb_get_path(2));<br />
    $feed_id = $topic->topic_id;</p>
    <p>} elseif ( isset($_GET['profile']) || bb_get_path() == 'profile' ) {</p>
    <p> // Profile<br />
    $feed = 'profile';<br />
    $feed_id = isset($_GET['profile']) ? $_GET['profile'] : bb_get_path(2);</p>
    <p>} elseif ( isset($_GET['tag']) || bb_get_path() == 'tags' ) {</p>
    <p> if ( isset($_GET['topics']) || bb_get_path(3) == 'topics' ) {<br />
    // Tag recent topics<br />
    $feed = 'tag-topics';<br />
    } else {<br />
    // Tag recent posts<br />
    $feed = 'tag-posts';<br />
    }<br />
    $feed_id = isset($_GET['tag']) ? $_GET['tag'] : bb_get_path(2);</p>
    <p>} elseif ( isset($_GET['forum']) || bb_get_path() == 'forum' ) {</p>
    <p> if ( isset($_GET['topics']) || bb_get_path(3) == 'topics' ) {<br />
    // Forum recent topics<br />
    $feed = 'forum-topics';<br />
    } else {<br />
    // Forum recent posts<br />
    $feed = 'forum-posts';<br />
    }<br />
    $forum = bb_get_forum(isset($_GET['forum']) ? $_GET['forum'] : bb_get_path(2));<br />
    $feed_id = $forum->forum_id;</p>
    <p>} elseif ( isset($_GET['topics']) || bb_get_path() == 'topics' ) {</p>
    <p> // Recent topics<br />
    $feed = 'all-topics';</p>
    <p>} else {</p>
    <p> // Recent posts<br />
    $feed = 'all-posts';</p>
    <p>}</p>
    <p>// Initialise the override variable<br />
    $bb_db_override = false;<br />
    do_action( 'bb_rss.php_pre_db' );</p>
    <p>if ( !$bb_db_override ) {</p>
    <p> // Get the posts and the title for the given feed<br />
    switch ($feed) {<br />
    case 'view':<br />
    if ( !isset($bb_views[$feed_id]) )<br />
    die();<br />
    if ( !$bb_views[$feed_id]['feed'] )<br />
    die();<br />
    if ( !$topics_object = new BB_Query( 'topic', $bb_views[$feed_id]['query'], "bb_view_$feed_id" ) )<br />
    die();</p>
    <p> $topics = $topics_object->results;<br />
    if ( !$topics || !is_array($topics) )<br />
    die();</p>
    <p> $posts = array();<br />
    foreach ($topics as $topic) {<br />
    $posts[] = bb_get_first_post($topic->topic_id);<br />
    }</p>
    <p> $title = esc_html( sprintf( __( '%1$s View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] ) );<br />
    $link = get_view_link($feed_id);<br />
    $link_self = bb_get_view_rss_link($feed_id);<br />
    break;</p>
    <p> case 'topic':<br />
    if ( !$topic = get_topic ( $feed_id ) )<br />
    die();<br />
    if ( !$posts = get_thread( $feed_id, 0, 1 ) )<br />
    die();<br />
    $title = esc_html( sprintf( __( '%1$s Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title() ) );<br />
    $link = get_topic_link($feed_id);<br />
    $link_self = get_topic_rss_link($feed_id);<br />
    break;</p>
    <p> case 'profile':<br />
    if ( bb_get_option( 'mod_rewrite' ) === 'slugs' ) {<br />
    $user = bb_get_user_by_nicename( $feed_id );<br />
    } else {<br />
    $user = bb_get_user( $feed_id );<br />
    }<br />
    if ( !$user ) {<br />
    die();<br />
    }<br />
    if ( !$posts = get_user_favorites( $user->ID ) ) {<br />
    die();<br />
    }<br />
    $title = esc_html( sprintf( __( '%1$s User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_login ) );<br />
    $link = bb_get_profile_link($feed_id);<br />
    $link_self = get_favorites_rss_link($feed_id);<br />
    break;</p>
    <p> case 'tag-topics':<br />
    if ( !$tag = bb_get_tag( $feed_id ) )<br />
    die();<br />
    if ( !$topics = get_tagged_topics( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )<br />
    die();</p>
    <p> $posts = array();<br />
    foreach ($topics as $topic) {<br />
    $posts[] = bb_get_first_post($topic->topic_id);<br />
    }</p>
    <p> $title = esc_html( sprintf( __( '%1$s Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name() ) );<br />
    $link = bb_get_tag_link($feed_id);<br />
    $link_self = bb_get_tag_topics_rss_link($feed_id);<br />
    break;</p>
    <p> case 'tag-posts':<br />
    if ( !$tag = bb_get_tag( $feed_id ) )<br />
    die();<br />
    if ( !$posts = get_tagged_topic_posts( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )<br />
    die();<br />
    $title = esc_html( sprintf( __( '%1$s Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name() ) );<br />
    $link = bb_get_tag_link($feed_id);<br />
    $link_self = bb_get_tag_posts_rss_link($feed_id);<br />
    break;</p>
    <p> case 'forum-topics':<br />
    if ( !$topics = get_latest_topics( $feed_id ) )<br />
    die();</p>
    <p> $posts = array();<br />
    foreach ($topics as $topic) {<br />
    $posts[] = bb_get_first_post($topic->topic_id);<br />
    }</p>
    <p> $title = esc_html( sprintf( __( '%1$s Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );<br />
    $link = get_forum_link($feed_id);<br />
    $link_self = bb_get_forum_topics_rss_link($feed_id);<br />
    break;</p>
    <p> case 'forum-posts':<br />
    if ( !$posts = bb_get_latest_forum_posts( $feed_id ) )<br />
    die();<br />
    $title = esc_html( sprintf( __( '%1$s Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );<br />
    $link = get_forum_link($feed_id);<br />
    $link_self = bb_get_forum_posts_rss_link($feed_id);<br />
    break;</p>
    <p> // Get just the first post from the latest topics<br />
    case 'all-topics':<br />
    if ( !$topics = get_latest_topics() )<br />
    die();</p>
    <p> $posts = array();<br />
    foreach ($topics as $topic) {<br />
    $posts[] = bb_get_first_post($topic->topic_id);<br />
    }</p>
    <p> $title = esc_html( sprintf( __( '%1$s Recent Topics' ), bb_get_option( 'name' ) ) );<br />
    $link = bb_get_uri();<br />
    $link_self = bb_get_topics_rss_link();<br />
    break;</p>
    <p> // Get latest posts by default<br />
    case 'all-posts':<br />
    default:<br />
    if ( !$posts = bb_get_latest_posts( 35 ) )<br />
    die();<br />
    $title = esc_html( sprintf( __( '%1$s Recent Posts' ), bb_get_option( 'name' ) ) );<br />
    $link = bb_get_uri();<br />
    $link_self = bb_get_posts_rss_link();<br />
    break;<br />
    }<br />
    }</p>
    <p>bb_send_304( $posts[0]->post_time );</p>
    <p>if (!$description = esc_html( bb_get_option('description') )) {<br />
    $description = $title;<br />
    }<br />
    $title = apply_filters( 'bb_title_rss', $title, $feed );<br />
    $description = apply_filters( 'bb_description_rss', $description, $feed );<br />
    $posts = apply_filters( 'bb_posts_rss', $posts, $feed );<br />
    $link_self = apply_filters( 'bb_link_self_rss', $link_self, $feed );</p>
    <p>bb_load_template( 'rss2.php', array('bb_db_override', 'title', 'description', 'link', 'link_self'), $feed );</p>
    <p>?>

    #86025
    chrishajer
    Participant

    Looks like that information is stored in the bb_meta table in the bbPress database, with the following values:

    meta_id: autoincrement

    object type: bb_option

    object_id: 0 (always zero in my case)

    meta_key: these 4

    user_bbdb_name
    user_bbdb_user
    user_bbdb_password
    user_bbdb_host

    meta_value: your database name, user, password and host.

    Screenshot: http://chrishajer.com/bbpress/cloner-userdatabase.png

    HTH

    #85906
    arpowers
    Member

    here’s a second one for ‘deep integrating’ with WP ( our customers struggle with that :)

    http://www.pagelines.com/posts/deep-integration-with-bbpress/

    Wait, is this just an installation procedure or integration procedure?

    First is installing bbPress, second is deep integrating..

    #86023
    cloner
    Participant

    Chris,

    The forum was set up and functoned for years with the split databases. Posts are saved in the bbPress db, whilst users are saved in the WordPress db. Now, for some reason, bbPress cannot read the user info from the WordPress db. I’ve tried to reinstall, but once I’ve completed “Step 1” and click the button to move to “Step 2”, the page is redirected to the forum homepage and I never get an opportunity to get to “Step 2”. I assume the installation script realized that there is already an installation of bbPress present and refuses to go further.

    My questions is, how (in the code) are bbPress and WordPress tied together? What could be fouled up that makes it impossible for bbPress to read the existing user data from WordPress?

    #86068

    In reply to: BBCODE not working

    johnhiler
    Member

    bbPress markup sounds suspiciously like hyper text markup. :-)

    #86067

    In reply to: BBCODE not working

    benbt-japan
    Member

    bbpress markup requires < > not [ ] around the tags.

    #33812
    benbt-japan
    Member

    This new forum has just been installed, but I have noticed – as I write a guide for non-English users of the forums in Japanese – that bbcode does not seem to be working. The url is http://www.language-global.com/language/forums/ but it might be quicker just to tell me if the following bbcode ‘tags’ work on bbpress :

    [ul][li][/li][/ul] & [strong][/strong]

    The message beneath the posting box includes all of those in the list of allowed markup, but none of them are working at the moment. Have also searched the admin area for some control over bbcode but couldn’t find any.

    Very happy with the look and feel of bbpress after wrestling with a certain WP plugin for almost two days without achieving what I have achieved with this forum in one afternoon.

    #86021
    johnhiler
    Member

    What do you mean about the bbPress querying the WordPress database for user data? I thought most posts are showing up as Anonymous?

    If they are different database, then that explains the problem. You want to install both WordPress and bbPress inside of a single database, if they are going to share users. This guide to integration might be useful.

    https://bbpress.org/forums/topic/wordpress-and-bbpress-integration-101

    It’s a bit outdated, but I’m guessing it will give you a nice lay of the land. :-)

    #86011
    cloner
    Participant

    OK…..in bb-config.php, there is a line that reads:

    // of the “SECRET_KEY” in the WordPress file wp-config.php

    define(‘BB_SECRET_KEY’, ‘6koHWRD9d{XOEQ-S5+T[Or|TK[at.G8Qo~s,Z$]n:Yt:Ts%+uVpO.]MI3$’); // Change this to a unique phrase.

    Then, in wp-config.php, there’s a line that reads:

    define(‘LOGGED_IN_KEY’, ‘6koHWRD9d{XOEQ-S5+T[Or|TK[at.G8Qo~s,Z$]n:Yt:Ts%+uVpO.]MI3$’|P]tL’);

    Notice the line in bbpress is missing the characters: ‘|P]tL’

    I don’t know if the ‘ between and | is the end of the phrase and the P[tl is code, or if the whole ‘|P]tL should be added, but it seems odd that they don’t match EXACTLY.

    Reckon this is an issue? I don’t know why it would have changed, but something’s askew.

    #86057

    In reply to: Hidden posts

    guarda-faro
    Member

    I already know that plugin. In fact I found the operative version of the same and I proved it. It has some deficiencies that I did not like. I rejected to use it. I do not understand the reason bbPress does not include the use of static pages. He is not so complicated. On the other hand, I prefer not to use plugins, if I can avoid it. For that reason I prefer to find another form through some function that I can incorporate to the code of my template.

    Thank you

    #77524

    In reply to: All RSS Feeds Broken?

    yoyopop
    Member

    @ kawauso

    I applied the patches suggested via the trac and your comments but my rss feed is still returning invalid in Chrome, Opera and Firefox (in Safari it works fine)

    it does seem to be something wrong with the markup via an extra space in front of the xml declaration somewhere…

    Anyone have any ideas??

    Chrome:

    error on line 1 at column 6: XML declaration allowed only at the start of the document

    Opera:

    XML parsing failed: syntax error (Line: 1, Character: 1)

    Error:XML declaration not at beginning of document

    and it shows a space in front of the initial <? xml

    Firefox:

    XML Parsing Error: XML or text declaration not at start of entity

    Location: /rss.php?topic=2074

    Line Number 1, Column 2: <?xml version=”1.0″ encoding=”UTF-8″?>

    -^

    #85996

    Update: I seem to have gotten it working, by inserting the following code directly to function bb_safe_redirect within functions.bb-pluggable.php, right before the line checking against $allowed_hosts:

    $allowed_redirects = array();

    $allowed_redirects[] = 'offsite-feedback-forum.com';

    $allowed_redirects[] = 'base-blog-url.com';

    $allowed_redirects[] = 'base-blog-url.com/wordpress-installed-directory';

    add_filter('allowed_redirect_hosts', 'add_allowed_redirect_hosts');

    I originally tried to do this from a plugin, as the code above is copied from a handy WordPress plugin, but I was not able to get it to work without sticking it right within the pluggable.php file. If anybody has a better suggestion, I’d love to avoid editing the core files if possible!

Viewing 25 results - 21,776 through 21,800 (of 32,495 total)
Skip to toolbar