WordPress.org

Ready to get started?Download WordPress

Forums

Another WordPress Classifieds Plugin
[resolved] List of Users on Create Ad by Administrator (10 posts)

  1. obedienceuk
    Member
    Posted 1 year ago #

    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.)

    http://wordpress.org/extend/plugins/another-wordpress-classifieds-plugin/

  2. obedienceuk
    Member
    Posted 1 year ago #

    Should have said the other site isn't wordpress.

  3. awpcp
    Member
    Plugin Author

    Posted 1 year ago #

    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 ?>
        </option>
        <?php endforeach ?>
    </select>

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

  4. obedienceuk
    Member
    Posted 1 year ago #

    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.

  5. awpcp
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  6. obedienceuk
    Member
    Posted 1 year ago #

    OK, thanks for trying, but neither worked.

  7. awpcp
    Member
    Plugin Author

    Posted 1 year ago #

    If PHP isn't your forte, you might consider hiring a developer to help you out from oDesk: http://odesk.com

  8. obedienceuk
    Member
    Posted 1 year ago #

    LOL

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

  9. awpcp
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  10. obedienceuk
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic