Support » Plugins and Hacks » [Resolved] writing a custom widget to show an image from only paid listings

[Resolved] writing a custom widget to show an image from only paid listings

  • 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


Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author businessdirectoryplugin


    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.


    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.


    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?

    Plugin Author businessdirectoryplugin


    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?


    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.

    edit: double post

    Plugin Author businessdirectoryplugin


    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] writing a custom widget to show an image from only paid listings’ is closed to new replies.