Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 20,001 through 20,025 (of 32,499 total)
  • Author
    Search Results
  • #92615
    kikko088
    Member

    thank you for the answer, I change the quotes but the problem persist :(

    kikko088

    #77150

    In reply to: Topic paging issue

    _ck_
    Participant

    Huh. The post numbering did reset. That is strange.

    What theme is that – I’d have to see the post.php to see what function they are using between <div class="postnumber"></div>

    I see a few people using neoease for bbPress but I can’t find it anywhere? Where did you get it? Or is that inove with your own modifications?

    #77148

    In reply to: Topic paging issue

    e-motion
    Participant

    It looks like I am missing something – when I changed post count on original thread from 81 to 80, all post numbers shifted and #24 is no longer missing. But anyway, I am OK with missing numbers, at least it lets people know where their posts are.

    How can I check why my bbpress does not recount posts? Where is that function? I was messing around with some PHP and template codes (to ‘join’ forum to the page) so maybe I have done something…

    #77144

    In reply to: Topic paging issue

    _ck_
    Participant

    That query IS working properly on my test copy.

    I purposely changed the topic_posts on a topic from 46 to 99.

    Then ran this

    INSERT INTO bb_topics (topic_id, topic_posts)
    (SELECT topic_id, COUNT(post_status) as topic_posts
    FROM bb_posts
    WHERE post_status = '0' GROUP BY topic_id)
    ON DUPLICATE KEY UPDATE topic_posts = VALUES(topic_posts);

    and it reverted it back to 46

    So try changing the 80 to 81

    then try the above query and see if it changes it back to 80 or not?

    #77140

    In reply to: Topic paging issue

    e-motion
    Participant

    OK, so I was going thru the database and saw that bbpress holds post count in it. I just changed that to correct value and it seems like everything is good now. And post #24 is no longer missing, posts have shifted per one place.

    Thank you for your help. :) Anyway now we have discovered one more bug to fix.

    #77139

    In reply to: Topic paging issue

    _ck_
    Participant

    Thinking out loud here, don’t do anything yet on your own.

    This is Sam’s new routine in 1.0.2 based on my alternate recount for bbpress 0.9

    $sql = “INSERT INTO $bbdb->topics (topic_id, topic_posts)

    (SELECT topic_id, COUNT(post_status) as topic_posts

    FROM $bbdb->posts

    WHERE post_status = ‘0’ GROUP BY topic_id)

    ON DUPLICATE KEY UPDATE topic_posts = VALUES(topic_posts);

    “;

    I will investigate further…

    #77137

    In reply to: Topic paging issue

    e-motion
    Participant

    Query returns 80 posts. :) Definitely something is very wrong…

    https://i.imgur.com/jslzY.png

    #77136

    In reply to: Topic paging issue

    _ck_
    Participant

    I forgot to add the topic_id=12 and group by on my queries sorry.

    Well the numbers are coming from post position.

    But still something is very wrong, because bbpress is showing 81 as the post count.

    You need to run the exact query that the recount function uses.

    SELECT topic_id, COUNT(post_status) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12 GROUP BY topic_id

    See if that gives 80 or 81

    #94066
    mr_pelle
    Participant

    I’ve checked every BackPress version and none of them has $end at line 244…. weird…

    The root of the problem is probably somewhere else.. no guess though..

    #77133

    In reply to: Topic paging issue

    e-motion
    Participant

    This query gave me an error:

    #1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

    So I just did this:

    SELECT * FROMbb_postsWHERE topic_id=12

    And the result is:

    Showing rows 0 – 29 (80 total, Query took 0.0020 sec)

    So now I’m wondering where is bbpress taking post count numbers from?

    #77132

    In reply to: Topic paging issue

    _ck_
    Participant

    Okay we need to see if the query is failing somehow.

    try this (assuming the table is bb_posts)

    SELECT topic_id, COUNT(post_status) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12

    See if that gives 80 or 81

    Then try this if that gives 81

    SELECT topic_id, COUNT(*) as topic_posts FROM bb_posts WHERE post_status=0 AND topic_id=12

    (sorry I forgot to add AND topic_id=12)

    #94058

    In reply to: Internal Server Error

    zaerl
    Participant

    Check the server error log logs/error_log and report the error.

    #94064
    mr_pelle
    Participant

    What version of bbPress are you on? There is no $end at line 244 of that file, neither on the BackPress version shipped with bbPress 1.0.2 neither with trunk…

    #77125

    In reply to: Topic paging issue

    _ck_
    Participant

    I have a little trick to workaround this problem, at least when bbpress requests a link for the post that happens to be the last post in the topic.

    I will write a filter for when get_post_link is requested, it will check the post id# – if it happens to be the last post in the topic (stored in topic_last_post_id) it will instead route the request to the more accurate get_topic_last_post_link

    #77124

    In reply to: Topic paging issue

    _ck_
    Participant

    Here’s a simplified example of what I think is happening internally.

    Let’s say for ease of understanding there are TWO posts per page.

    And there are 7 posts in this particular topic example

    |1 2| – |3 4| – |5 6| – |7|

    so there are 4 pages (each | | is a page)

    In this example, the post numbers are also the post-position.

    Now let’s say a mod deletes post number 4

    |1 2| – |3 5| – |6 7|

    Should only be three pages.

    But bbPress is stupid by default, post-position is never recalculated so those post numbers still represent post position in this example.

    bbPress DOES track number of posts in a topic, even when deleted.

    So requesting a link to the last post in the topic, regardless of post-position, WILL be calculated correctly, and return page 3.

    However, if it specifically asks for a direct link to post 7 and not the last post in the topic, this is what happens.

    Post 7 is post-position 7

    posts per page is 2 per page

    ceil( $post_position / $per_page )

    7 / 2 = 3.5, ceil of 3.5 = 4

    So it will ask for page 4

    Page 4 does not exist in the topic.

    The link may be created but the link is bogus and will not work, it will either return you to the first page of the topic, or maybe the front page of the entire forum.

    #77122

    In reply to: Topic paging issue

    _ck_
    Participant

    You know what, this is an inherit flaw with bbpress that I think I mentioned elsewhere years ago.

    It never recalculates post-position when there are deleted posts, yet it relies on that post-position to find a specific posts’s page.

    See this is how it calculates the page

    function get_post_link( $post_id = 0 ) {
    $bb_post = bb_get_post( get_post_id( $post_id ) );
    >>>>>> $page = bb_get_page_number( $bb_post->post_position );
    return apply_filters( 'get_post_link', get_topic_link( $bb_post->topic_id, $page ) . "#post-$bb_post->post_id", $bb_post->post_id );
    }

    and this is how it calculates that page

    return intval( ceil( $item / $per_page ) );

    so it’s $bb_post->post_position / $per_page

    always, regardless if there are deleted posts in the way, which is why it can be “short” when calculating the last page(s) on a longer topic with deleted posts.

    The solution is that post-position has to be recalculated when a post is deleted. The only side effect is that for admin, jumping directly to a deleted post would not work, you’d have to find it manually.

    bbPress never, ever, re-calculates post-position, even on a recount, if I am not mistaken.

    There is one tiny work-around we can do.

    For the LAST POST calculation, we can intercept that and subtract the number of deleted posts from the post-position. Hmm, actually wait, is it subtract or add. I have to investigate this a bit and think out the logic.

    #77121

    In reply to: Topic paging issue

    _ck_
    Participant

    I must be missing the problem here.

    The “latest reply” link works.

    When I am on page 3, the page 4 link works.

    What specifically is not working?

    Are you saying the problem is intermittent?

    ps. I use an ebike with a custom lifepo4 battery :-)

    Oh wait, I see what you saying now

    he problem vanished when one reply was written.

    It will reappear when someone writes a reply last on that page.

    so it’s an even/odd problem

    if there are an even number of posts, it works,

    if there is an uneven number, it does not work

    Did you try the trick of deleting one post and then undeleting it?

    There must be a bug in the way bbPress calculates post-position when there are deleted posts. I wonder if it’s specific to 1.x

    #77120

    In reply to: Topic paging issue

    e-motion
    Participant

    No, I do not. I have following plugins:

    Akismet

    Allow Images

    Avatar Upload

    BBcode Buttons Toolbar

    BBcode Lite

    bbPM

    BBVideo

    Bozo Users

    Hello Louie

    Human Test for bbPress

    Instant Password

    Skip Akismet

    SourceCode Highlighter

    #92614
    mr_pelle
    Participant

    I suppose the first echo should read:

    echo "<tr><td>". $forum_id." > ".$result->forum_name."</td>";

    By the way, I suggest you to use double quotes for html tags (like you would do normally) and single quotes for php commands, unless you include vars in them. Like this: echo '<td class="num">';

    More details here.

    #35030
    kikko088
    Member

    <table id=”latest”>

    <tr>

    <th>Forum</th>

    <th>Discussioni</th>

    <th>Messaggi</th>

    </tr>

    <?php

    global $wpdb;

    $query=”SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10″;

    $results=$wpdb->get_results($query);

    foreach ($results as $result) {

    echo “<tr><td>forum_id.”‘>”.$result->forum_name.”</td>”;

    echo “<td class=’num’>”.$result->forum_topics.”</td>”;

    echo “<td class=’num’>”.$result->forum_posts.”</td></tr>”;

    }

    ?>

    </table>

    why this code don’t display the number of discussions and posts?

    kikko088

    #94034

    In reply to: css input problem

    kikko088
    Member

    http://www.endurodoc.net/forum/

    new topic title

    kikko088 :)

    #76448

    @erlend – Understandable. Will try to do better.

    @mbiernat – Thanks for the pat on the back. Definitely helps to have some support :)

    nood
    Member

    Assuming you have permalinks set up, create a page with the permalink forums so the full url would be http://localhost/wordpress/forums

    Because the directory exists, when someone goes to the page they will end up on your forum.

    #76443
    Rich Pedley
    Member

    All sounds good, thanks for the update ;)

    #76442

    I’ve been side tracked with BuddyPress bugs and paying work, so don’t expect anything official for a week or two. I have a few projects coming up fast that will need this working so while I’m missing my soft Sept 15 deadline, I don’t think it will be /too/ far off.

    Sorry to disappoint, it’s no fun… and thanks for your patience with me and it.

    For the record, I love bbPress. I have a few commits going into 1.1, and I have every intention of making bbPress be the best it can be as a WordPress plugin.

    Regarding my motivation and priority, it’s to make great forum software that fits inside WordPress; nothing more and nothing less.

    Regarding why I was able to step into this role, it’s because our peers believe I am capable, and I am willing to dedicate time and effort towards it getting it done.

    Regarding any possible benefit BuddyPress might see, is a welcome bonus but not a priority. BuddyPress/bbPress processing times should decrease with BuddyPress 1.2.6, as a few tweaks have been made and a bug or two have been patched in that regard. Even still, nothing compares to the blazing fast speed of bbPress by itself, even in the slower 1.x branch.

    Regarding everything else, I’m just here to write the best code I can, help make bbPress a great WordPress plugin, and have fun doing it all. So far, so good on my end. :)

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