Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi Ted, thanks for the nice words!

    Actually, that request has been sitting on Github (see issue 47) for quite sometime now πŸ™‚ That feature (and a couple more) will come with version 3.3.x.

    Thread Starter Ted Slater

    (@tedslater)

    Thanks, HΓ©ctor!

    Thread Starter Ted Slater

    (@tedslater)

    Great plugin! You haven’t added an “offset” parameter yet, have you? πŸ˜€

    Plugin Author Hector Cabrera

    (@hcabrera)

    Nope, but I’m running a test version of WPP on my site with a new feature that kinda forces me to add the offset parameter (or else it’d be not much fun) πŸ˜‰

    Thread Starter Ted Slater

    (@tedslater)

    Thanks, Hector, for the update. I’m eager to see what you come up with!

    Hi

    I’m really interested in that feature, is it ready ?

    Alternatively, is it possible to fetch like the 6 most popular posts and skip the first 3 ? That would work for me.

    Thank you

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    Unfortunately no, not yet. This past month I’ve been too busy with other projects and haven’t had the time to work on the new features.

    If you really, really can’t wait, you can always modify WPP’s code and modify the LIMIT clause to add the offset here. Of course, next time you update the plugin this modification will be lost so you probably should bookmark this topic for future reference in the case that the next release doesn’t include the offset feature.

    Hi Hector

    This hack will perfectly work for me.

    Is limit just like OFFSET in the regular wp loop ?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Yep. When passing the offset parameter, WordPress actually translates that into an extra parameter in the LIMIT clause when building the query.

    So if I want the 4th,5th and 6th most popular posts, it’ll go like this on the page ?
    wpp_get_mostpopular(“range=monthly&limit=3&offset=3&order_by=’views’&post_type=post”)

    For the WPP code, I don’t understand what should be added, I’m sorry. Is it like : $offset = “OFFSET {$instance[‘offset’]}”; ?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Nope, that won’t work.

    Since offset isn’t registered as a valid paramater, WPP will just ignore it (you know, I don’t want people passing random stuff to the plugin, security first and stuff :P).

    You can keep the offset parameter in wpp_get_mostpopular() even knowing that WPP will ignore it since it’ll be available in the future, but change this:

    $limit = "LIMIT {$instance['limit']}";

    … into:

    $limit = "LIMIT {$instance['limit']} OFFSET 3";

    Ok it’s very clear now, but what if I want to set a different offset depending on the spot, or no offset at all ?

    PS : it’s great to see someone thinking about security. Is there a pro version of this plugin ? I would gladly buy it

    Plugin Author Hector Cabrera

    (@hcabrera)

    Well, since it’s a hack you won’t be able to change the offset dynamically unless you also add the offset parameter here. Otherwise, you’ll have to wait till I implement the feature myself πŸ˜›

    And no, there’s no pro version of WPP. All modesty aside, I believe that WPP is already pro as it is now – and for free! πŸ™‚ I do have plans to add one or two new features that could be available only with a pro license (one of them will require hiring a dedicated server and thus I’d need money to pay for it) but that’s still far from happening.

    Ok, I’ll try to make it work.

    Thank you for your time

    Thread Starter Ted Slater

    (@tedslater)

    lebucheron wrote, “Is there a pro version of this plugin? I would gladly buy it.”

    I would too. πŸ˜€

    Your plugin is top-notch, Hector. New features, and minimal hits to admin-ajax, are more than we can ask. πŸ™‚

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘adding an "offset" parameter’ is closed to new replies.