Support » Plugin: AWPCP - Classifieds Plugin » List of Users on Create Ad by Administrator

  • Resolved obedienceuk


    I have a new WordPress site that I’m transferring from another one. On the other site I have ads and would like to transfer them over (manually, not anything automated). BUT when I try to add them to the WordPress site and associate them to a particular user (of which I have over 1900) the pulldown list is useless. It lists the users in probably database id sequence, so how am I supposed to find the user. (I’d like them in Username sequence, but don’t know how.)

Viewing 9 replies - 1 through 9 (of 9 total)
  • Should have said the other site isn’t wordpress.

    Plugin Author awpcp


    We will have to address this in a patch, I think.

    As a workaround, you could hack the page frontend/templates/page-place-ad-users-dropdown.tpl.php and hack this section of code:

    <select id="place-ad-user-id" name="user_id">
        <option value="0"><?php _e('Select a User owner for this Ad', 'AWPCP') ?></option>
        <?php $selected = $user_id ?>
        <?php foreach ($users as $k => $user): ?>
        <option value="<?php echo esc_attr($user->ID) ?>" data-payment-terms="<?php echo esc_attr($user->payment_terms) ?>" <?php echo $selected == $user->ID ? 'selected="selected"' : '' ?>>
            <?php echo $user->display_name ?>
        <?php endforeach ?>

    If you use a PHP sorting routine on the variable $users, you can put them in alphabetical order.

    Thanks. I found the code, but as a PHP dunce, I wouldn’t know what the PHP sorting routine is, or where to put it.

    Plugin Author awpcp


    After this line:

    <?php $selected = $user_id ?>

    Add this line:

    <?php asort($users); ?>

    That should do it. The semi-colon may or may not be required–I’d have to test to know for sure.

    OK, thanks for trying, but neither worked.

    Plugin Author awpcp


    If PHP isn’t your forte, you might consider hiring a developer to help you out from oDesk:


    I already have for my unique development (really)! But thought this was a ‘working’ plugin!

    Plugin Author awpcp


    It does indeed work. What you found was a minor issue with sorting. Since my hack wasn’t quite enough, the next recommendation I can make is to have someone else take a deeper look until we can get to this particular issue.

    OK, thanks. But not a minor issue for me. I have an oDesk developer currently working on something for me, so I’ll see if he can do the hack for me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘List of Users on Create Ad by Administrator’ is closed to new replies.