If user have listings

This topic contains 7 replies, has 4 voices, and was last updated by  nanera 5 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #517510

    nanera
    Expired Member
    Post count: 60

    Hello,

    I’m trying to find a way to call a function like if user have any listing echo “See your listings”, else “Add listing”.
    Is there any possible solution?

    Thank you for your time.

    #517529

    Guust
    Moderator
    Post count: 29970

    The simplest solution for that is to add the GD Dashboard widget.
    Thanks

    #517619

    nanera
    Expired Member
    Post count: 60

    Thank you, I’m looking for a complicate solution. I want to integrate this in php code. GD Dashboard widget doesn’t offer “See your listings” link. I want to do it with php IF function. Is there any php code that can check the user for listings?

    Thank you for your time.

    #517621

    Guust
    Moderator
    Post count: 29970

    GD Dashboard widget will offer “See your listings” link to users with listings.
    Anything else will require your own customization.
    Thanks

    #517622

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    There are several ways to do what you want but it depends on if you are using multiple CPTs etc.

    There is a General way to get a select of users listings per CPT

    GeoDir_User::show_listings( $current_user->data->ID, 'select' );

    Of you can use our function like

    geodir_user_post_listing_count($user_id = null,$unpublished = false)

    and to get add listing link

    geodir_get_addlisting_link( 'gd_place' );

    Thanks,

    Stiofan

    #517844

    nanera
    Expired Member
    Post count: 60

    Thank you very much Stiofan,

    I’m looking for a possible way to count listings per CPT with geodir_user_post_listing_count. Is it possible?
    How I can select if there are places or events added separately?
    The result I’m looking for is something like –
    You have 2 places and 0 events – add event [link]
    or
    You have 0 places – add place [link] and 3 events
    Link to published events and places is not important as I found a way to make [gd_my_listings_link] shortcode.

    Thank you for your time!

    #517884

    Alex Rollin
    Moderator
    Post count: 27815

    If you need any further assistance, please renew your membership first. From https://wpgeodirectory.com/support-policy/ :

    Support for Free Users (non members) is provided for website where only the core plugin is installed and used. If addons are installed and used (even only one addon), the user will have to subscribe again before being able to receive support.

    Thanks

    #517886

    nanera
    Expired Member
    Post count: 60

    Thank you very much for your time.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount