WordPress.org

Ready to get started?Download WordPress

Forums

Business Directory Plugin
[resolved] writing a custom widget to show an image from only paid listings (7 posts)

  1. jasper_s
    Member
    Posted 1 year ago #

    Hey guys,

    I am trying to make a custom widget which shows images from an image form field but can't figure out how to get an array of post where the fee is greater than 0.0 and how to get the image url from the post meta.

    Not that i'm complaining but the db layout is hard to understand, even though I have a fair bit of php and wordpress knowledge it's a bit out of my league.

    The idea behind it is so businesses can upload an advert and pay for it to be displayed in a widget on my site.

    I purchased the paypal module last week and was hoping to have this set up by now so a few pointers or any help would be great.

    Thanks, J

    http://wordpress.org/extend/plugins/business-directory-plugin/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jasper,

    Have you tried using the existing widgets as a basis for starting? With 3.0.2, we have a Featured Listing, Random Listing and Latest Listing widget. The featured one might be the best to base yours on.

    The DB layout is based directly on WordPress posts, that's not our choice of data structure, it's theirs. You may want to read up on how custom posts and taxonomies are handled in WP 3.0 and higher to help you understand their choices.

  3. jasper_s
    Member
    Posted 1 year ago #

    Hey,

    Thanks for the reply. I've kind of got somewhere now, I figured out that the image id was in the post meta for the custom form field.

    I used wpbdp_listings_api()->cost_of_listing($post) to check how much the advertiser paid. I just would have prefered to keep the db queries down to a minimum.

    Thanks,
    J.

    P.S. While modifying the layout with the custom css, I would have liked a little bit more control over the layout. Something like what events manager plugin has where you use tags to position elements would be good for a future release.

    Great plugin though guys, is it possible to see the edit and delete action buttons in awpcp instead of users needing the code to modify their listings?

  4. businessdirectoryplugin
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jasper,

    We'll consider the tags suggestion, we're working on a way to improve that.

    Not sure I understand your AWPCP question, however. What is it you specifically want to see?

  5. jasper_s
    Member
    Posted 1 year ago #

    Hey,

    I was talking about awpcp where you need to use the key sent by email to edit your listing. This is a little daunting for some of my users and I think the action buttons (edit and delete) based on the logged in user being the ad creator would work better and the edit key would not be needed.

    I know I should have really posted this in awpcp support, sorry about that.

  6. jasper_s
    Member
    Posted 1 year ago #

    edit: double post

  7. businessdirectoryplugin
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jasper,

    You can avoid the edit key altogether in AWPCP and use the Ad Management panel instead. Look under Classifieds->Settings, General tab (at the bottom). It does require that Registration be turned on, since the panel is associated to a user's profile. But you get full edit/delete access in there, no edit key required.

    And it's probably best to post AWPCP support questions in that forum for the future. :) Less confusing that way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.