WordPress.org

Ready to get started?Download WordPress

Forums

WP Db Abstraction
Not showing posts (12 posts)

  1. andreymakarov
    Member
    Posted 2 years ago #

    Not showing posts while working with sql server.
    The problem is in file translations.php, the part which replaces Limit statement to Top statement.
    The following lines

    // Check for true offset
            if ( count($limit_matches) == 5 && $limit_matches[1] != '0' ) {
                $true_offset = true;
            } elseif ( count($limit_matches) == 5 && $limit_matches[1] == '0' ) {
                $limit_matches[1] = $limit_matches[4];
            }

    should be rewritten as

    // Check for true offset
            if ( count($limit_matches) == 5 && $limit_matches[1] != '0' ) {
                $true_offset = true;
            } elseif ( count($limit_matches) >= 5 && $limit_matches[1] == '0' ) {
                $limit_matches[1] = $limit_matches[4];
            }

    " == 5 " in elseif replaced as " >= 5 "

    http://wordpress.org/extend/plugins/wordpress-database-abstraction/

  2. Patrick Daly
    Member
    Posted 2 years ago #

    Thank you for the fix!

  3. Patrick Daly
    Member
    Posted 2 years ago #

    I'm not sure if this fix caused the problem, but pagination is not working for. Did you have similar results?

  4. andreymakarov
    Member
    Posted 2 years ago #

    Sorry, I'm not sure. I cann't reproduce 'cause I'm having only one page of posts. But I promise - I'll check that later =)

  5. jsmithv
    Member
    Posted 2 years ago #

    I am having the same problems listed here. First it was not showing posts, used the above fix and that worked. Now however, pagination is not working. With multiple pages of posts, when I click to go to the next page, it says I'm on page 2, but the posts are all the page 1 posts. Click next page, index at bottom says page 3, but still on page 1 posts. Thanks,

  6. LukeG84
    Member
    Posted 1 year ago #

    I think the better fix is in the thread below. The fix works for the admin section to show posts AND for pagination. Check the REGEX update by Yoren, it actually is reverting to previous code but fixed my issue for me.

    Thread Link

    Just found another way to fix this issue.

    Because I found in 1.1.3, the same $limit_matches equations worked, so I read the changelog and I think is the line 726:

    $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)(;{0,1})$/is';

    should be changed back as 1.1.3:

    $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)$/is';

    Although it seems to fix the "limit regex to catch queries with ; at the end" issue, but will cause new issue here.

  7. CriGoT
    Member
    Posted 1 year ago #

    Run into the same problem and fixed the pagination by applying the same principle used in the first post

    // Check for true offset
            if ( count($limit_matches) >= 5 && $limit_matches[1] != '0' ) {
                $true_offset = true;
            } elseif ( count($limit_matches) >= 5 && $limit_matches[1] == '0' ) {
                $limit_matches[1] = $limit_matches[4];
            }

    since the regular expression added the support for ; the number of matches should be increased in both comparisons

  8. Amigo Chan
    Member
    Posted 1 year ago #

    This is to confirm to use both LukeG84 and CriGoT suggestion works

    1. show the media library correctly, with ot without pagination.
    2. may edit and delete post in media library.

    You have to change two sections. Both in function translate_limit().

    Section 1:

    From:'/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)(;{0,1})$/is'
    To: '/LIMIT\s*(\d+)((\s*,?\s*)(\d+)*)$/is';

    Section 2 (Two if comparision statement):

    From: count($limit_matches) == 5
    To: count($limit_matches) >= 5

    Wish it helps!

  9. RichKavanagh
    Member
    Posted 1 year ago #

    I signed up to these forums simply to post a THANK YOU!

    I've no idea how I found this post, but the details here worked perfectly.

    Thank you, thank you very much :)

  10. RichKavanagh
    Member
    Posted 1 year ago #

    Erm... But :)

    Now I can't view any Users??

  11. RichKavanagh
    Member
    Posted 1 year ago #

    Sorry, ignore my last, I missed the post by amigoccs ;)

  12. swbts
    Member
    Posted 1 year ago #

    Followed the instructions above and fixed everything except now categories are not displaying. They show up in admin (but all categories have "0" under the Posts column) and even when you click on a post it has the category assigned properly but in the sidebar where it list categories it says there are no categories. any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.