Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 31,201 through 31,225 (of 32,432 total)
  • Author
    Search Results
  • #53976
    Null
    Member

    Quote I think your post may be corrupted: did you mean to say

    <li class= >

    ?

    Yes it got corrupted, <a class=> is what I ment.

    Btw to solve my ‘problem’ I am indeed going to use the switch thingy (read some more about it), so it will check some hardcoded “location” first and then check the db list. It’s kinda an ugly workaround, but normal users wont be bothered with this code anyway…

    Anyone has any ideas about the IE “bug” ??

    #54012
    chrishajer
    Participant

    I had a similar problem on bbpress.org/forums/, which resulted in a 408 timeout. I posted about that problem here.

    Thanks for the bump.

    #54031
    so1o
    Participant

    on the top of config.php add

    define('WP_BB', true);

    and

    require_once( '/absolute/path/to/wordpress/ config/file/wp-config.php');

    #53003
    davidbessler
    Member

    Problem: With forum restriction, I use the following code to filter topics with the default views:

    function forum_restriction_list_of_allowed_forums($user) {

    global $forum_restriction_allowed_in_forum,$bb_current_user;

    foreach ($forum_restriction_allowed_in_forum as $forum_number => $forum_memberlist){

    if (ereg(get_user_name($user),$forum_memberlist) || $forum_memberlist ==''){

    $list_of_allowed_forums .= "'".$forum_number."',";

    }

    }

    $list_of_allowed_forums = rtrim($list_of_allowed_forums,",");

    return $list_of_allowed_forums;

    }

    // FILTER TOPICS

    function forum_restriction_get_latest_topics_where( $where ) {

    if (bb_is_user_logged_in()) {

    global $bb_current_user;

    $list_of_allowed_forums = forum_restriction_list_of_allowed_forums($bb_current_user->ID);

    $where .= " AND forum_id IN ($list_of_allowed_forums) ";

    echo "where is set to: $where";

    return $where;

    } else {

    return $where;

    }

    }

    add_filter ( 'get_latest_topics_where', 'forum_restriction_get_latest_topics_where' );

    The problem is this doesn’t work with bb_custom_views used by since-last-visit.php. It seems the plugin changes the $where AFTER forum-restriction has already tried to filter the $where.

    How do I get forum_restriction_get_latest_topic_where to add ” AND forum_id IN ($list_of_allowed_forums) ” to $where AFTER since-last-post sets $where?

    Kapish?

    #50881

    In reply to: No Site Keymasters

    teknoseyir
    Member

    Hi, after upgrading to bbPress 0.75, we faced with this problem, too.

    The key master’s status had changed to administrator, and administrators’ custom titles had been reset.

    I’ve added the given code to config.php and applied bb-admin/install.php, and admin is again key master now. But in topics, key master’s link to his profile and his custom title cannot be shown now.

    #54010
    chrishajer
    Participant

    Still having this problem today. My database is on a different server. Maybe in most circumstances, it’s on localhost. Would mysql_connect() cause a delay where mysql_pconnect() would be more appropriate with the database being on a different server? Just asking: I had a problem with persistent connections causing about a 30 second delay with an application before, and the pconnect fixed that problem.

    Also, if you make two quick posts on one topic, the second one seems to go in quickly, without the 45 second delay. It appears normal.

    #1336
    kineda
    Member

    I’m trying to integrate WordPress 2.07 and bbpress 0.75, but I’m not having any luck! :(

    I’ve followed the instructions found here:

    http://bbpress.org/documentation/integration-with-wordpress/

    The following is a copy of my bbPress config.php file.

    <?php

    // ** MySQL settings ** //

    define(‘BBDB_NAME’, ”); // The name of the database

    define(‘BBDB_USER’, ”); // Your MySQL username

    define(‘BBDB_PASSWORD’, ”); // …and password

    define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    // Change the prefix if you want to have multiple forums in a single database.

    $bb_table_prefix = ‘bb_’; // Only letters, numbers and underscores please!

    // If your bbPress URL is http://bbpress.example.com/forums/ , the examples would be correct.

    // Adjust the domain and path to suit your actual URL.

    // Just the domain name; no directories or path. There should be no trailing slash here.

    $bb->domain = ‘http://www.kineda.com&#8217;; // Example: ‘http://bbpress.example.com&#8217;

    // There should be both a leading and trailing slash here. ‘/’ is fine if the site is in root.

    $bb->path = ‘/hype/’; // Example: ‘/forums/’

    // What are you going to call me?

    $bb->name = ‘Hype’;

    // This must be set before running the install script.

    $bb->admin_email = ”;

    // Set to true if you want pretty permalinks.

    $bb->mod_rewrite = true;

    // The number of topics that show on each page.

    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.

    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.

    $bb->gmt_offset = 0;

    // Change this to localize bbPress. A corresponding MO file for the

    // chosen language must be installed to bb-includes/languages.

    // For example, install de.mo to bb-includes/languages and set BBLANG to ‘de’

    // to enable German language support.

    define(‘BBLANG’, ”);

    // Your Akismet Key. You do not need a key to run bbPress, but if you want to take advantage

    // of Akismet’s powerful spam blocking, you’ll need one. You can get an Akismet key at

    // http://wordpress.com/api-keys/

    $bb->akismet_key = ‘e9a77fed10be’; // Example: ”

    // The rest is only useful if you are integrating bbPress with WordPress.

    // If you’re not, just leave the rest as it is.

    $bb->wp_table_prefix = ‘wp_’; // WordPress table prefix. Example: ‘wp_’;

    $bb->wp_home = ‘http://www.kineda.com&#8217;; // WordPress – Options->General: Blog address (URL) // No trailing slash. Example: ‘http://example.com&#8217;

    $bb->wp_siteurl = ‘http://www.kineda.com&#8217;; // WordPress – Options->General: WordPress address (URL) // No trailing slash. Example: ‘http://example.com&#8217;

    /* Stop editing */

    define(‘BBPATH’, dirname(__FILE__) . ‘/’ );

    require_once( BBPATH . ‘bb-settings.php’ );

    ?>

    After setting the config file, I went through the install process for bbPress. Then I downloaded the following plugins: wordpress-integration.php (placed in my-plugins) and bbpress-integration (activated in WordPress and set table prefix to bb_)

    The only account that works through both logins is the admin account. When I check the tables for the bbPress database I see this:

    bb_forums

    bb_posts

    bb_tagged

    bb_tags

    bb_topicmeta

    bb_topics

    wp_usermeta

    wp_users

    I checked wp_users and there is only 1 user in the database.

    This is driving me nuts!!! Any help would be appreciated.

    #1335
    ralphdagza
    Member

    Someone told me that this might work..

    <?

    get_header();

    /* HTML Stuff here, if you need to */

    include "bbpress.here";

    get_sidebar();

    get_footer();

    ?>

    can someone PLEASE explain this to me.

    what should i put here? >> “bbpress.here”

    and another question, where is the place to install bbpress?

    subfolder? or subdomain?

    thanks

    #53974
    ear1grey
    Member

    I think your post may be corrupted: did you mean to say

    <li class= >

    ?

    #53973
    Null
    Member

    But then I will have <li class= > and They wont conflict?

    Btw the code you gave doesn’t work. They beta is the most stable I’ve got working correctly. So if you like to help me out, plz take a look at it. And yes the beta has the “wrong” id coding.

    #53972
    ear1grey
    Member

    Syntactically speaking: only if a page does not validate is it “wrong”.

    Semantically speaking: if a page uses id to encode semantic meaning then it is syntactically correct, but semantically naive (which for a “semantic personal publishing platform” is sub-optimal).

    There are possibly places where WP gets semantically wrong, but, a lot (possibly all) of this is down to theme and plugin designers who are often unaware of the semantic issues.

    Anyhow, your description in the opening post (two items returning “current” as their id) is something that will create a non-validating document, so it would be syntactically wrong.

    In summary: id is for addressing elements, class is for describing them.

    #53971
    Null
    Member

    Yeah I know about the id/class thingy, but even WP uses id instead of class. So why do they do that?. Are they wrong too? Perhaps I will change it in the official release, I just want to have it working first :)

    #53970
    ear1grey
    Member

    So, I think now you’re getting the function name “is_bb_search” (among other function names) from the db and you want to execute it to know if a particular list item should be marked as current.

    If that’s the case then it’s what I described before, which is something like where the function name is defined in $rw["location"] so…

    ...

    $page_location = $page->location;

    $switch = eval("return ".$rw["location"]);

    $current = ($switch ? ' class="current"' : "");

    echo "<li $current><a href="$page_id">$page_item</a></li>";

    ...

    #53969
    ear1grey
    Member

    …only the front page is id-ed as current as the forum link is active, while topic-page should return as current aswell, cause I want this page to be “under” the forum link as well…

    <grimace />

    If you do that (a) your page won’t validate and (b) there’s no guarantee of how the browser will interpret the content because HTML4 and XHTML specs require that element ID is unique in a page.

    From HTML4 spec:

    “id ID #IMPLIED — document-wide unique id —

    class CDATA #IMPLIED — space-separated list of classes —

    Yet another reason to use class="current". Using classes and ID’s appropriately is important.

    #54026

    Have you installed Simple Onlinelist 1.4? Without this, the posts since last visit plugin wont work at the moment …

    #53704
    chrishajer
    Participant

    Thank you mdawaffe :)

    #1260
    baptiste
    Member

    All,

    I’ve posted a few things on the forums about odd behavior I’ve seen – href attributes in a tags getting stripped, slashes not getting stripped, etc.

    I’ve confirmed that these problems are due to the WordPress integration. I am running WordPress 2.1 and bbPress 0.75 and followed the documentation to do the integration.

    When I stop loading wp-config in my bbPress config, the slashes get removed and href attributes stay in posts.

    I’m still digging, but part of this problem is overlap between WordPress and bbPress. The docs talk about a constant WP_BB that tells the code there are possibly conflicting APIs out there. Setting it causes bbPress to use the kses code from WordPress instead. WordPress 2.1 uses kses v0.2.2 while bbPress ships with v0.2.1. My guess is something changed between the two that bbPress doesn’t handle.

    As for the slashes in front of apostrophes, it MAY be part of it – I’m not sure yet if kses is used to strip slashes. I didn’t think kses got called except during posting, not during viewing. There is another library from WordPress that bbPress uses in integration mode (l10n) for localization – not sure if this is involved in anyway (doubt it)

    So if you’re seeing weird behavior – it may very well be intergation. But the good news is it doesn’t seem to be overly difficult to fix. Still digging to find the ‘right’ way (though as a hack for the slash problem, you can include a stripslashes call in template-functions:

    function get_post_text() {

    global $bb_post;

    // Hack to strip slashes until WordPress integration is fixed

    return stripslashes($bb_post->post_text);

    }

    Anyway – just an FYI. I’ll dig more into the kses href issue and post if I find anything.

    #50384
    larmir
    Member

    This seems to work for the text. Thanks so much baptiste.

    One more question, the issue still exists in the title. I’m guessing I need to update this expression, just unsure of the syntax:

    function get_topic_title( $id = 0 ) {

    global $topic;

    if ( $id )

    $topic = get_topic( $id );

    return apply_filters( 'get_topic_title', $topic->topic_title, $id );

    }

    #50383
    baptiste
    Member

    Easy fix (hack) in bb-includes/template-functions.php, update this function to look like this:

    function get_post_text() {

    global $bb_post;

    return stripslashes($bb_post->post_text);

    }

    May be an artifact of the wordpress integration – not sure.

    #51965

    lo all, I have the same problem as Staffan, when I use this fine plugin, I get no name name displayed, I have just installed the 0.75 of BBPress, and I do not have any option in my profile to enter a nicename at all, hence why the assigned database entry (‘user_nicename’) doesn’t hold a Nicename 😮

    Well I could enter a Nicename via phpMyAdmin, but that’s surely not the way to work that out, because tbh I am way too lazy, to do that for every future user registering with the forum ;)

    ==edit==

    Nevermind my post above, just sorted it out, it works, IF you install BBP with the database tables from WP in the config.php, but NOT IF you install BBP without these information ;)

    So the nicename from the WP user-table is being used, also means, users have to enter their WP profile to change that, as this is NOT possible via BBP profile

    Thx anyways :D

    ==end edit==

    Anyhow, a pretty nice plugin, keep up the good work Atsutane :)

    #53968
    Null
    Member

    Got the for each working:

    <ul id="navlist">

    <?php $pages = get_bb_menu();

    if ($pages) {

    foreach ($pages as $page) {

    $page_id = $page->page;

    $page_item = $page->item;

    $page_location = $page->location;

    echo "<li><a href="".($page_id)."">".($page_item)."</a></li>n";

    }

    }

    ?>

    </ul>

    The problem is, how can I let it spit:

    <li><a <?php if (is_bb_search())

    {

    echo "id="current"";

    }?> href="$page_id">$page_item</a></li>

    And is_bb_search() is $page_location = $page->location;

    #53556
    davidbessler
    Member

    Can someone tell me how to include the text of the first post in the new topic in the notification email. Here is the code I am using:

    function forum_restriction_send_email ($topic_id){

    if (bb_get_option('forum_restriction_notify') == "on") {

    global $forum_restriction_allowed_in_forum, $bbdb, $bb_current_user;

    $topic = get_topic($topic_id);

    $forum = $topic->forum_id;

    $mailing_list = split(",",$forum_restriction_allowed_in_forum[$forum]);

    $message = __("There is a new topic called: %1$s. You can see it here %3$s. You got this email because Bessler decided to turn on the option to notify all members of restricted forums when there are new TOPICS started in each FORUM. However, don't forget to click on "Add this topic to your favorites" so that you get an email when someone adds a POST to this TOPIC. This will keep you involved in that particular discussion. Kapish?");

    foreach ($mailing_list as $member) {

    $userdata = $bbdb->get_var("SELECT ID FROM $bbdb->users WHERE display_name = '$member'");

    $email_address .= $bbdb->get_var("SELECT user_email FROM $bbdb->users WHERE ID='$userdata'").",";

    }

    mail( $email_address, '['.bb_get_option('name') . '] ' . __('New Topic In Private Forum:').get_forum_name($forum),

    sprintf( $message, $topic->topic_title, get_user_name($bb_current_user->ID), get_topic_link($topic_id) ),

    'From: ' . bb_get_option('admin_email')

    );

    }

    }

    add_action('bb_new_topic', 'forum_restriction_send_email');

    #53839

    In reply to: Why Key Masters?

    Null
    Member

    Now let’s call version 1.0 Gozer :)

    http://www.imdb.com/title/tt0087332/trailers-screenplay-X31785-10-2 for who never seen the movie

    #53041

    No need to change core files. Just make a file called user_types.php with the following code in it and put it in your my-plugins/ folder.

    <?php

    /*

    Plugin Name: Change 'Member' Label

    Plugin URI: https://bbpress.org/forums/topic/503

    */

    function change_user_type_labels( $label, $type ) {

    if ( 'member' == $type )

    return 'Kazoo Corps Draftee';

    return $label;

    }

    add_filter( 'get_user_type_label', 'change_user_type_labels', 10, 2 );

    ?>

    #1330
    chrishajer
    Participant

    When viewing pages on my forum, the pages load relatively quickly and normally. When submitting a new post, or editing an existing post (as admin) after hitting “send post” there is a 45 second delay. This happened once before (on Jan 16, if it matters) but appeared to go away on its own. Now, it’s back, for the past 12 hours or so. Every post that is submitted has a 45 second delay. The display of the page happens fine:

    0.986 - 13 queries is one example.

    It’s just new posts, new topics or edited posts that have the 45 second delay. Setting the akismet key to FALSE did not improve the response time. This is a new problem. The forum software was fine for a couple months and now has this problem.

    Also, I’m using 0.73. I know I need to upgrade to 0.75, but I was kind of waiting for 0.80, and the fact that 0.73 has been running fine for a long time, with this problem just cropping up makes me think it’s something else. Of course, I will upgrade if you think it will help.

    Thanks

Viewing 25 results - 31,201 through 31,225 (of 32,432 total)
Skip to toolbar