Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi John,

    Yep, AWPCPUSERLISTINGS, documented here: http://awpcp.com/forum/faq/valid-awpcp-shortcodes-3-x/

    Hi John,

    Yep, AWPCPUSERLISTINGS, documented here: http://awpcp.com/forum/faq/valid-awpcp-shortcodes-3-x/

    Thread Starter John

    (@dsl225)

    Thanks for this but I can’t find any docs on HOW to use those shortcodes and corresponding parameters!

    In fact, I don’t well understand the purpose and usage of this particular shortcode AWPCPUSERLISTINGS. I don’t want to list my own listings as I may find them under Ad Mangement.

    The idea here is to be able to display listings of OTHER users, without knowing their IDs of course! For example, when visiting the website and displaying a given listing of a given user, I would like to see what other listings this same user has published.

    Is this possible?

    Hi John,

    Sorry if the docs weren’t very clear. Here’s what is says about AWPCPUSERLISTINGS at the bottom:

    AWPCPUSERLISTINGS: Shows listings for a user, depending on the settings: It takes three parameters:

    menu: true or false to show or hide the menu items.
    limit: the number of listings to show.
    user_id: if present, the listings of the specified uses will be shown. If not present, the shortcode will show the listings of currently logged in user’. If no user is logged in and no user_id was provided, the shortcode will show nothing.

    The purpose of that shortcode is to display the listings of users. It can work in one of two modes:
    – For registered users, if you leave “user_id” blank, the page will show the ads for that logged in user.
    – For registered users, if you use a specific user_id, then the page will show their ads only

    The other parameters should be easy enough to understand from the docs above. The menu is the “Place Ad/Edit Ad/Change Category” menu.

    Sounds like what you want is the functionality offered by our BuddyPress module–where you can browse listings by other users on their profile. That’s supported on this module: http://awpcp.com/downloads/buddypress-module/ (you also have to install the WP BuddyPress module as well)

    Thread Starter John

    (@dsl225)

    Thanks for this.

    Regarding the shortcode, I’ve absolutely read the docs but still don’t understand how to use it as there is no example.
    When I use this in a page
    AWPCPUSERLISTINGS user_id:XXXX
    I simply get nothing, just the above code displaying in page.

    I also don’t understand this sentence:

    The menu is the “Place Ad/Edit Ad/Change Category” menu.

    What’s this menu about? And what has this to do here?

    Just to clarify the usage of the shortcode, how and where should I use the above shortcode in order to show listings of a given registered user?

    But, in any case, my initial question is different and I certainly don’t want to install Buddy Press for that!

    All classified sites that I know have a username/nickname as the owner for a given listing. This name is usually hyperlinked and when you click on it you get the list of ads of this given user.

    The same works for blog posts. Posts have an author and this author is usually hyperlinked and when you click on his name you get the list of articles for which he is the author at that sort of page:
    http://mysite.com/author/john/

    What can’t we have the same for listings? Listings should publicly display their author’s username/nickname, hyperlinked to the page of his listings.

    Is this something that will change when you migrate to Custom Post Types?

    Hi John,

    OK, sorry–the article does assume that you’re familiar with WP shortcodes in general. A shortcode is just a macro that when included on a page expands.

    A typical shortcode is enclosed in brackets: [shortcode]

    You can have attributes with it, too, like this:

    [shortcode attribute=”value”]

    The WordPress Codex talks about it in nauseating detail here: https://codex.wordpress.org/Shortcode

    The “complete” shortcode for you would be:

    [AWPCPUSERLISTINGS user_id=”idxxx”]

    That should work.

    But, with all that said, since what you’re looking for isn’t a specific user, but instead, to be able to browse other user’s listings, that’s not something the core plugin supports today. We can investigate that after CPT migration, as it will enable a lot of things, not just association to users. It’s not available today without BuddyPress, though.

    Thread Starter John

    (@dsl225)

    A typical shortcode is enclosed in brackets: [shortcode]

    Yes, right, I’m familiar with this and already use some of them but we are all used to copy/paste those codes ready-made (with brackets included) from plugin settings and don’t think much when doing so… We are all somehow in “robot mode” when it comes to those settings – probably because of those “nauseating” details when it comes to read docs online – and it would be a good idea to include those brackets in your examples.

    But thanks anyhow, my mistake!
    This being said, it works fine but the example you gave above is wrong:

    [AWPCPUSERLISTINGS user_id=”idxxx”]

    should not have the “id” letters in front of numbers inside the quotes…

    That’s also the reason why, in such cases, examples are of great importance!

    Nevertheless, I find such feature (displaying a given users listings) really essential and rather basic and I hope we’ll be able to do something when your CPT version will up and running. Thanks!

    I’ll make sure we get that updated, thanks for letting me know about the error in the docs.

    Thread Starter John

    (@dsl225)

    Thanks!

    I was trying this shortcode to just show the users ads and nothing is showing.

    [AWPCPUSERLISTINGS user_id=”idxxx”]

    Should it be something else? Thanks

    Hi Tammy,

    Sorry that you ran into issues here!

    No, that’s the right code from here: http://awpcp.com/forum/faq/valid-awpcp-shortcodes-3-x/

    Did you try it with the 3 total parameters?

    What are you putting in for user_id? A username or an actual number?

    Since I’m not good with shortcode I was just using
    [AWPCPUSERLISTINGS user_id=”idxxx”]

    Not sure what to use for an ID

    Hi Tammy,

    Well, what did you use, exactly? You can’t use “idxxx”, that’s not a valid user ID.

    Valid user IDs can be found under Settings->Users, where you find the left-most column for the user you want to put listings in for.

    If you don’t put a specific ID in there, then this shortcode will display the listings for the currently logged in user. That’s how most people use it now.

    Can you try that and see how it goes?

    When I use [AWPCPUSERLISTINGS], nothing shows.

    To see something, you must be logged in as a user who has posted one or more ads.

    Have you tried that?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Display all ads of given user?’ is closed to new replies.